<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[207536] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/207536">207536</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2016-10-19 08:07:19 -0700 (Wed, 19 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Parser] Fix compound selector parsing.
https://bugs.webkit.org/show_bug.cgi?id=163649

Reviewed by Darin Adler.

The new CSS parser is failing to handle compound selectors. The code has an assumption that the
first value in the RelationType enum is SubSelector. This patch changes the enum to have the same
name used in Blink, RelationType, and to make the ordering be exactly the same.

* css/CSSSelector.h:
(WebCore::CSSSelector::relation):
(WebCore::CSSSelector::setRelation):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
(WebCore::canMatchHoverOrActiveInQuirksMode):
(WebCore::SelectorChecker::determineLinkMatchType):
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::insertTagHistory):
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::setRelation):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeComplexSelector):
(WebCore::CSSSelectorParser::consumeCombinator):
* css/parser/CSSSelectorParser.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
(WebCore::SelectorCompiler::constructFragmentsInternal):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorcpp">trunk/Source/WebCore/css/CSSSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorh">trunk/Source/WebCore/css/CSSSelector.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorListcpp">trunk/Source/WebCore/css/CSSSelectorList.cpp</a></li>
<li><a href="#trunkSourceWebCorecssRuleSetcpp">trunk/Source/WebCore/css/RuleSet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorFiltercpp">trunk/Source/WebCore/css/SelectorFilter.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParsercpp">trunk/Source/WebCore/css/parser/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserValuescpp">trunk/Source/WebCore/css/parser/CSSParserValues.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserValuesh">trunk/Source/WebCore/css/parser/CSSParserValues.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSSelectorParsercpp">trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSSelectorParserh">trunk/Source/WebCore/css/parser/CSSSelectorParser.h</a></li>
<li><a href="#trunkSourceWebCorecssjitSelectorCompilercpp">trunk/Source/WebCore/cssjit/SelectorCompiler.cpp</a></li>
<li><a href="#trunkSourceWebCoredomSelectorQuerycpp">trunk/Source/WebCore/dom/SelectorQuery.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/ChangeLog        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-10-18  Dave Hyatt  &lt;hyatt@apple.com&gt;
+
+        [CSS Parser] Fix compound selector parsing.
+        https://bugs.webkit.org/show_bug.cgi?id=163649
+
+        Reviewed by Darin Adler.
+
+        The new CSS parser is failing to handle compound selectors. The code has an assumption that the
+        first value in the RelationType enum is SubSelector. This patch changes the enum to have the same
+        name used in Blink, RelationType, and to make the ordering be exactly the same.
+
+        * css/CSSSelector.h:
+        (WebCore::CSSSelector::relation):
+        (WebCore::CSSSelector::setRelation):
+        * css/SelectorChecker.cpp:
+        (WebCore::SelectorChecker::matchRecursively):
+        (WebCore::canMatchHoverOrActiveInQuirksMode):
+        (WebCore::SelectorChecker::determineLinkMatchType):
+        * css/SelectorFilter.cpp:
+        (WebCore::SelectorFilter::collectIdentifierHashes):
+        * css/parser/CSSParserValues.cpp:
+        (WebCore::CSSParserSelector::insertTagHistory):
+        (WebCore::CSSParserSelector::appendTagHistory):
+        * css/parser/CSSParserValues.h:
+        (WebCore::CSSParserSelector::setRelation):
+        * css/parser/CSSSelectorParser.cpp:
+        (WebCore::CSSSelectorParser::consumeComplexSelector):
+        (WebCore::CSSSelectorParser::consumeCombinator):
+        * css/parser/CSSSelectorParser.h:
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
+        (WebCore::SelectorCompiler::constructFragmentsInternal):
+
</ins><span class="cx"> 2016-10-19  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Debugger buttons positioned incorrectly, align-content default value is unexpected
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx">     void* unionPointer;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+static_assert(CSSSelector::RelationType::Subselector == 0, &quot;Subselector must be 0 for consumeCombinator.&quot;);
</ins><span class="cx"> static_assert(sizeof(CSSSelector) == sizeof(SameSizeAsCSSSelector), &quot;CSSSelector should remain small.&quot;);
</span><span class="cx"> 
</span><span class="cx"> CSSSelector::CSSSelector(const QualifiedName&amp; tagQName, bool tagIsForNamespaceRule)
</span><span class="lines">@@ -720,7 +721,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (cs-&gt;relation() != CSSSelector::SubSelector || !cs-&gt;tagHistory())
</del><ins>+        if (cs-&gt;relation() != CSSSelector::Subselector || !cs-&gt;tagHistory())
</ins><span class="cx">             break;
</span><span class="cx">         cs = cs-&gt;tagHistory();
</span><span class="cx">     }
</span><span class="lines">@@ -741,7 +742,7 @@
</span><span class="cx">             return tagHistory-&gt;selectorText(&quot; + &quot; + str.toString() + rightSide);
</span><span class="cx">         case CSSSelector::IndirectAdjacent:
</span><span class="cx">             return tagHistory-&gt;selectorText(&quot; ~ &quot; + str.toString() + rightSide);
</span><del>-        case CSSSelector::SubSelector:
</del><ins>+        case CSSSelector::Subselector:
</ins><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx"> #if ASSERT_DISABLED
</span><span class="cx">             FALLTHROUGH;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.h (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.h        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/CSSSelector.h        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -81,12 +81,12 @@
</span><span class="cx">             PagePseudoClass
</span><span class="cx">         };
</span><span class="cx"> 
</span><del>-        enum Relation {
-            Descendant = 0,
</del><ins>+        enum RelationType {
+            Subselector,
+            Descendant,
</ins><span class="cx">             Child,
</span><span class="cx">             DirectAdjacent,
</span><span class="cx">             IndirectAdjacent,
</span><del>-            SubSelector,
</del><span class="cx">             ShadowDescendant, // FIXME-NEWPARSER: Remove this in favor of the new shadow values below.
</span><span class="cx">             ShadowPseudo, // Special case of shadow DOM pseudo elements / shadow pseudo element
</span><span class="cx">             ShadowDeep, // /deep/ combinator
</span><span class="lines">@@ -295,8 +295,8 @@
</span><span class="cx">         bool isSiblingSelector() const;
</span><span class="cx">         bool isAttributeSelector() const;
</span><span class="cx"> 
</span><del>-        Relation relation() const { return static_cast&lt;Relation&gt;(m_relation); }
-        void setRelation(Relation relation)
</del><ins>+        RelationType relation() const { return static_cast&lt;RelationType&gt;(m_relation); }
+        void setRelation(RelationType relation)
</ins><span class="cx">         {
</span><span class="cx">             m_relation = relation;
</span><span class="cx">             ASSERT(m_relation == relation);
</span><span class="lines">@@ -326,7 +326,7 @@
</span><span class="cx">         void setForPage() { m_isForPage = true; }
</span><span class="cx"> 
</span><span class="cx">     private:
</span><del>-        unsigned m_relation              : 3; // enum Relation.
</del><ins>+        unsigned m_relation              : 3; // enum RelationType.
</ins><span class="cx">         mutable unsigned m_match         : 4; // enum Match.
</span><span class="cx">         mutable unsigned m_pseudoType    : 8; // PseudoType.
</span><span class="cx">         mutable unsigned m_parsedNth     : 1; // Used for :nth-*.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelectorList.cpp (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelectorList.cpp        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/CSSSelectorList.cpp        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -131,9 +131,9 @@
</span><span class="cx"> 
</span><span class="cx"> void CSSSelectorList::buildSelectorsText(StringBuilder&amp; stringBuilder) const
</span><span class="cx"> {
</span><del>-    const CSSSelector* firstSubSelector = first();
-    for (const CSSSelector* subSelector = firstSubSelector; subSelector; subSelector = CSSSelectorList::next(subSelector)) {
-        if (subSelector != firstSubSelector)
</del><ins>+    const CSSSelector* firstSubselector = first();
+    for (const CSSSelector* subSelector = firstSubselector; subSelector; subSelector = CSSSelectorList::next(subSelector)) {
+        if (subSelector != firstSubselector)
</ins><span class="cx">             stringBuilder.appendLiteral(&quot;, &quot;);
</span><span class="cx">         stringBuilder.append(subSelector-&gt;selectorText());
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorecssRuleSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/RuleSet.cpp (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/RuleSet.cpp        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/RuleSet.cpp        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (selector-&gt;relation() != CSSSelector::SubSelector)
</del><ins>+        if (selector-&gt;relation() != CSSSelector::Subselector)
</ins><span class="cx">             matchesRightmostElement = false;
</span><span class="cx"> 
</span><span class="cx">         selector = selector-&gt;tagHistory();
</span><span class="lines">@@ -268,7 +268,7 @@
</span><span class="cx">             m_slottedPseudoElementRules.append(ruleData);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        if (selector-&gt;relation() != CSSSelector::SubSelector)
</del><ins>+        if (selector-&gt;relation() != CSSSelector::Subselector)
</ins><span class="cx">             break;
</span><span class="cx">         selector = selector-&gt;tagHistory();
</span><span class="cx">     } while (selector);
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // The rest of the selectors has to match
</span><del>-    CSSSelector::Relation relation = context.selector-&gt;relation();
</del><ins>+    auto relation = context.selector-&gt;relation();
</ins><span class="cx"> 
</span><span class="cx">     // Prepare next selector
</span><span class="cx">     const CSSSelector* leftSelector = context.selector-&gt;tagHistory();
</span><span class="lines">@@ -321,7 +321,7 @@
</span><span class="cx">     LocalContext nextContext(context);
</span><span class="cx">     nextContext.selector = leftSelector;
</span><span class="cx"> 
</span><del>-    if (relation != CSSSelector::SubSelector) {
</del><ins>+    if (relation != CSSSelector::Subselector) {
</ins><span class="cx">         // Bail-out if this selector is irrelevant for the pseudoId
</span><span class="cx">         if (context.pseudoId != NOPSEUDO &amp;&amp; !dynamicPseudoIdSet.has(context.pseudoId))
</span><span class="cx">             return MatchResult::fails(Match::SelectorFailsCompletely);
</span><span class="lines">@@ -416,7 +416,7 @@
</span><span class="cx">         };
</span><span class="cx">         return MatchResult::fails(Match::SelectorFailsAllSiblings);
</span><span class="cx"> 
</span><del>-    case CSSSelector::SubSelector:
</del><ins>+    case CSSSelector::Subselector:
</ins><span class="cx">         {
</span><span class="cx">             // a selector is invalid if something follows a pseudo-element
</span><span class="cx">             // We make an exception for scrollbar pseudo elements and allow a set of pseudo classes (but nothing else)
</span><span class="lines">@@ -634,11 +634,11 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        CSSSelector::Relation relation = selector-&gt;relation();
</del><ins>+        auto relation = selector-&gt;relation();
</ins><span class="cx">         if (relation == CSSSelector::ShadowDescendant)
</span><span class="cx">             return true;
</span><span class="cx"> 
</span><del>-        if (relation != CSSSelector::SubSelector)
</del><ins>+        if (relation != CSSSelector::Subselector)
</ins><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx">     return false;
</span><span class="lines">@@ -1201,8 +1201,8 @@
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">         }
</span><del>-        CSSSelector::Relation relation = selector-&gt;relation();
-        if (relation == CSSSelector::SubSelector)
</del><ins>+        auto relation = selector-&gt;relation();
+        if (relation == CSSSelector::Subselector)
</ins><span class="cx">             continue;
</span><span class="cx">         if (relation != CSSSelector::Descendant &amp;&amp; relation != CSSSelector::Child)
</span><span class="cx">             return linkMatchType;
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorFiltercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorFilter.cpp (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorFilter.cpp        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/SelectorFilter.cpp        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx"> {
</span><span class="cx">     unsigned* hash = identifierHashes;
</span><span class="cx">     unsigned* end = identifierHashes + maximumIdentifierCount;
</span><del>-    CSSSelector::Relation relation = selector-&gt;relation();
</del><ins>+    auto relation = selector-&gt;relation();
</ins><span class="cx"> 
</span><span class="cx">     // Skip the topmost selector. It is handled quickly by the rule hashes.
</span><span class="cx">     bool skipOverSubselectors = true;
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx">     for (selector = selector-&gt;tagHistory(); selector; selector = selector-&gt;tagHistory()) {
</span><span class="cx">         // Only collect identifiers that match ancestors.
</span><span class="cx">         switch (relation) {
</span><del>-        case CSSSelector::SubSelector:
</del><ins>+        case CSSSelector::Subselector:
</ins><span class="cx">             if (!skipOverSubselectors)
</span><span class="cx">                 collectDescendantSelectorIdentifierHashes(selector, hash);
</span><span class="cx">             break;
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -12981,10 +12981,10 @@
</span><span class="cx">     }
</span><span class="cx">     if (specifiers-&gt;isCustomPseudoElement()) {
</span><span class="cx">         // Specifiers for unknown pseudo element go right behind it in the chain.
</span><del>-        specifiers-&gt;insertTagHistory(CSSSelector::SubSelector, WTFMove(newSpecifier), CSSSelector::ShadowDescendant);
</del><ins>+        specifiers-&gt;insertTagHistory(CSSSelector::Subselector, WTFMove(newSpecifier), CSSSelector::ShadowDescendant);
</ins><span class="cx">         return specifiers;
</span><span class="cx">     }
</span><del>-    specifiers-&gt;appendTagHistory(CSSSelector::SubSelector, WTFMove(newSpecifier));
</del><ins>+    specifiers-&gt;appendTagHistory(CSSSelector::Subselector, WTFMove(newSpecifier));
</ins><span class="cx">     return specifiers;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserValuescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserValues.cpp (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserValues.cpp        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/parser/CSSParserValues.cpp        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -447,7 +447,7 @@
</span><span class="cx">     return m_selector-&gt;matchesPseudoElement() || selectorListMatchesPseudoElement(m_selector-&gt;selectorList());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CSSParserSelector::insertTagHistory(CSSSelector::Relation before, std::unique_ptr&lt;CSSParserSelector&gt; selector, CSSSelector::Relation after)
</del><ins>+void CSSParserSelector::insertTagHistory(CSSSelector::RelationType before, std::unique_ptr&lt;CSSParserSelector&gt; selector, CSSSelector::RelationType after)
</ins><span class="cx"> {
</span><span class="cx">     if (m_tagHistory)
</span><span class="cx">         selector-&gt;setTagHistory(WTFMove(m_tagHistory));
</span><span class="lines">@@ -456,7 +456,7 @@
</span><span class="cx">     m_tagHistory = WTFMove(selector);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CSSParserSelector::appendTagHistory(CSSSelector::Relation relation, std::unique_ptr&lt;CSSParserSelector&gt; selector)
</del><ins>+void CSSParserSelector::appendTagHistory(CSSSelector::RelationType relation, std::unique_ptr&lt;CSSParserSelector&gt; selector)
</ins><span class="cx"> {
</span><span class="cx">     CSSParserSelector* end = this;
</span><span class="cx">     while (end-&gt;tagHistory())
</span><span class="lines">@@ -472,7 +472,7 @@
</span><span class="cx">     while (end-&gt;tagHistory())
</span><span class="cx">         end = end-&gt;tagHistory();
</span><span class="cx"> 
</span><del>-    CSSSelector::Relation selectorRelation;
</del><ins>+    CSSSelector::RelationType selectorRelation;
</ins><span class="cx">     switch (relation) {
</span><span class="cx">     case CSSParserSelectorCombinator::Child:
</span><span class="cx">         selectorRelation = CSSSelector::Child;
</span><span class="lines">@@ -519,12 +519,12 @@
</span><span class="cx">     m_tagHistory = WTFMove(second);
</span><span class="cx"> 
</span><span class="cx">     m_selector = std::make_unique&lt;CSSSelector&gt;(tagQName, tagIsForNamespaceRule);
</span><del>-    m_selector-&gt;setRelation(CSSSelector::SubSelector);
</del><ins>+    m_selector-&gt;setRelation(CSSSelector::Subselector);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;CSSParserSelector&gt; CSSParserSelector::releaseTagHistory()
</span><span class="cx"> {
</span><del>-    setRelation(CSSSelector::SubSelector);
</del><ins>+    setRelation(CSSSelector::Subselector);
</ins><span class="cx">     return WTFMove(m_tagHistory);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserValuesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserValues.h (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserValues.h        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/parser/CSSParserValues.h        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx">     void setArgument(const AtomicString&amp; value) { m_selector-&gt;setArgument(value); }
</span><span class="cx">     void setAttributeValueMatchingIsCaseInsensitive(bool isCaseInsensitive) { m_selector-&gt;setAttributeValueMatchingIsCaseInsensitive(isCaseInsensitive); }
</span><span class="cx">     void setMatch(CSSSelector::Match value) { m_selector-&gt;setMatch(value); }
</span><del>-    void setRelation(CSSSelector::Relation value) { m_selector-&gt;setRelation(value); }
</del><ins>+    void setRelation(CSSSelector::RelationType value) { m_selector-&gt;setRelation(value); }
</ins><span class="cx">     void setForPage() { m_selector-&gt;setForPage(); }
</span><span class="cx"> 
</span><span class="cx">     CSSSelector::Match match() const { return m_selector-&gt;match(); }
</span><span class="lines">@@ -261,8 +261,8 @@
</span><span class="cx">     CSSParserSelector* tagHistory() const { return m_tagHistory.get(); }
</span><span class="cx">     void setTagHistory(std::unique_ptr&lt;CSSParserSelector&gt; selector) { m_tagHistory = WTFMove(selector); }
</span><span class="cx">     void clearTagHistory() { m_tagHistory.reset(); }
</span><del>-    void insertTagHistory(CSSSelector::Relation before, std::unique_ptr&lt;CSSParserSelector&gt;, CSSSelector::Relation after);
-    void appendTagHistory(CSSSelector::Relation, std::unique_ptr&lt;CSSParserSelector&gt;);
</del><ins>+    void insertTagHistory(CSSSelector::RelationType before, std::unique_ptr&lt;CSSParserSelector&gt;, CSSSelector::RelationType after);
+    void appendTagHistory(CSSSelector::RelationType, std::unique_ptr&lt;CSSParserSelector&gt;);
</ins><span class="cx">     void appendTagHistory(CSSParserSelectorCombinator, std::unique_ptr&lt;CSSParserSelector&gt;);
</span><span class="cx">     void prependTagSelector(const QualifiedName&amp;, bool tagIsForNamespaceRule = false);
</span><span class="cx">     std::unique_ptr&lt;CSSParserSelector&gt; releaseTagHistory();
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSSelectorParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -132,13 +132,12 @@
</span><span class="cx">     if (!selector)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-
</del><span class="cx">     unsigned previousCompoundFlags = 0;
</span><span class="cx"> 
</span><span class="cx">     for (CSSParserSelector* simple = selector.get(); simple &amp;&amp; !previousCompoundFlags; simple = simple-&gt;tagHistory())
</span><span class="cx">         previousCompoundFlags |= extractCompoundFlags(*simple, m_context.mode);
</span><span class="cx"> 
</span><del>-    while (CSSSelector::Relation combinator = consumeCombinator(range)) {
</del><ins>+    while (auto combinator = consumeCombinator(range)) {
</ins><span class="cx">         std::unique_ptr&lt;CSSParserSelector&gt; nextSelector = consumeCompoundSelector(range);
</span><span class="cx">         if (!nextSelector)
</span><span class="cx">             return combinator == CSSSelector::Descendant ? WTFMove(selector) : nullptr;
</span><span class="lines">@@ -533,9 +532,9 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CSSSelector::Relation CSSSelectorParser::consumeCombinator(CSSParserTokenRange&amp; range)
</del><ins>+CSSSelector::RelationType CSSSelectorParser::consumeCombinator(CSSParserTokenRange&amp; range)
</ins><span class="cx"> {
</span><del>-    CSSSelector::Relation fallbackResult = CSSSelector::SubSelector;
</del><ins>+    auto fallbackResult = CSSSelector::Subselector;
</ins><span class="cx">     while (range.peek().type() == WhitespaceToken) {
</span><span class="cx">         range.consume();
</span><span class="cx">         fallbackResult = CSSSelector::Descendant;
</span><span class="lines">@@ -732,7 +731,7 @@
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;CSSParserSelector&gt; CSSSelectorParser::addSimpleSelectorToCompound(std::unique_ptr&lt;CSSParserSelector&gt; compoundSelector, std::unique_ptr&lt;CSSParserSelector&gt; simpleSelector)
</span><span class="cx"> {
</span><del>-    compoundSelector-&gt;appendTagHistory(CSSSelector::SubSelector, WTFMove(simpleSelector));
</del><ins>+    compoundSelector-&gt;appendTagHistory(CSSSelector::Subselector, WTFMove(simpleSelector));
</ins><span class="cx">     return compoundSelector;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -743,7 +742,7 @@
</span><span class="cx">     // from left-to-right.
</span><span class="cx">     //
</span><span class="cx">     // &quot;.a.b &gt; div#id&quot; is stored in a tagHistory as [div, #id, .a, .b], each element in the
</span><del>-    // list stored with an associated relation (combinator or SubSelector).
</del><ins>+    // list stored with an associated relation (combinator or Subselector).
</ins><span class="cx">     //
</span><span class="cx">     // ::cue, ::shadow, and custom pseudo elements have an implicit ShadowPseudo combinator
</span><span class="cx">     // to their left, which really makes for a new compound selector, yet it's consumed by
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSSelectorParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSSelectorParser.h (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSSelectorParser.h        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/css/parser/CSSSelectorParser.h        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">     std::unique_ptr&lt;CSSParserSelector&gt; consumePseudo(CSSParserTokenRange&amp;);
</span><span class="cx">     std::unique_ptr&lt;CSSParserSelector&gt; consumeAttribute(CSSParserTokenRange&amp;);
</span><span class="cx"> 
</span><del>-    CSSSelector::Relation consumeCombinator(CSSParserTokenRange&amp;);
</del><ins>+    CSSSelector::RelationType consumeCombinator(CSSParserTokenRange&amp;);
</ins><span class="cx">     CSSSelector::Match consumeAttributeMatch(CSSParserTokenRange&amp;);
</span><span class="cx">     CSSSelector::AttributeMatchType consumeAttributeFlags(CSSParserTokenRange&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitSelectorCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -398,7 +398,7 @@
</span><span class="cx">     return codeGenerator.compile(vm, codeRef);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline FragmentRelation fragmentRelationForSelectorRelation(CSSSelector::Relation relation)
</del><ins>+static inline FragmentRelation fragmentRelationForSelectorRelation(CSSSelector::RelationType relation)
</ins><span class="cx"> {
</span><span class="cx">     switch (relation) {
</span><span class="cx">     case CSSSelector::Descendant:
</span><span class="lines">@@ -409,7 +409,7 @@
</span><span class="cx">         return FragmentRelation::DirectAdjacent;
</span><span class="cx">     case CSSSelector::IndirectAdjacent:
</span><span class="cx">         return FragmentRelation::IndirectAdjacent;
</span><del>-    case CSSSelector::SubSelector:
</del><ins>+    case CSSSelector::Subselector:
</ins><span class="cx">     case CSSSelector::ShadowDescendant:
</span><span class="cx">     case CSSSelector::ShadowPseudo:
</span><span class="cx">     case CSSSelector::ShadowDeep:
</span><span class="lines">@@ -998,8 +998,8 @@
</span><span class="cx">             return FunctionType::CannotMatchAnything;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        CSSSelector::Relation relation = selector-&gt;relation();
-        if (relation == CSSSelector::SubSelector)
</del><ins>+        auto relation = selector-&gt;relation();
+        if (relation == CSSSelector::Subselector)
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         if (relation == CSSSelector::ShadowDescendant &amp;&amp; !selector-&gt;isLastInTagHistory())
</span></span></pre></div>
<a id="trunkSourceWebCoredomSelectorQuerycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/SelectorQuery.cpp (207535 => 207536)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/SelectorQuery.cpp        2016-10-19 13:42:43 UTC (rev 207535)
+++ trunk/Source/WebCore/dom/SelectorQuery.cpp        2016-10-19 15:07:19 UTC (rev 207536)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">                 return IdMatchingType::Rightmost;
</span><span class="cx">             return IdMatchingType::Filter;
</span><span class="cx">         }
</span><del>-        if (selector-&gt;relation() != CSSSelector::SubSelector)
</del><ins>+        if (selector-&gt;relation() != CSSSelector::Subselector)
</ins><span class="cx">             inRightmost = false;
</span><span class="cx">     }
</span><span class="cx">     return IdMatchingType::None;
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx">     for (const CSSSelector* selector = &amp;firstSelector; selector; selector = selector-&gt;tagHistory()) {
</span><span class="cx">         if (canBeUsedForIdFastPath(*selector))
</span><span class="cx">             return selector;
</span><del>-        if (selector-&gt;relation() != CSSSelector::SubSelector)
</del><ins>+        if (selector-&gt;relation() != CSSSelector::Subselector)
</ins><span class="cx">             break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx">     const CSSSelector* selector = &amp;firstSelector;
</span><span class="cx">     do {
</span><span class="cx">         ASSERT(!canBeUsedForIdFastPath(*selector));
</span><del>-        if (selector-&gt;relation() != CSSSelector::SubSelector)
</del><ins>+        if (selector-&gt;relation() != CSSSelector::Subselector)
</ins><span class="cx">             break;
</span><span class="cx">         selector = selector-&gt;tagHistory();
</span><span class="cx">     } while (selector);
</span><span class="lines">@@ -274,7 +274,7 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         }
</span><del>-        if (selector-&gt;relation() == CSSSelector::SubSelector)
</del><ins>+        if (selector-&gt;relation() == CSSSelector::Subselector)
</ins><span class="cx">             continue;
</span><span class="cx">         if (selector-&gt;relation() == CSSSelector::DirectAdjacent || selector-&gt;relation() == CSSSelector::IndirectAdjacent)
</span><span class="cx">             inAdjacentChain = true;
</span></span></pre>
</div>
</div>

</body>
</html>