<!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>[204220] 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/204220">204220</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-08-05 22:37:28 -0700 (Fri, 05 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>NULL Reference Error in ElementRuleCollector
https://bugs.webkit.org/show_bug.cgi?id=160362

Patch by Jonathan Bedard &lt;jbedard@apple.com&gt; on 2016-08-05
Reviewed by Darin Adler.

No new tests, existing CSS tests cover this change.

Undefined behavior sanitizer found a reference bound to a NULL pointer.
The root cause of this issue was a discrepancy between whether an author style needed to be defined.  In some logic, an undefined author style was considered acceptable, but in other logic, author style was always assumed to be defined.  To fix this, a variable was added so that while author style is always defined, there is a flag indicating if this definition occurred in the constructor for use by functions which allow an undefined author style.

* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::DocumentRuleSets): Define author style by default.
(WebCore::DocumentRuleSets::resetAuthorStyle): Switch author style flag.
* css/DocumentRuleSets.h: Added author style flag, changed authorStyle accessor to reference from pointer.
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::ElementRuleCollector): Original location of undefined behavior.
(WebCore::ElementRuleCollector::matchHostPseudoClassRules): Changed pointer to reference.
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules): Changed pointer to reference.
* css/PageRuleCollector.cpp:
(WebCore::PageRuleCollector::matchAllPageRules): Check new flag, changed pointer to reference.

