Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement DOMTokenList.supports API #24965
Comments
|
html/semantics/document-metadata/the-link-element/link-rellist.html also wants .supports. |
|
Every attribute that can be the associated attribute of a DOMTokenList defines a set of "supported tokens" for use in feature-sniffing, e.g. https://html.spec.whatwg.org/multipage/forms.html#attr-form-rel defines them for the rel attribute of a form and https://html.spec.whatwg.org/#attr-hyperlink-rel defines slightly different ones for the rel attribute of an anchor. Since the purpose is feature-sniffing, we're explicitly only supposed to include the ones the browser actually implements, not ones that we'd be ignoring; it might be desirable to have some well-defined way of keeping it in sync with implementation progress. |
|
To represent the validation steps when there is a static list of supported keywords, we should add a new optional argument to DOMTokenList::new (
When implementing DOMTokenList::supports, if no list was provided then any we should compare the provided token against the tokens in the element's attribute. Otherwise, we should use the list of provided tokens from the constructor and compare the provided token against that. Spec:
Code:
Tests:
We'll need to update the corresponding INI files ( |
|
I've looked into this issue a bit and would be willing pick it up. |
html/semantics/embedded-content/the-iframe-element/sandbox-ascii-case-insensitive incidentally fails, separately from what it's trying to test, because there's no .supports on iframe.sandbox. It looks like Servo's IDL doesn't even mention it; https://dom.spec.whatwg.org/#interface-domtokenlist does.