Fix compound selector parsing. The new parser makes the assumption that SubSelector is the first value in the RelationType enum. Although this is kind of lame, it's easy for us to move it to the correct spot to fix.
Created attachment 292033 [details] Patch
Comment on attachment 292033 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=292033&action=review > Source/WebCore/css/CSSSelector.h:84 > + enum RelationType { Should we change it to an enum class at some point? > Source/WebCore/css/CSSSelector.h:85 > + SubSelector, That should be "Subselector" since it's one word. Should we add a static_assert that subselector is 0 since the code assumes subselector is 0? > Source/WebCore/css/SelectorChecker.cpp:637 > + CSSSelector::RelationType relation = selector->relation(); I suggest auto instead. > Source/WebCore/css/SelectorChecker.cpp:1204 > + CSSSelector::RelationType relation = selector->relation(); I suggest auto instead. > Source/WebCore/css/SelectorFilter.cpp:125 > + CSSSelector::RelationType relation = selector->relation(); I suggest auto instead. > Source/WebCore/css/parser/CSSSelectorParser.cpp:141 > + while (CSSSelector::RelationType combinator = consumeCombinator(range)) { I suggest auto instead. > Source/WebCore/css/parser/CSSSelectorParser.cpp:538 > + CSSSelector::RelationType fallbackResult = CSSSelector::SubSelector; I suggest auto instead. > Source/WebCore/cssjit/SelectorCompiler.cpp:1001 > + CSSSelector::RelationType relation = selector->relation(); I suggest auto instead.
Yes, static_assert is a great idea here. Will also patch all the other places to use auto as suggested.
Landed in r207536.