RESOLVED FIXED 148780
DOMTokenList.add() / remove() should run the update steps even if tokens were not modified
https://bugs.webkit.org/show_bug.cgi?id=148780
Summary DOMTokenList.add() / remove() should run the update steps even if tokens were...
Ryosuke Niwa
Reported 2015-09-03 20:07:47 PDT
MutationObserver should be getting new records on classList.add/remove even if they're no-op. See https://dom.spec.whatwg.org/#concept-DTL-update Firefox adds the records as expected by the spec. This bug was found by the newly added test: LayoutTests/http/tests/w3c/dom/nodes/MutationObserver-attributes.html
Attachments
Patch (9.24 KB, patch)
2015-09-21 11:51 PDT, Chris Dumez
no flags
Patch (9.83 KB, patch)
2015-09-21 13:09 PDT, Chris Dumez
no flags
Radar WebKit Bug Importer
Comment 1 2015-09-03 20:08:06 PDT
Chris Dumez
Comment 2 2015-09-21 11:51:55 PDT
Ryosuke Niwa
Comment 3 2015-09-21 12:00:58 PDT
Comment on attachment 261670 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=261670&action=review > LayoutTests/fast/dom/rel-list.html:80 > element.relList.add('x'); > - shouldBeEqualToString('element.rel', 'x x'); > + shouldBeEqualToString('element.rel', 'x'); This seems like an orthogonal behavioral change. This is expected? If so, we should explain why this behavior change is desirable in the change log.
Chris Dumez
Comment 4 2015-09-21 13:02:57 PDT
Comment on attachment 261670 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=261670&action=review >> LayoutTests/fast/dom/rel-list.html:80 >> + shouldBeEqualToString('element.rel', 'x'); > > This seems like an orthogonal behavioral change. > This is expected? If so, we should explain why this behavior change is desirable in the change log. Not really an orthogonal change, as per the specification, we can the update steps even if the token update is a no-op. The update steps are: https://dom.spec.whatwg.org/#concept-DTL-update Step 2 is "Set an attribute value for the associated element using associated attribute’s local name and the result of running the ordered set serializer for tokens." Setting the attribute value will generate a mutation event but will also possible change the value as "ordered set serializer for tokens" will clean up the attribute value. I will update the change log to clarify before landing.
Chris Dumez
Comment 5 2015-09-21 13:09:45 PDT
WebKit Commit Bot
Comment 6 2015-09-21 13:59:31 PDT
Comment on attachment 261680 [details] Patch Clearing flags on attachment: 261680 Committed r190078: <http://trac.webkit.org/changeset/190078>
WebKit Commit Bot
Comment 7 2015-09-21 13:59:37 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.