Chromium Code Reviews
DescriptionRemove ClassElementList and reuse collectElementsByClassName in SelectorQuery.
We can add a check to collectElementsByClassName to match a full
selector once we find an element with a matching class name and remove
the AllElements mode of the ClassElementList.
This does mean we do one extra branch per element in the cases of
selectors like '.a' for each element that does actually have this class
name, but that seems fine given the cost of allocating wrappers and
everything else that's going to happen after returning the matches.
After removing the AllElements mode we can inline the loop for
ClassElementList into the caller and remove this iterator abstraction
entirely.
BUG=703900
Review-Url: https://codereview.chromium.org/2788953003
Cr-Commit-Position: refs/heads/master@{#461316}
Committed: https://chromium.googlesource.com/chromium/src/+/00b1fe65b09e25713e2ebb7c0e940be33cdfb7c7
Patch Set 1 #Patch Set 2 : Woops missed a return. #Messages
Total messages: 17 (14 generated)
|