-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"When a DOMTokenList object is created, then: ..." #666
Comments
Making it use "get an attribute value" seems best. Might also be good to quickly look at blame to see if this regressed somehow or was always incorrect. |
Looks like this this was first added by you in 4b291d1#diff-a467e681501e456ce8c1ef31425e1b41R9223 |
I had to read it a few times, but I *think* the steps prior to the above change were correct, but a bit more convoluted. It basically reads if the element has an attribute that is its associated attribute's local name, or if the element's associated attribute's local name is set, then set the list of tokens to the new value after being parsed by the ordered set parsing steps. |
This makes it so that if the `DOMTokenList`'s associated element has an attribute that is the associated attribute's local name, at creation time, it will use the "get an attribute value" steps, which will always return a string. Previously, the this used the "get an attribute by namespace and local name" steps, whuch would return an `Attr` node if the associated element had an attribute that is the associated attribute's local name. Fixes whatwg#666.
This makes it so that if the `DOMTokenList`'s associated element has an attribute that is the associated attribute's local name, at creation time, it will use the "get an attribute value" steps, which will always return a string. Previously, the this used the "get an attribute by namespace and local name" steps, whuch would return an `Attr` node if the associated element had an attribute that is the associated attribute's local name. Fixes whatwg#666.
This makes it so that if a DOMTokenList's associated element has an attribute that is the associated attribute's local name, at creation time, it will use the "get an attribute value" steps, which will always return a string. Previously, the this used the "get an attribute by namespace and local name" steps, which would return an Attr node if the associated element had an attribute that is the associated attribute's local name. Fixes #666.
https://dom.spec.whatwg.org/commit-snapshots/32efc48fef28c34ed914b60cfb3c29807e617365/#interface-domtokenlist
In step 3, "getting an attribute" links to the get an attribute by namespace and local name algorithm, which returns an
Attr
node ornull
. This is a problem because in step 4, value is passed to the "attribute change steps" as the oldValue and value arguments, which only accept astring
ornull
. So, step 3 should either link to the get an attribute value algorithm or operate on the returnedAttr
node's value. Not really sure which is more appropriate here.The text was updated successfully, but these errors were encountered: