DescriptionSplit compound selector after consume finished.
CSSSelectorParser::consumeCompoundSelector() will split a compound into
two compounds when it contains a simple selector which needs a synthetic
ShadowPseudo combinator. This split was done as simple selectors were
added. That code was complicated and and yielded some strange
serializations like what was reported in https://crbug.com/478563.
This CL adds simple selectors to the compound in the selector text
order, and splits the compound into two compounds and re-order them
after the whole compound has been consumed. This makes the code simpler
and makes it simpler to check selector validity (before the split).
This fixes issue 478563 and prepares for validity checking. A side
effect is that unnecessary universal selectors are left out of the
serialization (issue 478969).
::content is no longer kept leftmost in the compound, which is the
reason why contentPseudoCrossing is set when the combinators which are
affectedByPseudoContent instead of when the actual ::content selector
is seen.
R=timloh@chromium.org
BUG=478563, 489481, 478969
Committed: https://crrev.com/a6ba29080ae9af6a64aea3c775701742a1885155
Cr-Commit-Position: refs/heads/master@{#369723}
Patch Set 1 #Patch Set 2 : Removed obsolete serialization hack and fixed unit tests. #Dependent Patchsets: Messages
Total messages: 23 (11 generated)
|