The wpt changes come from https://github.com/w3c/web-platform-tests/pull/9920
and are needed to keep Element-classlist.html passing.
The change to testing/web-platform/mozilla/tests/dom/classList.html is pulling
those changes into our weird forked version of that test...
MozReview-Commit-ID: CvQlBRuieUY
(Path is actually r=froydnj.)
Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.
MozReview-Commit-ID: 91U22X2NydP
Previously, replace() and toggle() would not always remove duplicates
and whitespace from the DOM attribute in the case where they were no-ops
(replacing a nonexistent token, force-toggling a token to its current
state). Now they do. This matches the behavior of add() and remove(),
and also replace() in one case (replacing an existing token with
itself).
This follows a spec change: https://github.com/whatwg/dom/pull/444
MozReview-Commit-ID: 7lDEQxOGxPV
Some bits taken from a patch by Cameron McCormack. This follows a
change to the DOM spec that has already been implemented by WebKit.
We do no checks for duplicates on initial attribute parsing, only when
the DOMTokenList is accessed. We re-check for duplicates on every
DOMTokenList access, but optimized with a bloom filter, so it should be
fast. It would be possible to add a flag to check if we've already
removed duplicates from the atom list, but it would require the
nsAttrValue to talk to the nsDOMTokenList somehow, and a spare bit would
be needed in nsAttrValue, and it would only help cases where
DOMTokenList is repeatedly accessed without the content attribute being
modified in between (e.g., .length) where the token list is extremely
long.
This patch assumes that no one other than nsDOMTokenList cares if
duplicates are removed from the nsAttrValue's atom array. If anything
does, they will see inconsistent behavior depending on whether
nsDOMTokenList has removed duplicates yet. Since we don't want to
check for duplicates on parse for performance reasons, the correct fix
is to update the code elsewhere to also remove duplicates.
MozReview-Commit-ID: 97KRVhPGwm8