Skip to content

HTMLIFrameElement should use token list instead of manual string splitting for sandbox attribute #3758

Closed

Description

@jdm

The manual setters and getters should be replaced with the appropriate macros, and after_set_attr can use attr.value().tokens() instead of dealing with the string manually. There's no make_tokenlist_setter macro yet in http://mxr.mozilla.org/servo/source/components/script/dom/macros.rs, so that should be added too.

Activity

  1. added
    A-content/dom
    E-less-complex
    I-cleanup
    on Oct 21, 2014
  2. jimrhoskins commented on Jan 5, 2015

    @jimrhoskins
    Contributor

    I'm looking into this, and it turned into a bit of a rabbit hole, and I wanted to get an idea of how deep to go, and if I'm even on the right path.

    Right now, HTMLIframeElement.sandbox is implemented (against the spec) as a DOMString. W3C says sandbox is [PutForwards=value] readonly attribute DOMSettableTokenList sandbox;

    My question would be, is it appropriate to try to get sandbox implemented as DOMSettableTokenList, which involves implementing that type all-together?

    Or do we want to keep the type of sandbox of DOMString as far as the interface is concerned, and use a DOMTokenList internally? Seemingly the only benefit of that is allowing .tokens() to do the work. If that route would be chosen, it would probably be awkward if make_tokenlist_getter!'s method ended up returning a DOMString.

    Is the goal ultimately to have sandbox be DOMSettableTokenList (gecko does this) or keep sandbox as a DOMString (Webkit/Blink do this)

  3. jdm commented on Jan 5, 2015

    @jdm
    MemberAuthor

    The ultimate goal is to follow the spec, so we do want DOMSettableTokenList eventually (see #1717). If you feel like tackling that, that would be great and I'm happy to provide guidance. All I had in mind for this issue in particular was making use of tokens(); I think using a DOMTokenList internally and serializing that to a string would be acceptable, but it probably isn't worth creating a make_tokenlist_getter macro in that case.

  4. jimrhoskins commented on Jan 5, 2015

    @jimrhoskins
    Contributor

    Ok, cool. I think I'll start with just doing an internal DOMTokenList and serialization, I think I can handle that. After that, I'll try to figure out if DOMSettableTokenList is something I can take on.

  5. added 2 commits that reference this issue on Jan 9, 2015
    8829c19
    e8036ac
  6. added a commit that references this issue on Jan 9, 2015
    ebb702a
  7. added a commit that references this issue on Feb 4, 2015
    9b045a8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domE-less-complexI-cleanup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions