<!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>[197165] trunk</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/197165">197165</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-02-26 06:57:01 -0800 (Fri, 26 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Implement ::slotted pseudo element
https://bugs.webkit.org/show_bug.cgi?id=149441
<rdar://problem/22731987>
Reviewed by Andreas Kling.
Source/WebCore:
Based on latest in https://github.com/w3c/webcomponents/issues/331
* css/CSSGrammar.y.in:
Parse ::slotted.
* css/CSSParser.cpp:
(WebCore::CSSParser::detectFunctionTypeToken):
* css/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
(WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector):
Tokenize ::slotted.
(WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
* css/CSSParserValues.h:
* css/CSSSelector.cpp:
(WebCore::CSSSelector::pseudoId):
* css/CSSSelector.h:
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAuthorRules):
(WebCore::ElementRuleCollector::matchHostPseudoClassRules):
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
Match ::slotted selector.
(WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
Collect ::slotted rules that may apply to an element in a slot.
(WebCore::ElementRuleCollector::matchUserRules):
(WebCore::ElementRuleCollector::matchUARules):
(WebCore::findSlottedPseudoElementSelector):
(WebCore::ElementRuleCollector::ruleMatches):
* css/ElementRuleCollector.h:
* css/RuleSet.cpp:
(WebCore::RuleSet::addRule):
Collect ::slotted rules.
(WebCore::RuleSet::shrinkToFit):
* css/RuleSet.h:
(WebCore::RuleSet::hostPseudoClassRules):
(WebCore::RuleSet::slottedPseudoElementRules):
(WebCore::RuleSet::focusPseudoClassRules):
(WebCore::RuleSet::universalRules):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
Disable style sharing for children of shadow host. They may be affected by the shadow tree style
which is not considered in style sharing checks.
LayoutTests:
* fast/shadow-dom/css-scoping-shadow-slotted-rule.html:
Enable the test, fix it and update it to the current spec.
* fast/shadow-dom/slotted-pseudo-element-css-text-expected.txt: Added.
* fast/shadow-dom/slotted-pseudo-element-css-text.html: Added.
Add parsing/cssText test based on a Blink test.
There are a few failures due to * not roundtripping and the parser being too lenient with pseudo elements.
* platform/mac/TestExpectations:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastshadowdomcssscopingshadowslottedrulehtml">trunk/LayoutTests/fast/shadow-dom/css-scoping-shadow-slotted-rule.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSGrammaryin">trunk/Source/WebCore/css/CSSGrammar.y.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserValuescpp">trunk/Source/WebCore/css/CSSParserValues.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserValuesh">trunk/Source/WebCore/css/CSSParserValues.h</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="#trunkSourceWebCorecssElementRuleCollectorcpp">trunk/Source/WebCore/css/ElementRuleCollector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssElementRuleCollectorh">trunk/Source/WebCore/css/ElementRuleCollector.h</a></li>
<li><a href="#trunkSourceWebCorecssRuleSetcpp">trunk/Source/WebCore/css/RuleSet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssRuleSeth">trunk/Source/WebCore/css/RuleSet.h</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleSharingResolvercpp">trunk/Source/WebCore/style/StyleSharingResolver.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastshadowdomslottedpseudoelementcsstextexpectedtxt">trunk/LayoutTests/fast/shadow-dom/slotted-pseudo-element-css-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastshadowdomslottedpseudoelementcsstexthtml">trunk/LayoutTests/fast/shadow-dom/slotted-pseudo-element-css-text.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/LayoutTests/ChangeLog        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-02-26 Antti Koivisto <antti@apple.com>
+
+ Implement ::slotted pseudo element
+ https://bugs.webkit.org/show_bug.cgi?id=149441
+ <rdar://problem/22731987>
+
+ Reviewed by Andreas Kling.
+
+ * fast/shadow-dom/css-scoping-shadow-slotted-rule.html:
+
+ Enable the test, fix it and update it to the current spec.
+
+ * fast/shadow-dom/slotted-pseudo-element-css-text-expected.txt: Added.
+ * fast/shadow-dom/slotted-pseudo-element-css-text.html: Added.
+
+ Add parsing/cssText test based on a Blink test.
+ There are a few failures due to * not roundtripping and the parser being too lenient with pseudo elements.
+
+ * platform/mac/TestExpectations:
+
</ins><span class="cx"> 2016-02-26 Youenn Fablet <youenn.fablet@crf.canon.fr>
</span><span class="cx">
</span><span class="cx"> Sync web-platform-tests up to revision 5ca8b46
</span></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomcssscopingshadowslottedrulehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shadow-dom/css-scoping-shadow-slotted-rule.html (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/css-scoping-shadow-slotted-rule.html        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/LayoutTests/fast/shadow-dom/css-scoping-shadow-slotted-rule.html        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> <!DOCTYPE html>
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><del>- <title>CSS Scoping - :slotted pesudo element must allow selecting elements assigned to a slot element</title>
</del><ins>+ <title>CSS Scoping - :slotted pseudo element must allow selecting elements assigned to a slot element</title>
</ins><span class="cx"> <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
</span><span class="cx"> <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model">
</span><span class="cx"> <link rel="match" href="reference/green-box.html"/>
</span><span class="lines">@@ -12,7 +12,8 @@
</span><span class="cx"> display: block;
</span><span class="cx"> width: 100px;
</span><span class="cx"> height: 100px;
</span><del>- background: red;
</del><ins>+ color: red;
+ background: green;
</ins><span class="cx"> }
</span><span class="cx"> my-host > div, nested-host {
</span><span class="cx"> display: block;
</span><span class="lines">@@ -23,7 +24,7 @@
</span><span class="cx"> <p>Test passes if you see a single 100px by 100px green box below.</p>
</span><span class="cx"> <my-host>
</span><span class="cx"> <div class="green">FAIL1</div>
</span><del>- <div><span>FAIL2</span></div>
</del><ins>+ <myelem><span>FAIL2</span></myelem>
</ins><span class="cx"> <nested-host>
</span><span class="cx"> <span>FAIL3</span>
</span><span class="cx"> </nested-host>
</span><span class="lines">@@ -36,15 +37,15 @@
</span><span class="cx"> try {
</span><span class="cx"> var shadowHost = document.querySelector('my-host');
</span><span class="cx"> shadowRoot = shadowHost.attachShadow({mode: 'open'});
</span><del>- shadowRoot.innerHTML = '<slot></slot><style> ::slotted > .green, ::slotted span { color:green; } </style>';
</del><ins>+ shadowRoot.innerHTML = '<slot></slot><style> ::slotted(.green), ::slotted(myelem) { color:green; } </style>';
</ins><span class="cx">
</span><span class="cx"> shadowHost = document.querySelector('nested-host');
</span><span class="cx"> shadowRoot = shadowHost.attachShadow({mode: 'open'});
</span><del>- shadowRoot.innerHTML = '<slot></slot>';
</del><ins>+ shadowRoot.innerHTML = '<style> .mydiv ::slotted(*) { color:green; } </style><div class=mydiv><slot></slot></div>';
</ins><span class="cx">
</span><span class="cx"> shadowHost = document.querySelector('another-host');
</span><span class="cx"> shadowRoot = shadowHost.attachShadow({mode: 'open'});
</span><del>- shadowRoot.innerHTML = '<style> ::slotted { color:green; } </style><slot></slot>';
</del><ins>+ shadowRoot.innerHTML = '<style> ::slotted(*) { color:green; } </style><slot></slot>';
</ins><span class="cx"> } catch (exception) {
</span><span class="cx"> document.body.appendChild(document.createTextNode(exception));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomslottedpseudoelementcsstextexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/shadow-dom/slotted-pseudo-element-css-text-expected.txt (0 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/slotted-pseudo-element-css-text-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/shadow-dom/slotted-pseudo-element-css-text-expected.txt        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+
+PASS ::slotted { display: block; }
+PASS ::slotted() { display: block; }
+PASS ::slotted(*) { display: block; }
+FAIL *::slotted(*) { display: block; } assert_equals: expected "*::slotted(*) { display: block; }" but got "::slotted(*) { display: block; }"
+PASS ::slotted(div) { display: block; }
+PASS ::slotted( div) { display: block; }
+PASS ::slotted(div ) { display: block; }
+PASS ::slotted(div::before) { display: block; }
+PASS .foo::slotted(div) { color: blue; }
+PASS #id::slotted(*) { color: blue; }
+PASS [attr=foo]::slotted(*) { color: blue; }
+PASS .foo .bar::slotted(div) { color: blue; }
+FAIL .foo::before .bar::slotted(div) { color: blue; } assert_equals: expected "" but got ".foo::before .bar::slotted(div) { color: blue; }"
+FAIL .foo::slotted(div) .bar { color: blue; } assert_equals: expected "" but got ".foo::slotted(div) .bar { color: blue; }"
+PASS ::slotted(div, div) { color: blue; }
+PASS ::slotted(div div) { color: blue; }
+PASS slot::slotted(.green) { color: green; }
+PASS slot::slotted(#green) { color: green; }
+PASS slot::slotted([green=green]) { color: green; }
+PASS slot::slotted(div.green) { color: green; }
+PASS div ::slotted(div) { color: red; }
+PASS div + slot::slotted(div) { color: red; }
+PASS span::slotted(*) { color: red; }
+FAIL ::slotted(span)::slotted(span) { color: red; } assert_equals: expected "" but got "::slotted(span)::slotted(span) { color: red; }"
+PASS ::slotted(::slotted(div)) { color: red; }
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomslottedpseudoelementcsstexthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/shadow-dom/slotted-pseudo-element-css-text.html (0 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/slotted-pseudo-element-css-text.html         (rev 0)
+++ trunk/LayoutTests/fast/shadow-dom/slotted-pseudo-element-css-text.html        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+<!DOCTYPE html>
+<script src='../../resources/testharness.js'></script>
+<script src='../../resources/testharnessreport.js'></script>
+<script>
+var rules = [
+"::slotted { display: block; }", /* invalid - no parameter */
+"::slotted() { display: block; }", /* invalid - empty parameter */
+"::slotted(*) { display: block; }",
+"*::slotted(*) { display: block; }",
+"::slotted(div) { display: block; }", /* expects universal selector (*) on the left in cssText */
+"::slotted( div) { display: block; }", /* allow a space on left */
+"::slotted(div ) { display: block; }", /* allow a space on right */
+"::slotted(div::before) { display: block; }", /* having a pseudo element in () is invalid */
+".foo::slotted(div) { color: blue; }",
+"#id::slotted(*) { color: blue; }",
+"[attr=foo]::slotted(*) { color: blue; }",
+".foo .bar::slotted(div) { color: blue; }",
+".foo::before .bar::slotted(div) { color: blue; }", /* invalid, only one pseudo element is allowed at the rightmost compound */
+".foo::slotted(div) .bar { color: blue; }", /* invalid, same as above */
+"::slotted(div, div) { color: blue; }", /* invalid - selector list */
+"::slotted(div div) { color: blue; }", /* invalid - complex selector (combinator is used) */
+"slot::slotted(.green) { color: green; }",
+"slot::slotted(#green) { color: green; }",
+"slot::slotted([green=green]) { color: green; }",
+"slot::slotted(div.green) { color: green; }",
+"div ::slotted(div) { color: red; }",
+"div + slot::slotted(div) { color: red; }",
+"span::slotted(*) { color: red; }", /* never matches, but valid as a selector */
+"::slotted(span)::slotted(span) { color: red; }", /* invalid */
+"::slotted(::slotted(div)) { color: red; }" /* invalid */
+];
+
+var expectedCSSTexts = [
+"",
+"",
+"::slotted(*) { display: block; }",
+"*::slotted(*) { display: block; }",
+"::slotted(div) { display: block; }",
+"::slotted(div) { display: block; }",
+"::slotted(div) { display: block; }",
+"",
+".foo::slotted(div) { color: blue; }",
+"#id::slotted(*) { color: blue; }",
+"[attr=\"foo\"]::slotted(*) { color: blue; }",
+".foo .bar::slotted(div) { color: blue; }",
+"",
+"",
+"",
+"",
+"slot::slotted(.green) { color: green; }",
+"slot::slotted(#green) { color: green; }",
+"slot::slotted([green=\"green\"]) { color: green; }",
+"slot::slotted(div.green) { color: green; }",
+"div ::slotted(div) { color: red; }",
+"div + slot::slotted(div) { color: red; }",
+"span::slotted(*) { color: red; }",
+"",
+"",
+];
+
+function ruleCSSText(rule)
+{
+ var style = document.createElement("style");
+ style.innerText = rule;
+ document.head.appendChild(style);
+ if (style.sheet.cssRules.length == 0)
+ return "";
+ return style.sheet.cssRules.item(0).cssText;
+}
+
+for (var i = 0; i < rules.length; ++i) {
+ test(() => {
+ assert_equals(ruleCSSText(rules[i]), expectedCSSTexts[i]);
+ }, rules[i]);
+}
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -1249,7 +1249,6 @@
</span><span class="cx">
</span><span class="cx"> webkit.org/b/148695 fast/shadow-dom [ Pass ]
</span><span class="cx"> webkit.org/b/149440 fast/shadow-dom/css-scoping-shadow-host-functional-rule.html [ ImageOnlyFailure ]
</span><del>-webkit.org/b/149441 fast/shadow-dom/css-scoping-shadow-slotted-rule.html [ ImageOnlyFailure ]
</del><span class="cx"> webkit.org/b/149441 fast/shadow-dom/css-scoping-shadow-slot-display-override.html [ ImageOnlyFailure ]
</span><span class="cx">
</span><span class="cx"> # Touch events is not enabled on Mac
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/ChangeLog        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2016-02-25 Antti Koivisto <antti@apple.com>
+
+ Implement ::slotted pseudo element
+ https://bugs.webkit.org/show_bug.cgi?id=149441
+ <rdar://problem/22731987>
+
+ Reviewed by Andreas Kling.
+
+ Based on latest in https://github.com/w3c/webcomponents/issues/331
+
+ * css/CSSGrammar.y.in:
+
+ Parse ::slotted.
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::detectFunctionTypeToken):
+ * css/CSSParserValues.cpp:
+ (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
+ (WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector):
+
+ Tokenize ::slotted.
+
+ (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
+ * css/CSSParserValues.h:
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::pseudoId):
+ * css/CSSSelector.h:
+ * css/ElementRuleCollector.cpp:
+ (WebCore::ElementRuleCollector::matchAuthorRules):
+ (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
+ (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
+
+ Match ::slotted selector.
+
+ (WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
+
+ Collect ::slotted rules that may apply to an element in a slot.
+
+ (WebCore::ElementRuleCollector::matchUserRules):
+ (WebCore::ElementRuleCollector::matchUARules):
+ (WebCore::findSlottedPseudoElementSelector):
+ (WebCore::ElementRuleCollector::ruleMatches):
+ * css/ElementRuleCollector.h:
+ * css/RuleSet.cpp:
+ (WebCore::RuleSet::addRule):
+
+ Collect ::slotted rules.
+
+ (WebCore::RuleSet::shrinkToFit):
+ * css/RuleSet.h:
+ (WebCore::RuleSet::hostPseudoClassRules):
+ (WebCore::RuleSet::slottedPseudoElementRules):
+ (WebCore::RuleSet::focusPseudoClassRules):
+ (WebCore::RuleSet::universalRules):
+ * css/SelectorChecker.cpp:
+ (WebCore::SelectorChecker::checkOne):
+ * style/StyleSharingResolver.cpp:
+ (WebCore::Style::SharingResolver::resolve):
+
+ Disable style sharing for children of shadow host. They may be affected by the shadow tree style
+ which is not considered in style sharing checks.
+
</ins><span class="cx"> 2016-02-25 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><span class="cx"> Font size computed style is innaccurate
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGrammaryin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGrammar.y.in        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -365,6 +365,12 @@
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE_SHADOW_DOM
+
+%token <string> SLOTTEDFUNCTION
+
+#endif
+
</ins><span class="cx"> %%
</span><span class="cx">
</span><span class="cx"> stylesheet:
</span><span class="lines">@@ -1357,6 +1363,11 @@
</span><span class="cx"> $$ = CSSParserSelector::parsePseudoElementCueFunctionSelector($3, $5);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+#if ENABLE_SHADOW_DOM
+ | ':' ':' SLOTTEDFUNCTION maybe_space compound_selector maybe_space ')' {
+ $$ = CSSParserSelector::parsePseudoElementSlottedFunctionSelector($3, $5);
+ }
+#endif
</ins><span class="cx"> // use by :-webkit-any.
</span><span class="cx"> // FIXME: should we support generic selectors here or just simple_selectors?
</span><span class="cx"> // Use simple_selector_list for now to match -moz-any.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -11894,6 +11894,12 @@
</span><span class="cx"> m_token = MATCHESFUNCTION;
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><ins>+#if ENABLE(SHADOW_DOM)
+ if (isEqualToCSSIdentifier(name, "slotted")) {
+ m_token = SLOTTEDFUNCTION;
+ return true;
+ }
+#endif
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> case 9:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserValuescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserValues.cpp (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserValues.cpp        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/CSSParserValues.cpp        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -231,6 +231,32 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(SHADOW_DOM)
+CSSParserSelector* CSSParserSelector::parsePseudoElementSlottedFunctionSelector(const CSSParserString& functionIdentifier, CSSParserSelector* parsedSelector)
+{
+ ASSERT_UNUSED(functionIdentifier, String(functionIdentifier) == "slotted(");
+
+ if (!parsedSelector)
+ return nullptr;
+
+ std::unique_ptr<CSSParserSelector> ownedParsedSelector(parsedSelector);
+
+ for (auto* component = parsedSelector; component; component = component->tagHistory()) {
+ if (component->matchesPseudoElement())
+ return nullptr;
+ }
+
+ auto selectorVector = std::make_unique<Vector<std::unique_ptr<CSSParserSelector>>>();
+ selectorVector->append(WTFMove(ownedParsedSelector));
+
+ auto selector = std::make_unique<CSSParserSelector>();
+ selector->m_selector->setMatch(CSSSelector::PseudoElement);
+ selector->m_selector->setPseudoElementType(CSSSelector::PseudoElementSlotted);
+ selector->adoptSelectorVector(*selectorVector);
+ return selector.release();
+}
+#endif
+
</ins><span class="cx"> CSSParserSelector* CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString)
</span><span class="cx"> {
</span><span class="cx"> if (pseudoTypeString.length() && pseudoTypeString[pseudoTypeString.length() - 1] == '(')
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserValuesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserValues.h (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserValues.h        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/CSSParserValues.h        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -203,7 +203,10 @@
</span><span class="cx"> public:
</span><span class="cx"> static CSSParserSelector* parsePagePseudoSelector(const CSSParserString& pseudoTypeString);
</span><span class="cx"> static CSSParserSelector* parsePseudoElementSelector(CSSParserString& pseudoTypeString);
</span><del>- static CSSParserSelector* parsePseudoElementCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>* selectorVector);
</del><ins>+ static CSSParserSelector* parsePseudoElementCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>*);
+#if ENABLE(SHADOW_DOM)
+ static CSSParserSelector* parsePseudoElementSlottedFunctionSelector(const CSSParserString& functionIdentifier, CSSParserSelector*);
+#endif
</ins><span class="cx"> static CSSParserSelector* parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString);
</span><span class="cx">
</span><span class="cx"> CSSParserSelector();
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -299,6 +299,9 @@
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> case PseudoElementCue:
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(SHADOW_DOM)
+ case PseudoElementSlotted:
+#endif
</ins><span class="cx"> case PseudoElementUnknown:
</span><span class="cx"> case PseudoElementUserAgentCustom:
</span><span class="cx"> case PseudoElementWebKitCustom:
</span><span class="lines">@@ -644,8 +647,18 @@
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> } else if (cs->match() == CSSSelector::PseudoElement) {
</span><del>- str.appendLiteral("::");
- str.append(cs->value());
</del><ins>+ switch (cs->pseudoElementType()) {
+#if ENABLE(SHADOW_DOM)
+ case CSSSelector::PseudoElementSlotted:
+ str.appendLiteral("::slotted(");
+ cs->selectorList()->buildSelectorsText(str);
+ str.append(')');
+ break;
+#endif
+ default:
+ str.appendLiteral("::");
+ str.append(cs->value());
+ }
</ins><span class="cx"> } else if (cs->isAttributeSelector()) {
</span><span class="cx"> str.append('[');
</span><span class="cx"> const AtomicString& prefix = cs->attribute().prefix();
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.h (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.h        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/CSSSelector.h        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -181,6 +181,9 @@
</span><span class="cx"> PseudoElementScrollbarTrack,
</span><span class="cx"> PseudoElementScrollbarTrackPiece,
</span><span class="cx"> PseudoElementSelection,
</span><ins>+#if ENABLE(SHADOW_DOM)
+ PseudoElementSlotted,
+#endif
</ins><span class="cx"> PseudoElementUserAgentCustom,
</span><span class="cx"> PseudoElementWebKitCustom,
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorecssElementRuleCollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/ElementRuleCollector.cpp (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/ElementRuleCollector.cpp        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/ElementRuleCollector.cpp        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "CSSSelectorList.h"
</span><span class="cx"> #include "CSSValueKeywords.h"
</span><span class="cx"> #include "HTMLElement.h"
</span><ins>+#include "HTMLSlotElement.h"
</ins><span class="cx"> #include "InspectorInstrumentation.h"
</span><span class="cx"> #include "NodeRenderStyle.h"
</span><span class="cx"> #include "RenderRegion.h"
</span><span class="lines">@@ -206,6 +207,10 @@
</span><span class="cx"> #if ENABLE(SHADOW_DOM)
</span><span class="cx"> if (m_element.shadowRoot())
</span><span class="cx"> matchHostPseudoClassRules(includeEmptyRules);
</span><ins>+
+ auto* parent = m_element.parentNode();
+ if (parent && parent->shadowRoot())
+ matchSlottedPseudoElementRules(includeEmptyRules);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> clearMatchedRules();
</span><span class="lines">@@ -241,6 +246,62 @@
</span><span class="cx"> // FIXME: Match the spec when it is finalized.
</span><span class="cx"> sortAndTransferMatchedRules();
</span><span class="cx"> }
</span><ins>+
+void ElementRuleCollector::matchSlottedPseudoElementRules(bool includeEmptyRules)
+{
+ auto* hostShadowRoot = m_element.parentNode()->shadowRoot();
+ ASSERT(hostShadowRoot);
+ auto* slot = hostShadowRoot->findAssignedSlot(m_element);
+ if (!slot)
+ return;
+ auto* shadowAuthorStyle = hostShadowRoot->styleResolver().ruleSets().authorStyle();
+ if (!shadowAuthorStyle)
+ return;
+ // Find out if there are any ::slotted rules in the shadow tree matching the current slot.
+ // FIXME: This is really part of the slot style and could be cached when resolving it.
+ ElementRuleCollector collector(*slot, *shadowAuthorStyle, nullptr);
+ auto slottedPseudoElementRules = collector.collectSlottedPseudoElementRulesForSlot(includeEmptyRules);
+ if (slottedPseudoElementRules.isEmpty())
+ return;
+
+ clearMatchedRules();
+ m_result.ranges.lastAuthorRule = m_result.matchedProperties().size() - 1;
+
+ {
+ // Match in the current scope.
+ TemporaryChange<bool> change(m_isMatchingSlottedPseudoElements, true);
+
+ MatchRequest matchRequest(nullptr, includeEmptyRules);
+ auto ruleRange = m_result.ranges.authorRuleRange();
+ collectMatchingRulesForList(&slottedPseudoElementRules, matchRequest, ruleRange);
+ }
+
+ // FIXME: What is the correct order?
+ sortAndTransferMatchedRules();
+}
+
+RuleSet::RuleDataVector ElementRuleCollector::collectSlottedPseudoElementRulesForSlot(bool includeEmptyRules)
+{
+ ASSERT(is<HTMLSlotElement>(m_element));
+
+ clearMatchedRules();
+
+ m_mode = SelectorChecker::Mode::CollectingRules;
+
+ // Match global author rules.
+ MatchRequest matchRequest(&m_authorStyle, includeEmptyRules);
+ StyleResolver::RuleRange ruleRange = m_result.ranges.authorRuleRange();
+ collectMatchingRulesForList(&m_authorStyle.slottedPseudoElementRules(), matchRequest, ruleRange);
+
+ if (m_matchedRules.isEmpty())
+ return { };
+
+ RuleSet::RuleDataVector ruleDataVector;
+ ruleDataVector.reserveInitialCapacity(m_matchedRules.size());
+ for (auto& matchedRule : m_matchedRules)
+ ruleDataVector.uncheckedAppend(*matchedRule.ruleData);
+ return ruleDataVector;
+}
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void ElementRuleCollector::matchUserRules(bool includeEmptyRules)
</span><span class="lines">@@ -284,6 +345,20 @@
</span><span class="cx"> sortAndTransferMatchedRules();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(SHADOW_DOM)
+static const CSSSelector* findSlottedPseudoElementSelector(const CSSSelector* selector)
+{
+ for (; selector; selector = selector->tagHistory()) {
+ if (selector->match() == CSSSelector::PseudoElement && selector->pseudoElementType() == CSSSelector::PseudoElementSlotted) {
+ if (auto* list = selector->selectorList())
+ return list->first();
+ break;
+ }
+ };
+ return nullptr;
+}
+#endif
+
</ins><span class="cx"> inline bool ElementRuleCollector::ruleMatches(const RuleData& ruleData, unsigned& specificity)
</span><span class="cx"> {
</span><span class="cx"> // We know a sufficiently simple single part selector matches simply because we found it from the rule hash when filtering the RuleSet.
</span><span class="lines">@@ -356,9 +431,17 @@
</span><span class="cx"> } else
</span><span class="cx"> #endif // ENABLE(CSS_SELECTOR_JIT)
</span><span class="cx"> {
</span><ins>+ auto* selector = ruleData.selector();
+#if ENABLE(SHADOW_DOM)
+ if (m_isMatchingSlottedPseudoElements) {
+ selector = findSlottedPseudoElementSelector(ruleData.selector());
+ if (!selector)
+ return false;
+ }
+#endif
</ins><span class="cx"> // Slow path.
</span><span class="cx"> SelectorChecker selectorChecker(m_element.document());
</span><del>- selectorMatches = selectorChecker.match(*ruleData.selector(), m_element, context, specificity);
</del><ins>+ selectorMatches = selectorChecker.match(*selector, m_element, context, specificity);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> commitStyleRelations(context.styleRelations);
</span></span></pre></div>
<a id="trunkSourceWebCorecssElementRuleCollectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/ElementRuleCollector.h (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/ElementRuleCollector.h        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/ElementRuleCollector.h        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -73,6 +73,8 @@
</span><span class="cx"> void matchUARules(RuleSet*);
</span><span class="cx"> #if ENABLE(SHADOW_DOM)
</span><span class="cx"> void matchHostPseudoClassRules(bool includeEmptyRules);
</span><ins>+ void matchSlottedPseudoElementRules(bool includeEmptyRules);
+ RuleSet::RuleDataVector collectSlottedPseudoElementRulesForSlot(bool includeEmptyRules);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void collectMatchingRules(const MatchRequest&, StyleResolver::RuleRange&);
</span><span class="lines">@@ -98,6 +100,9 @@
</span><span class="cx"> PseudoStyleRequest m_pseudoStyleRequest { NOPSEUDO };
</span><span class="cx"> bool m_sameOriginOnly { false };
</span><span class="cx"> SelectorChecker::Mode m_mode { SelectorChecker::Mode::ResolvingStyle };
</span><ins>+#if ENABLE(SHADOW_DOM)
+ bool m_isMatchingSlottedPseudoElements { false };
+#endif
</ins><span class="cx">
</span><span class="cx"> Vector<MatchedRule, 64> m_matchedRules;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssRuleSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/RuleSet.cpp (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/RuleSet.cpp        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/RuleSet.cpp        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -266,6 +266,12 @@
</span><span class="cx"> m_hostPseudoClassRules.append(ruleData);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+ if (selector->match() == CSSSelector::PseudoElement && selector->pseudoElementType() == CSSSelector::PseudoElementSlotted) {
+ // ::slotted pseudo elements work accross shadow boundary making filtering difficult.
+ ruleData.disableSelectorFiltering();
+ m_slottedPseudoElementRules.append(ruleData);
+ return;
+ }
</ins><span class="cx"> #endif
</span><span class="cx"> if (selector->relation() != CSSSelector::SubSelector)
</span><span class="cx"> break;
</span><span class="lines">@@ -422,6 +428,10 @@
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> m_cuePseudoRules.shrinkToFit();
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(SHADOW_DOM)
+ m_hostPseudoClassRules.shrinkToFit();
+ m_slottedPseudoElementRules.shrinkToFit();
+#endif
</ins><span class="cx"> m_focusPseudoClassRules.shrinkToFit();
</span><span class="cx"> m_universalRules.shrinkToFit();
</span><span class="cx"> m_pageRules.shrinkToFit();
</span></span></pre></div>
<a id="trunkSourceWebCorecssRuleSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/RuleSet.h (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/RuleSet.h        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/RuleSet.h        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -184,6 +184,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(SHADOW_DOM)
</span><span class="cx"> const RuleDataVector& hostPseudoClassRules() const { return m_hostPseudoClassRules; }
</span><ins>+ const RuleDataVector& slottedPseudoElementRules() const { return m_slottedPseudoElementRules; }
</ins><span class="cx"> #endif
</span><span class="cx"> const RuleDataVector* focusPseudoClassRules() const { return &m_focusPseudoClassRules; }
</span><span class="cx"> const RuleDataVector* universalRules() const { return &m_universalRules; }
</span><span class="lines">@@ -210,6 +211,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(SHADOW_DOM)
</span><span class="cx"> RuleDataVector m_hostPseudoClassRules;
</span><ins>+ RuleDataVector m_slottedPseudoElementRules;
</ins><span class="cx"> #endif
</span><span class="cx"> RuleDataVector m_focusPseudoClassRules;
</span><span class="cx"> RuleDataVector m_universalRules;
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #include "HTMLOptionElement.h"
</span><span class="cx"> #include "HTMLParserIdioms.h"
</span><span class="cx"> #include "HTMLProgressElement.h"
</span><ins>+#include "HTMLSlotElement.h"
</ins><span class="cx"> #include "HTMLStyleElement.h"
</span><span class="cx"> #include "InspectorInstrumentation.h"
</span><span class="cx"> #include "Page.h"
</span><span class="lines">@@ -1038,7 +1039,13 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><del>- // ### add the rest of the checks...
</del><ins>+#if ENABLE(SHADOW_DOM)
+ if (selector.match() == CSSSelector::PseudoElement && selector.pseudoElementType() == CSSSelector::PseudoElementSlotted) {
+ // We see ::slotted() pseudo elements when collecting slotted rules from the slot shadow tree only.
+ ASSERT(checkingContext.resolvingMode == Mode::CollectingRules);
+ return is<HTMLSlotElement>(element);
+ }
+#endif
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleSharingResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleSharingResolver.cpp (197164 => 197165)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleSharingResolver.cpp        2016-02-26 11:49:49 UTC (rev 197164)
+++ trunk/Source/WebCore/style/StyleSharingResolver.cpp        2016-02-26 14:57:01 UTC (rev 197165)
</span><span class="lines">@@ -76,6 +76,8 @@
</span><span class="cx"> if (!element.parentElement())
</span><span class="cx"> return nullptr;
</span><span class="cx"> auto& parentElement = *element.parentElement();
</span><ins>+ if (parentElement.shadowRoot())
+ return nullptr;
</ins><span class="cx"> if (!parentElement.renderStyle())
</span><span class="cx"> return nullptr;
</span><span class="cx"> // If the element has inline style it is probably unique.
</span></span></pre>
</div>
</div>
</body>
</html>