<!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>[208180] 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/208180">208180</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2016-10-31 15:08:12 -0700 (Mon, 31 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[CSS Parser] Support the shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=164240
Reviewed by Dean Jackson.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.
* css/SelectorPseudoElementTypeMap.in:
Add support for slotted.
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::appendTagHistory):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator. Take :slotted out of
needsImplicitShadowCombinatorForMatching(), since our code doesn't do
this for :slotted.
* css/parser/CSSSelectorParser.cpp:
(WebCore::isPseudoClassFunction):
:host can be both an id and a function, so don't restrict it.
(WebCore::CSSSelectorParser::consumePseudo):
Put in a hack for :host (inside the hack we already plan on removing
once we turn on).
(WebCore::CSSSelectorParser::consumeCombinator):
Remove deep shadow combinator support, as we don't support matching
on it.
(WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
(WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
Make the split use our combinator, ShadowDescendant, and no longer do anything
special with :slotted.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
ShadowDescendant combinator.</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="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorFiltercpp">trunk/Source/WebCore/css/SelectorFilter.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorPseudoElementTypeMapin">trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in</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="#trunkSourceWebCorecssjitSelectorCompilercpp">trunk/Source/WebCore/cssjit/SelectorCompiler.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208179 => 208180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-31 22:07:53 UTC (rev 208179)
+++ trunk/Source/WebCore/ChangeLog        2016-10-31 22:08:12 UTC (rev 208180)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2016-10-31 Dave Hyatt <hyatt@apple.com>
+
+ [CSS Parser] Support the shadow DOM
+ https://bugs.webkit.org/show_bug.cgi?id=164240
+
+ Reviewed by Dean Jackson.
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::selectorText):
+ Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
+ ShadowDescendant combinator.
+
+ * css/CSSSelector.h:
+ * css/SelectorChecker.cpp:
+ (WebCore::SelectorChecker::matchRecursively):
+ Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
+ ShadowDescendant combinator.
+
+ * css/SelectorFilter.cpp:
+ (WebCore::SelectorFilter::collectIdentifierHashes):
+ Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
+ ShadowDescendant combinator.
+
+ * css/SelectorPseudoElementTypeMap.in:
+ Add support for slotted.
+
+ * css/parser/CSSParserValues.cpp:
+ (WebCore::CSSParserSelector::appendTagHistory):
+ * css/parser/CSSParserValues.h:
+ (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
+ Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
+ ShadowDescendant combinator. Take :slotted out of
+ needsImplicitShadowCombinatorForMatching(), since our code doesn't do
+ this for :slotted.
+
+ * css/parser/CSSSelectorParser.cpp:
+ (WebCore::isPseudoClassFunction):
+ :host can be both an id and a function, so don't restrict it.
+
+ (WebCore::CSSSelectorParser::consumePseudo):
+ Put in a hack for :host (inside the hack we already plan on removing
+ once we turn on).
+
+ (WebCore::CSSSelectorParser::consumeCombinator):
+ Remove deep shadow combinator support, as we don't support matching
+ on it.
+
+ (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
+ (WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
+ Make the split use our combinator, ShadowDescendant, and no longer do anything
+ special with :slotted.
+
+ * cssjit/SelectorCompiler.cpp:
+ (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
+ Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
+ ShadowDescendant combinator.
+
</ins><span class="cx"> 2016-10-31 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Use #pragma once in WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (208179 => 208180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2016-10-31 22:07:53 UTC (rev 208179)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2016-10-31 22:08:12 UTC (rev 208180)
</span><span class="lines">@@ -729,8 +729,6 @@
</span><span class="cx"> return tagHistory->selectorText(" " + str.toString() + rightSide);
</span><span class="cx"> case CSSSelector::Child:
</span><span class="cx"> return tagHistory->selectorText(" > " + str.toString() + rightSide);
</span><del>- case CSSSelector::ShadowDeep:
- return tagHistory->selectorText(" /deep/ " + str.toString() + rightSide);
</del><span class="cx"> case CSSSelector::DirectAdjacent:
</span><span class="cx"> return tagHistory->selectorText(" + " + str.toString() + rightSide);
</span><span class="cx"> case CSSSelector::IndirectAdjacent:
</span><span class="lines">@@ -745,8 +743,6 @@
</span><span class="cx"> FALLTHROUGH;
</span><span class="cx"> #endif
</span><span class="cx"> case CSSSelector::ShadowDescendant:
</span><del>- case CSSSelector::ShadowPseudo:
- case CSSSelector::ShadowSlot:
</del><span class="cx"> return tagHistory->selectorText(str.toString() + rightSide);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.h (208179 => 208180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.h        2016-10-31 22:07:53 UTC (rev 208179)
+++ trunk/Source/WebCore/css/CSSSelector.h        2016-10-31 22:08:12 UTC (rev 208180)
</span><span class="lines">@@ -90,10 +90,7 @@
</span><span class="cx"> #if ENABLE(CSS_SELECTORS_LEVEL4)
</span><span class="cx"> DescendantDoubleChild,
</span><span class="cx"> #endif
</span><del>- ShadowDescendant, // FIXME-NEWPARSER: Remove this in favor of the new shadow values below.
- ShadowPseudo, // Special case of shadow DOM pseudo elements / shadow pseudo element
- ShadowDeep, // /deep/ combinator
- ShadowSlot // slotted to <slot> e
</del><ins>+ ShadowDescendant
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> enum PseudoClassType {
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (208179 => 208180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2016-10-31 22:07:53 UTC (rev 208179)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2016-10-31 22:08:12 UTC (rev 208180)
</span><span class="lines">@@ -448,13 +448,6 @@
</span><span class="cx">
</span><span class="cx"> return MatchResult::updateWithMatchType(result, matchType);
</span><span class="cx"> }
</span><del>-
- case CSSSelector::ShadowPseudo:
- case CSSSelector::ShadowDeep:
- case CSSSelector::ShadowSlot:
- // FIXME-NEWPARSER: Have to implement these.
- // ASSERT_NOT_REACHED();
- return MatchResult::fails(Match::SelectorFailsCompletely);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorFiltercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorFilter.cpp (208179 => 208180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorFilter.cpp        2016-10-31 22:07:53 UTC (rev 208179)
+++ trunk/Source/WebCore/css/SelectorFilter.cpp        2016-10-31 22:08:12 UTC (rev 208180)
</span><span class="lines">@@ -138,17 +138,11 @@
</span><span class="cx"> case CSSSelector::ShadowDescendant:
</span><span class="cx"> skipOverSubselectors = true;
</span><span class="cx"> break;
</span><del>- case CSSSelector::ShadowSlot:
- // Disable fastRejectSelector.
- *identifierHashes = 0;
- return;
</del><span class="cx"> case CSSSelector::DescendantSpace:
</span><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><span class="cx"> case CSSSelector::DescendantDoubleChild:
</span><span class="cx"> #endif
</span><span class="cx"> case CSSSelector::Child:
</span><del>- case CSSSelector::ShadowPseudo:
- case CSSSelector::ShadowDeep:
</del><span class="cx"> skipOverSubselectors = false;
</span><span class="cx"> collectDescendantSelectorIdentifierHashes(selector, hash);
</span><span class="cx"> break;
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorPseudoElementTypeMapin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in (208179 => 208180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in        2016-10-31 22:07:53 UTC (rev 208179)
+++ trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in        2016-10-31 22:08:12 UTC (rev 208180)
</span><span class="lines">@@ -15,3 +15,4 @@
</span><span class="cx"> -webkit-scrollbar-track
</span><span class="cx"> -webkit-scrollbar-track-piece
</span><span class="cx"> selection
</span><ins>+slotted
</ins></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserValuescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserValues.cpp (208179 => 208180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserValues.cpp        2016-10-31 22:07:53 UTC (rev 208179)
+++ trunk/Source/WebCore/css/parser/CSSParserValues.cpp        2016-10-31 22:08:12 UTC (rev 208180)
</span><span class="lines">@@ -494,15 +494,6 @@
</span><span class="cx"> case CSSParserSelectorCombinator::IndirectAdjacent:
</span><span class="cx"> selectorRelation = CSSSelector::IndirectAdjacent;
</span><span class="cx"> break;
</span><del>- case CSSParserSelectorCombinator::ShadowDeep:
- selectorRelation = CSSSelector::ShadowDeep;
- break;
- case CSSParserSelectorCombinator::ShadowPseudo:
- selectorRelation = CSSSelector::ShadowPseudo;
- break;
- case CSSParserSelectorCombinator::ShadowSlot:
- selectorRelation = CSSSelector::ShadowSlot;
- break;
</del><span class="cx"> }
</span><span class="cx"> end->setRelation(selectorRelation);
</span><span class="cx"> end->setTagHistory(WTFMove(selector));
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserValuesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserValues.h (208179 => 208180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserValues.h        2016-10-31 22:07:53 UTC (rev 208179)
+++ trunk/Source/WebCore/css/parser/CSSParserValues.h        2016-10-31 22:08:12 UTC (rev 208180)
</span><span class="lines">@@ -194,10 +194,7 @@
</span><span class="cx"> DescendantDoubleChild,
</span><span class="cx"> #endif
</span><span class="cx"> DirectAdjacent,
</span><del>- IndirectAdjacent,
- ShadowPseudo, // Special case of shadow DOM pseudo elements / shadow pseudo element
- ShadowDeep, // /deep/ combinator
- ShadowSlot // slotted to <slot> e
</del><ins>+ IndirectAdjacent
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class CSSParserSelector {
</span><span class="lines">@@ -262,8 +259,11 @@
</span><span class="cx">
</span><span class="cx"> bool isHostPseudoSelector() const;
</span><span class="cx">
</span><del>- // FIXME-NEWPARSER: Missing "shadow"
- bool needsImplicitShadowCombinatorForMatching() const { return match() == CSSSelector::PseudoElement && (pseudoElementType() == CSSSelector::PseudoElementWebKitCustom || pseudoElementType() == CSSSelector::PseudoElementUserAgentCustom || pseudoElementType() == CSSSelector::PseudoElementWebKitCustomLegacyPrefixed || pseudoElementType() == CSSSelector::PseudoElementCue || pseudoElementType() == CSSSelector::PseudoElementSlotted); }
</del><ins>+ // FIXME-NEWPARSER: "slotted" was removed here for now, since it leads to a combinator
+ // connection of ShadowDescendant, and the current shadow DOM code doesn't expect this. When
+ // we do fix this issue, make sure to patch the namespace prependTag code to remove the slotted
+ // special case, since it will be covered by this function once again.
+ bool needsImplicitShadowCombinatorForMatching() const { return match() == CSSSelector::PseudoElement && (pseudoElementType() == CSSSelector::PseudoElementWebKitCustom || pseudoElementType() == CSSSelector::PseudoElementUserAgentCustom || pseudoElementType() == CSSSelector::PseudoElementWebKitCustomLegacyPrefixed || pseudoElementType() == CSSSelector::PseudoElementCue); }
</ins><span class="cx">
</span><span class="cx"> CSSParserSelector* tagHistory() const { return m_tagHistory.get(); }
</span><span class="cx"> void setTagHistory(std::unique_ptr<CSSParserSelector> selector) { m_tagHistory = WTFMove(selector); }
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSSelectorParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp (208179 => 208180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp        2016-10-31 22:07:53 UTC (rev 208179)
+++ trunk/Source/WebCore/css/parser/CSSSelectorParser.cpp        2016-10-31 22:08:12 UTC (rev 208180)
</span><span class="lines">@@ -472,7 +472,6 @@
</span><span class="cx"> case CSSSelector::PseudoClassNthLastOfType:
</span><span class="cx"> case CSSSelector::PseudoClassLang:
</span><span class="cx"> case CSSSelector::PseudoClassAny:
</span><del>- case CSSSelector::PseudoClassHost:
</del><span class="cx"> #if ENABLE_CSS_SELECTORS_LEVEL4
</span><span class="cx"> case CSSSelector::PseudoClassDir:
</span><span class="cx"> case CSSSelector::PseudoClassRole:
</span><span class="lines">@@ -518,9 +517,12 @@
</span><span class="cx"> // uses without breaking it; this hack allows function selectors to work. When the new
</span><span class="cx"> // parser turns on, we can patch the map and remove this code.
</span><span class="cx"> String newValue;
</span><del>- if (token.type() == FunctionToken) {
- newValue = value.toString() + "(";
- value = newValue;
</del><ins>+ if (token.type() == FunctionToken && colons == 1) {
+ String tokenString = value.toString();
+ if (!tokenString.startsWithIgnoringASCIICase("host")) {
+ newValue = value.toString() + "(";
+ value = newValue;
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (colons == 1)
</span><span class="lines">@@ -604,7 +606,6 @@
</span><span class="cx"> selector->setSelectorList(WTFMove(selectorList));
</span><span class="cx"> return selector;
</span><span class="cx"> }
</span><del>- // FIXME-NEWPARSER: Support :host-context
</del><span class="cx"> case CSSSelector::PseudoClassAny:
</span><span class="cx"> case CSSSelector::PseudoClassHost: {
</span><span class="cx"> DisallowPseudoElementsScope scope(this);
</span><span class="lines">@@ -699,17 +700,7 @@
</span><span class="cx"> return CSSSelector::Child;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // Match /deep/
- if (delimiter != '/')
- return fallbackResult;
- range.consume();
- const CSSParserToken& ident = range.consume();
- if (ident.type() != IdentToken || !equalIgnoringASCIICase(ident.value(), "deep"))
- m_failedParsing = true;
- const CSSParserToken& slash = range.consumeIncludingWhitespace();
- if (slash.type() != DelimiterToken || slash.delimiter() != '/')
- m_failedParsing = true;
- return CSSSelector::ShadowDeep;
</del><ins>+ return fallbackResult;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CSSSelector::Match CSSSelectorParser::consumeAttributeMatch(CSSParserTokenRange& range)
</span><span class="lines">@@ -847,7 +838,9 @@
</span><span class="cx">
</span><span class="cx"> void CSSSelectorParser::prependTypeSelectorIfNeeded(const AtomicString& namespacePrefix, const AtomicString& elementName, CSSParserSelector* compoundSelector)
</span><span class="cx"> {
</span><del>- if (elementName.isNull() && defaultNamespace() == starAtom && !compoundSelector->needsImplicitShadowCombinatorForMatching())
</del><ins>+ bool isShadowDOM = compoundSelector->needsImplicitShadowCombinatorForMatching();
+
+ if (elementName.isNull() && defaultNamespace() == starAtom && !isShadowDOM)
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> AtomicString determinedElementName = elementName.isNull() ? starAtom : elementName;
</span><span class="lines">@@ -861,16 +854,16 @@
</span><span class="cx"> determinedPrefix = nullAtom;
</span><span class="cx"> QualifiedName tag = QualifiedName(determinedPrefix, determinedElementName, namespaceURI);
</span><span class="cx">
</span><del>- // *:host/*:host-context never matches, so we can't discard the *,
</del><ins>+ // *:host never matches, so we can't discard the *,
</ins><span class="cx"> // otherwise we can't tell the difference between *:host and just :host.
</span><span class="cx"> //
</span><span class="cx"> // Also, selectors where we use a ShadowPseudo combinator between the
</span><span class="cx"> // element and the pseudo element for matching (custom pseudo elements,
</span><del>- // ::cue, ::shadow), we need a universal selector to set the combinator
</del><ins>+ // ::cue), we need a universal selector to set the combinator
</ins><span class="cx"> // (relation) on in the cases where there are no simple selectors preceding
</span><span class="cx"> // the pseudo element.
</span><span class="cx"> bool explicitForHost = compoundSelector->isHostPseudoSelector() && !elementName.isNull();
</span><del>- if (tag != anyQName() || explicitForHost || compoundSelector->needsImplicitShadowCombinatorForMatching())
</del><ins>+ if (tag != anyQName() || explicitForHost || isShadowDOM)
</ins><span class="cx"> compoundSelector->prependTagSelector(tag, determinedPrefix == nullAtom && determinedElementName == starAtom && !explicitForHost);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -908,7 +901,7 @@
</span><span class="cx"> return compoundSelector;
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory();
</span><del>- secondCompound->appendTagHistory(secondCompound->pseudoElementType() == CSSSelector::PseudoElementSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, WTFMove(compoundSelector));
</del><ins>+ secondCompound->appendTagHistory(CSSSelector::ShadowDescendant, WTFMove(compoundSelector));
</ins><span class="cx"> return secondCompound;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssjitSelectorCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (208179 => 208180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2016-10-31 22:07:53 UTC (rev 208179)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp        2016-10-31 22:08:12 UTC (rev 208180)
</span><span class="lines">@@ -414,9 +414,6 @@
</span><span class="cx"> return FragmentRelation::IndirectAdjacent;
</span><span class="cx"> case CSSSelector::Subselector:
</span><span class="cx"> case CSSSelector::ShadowDescendant:
</span><del>- case CSSSelector::ShadowPseudo:
- case CSSSelector::ShadowDeep:
- case CSSSelector::ShadowSlot:
</del><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> ASSERT_NOT_REACHED();
</span></span></pre>
</div>
</div>
</body>
</html>