[Bug 27114] New: DOMTokenList and DOMSettableTokenList should be constructible

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 27114] New: DOMTokenList and DOMSettableTokenList should be constructible

Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27114

            Bug ID: 27114
           Summary: DOMTokenList and DOMSettableTokenList should be
                    constructible
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DOM
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]
                CC: [hidden email], [hidden email]

I would like to implement a custom element with an attribute that is a token
list, and another that is a settable token list. When I try to reflect these
attributes as properties, I would rather do them as instances of DOMTokenList
and DOMSettableTokenList than as my own custom types.

To be able to do this, both classes should be constructible. I think it'd be
fine if they just had empty constructors and developers had to call add() to
use them. You can imagine more complicated designs, e.g.:

- Pass a sequence<DOMString> and use that as the initial seed values
- Pass an element and an attribute and use mutation observers to monitor
changes to the attribute and automatically reflect them in the list

but empty constructor is fine.

Another use case besides custom elements is being able to create mock
DOMTokenLists for writing unit tests.

There is interest from Chrome in implementing this so we can implement more
HTML elements in JS.

--
You are receiving this mail because:
You are on the CC list for the bug.

Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 27114] Make DOMTokenList constructible

Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27114

Anne <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |NEEDSINFO

--- Comment #7 from Anne <[hidden email]> ---
Closing due to lack of API proposal. Happy to reconsider this on GitHub if
someone wants to drive this.

--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...