* css/StyleResolver.cpp: Changed pointer to reference.
* dom/Document.cpp: Dito.
* style/AttributeChangeInvalidation.cpp: Dito.
* style/ClassChangeInvalidation.cpp: Dito.
* style/IdChangeInvalidation.cpp: Dito.
* style/StyleSharingResolver.cpp: Dito.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssDocumentRuleSetscpp">trunk/Source/WebCore/css/DocumentRuleSets.cpp</a></li>
<li><a href="#trunkSourceWebCorecssDocumentRuleSetsh">trunk/Source/WebCore/css/DocumentRuleSets.h</a></li>
<li><a href="#trunkSourceWebCorecssElementRuleCollectorcpp">trunk/Source/WebCore/css/ElementRuleCollector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssPageRuleCollectorcpp">trunk/Source/WebCore/css/PageRuleCollector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoredomAuthorStyleSheetscpp">trunk/Source/WebCore/dom/AuthorStyleSheets.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleAttributeChangeInvalidationcpp">trunk/Source/WebCore/style/AttributeChangeInvalidation.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleClassChangeInvalidationcpp">trunk/Source/WebCore/style/ClassChangeInvalidation.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleIdChangeInvalidationcpp">trunk/Source/WebCore/style/IdChangeInvalidation.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleSharingResolvercpp">trunk/Source/WebCore/style/StyleSharingResolver.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/ChangeLog        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2016-08-05  Jonathan Bedard  &lt;jbedard@apple.com&gt;
+
+        NULL Reference Error in ElementRuleCollector
+        https://bugs.webkit.org/show_bug.cgi?id=160362
+
+        Reviewed by Darin Adler.
+
+        No new tests, existing CSS tests cover this change.
+
+        Undefined behavior sanitizer found a reference bound to a NULL pointer.
+        The root cause of this issue was a discrepancy between whether an author style needed to be defined.  In some logic, an undefined author style was considered acceptable, but in other logic, author style was always assumed to be defined.  To fix this, a variable was added so that while author style is always defined, there is a flag indicating if this definition occurred in the constructor for use by functions which allow an undefined author style.
+
+        * css/DocumentRuleSets.cpp:
+        (WebCore::DocumentRuleSets::DocumentRuleSets): Define author style by default.
+        (WebCore::DocumentRuleSets::resetAuthorStyle): Switch author style flag.
+        * css/DocumentRuleSets.h: Added author style flag, changed authorStyle accessor to reference from pointer.
+        * css/ElementRuleCollector.cpp:
+        (WebCore::ElementRuleCollector::ElementRuleCollector): Original location of undefined behavior.
+        (WebCore::ElementRuleCollector::matchHostPseudoClassRules): Changed pointer to reference.
+        (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules): Changed pointer to reference.
+        * css/PageRuleCollector.cpp:
+        (WebCore::PageRuleCollector::matchAllPageRules): Check new flag, changed pointer to reference.
+
+        * css/StyleResolver.cpp: Changed pointer to reference.
+        * dom/Document.cpp: Dito.
+        * style/AttributeChangeInvalidation.cpp: Dito.
+        * style/ClassChangeInvalidation.cpp: Dito.
+        * style/IdChangeInvalidation.cpp: Dito.
+        * style/StyleSharingResolver.cpp: Dito.
+
</ins><span class="cx"> 2016-08-05  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         DOMException should be constructible
</span></span></pre></div>
<a id="trunkSourceWebCorecssDocumentRuleSetscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DocumentRuleSets.cpp (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DocumentRuleSets.cpp        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/css/DocumentRuleSets.cpp        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -39,6 +39,8 @@
</span><span class="cx"> 
</span><span class="cx"> DocumentRuleSets::DocumentRuleSets()
</span><span class="cx"> {
</span><ins>+    m_authorStyle = std::make_unique&lt;RuleSet&gt;();
+    m_authorStyle-&gt;disableAutoShrinkToFit();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> DocumentRuleSets::~DocumentRuleSets()
</span><span class="lines">@@ -78,6 +80,7 @@
</span><span class="cx"> 
</span><span class="cx"> void DocumentRuleSets::resetAuthorStyle()
</span><span class="cx"> {
</span><ins>+    m_isAuthorStyleDefined = true;
</ins><span class="cx">     m_authorStyle = std::make_unique&lt;RuleSet&gt;();
</span><span class="cx">     m_authorStyle-&gt;disableAutoShrinkToFit();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssDocumentRuleSetsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DocumentRuleSets.h (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DocumentRuleSets.h        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/css/DocumentRuleSets.h        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -44,7 +44,9 @@
</span><span class="cx"> public:
</span><span class="cx">     DocumentRuleSets();
</span><span class="cx">     ~DocumentRuleSets();
</span><del>-    RuleSet* authorStyle() const { return m_authorStyle.get(); }
</del><ins>+    
+    bool isAuthorStyleDefined() const { return m_isAuthorStyleDefined; }
+    RuleSet&amp; authorStyle() const { return *m_authorStyle.get(); }
</ins><span class="cx">     RuleSet* userStyle() const { return m_userStyle.get(); }
</span><span class="cx">     const RuleFeatureSet&amp; features() const;
</span><span class="cx">     RuleSet* sibling() const { return m_siblingRuleSet.get(); }
</span><span class="lines">@@ -69,6 +71,7 @@
</span><span class="cx">     void collectFeatures() const;
</span><span class="cx">     void collectRulesFromUserStyleSheets(const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp;, RuleSet&amp; userStyle, const MediaQueryEvaluator&amp;, StyleResolver&amp;);
</span><span class="cx"> 
</span><ins>+    bool m_isAuthorStyleDefined { false };
</ins><span class="cx">     std::unique_ptr&lt;RuleSet&gt; m_authorStyle;
</span><span class="cx">     std::unique_ptr&lt;RuleSet&gt; m_userStyle;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssElementRuleCollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/ElementRuleCollector.cpp (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/ElementRuleCollector.cpp        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/css/ElementRuleCollector.cpp        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> 
</span><span class="cx"> ElementRuleCollector::ElementRuleCollector(const Element&amp; element, const DocumentRuleSets&amp; ruleSets, const SelectorFilter* selectorFilter)
</span><span class="cx">     : m_element(element)
</span><del>-    , m_authorStyle(*ruleSets.authorStyle())
</del><ins>+    , m_authorStyle(ruleSets.authorStyle())
</ins><span class="cx">     , m_userStyle(ruleSets.userStyle())
</span><span class="cx">     , m_selectorFilter(selectorFilter)
</span><span class="cx"> {
</span><span class="lines">@@ -234,7 +234,7 @@
</span><span class="cx"> 
</span><span class="cx">     matchRequest.treeContextOrdinal++;
</span><span class="cx"> 
</span><del>-    auto&amp; shadowAuthorStyle = *m_element.shadowRoot()-&gt;styleResolver().ruleSets().authorStyle();
</del><ins>+    auto&amp; shadowAuthorStyle = m_element.shadowRoot()-&gt;styleResolver().ruleSets().authorStyle();
</ins><span class="cx">     auto&amp; shadowHostRules = shadowAuthorStyle.hostPseudoClassRules();
</span><span class="cx">     if (shadowHostRules.isEmpty())
</span><span class="cx">         return;
</span><span class="lines">@@ -265,12 +265,11 @@
</span><span class="cx"> 
</span><span class="cx">         // In nested case the slot may itself be assigned to a slot. Collect ::slotted rules from all the nested trees.
</span><span class="cx">         maybeSlotted = slot;
</span><del>-        auto* shadowAuthorStyle = hostShadowRoot-&gt;styleResolver().ruleSets().authorStyle();
-        if (!shadowAuthorStyle)
</del><ins>+        if (!hostShadowRoot-&gt;styleResolver().ruleSets().isAuthorStyleDefined())
</ins><span class="cx">             continue;
</span><span class="cx">         // Find out if there are any ::slotted rules in the shadow tree matching the current slot.
</span><span class="cx">         // FIXME: This is really part of the slot style and could be cached when resolving it.
</span><del>-        ElementRuleCollector collector(*slot, *shadowAuthorStyle, nullptr);
</del><ins>+        ElementRuleCollector collector(*slot, hostShadowRoot-&gt;styleResolver().ruleSets().authorStyle(), nullptr);
</ins><span class="cx">         auto slottedPseudoElementRules = collector.collectSlottedPseudoElementRulesForSlot(matchRequest.includeEmptyRules);
</span><span class="cx">         if (!slottedPseudoElementRules)
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkSourceWebCorecssPageRuleCollectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/PageRuleCollector.cpp (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/PageRuleCollector.cpp        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/css/PageRuleCollector.cpp        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -70,7 +70,8 @@
</span><span class="cx">     matchPageRules(CSSDefaultStyleSheets::defaultPrintStyle, isLeft, isFirst, page);
</span><span class="cx">     matchPageRules(m_ruleSets.userStyle(), isLeft, isFirst, page);
</span><span class="cx">     // Only consider the global author RuleSet for @page rules, as per the HTML5 spec.
</span><del>-    matchPageRules(m_ruleSets.authorStyle(), isLeft, isFirst, page);
</del><ins>+    if (m_ruleSets.isAuthorStyleDefined())
+        matchPageRules(&amp;m_ruleSets.authorStyle(), isLeft, isFirst, page);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageRuleCollector::matchPageRules(RuleSet* rules, bool isLeftPage, bool isFirstPage, const String&amp; pageName)
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -1061,10 +1061,10 @@
</span><span class="cx"> 
</span><span class="cx"> bool StyleResolver::checkRegionStyle(const Element* regionElement)
</span><span class="cx"> {
</span><del>-    unsigned rulesSize = m_ruleSets.authorStyle()-&gt;regionSelectorsAndRuleSets().size();
</del><ins>+    unsigned rulesSize = m_ruleSets.authorStyle().regionSelectorsAndRuleSets().size();
</ins><span class="cx">     for (unsigned i = 0; i &lt; rulesSize; ++i) {
</span><del>-        ASSERT(m_ruleSets.authorStyle()-&gt;regionSelectorsAndRuleSets().at(i).ruleSet.get());
-        if (checkRegionSelector(m_ruleSets.authorStyle()-&gt;regionSelectorsAndRuleSets().at(i).selector, regionElement))
</del><ins>+        ASSERT(m_ruleSets.authorStyle().regionSelectorsAndRuleSets().at(i).ruleSet.get());
+        if (checkRegionSelector(m_ruleSets.authorStyle().regionSelectorsAndRuleSets().at(i).selector, regionElement))
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomAuthorStyleSheetscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/AuthorStyleSheets.cpp (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/AuthorStyleSheets.cpp        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/dom/AuthorStyleSheets.cpp        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -357,9 +357,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     userAgentShadowTreeStyleResolver.ruleSets().resetAuthorStyle();
</span><del>-    auto&amp; authorRuleSet = *styleResolver.ruleSets().authorStyle();
</del><ins>+    auto&amp; authorRuleSet = styleResolver.ruleSets().authorStyle();
</ins><span class="cx">     if (authorRuleSet.hasShadowPseudoElementRules())
</span><del>-        userAgentShadowTreeStyleResolver.ruleSets().authorStyle()-&gt;copyShadowPseudoElementRulesFrom(authorRuleSet);
</del><ins>+        userAgentShadowTreeStyleResolver.ruleSets().authorStyle().copyShadowPseudoElementRulesFrom(authorRuleSet);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; AuthorStyleSheets::activeStyleSheetsForInspector() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -2205,9 +2205,9 @@
</span><span class="cx">         m_userAgentShadowTreeStyleResolver = std::make_unique&lt;StyleResolver&gt;(*this);
</span><span class="cx"> 
</span><span class="cx">         // FIXME: Filter out shadow pseudo elements we don't want to expose to authors.
</span><del>-        auto&amp; documentAuthorStyle = *ensureStyleResolver().ruleSets().authorStyle();
</del><ins>+        auto&amp; documentAuthorStyle = ensureStyleResolver().ruleSets().authorStyle();
</ins><span class="cx">         if (documentAuthorStyle.hasShadowPseudoElementRules())
</span><del>-            m_userAgentShadowTreeStyleResolver-&gt;ruleSets().authorStyle()-&gt;copyShadowPseudoElementRulesFrom(documentAuthorStyle);
</del><ins>+            m_userAgentShadowTreeStyleResolver-&gt;ruleSets().authorStyle().copyShadowPseudoElementRulesFrom(documentAuthorStyle);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return *m_userAgentShadowTreeStyleResolver;
</span></span></pre></div>
<a id="trunkSourceWebCorestyleAttributeChangeInvalidationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/AttributeChangeInvalidation.cpp (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/AttributeChangeInvalidation.cpp        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/style/AttributeChangeInvalidation.cpp        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> static bool mayBeAffectedByHostStyle(ShadowRoot&amp; shadowRoot, bool isHTML, const QualifiedName&amp; attributeName)
</span><span class="cx"> {
</span><span class="cx">     auto&amp; shadowRuleSets = shadowRoot.styleResolver().ruleSets();
</span><del>-    if (shadowRuleSets.authorStyle()-&gt;hostPseudoClassRules().isEmpty())
</del><ins>+    if (shadowRuleSets.authorStyle().hostPseudoClassRules().isEmpty())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     auto&amp; nameSet = isHTML ? shadowRuleSets.features().attributeCanonicalLocalNamesInRules : shadowRuleSets.features().attributeLocalNamesInRules;
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_element.shadowRoot() &amp;&amp; ruleSets.authorStyle()-&gt;hasShadowPseudoElementRules()) {
</del><ins>+    if (m_element.shadowRoot() &amp;&amp; ruleSets.authorStyle().hasShadowPseudoElementRules()) {
</ins><span class="cx">         m_element.setNeedsStyleRecalc(FullStyleChange);
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorestyleClassChangeInvalidationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/ClassChangeInvalidation.cpp (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/ClassChangeInvalidation.cpp        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/style/ClassChangeInvalidation.cpp        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> static bool mayBeAffectedByHostStyle(ShadowRoot&amp; shadowRoot, AtomicStringImpl* changedClass)
</span><span class="cx"> {
</span><span class="cx">     auto&amp; shadowRuleSets = shadowRoot.styleResolver().ruleSets();
</span><del>-    if (shadowRuleSets.authorStyle()-&gt;hostPseudoClassRules().isEmpty())
</del><ins>+    if (shadowRuleSets.authorStyle().hostPseudoClassRules().isEmpty())
</ins><span class="cx">         return false;
</span><span class="cx">     return shadowRuleSets.features().classesInRules.contains(changedClass);
</span><span class="cx"> }
</span><span class="lines">@@ -114,7 +114,7 @@
</span><span class="cx">     if (changedClassesAffectingStyle.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (shadowRoot &amp;&amp; ruleSets.authorStyle()-&gt;hasShadowPseudoElementRules()) {
</del><ins>+    if (shadowRoot &amp;&amp; ruleSets.authorStyle().hasShadowPseudoElementRules()) {
</ins><span class="cx">         m_element.setNeedsStyleRecalc(FullStyleChange);
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorestyleIdChangeInvalidationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/IdChangeInvalidation.cpp (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/IdChangeInvalidation.cpp        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/style/IdChangeInvalidation.cpp        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> static bool mayBeAffectedByHostStyle(ShadowRoot&amp; shadowRoot, const AtomicString&amp; changedId)
</span><span class="cx"> {
</span><span class="cx">     auto&amp; shadowRuleSets = shadowRoot.styleResolver().ruleSets();
</span><del>-    if (shadowRuleSets.authorStyle()-&gt;hostPseudoClassRules().isEmpty())
</del><ins>+    if (shadowRuleSets.authorStyle().hostPseudoClassRules().isEmpty())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return shadowRuleSets.features().idsInRules.contains(changedId.impl());
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     if (!mayAffectStyle)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (m_element.shadowRoot() &amp;&amp; ruleSets.authorStyle()-&gt;hasShadowPseudoElementRules()) {
</del><ins>+    if (m_element.shadowRoot() &amp;&amp; ruleSets.authorStyle().hasShadowPseudoElementRules()) {
</ins><span class="cx">         m_element.setNeedsStyleRecalc(FullStyleChange);
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleSharingResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleSharingResolver.cpp (204219 => 204220)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleSharingResolver.cpp        2016-08-06 05:34:57 UTC (rev 204219)
+++ trunk/Source/WebCore/style/StyleSharingResolver.cpp        2016-08-06 05:37:28 UTC (rev 204220)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     if (elementHasDirectionAuto(element))
</span><span class="cx">         return nullptr;
</span><del>-    if (element.shadowRoot() &amp;&amp; !element.shadowRoot()-&gt;styleResolver().ruleSets().authorStyle()-&gt;hostPseudoClassRules().isEmpty())
</del><ins>+    if (element.shadowRoot() &amp;&amp; !element.shadowRoot()-&gt;styleResolver().ruleSets().authorStyle().hostPseudoClassRules().isEmpty())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     Context context {
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx">     if (candidateElement.matchesDefaultPseudoClass() != element.matchesDefaultPseudoClass())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (element.shadowRoot() &amp;&amp; !element.shadowRoot()-&gt;styleResolver().ruleSets().authorStyle()-&gt;hostPseudoClassRules().isEmpty())
</del><ins>+    if (element.shadowRoot() &amp;&amp; !element.shadowRoot()-&gt;styleResolver().ruleSets().authorStyle().hostPseudoClassRules().isEmpty())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span></span></pre>
</div>
</div>

</body>
</html>