<!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>[207686] 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/207686">207686</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-10-21 11:20:07 -0700 (Fri, 21 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Tighten ComputedStyleExtractor to use Element instead of Node
https://bugs.webkit.org/show_bug.cgi?id=163798

Reviewed by Andreas Kling.

Also make its functions non-const as they may compute style.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::styleElementForNode):
(WebCore::ComputedStyleExtractor::ComputedStyleExtractor):

    If we are called with a Node figure out the style Element in constructor.

(WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
(WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
(WebCore::ComputedStyleExtractor::styledElement):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
(WebCore::CSSComputedStyleDeclaration::copyProperties):
(WebCore::elementOrItsAncestorNeedsStyleRecalc):

    Use composed tree iterator for increased correctness in shadow trees.

(WebCore::updateStyleIfNeededForElement):
(WebCore::computeRenderStyleForProperty):
(WebCore::ComputedStyleExtractor::customPropertyValue):
(WebCore::ComputedStyleExtractor::customPropertyText):
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::CSSComputedStyleDeclaration::length):
(WebCore::CSSComputedStyleDeclaration::item):
(WebCore::ComputedStyleExtractor::propertyMatches):
(WebCore::ComputedStyleExtractor::copyProperties):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
(WebCore::ComputedStyleExtractor::copyPropertiesInSet):
(WebCore::CSSComputedStyleDeclaration::getPropertyValue):
(WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
(WebCore::ComputedStyleExtractor::styledNode): Deleted.
(WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
(WebCore::updateStyleIfNeededForNode): Deleted.
* css/CSSComputedStyleDeclaration.h:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::removeEquivalentProperties):
* editing/EditingStyle.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationh">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h</a></li>
<li><a href="#trunkSourceWebCorecssSVGCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingStylecpp">trunk/Source/WebCore/editing/EditingStyle.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingStyleh">trunk/Source/WebCore/editing/EditingStyle.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207685 => 207686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-21 17:56:09 UTC (rev 207685)
+++ trunk/Source/WebCore/ChangeLog        2016-10-21 18:20:07 UTC (rev 207686)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2016-10-21  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Tighten ComputedStyleExtractor to use Element instead of Node
+        https://bugs.webkit.org/show_bug.cgi?id=163798
+
+        Reviewed by Andreas Kling.
+
+        Also make its functions non-const as they may compute style.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::styleElementForNode):
+        (WebCore::ComputedStyleExtractor::ComputedStyleExtractor):
+
+            If we are called with a Node figure out the style Element in constructor.
+
+        (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
+        (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
+        (WebCore::ComputedStyleExtractor::styledElement):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        (WebCore::CSSComputedStyleDeclaration::copyProperties):
+        (WebCore::elementOrItsAncestorNeedsStyleRecalc):
+
+            Use composed tree iterator for increased correctness in shadow trees.
+
+        (WebCore::updateStyleIfNeededForElement):
+        (WebCore::computeRenderStyleForProperty):
+        (WebCore::ComputedStyleExtractor::customPropertyValue):
+        (WebCore::ComputedStyleExtractor::customPropertyText):
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        (WebCore::CSSComputedStyleDeclaration::length):
+        (WebCore::CSSComputedStyleDeclaration::item):
+        (WebCore::ComputedStyleExtractor::propertyMatches):
+        (WebCore::ComputedStyleExtractor::copyProperties):
+        (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
+        (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
+        (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
+        (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
+        (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
+        (WebCore::ComputedStyleExtractor::styledNode): Deleted.
+        (WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
+        (WebCore::updateStyleIfNeededForNode): Deleted.
+        * css/CSSComputedStyleDeclaration.h:
+        * css/SVGCSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::svgPropertyValue):
+        * editing/EditingStyle.cpp:
+        (WebCore::EditingStyle::removeEquivalentProperties):
+        * editing/EditingStyle.h:
+
</ins><span class="cx"> 2016-10-21  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (207685 => 207686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-10-21 17:56:09 UTC (rev 207685)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-10-21 18:20:07 UTC (rev 207686)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #include &quot;CSSTimingFunctionValue.h&quot;
</span><span class="cx"> #include &quot;CSSValueList.h&quot;
</span><span class="cx"> #include &quot;CSSValuePool.h&quot;
</span><ins>+#include &quot;ComposedTreeAncestorIterator.h&quot;
</ins><span class="cx"> #include &quot;ContentData.h&quot;
</span><span class="cx"> #include &quot;CounterContent.h&quot;
</span><span class="cx"> #include &quot;CursorList.h&quot;
</span><span class="lines">@@ -72,6 +73,7 @@
</span><span class="cx"> #include &quot;StylePropertyShorthandFunctions.h&quot;
</span><span class="cx"> #include &quot;StyleResolver.h&quot;
</span><span class="cx"> #include &quot;StyleScope.h&quot;
</span><ins>+#include &quot;Text.h&quot;
</ins><span class="cx"> #include &quot;WebKitCSSFilterValue.h&quot;
</span><span class="cx"> #include &quot;WebKitCSSTransformValue.h&quot;
</span><span class="cx"> #include &quot;WebKitFontFamilyNames.h&quot;
</span><span class="lines">@@ -1583,13 +1585,28 @@
</span><span class="cx">     return CSSLineBoxContainValue::create(lineBoxContain);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ComputedStyleExtractor::ComputedStyleExtractor(RefPtr&lt;Node&gt;&amp;&amp; node, bool allowVisitedStyle, PseudoId pseudoElementSpecifier)
-    : m_node(WTFMove(node))
</del><ins>+static Element* styleElementForNode(Node* node)
+{
+    if (!node)
+        return nullptr;
+    if (is&lt;Element&gt;(*node))
+        return downcast&lt;Element&gt;(node);
+    return composedTreeAncestors(*node).first();
+}
+
+ComputedStyleExtractor::ComputedStyleExtractor(Node* node, bool allowVisitedStyle, PseudoId pseudoElementSpecifier)
+    : m_element(styleElementForNode(node))
</ins><span class="cx">     , m_pseudoElementSpecifier(pseudoElementSpecifier)
</span><span class="cx">     , m_allowVisitedStyle(allowVisitedStyle)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ComputedStyleExtractor::ComputedStyleExtractor(Element* element, bool allowVisitedStyle, PseudoId pseudoElementSpecifier)
+    : m_element(element)
+    , m_pseudoElementSpecifier(pseudoElementSpecifier)
+    , m_allowVisitedStyle(allowVisitedStyle)
+{
+}
</ins><span class="cx"> 
</span><span class="cx"> CSSComputedStyleDeclaration::CSSComputedStyleDeclaration(Element&amp; element, bool allowVisitedStyle, const String&amp; pseudoElementName)
</span><span class="cx">     : m_element(element)
</span><span class="lines">@@ -1638,14 +1655,14 @@
</span><span class="cx">     return Exception { NO_MODIFICATION_ALLOWED_ERR };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSPrimitiveValue&gt; ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword() const
</del><ins>+RefPtr&lt;CSSPrimitiveValue&gt; ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword()
</ins><span class="cx"> {
</span><del>-    if (!m_node)
</del><ins>+    if (!m_element)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    m_node-&gt;document().updateLayoutIgnorePendingStylesheets();
</del><ins>+    m_element-&gt;document().updateLayoutIgnorePendingStylesheets();
</ins><span class="cx"> 
</span><del>-    auto* style = m_node-&gt;computedStyle(m_pseudoElementSpecifier);
</del><ins>+    auto* style = m_element-&gt;computedStyle(m_pseudoElementSpecifier);
</ins><span class="cx">     if (!style)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -1655,12 +1672,11 @@
</span><span class="cx">     return zoomAdjustedPixelValue(style-&gt;fontDescription().computedSize(), *style);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ComputedStyleExtractor::useFixedFontDefaultSize() const
</del><ins>+bool ComputedStyleExtractor::useFixedFontDefaultSize()
</ins><span class="cx"> {
</span><del>-    if (!m_node)
</del><ins>+    if (!m_element)
</ins><span class="cx">         return false;
</span><del>-
-    auto* style = m_node-&gt;computedStyle(m_pseudoElementSpecifier);
</del><ins>+    auto* style = m_element-&gt;computedStyle(m_pseudoElementSpecifier);
</ins><span class="cx">     if (!style)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -2264,19 +2280,16 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Node* ComputedStyleExtractor::styledNode() const
</del><ins>+Element* ComputedStyleExtractor::styledElement()
</ins><span class="cx"> {
</span><del>-    if (!m_node)
</del><ins>+    if (!m_element)
</ins><span class="cx">         return nullptr;
</span><del>-    if (!is&lt;Element&gt;(*m_node))
-        return m_node.get();
-    Element&amp; element = downcast&lt;Element&gt;(*m_node);
</del><span class="cx">     PseudoElement* pseudoElement;
</span><del>-    if (m_pseudoElementSpecifier == BEFORE &amp;&amp; (pseudoElement = element.beforePseudoElement()))
</del><ins>+    if (m_pseudoElementSpecifier == BEFORE &amp;&amp; (pseudoElement = m_element-&gt;beforePseudoElement()))
</ins><span class="cx">         return pseudoElement;
</span><del>-    if (m_pseudoElementSpecifier == AFTER &amp;&amp; (pseudoElement = element.afterPseudoElement()))
</del><ins>+    if (m_pseudoElementSpecifier == AFTER &amp;&amp; (pseudoElement = m_element-&gt;afterPseudoElement()))
</ins><span class="cx">         return pseudoElement;
</span><del>-    return &amp;element;
</del><ins>+    return m_element.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="lines">@@ -2326,53 +2339,56 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
</span><span class="cx"> {
</span><del>-    return ComputedStyleExtractor(m_element.copyRef(), m_allowVisitedStyle, m_pseudoElementSpecifier).propertyValue(propertyID, updateLayout);
</del><ins>+    return ComputedStyleExtractor(m_element.ptr(), m_allowVisitedStyle, m_pseudoElementSpecifier).propertyValue(propertyID, updateLayout);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;MutableStyleProperties&gt; CSSComputedStyleDeclaration::copyProperties() const
</span><span class="cx"> {
</span><del>-    return ComputedStyleExtractor(m_element.copyRef(), m_allowVisitedStyle, m_pseudoElementSpecifier).copyProperties();
</del><ins>+    return ComputedStyleExtractor(m_element.ptr(), m_allowVisitedStyle, m_pseudoElementSpecifier).copyProperties();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool nodeOrItsAncestorNeedsStyleRecalc(const Node&amp; node)
</del><ins>+static inline bool elementOrItsAncestorNeedsStyleRecalc(Element&amp; element)
</ins><span class="cx"> {
</span><del>-    if (node.needsStyleRecalc())
</del><ins>+    if (element.needsStyleRecalc())
</ins><span class="cx">         return true;
</span><ins>+    if (element.document().hasPendingForcedStyleRecalc())
+        return true;
+    if (!element.document().childNeedsStyleRecalc())
+        return false;
</ins><span class="cx"> 
</span><del>-    const Node* currentNode = &amp;node;
-    const Element* ancestor = currentNode-&gt;parentOrShadowHostElement();
-    while (ancestor) {
-        if (ancestor-&gt;needsStyleRecalc())
</del><ins>+    const auto* currentElement = &amp;element;
+    for (auto&amp; ancestor : composedTreeAncestors(element)) {
+        if (ancestor.needsStyleRecalc())
</ins><span class="cx">             return true;
</span><span class="cx"> 
</span><del>-        if (ancestor-&gt;directChildNeedsStyleRecalc() &amp;&amp; currentNode-&gt;styleIsAffectedByPreviousSibling())
</del><ins>+        if (ancestor.directChildNeedsStyleRecalc() &amp;&amp; currentElement-&gt;styleIsAffectedByPreviousSibling())
</ins><span class="cx">             return true;
</span><span class="cx"> 
</span><del>-        currentNode = ancestor;
-        ancestor = currentNode-&gt;parentOrShadowHostElement();
</del><ins>+        currentElement = &amp;ancestor;
</ins><span class="cx">     }
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool updateStyleIfNeededForNode(const Node&amp; node)
</del><ins>+static bool updateStyleIfNeededForElement(Element&amp; element)
</ins><span class="cx"> {
</span><del>-    Document&amp; document = node.document();
</del><ins>+    auto&amp; document = element.document();
</ins><span class="cx"> 
</span><span class="cx">     document.styleScope().flushPendingUpdate();
</span><span class="cx"> 
</span><del>-    if (!document.hasPendingForcedStyleRecalc() &amp;&amp; !(document.childNeedsStyleRecalc() &amp;&amp; nodeOrItsAncestorNeedsStyleRecalc(node)))
</del><ins>+    if (!elementOrItsAncestorNeedsStyleRecalc(element))
</ins><span class="cx">         return false;
</span><ins>+
</ins><span class="cx">     document.updateStyleIfNeeded();
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline const RenderStyle* computeRenderStyleForProperty(Node* styledNode, PseudoId pseudoElementSpecifier, CSSPropertyID propertyID, std::unique_ptr&lt;RenderStyle&gt;&amp; ownedStyle)
</del><ins>+static inline const RenderStyle* computeRenderStyleForProperty(Element&amp; element, PseudoId pseudoElementSpecifier, CSSPropertyID propertyID, std::unique_ptr&lt;RenderStyle&gt;&amp; ownedStyle)
</ins><span class="cx"> {
</span><del>-    RenderObject* renderer = styledNode-&gt;renderer();
</del><ins>+    auto* renderer = element.renderer();
</ins><span class="cx"> 
</span><span class="cx">     if (renderer &amp;&amp; renderer-&gt;isComposited() &amp;&amp; AnimationController::supportsAcceleratedAnimationOfProperty(propertyID)) {
</span><del>-        ownedStyle = renderer-&gt;animation().getAnimatedStyleForRenderer(downcast&lt;RenderElement&gt;(*renderer));
-        if (pseudoElementSpecifier &amp;&amp; !styledNode-&gt;isPseudoElement()) {
</del><ins>+        ownedStyle = renderer-&gt;animation().getAnimatedStyleForRenderer(*renderer);
+        if (pseudoElementSpecifier &amp;&amp; !element.isPseudoElement()) {
</ins><span class="cx">             // FIXME: This cached pseudo style will only exist if the animation has been run at least once.
</span><span class="cx">             return ownedStyle-&gt;getCachedPseudoStyle(pseudoElementSpecifier);
</span><span class="cx">         }
</span><span class="lines">@@ -2379,7 +2395,7 @@
</span><span class="cx">         return ownedStyle.get();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return styledNode-&gt;computedStyle(styledNode-&gt;isPseudoElement() ? NOPSEUDO : pseudoElementSpecifier);
</del><ins>+    return element.computedStyle(element.isPseudoElement() ? NOPSEUDO : pseudoElementSpecifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static Ref&lt;CSSValue&gt; shapePropertyValue(const RenderStyle&amp; style, const ShapeValue* shapeValue)
</span><span class="lines">@@ -2446,20 +2462,19 @@
</span><span class="cx">     return element &amp;&amp; element-&gt;computedStyle() &amp;&amp; element-&gt;computedStyle()-&gt;isDisplayFlexibleOrGridBox();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSValue&gt; ComputedStyleExtractor::customPropertyValue(const String&amp; propertyName) const
</del><ins>+RefPtr&lt;CSSValue&gt; ComputedStyleExtractor::customPropertyValue(const String&amp; propertyName)
</ins><span class="cx"> {
</span><del>-    Node* styledNode = this-&gt;styledNode();
-    if (!styledNode)
</del><ins>+    Element* styledElement = this-&gt;styledElement();
+    if (!styledElement)
</ins><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    if (updateStyleIfNeededForNode(*styledNode)) {
-        // The style recalc could have caused the styled node to be discarded or replaced
-        // if it was a PseudoElement so we need to update it.
-        styledNode = this-&gt;styledNode();
</del><ins>+    if (updateStyleIfNeededForElement(*styledElement)) {
+        // Style update may change styledElement() to PseudoElement or back.
+        styledElement = this-&gt;styledElement();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;RenderStyle&gt; ownedStyle;
</span><del>-    auto* style = computeRenderStyleForProperty(styledNode, m_pseudoElementSpecifier, CSSPropertyCustom, ownedStyle);
</del><ins>+    auto* style = computeRenderStyleForProperty(*styledElement, m_pseudoElementSpecifier, CSSPropertyCustom, ownedStyle);
</ins><span class="cx">     if (!style || !style-&gt;hasCustomProperty(propertyName))
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -2466,16 +2481,16 @@
</span><span class="cx">     return style-&gt;getCustomPropertyValue(propertyName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String ComputedStyleExtractor::customPropertyText(const String&amp; propertyName) const
</del><ins>+String ComputedStyleExtractor::customPropertyText(const String&amp; propertyName)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;CSSValue&gt; propertyValue = this-&gt;customPropertyValue(propertyName);
</del><ins>+    RefPtr&lt;CSSValue&gt; propertyValue = customPropertyValue(propertyName);
</ins><span class="cx">     return propertyValue ? propertyValue-&gt;cssText() : emptyString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSValue&gt; ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
</del><ins>+RefPtr&lt;CSSValue&gt; ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout)
</ins><span class="cx"> {
</span><del>-    Node* styledNode = this-&gt;styledNode();
-    if (!styledNode)
</del><ins>+    auto* styledElement = this-&gt;styledElement();
+    if (!styledElement)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;RenderStyle&gt; ownedStyle;
</span><span class="lines">@@ -2483,35 +2498,33 @@
</span><span class="cx">     RenderObject* renderer = nullptr;
</span><span class="cx">     bool forceFullLayout = false;
</span><span class="cx">     if (updateLayout) {
</span><del>-        Document&amp; document = styledNode-&gt;document();
</del><ins>+        Document&amp; document = m_element-&gt;document();
</ins><span class="cx"> 
</span><del>-        if (updateStyleIfNeededForNode(*styledNode)) {
-            // The style recalc could have caused the styled node to be discarded or replaced
-            // if it was a PseudoElement so we need to update it.
-            styledNode = this-&gt;styledNode();
</del><ins>+        if (updateStyleIfNeededForElement(*styledElement)) {
+            // Style update may change styledElement() to PseudoElement or back.
+            styledElement = this-&gt;styledElement();
</ins><span class="cx">         }
</span><ins>+        renderer = styledElement-&gt;renderer();
</ins><span class="cx"> 
</span><del>-        renderer = styledNode-&gt;renderer();
-
-        if (propertyID == CSSPropertyDisplay &amp;&amp; !renderer &amp;&amp; is&lt;SVGElement&gt;(*styledNode) &amp;&amp; !downcast&lt;SVGElement&gt;(*styledNode).isValid())
</del><ins>+        if (propertyID == CSSPropertyDisplay &amp;&amp; !renderer &amp;&amp; is&lt;SVGElement&gt;(*styledElement) &amp;&amp; !downcast&lt;SVGElement&gt;(*styledElement).isValid())
</ins><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><del>-        style = computeRenderStyleForProperty(styledNode, m_pseudoElementSpecifier, propertyID, ownedStyle);
</del><ins>+        style = computeRenderStyleForProperty(*styledElement, m_pseudoElementSpecifier, propertyID, ownedStyle);
</ins><span class="cx"> 
</span><span class="cx">         // FIXME: Some of these cases could be narrowed down or optimized better.
</span><span class="cx">         forceFullLayout = isLayoutDependent(propertyID, style, renderer)
</span><del>-            || styledNode-&gt;isInShadowTree()
</del><ins>+            || styledElement-&gt;isInShadowTree()
</ins><span class="cx">             || (document.styleScope().resolverIfExists() &amp;&amp; document.styleScope().resolverIfExists()-&gt;hasViewportDependentMediaQueries() &amp;&amp; document.ownerElement());
</span><span class="cx"> 
</span><span class="cx">         if (forceFullLayout) {
</span><span class="cx">             document.updateLayoutIgnorePendingStylesheets();
</span><del>-            styledNode = this-&gt;styledNode();
</del><ins>+            styledElement = this-&gt;styledElement();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!updateLayout || forceFullLayout) {
</span><del>-        style = computeRenderStyleForProperty(styledNode, m_pseudoElementSpecifier, propertyID, ownedStyle);
-        renderer = styledNode-&gt;renderer();
</del><ins>+        style = computeRenderStyleForProperty(*styledElement, m_pseudoElementSpecifier, propertyID, ownedStyle);
+        renderer = styledElement-&gt;renderer();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!style)
</span><span class="lines">@@ -2819,7 +2832,7 @@
</span><span class="cx">         case CSSPropertyAlignItems:
</span><span class="cx">             return valueForItemPositionWithOverflowAlignment(style-&gt;alignItems());
</span><span class="cx">         case CSSPropertyAlignSelf:
</span><del>-            return valueForItemPositionWithOverflowAlignment(resolveAlignSelfAuto(style-&gt;alignSelf(), styledNode-&gt;parentNode()));
</del><ins>+            return valueForItemPositionWithOverflowAlignment(resolveAlignSelfAuto(style-&gt;alignSelf(), styledElement-&gt;parentNode()));
</ins><span class="cx">         case CSSPropertyFlex:
</span><span class="cx">             return getCSSPropertyValuesForShorthandProperties(flexShorthand());
</span><span class="cx">         case CSSPropertyFlexBasis:
</span><span class="lines">@@ -2838,9 +2851,9 @@
</span><span class="cx">             return valueForContentPositionAndDistributionWithOverflowAlignment(style-&gt;justifyContent(), CSSValueFlexStart);
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">         case CSSPropertyJustifyItems:
</span><del>-            return valueForItemPositionWithOverflowAlignment(resolveJustifyItemsAuto(style-&gt;justifyItems(), styledNode-&gt;parentNode()));
</del><ins>+            return valueForItemPositionWithOverflowAlignment(resolveJustifyItemsAuto(style-&gt;justifyItems(), styledElement-&gt;parentNode()));
</ins><span class="cx">         case CSSPropertyJustifySelf:
</span><del>-            return valueForItemPositionWithOverflowAlignment(resolveJustifySelfAuto(style-&gt;justifySelf(), styledNode-&gt;parentNode()));
</del><ins>+            return valueForItemPositionWithOverflowAlignment(resolveJustifySelfAuto(style-&gt;justifySelf(), styledElement-&gt;parentNode()));
</ins><span class="cx"> #endif
</span><span class="cx">         case CSSPropertyOrder:
</span><span class="cx">             return cssValuePool.createValue(style-&gt;order(), CSSPrimitiveValue::CSS_NUMBER);
</span><span class="lines">@@ -2890,7 +2903,7 @@
</span><span class="cx">         }
</span><span class="cx"> #if ENABLE(VARIATION_FONTS)
</span><span class="cx">         case CSSPropertyFontVariationSettings: {
</span><del>-            if (styledNode-&gt;document().settings() &amp;&amp; styledNode-&gt;document().settings()-&gt;variationFontsEnabled()) {
</del><ins>+            if (styledElement-&gt;document().settings() &amp;&amp; styledElement-&gt;document().settings()-&gt;variationFontsEnabled()) {
</ins><span class="cx">                 const FontVariationSettings&amp; variationSettings = style-&gt;fontDescription().variationSettings();
</span><span class="cx">                 if (variationSettings.isEmpty())
</span><span class="cx">                     return cssValuePool.createIdentifierValue(CSSValueNormal);
</span><span class="lines">@@ -3076,7 +3089,7 @@
</span><span class="cx">         }
</span><span class="cx">         case CSSPropertyMinHeight:
</span><span class="cx">             if (style-&gt;minHeight().isAuto()) {
</span><del>-                if (isFlexOrGrid(styledNode-&gt;parentNode()))
</del><ins>+                if (isFlexOrGrid(styledElement-&gt;parentNode()))
</ins><span class="cx">                     return cssValuePool.createIdentifierValue(CSSValueAuto);
</span><span class="cx">                 return zoomAdjustedPixelValue(0, *style);
</span><span class="cx">             }
</span><span class="lines">@@ -3083,7 +3096,7 @@
</span><span class="cx">             return zoomAdjustedPixelValueForLength(style-&gt;minHeight(), *style);
</span><span class="cx">         case CSSPropertyMinWidth:
</span><span class="cx">             if (style-&gt;minWidth().isAuto()) {
</span><del>-                if (isFlexOrGrid(styledNode-&gt;parentNode()))
</del><ins>+                if (isFlexOrGrid(styledElement-&gt;parentNode()))
</ins><span class="cx">                     return cssValuePool.createIdentifierValue(CSSValueAuto);
</span><span class="cx">                 return zoomAdjustedPixelValue(0, *style);
</span><span class="cx">             }
</span><span class="lines">@@ -3964,10 +3977,9 @@
</span><span class="cx"> 
</span><span class="cx"> unsigned CSSComputedStyleDeclaration::length() const
</span><span class="cx"> {
</span><del>-    auto&amp; element = m_element.get();
-    updateStyleIfNeededForNode(element);
</del><ins>+    updateStyleIfNeededForElement(m_element.get());
</ins><span class="cx"> 
</span><del>-    auto* style = const_cast&lt;Element&amp;&gt;(element).computedStyle(m_pseudoElementSpecifier);
</del><ins>+    auto* style = m_element-&gt;computedStyle(m_pseudoElementSpecifier);
</ins><span class="cx">     if (!style)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="lines">@@ -3982,8 +3994,7 @@
</span><span class="cx">     if (i &lt; numComputedProperties)
</span><span class="cx">         return getPropertyNameString(computedProperties[i]);
</span><span class="cx">     
</span><del>-    auto&amp; element = m_element.get();
-    auto* style = const_cast&lt;Element&amp;&gt;(element).computedStyle(m_pseudoElementSpecifier);
</del><ins>+    auto* style = m_element-&gt;computedStyle(m_pseudoElementSpecifier);
</ins><span class="cx">     if (!style)
</span><span class="cx">         return String();
</span><span class="cx">     
</span><span class="lines">@@ -3998,11 +4009,13 @@
</span><span class="cx">     return results.at(index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ComputedStyleExtractor::propertyMatches(CSSPropertyID propertyID, const CSSValue* value) const
</del><ins>+bool ComputedStyleExtractor::propertyMatches(CSSPropertyID propertyID, const CSSValue* value)
</ins><span class="cx"> {
</span><del>-    if (propertyID == CSSPropertyFontSize &amp;&amp; is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; m_node) {
-        m_node-&gt;document().updateLayoutIgnorePendingStylesheets();
-        if (auto* style = m_node-&gt;computedStyle(m_pseudoElementSpecifier)) {
</del><ins>+    if (!m_element)
+        return false;
+    if (propertyID == CSSPropertyFontSize &amp;&amp; is&lt;CSSPrimitiveValue&gt;(*value)) {
+        m_element-&gt;document().updateLayoutIgnorePendingStylesheets();
+        if (auto* style = m_element-&gt;computedStyle(m_pseudoElementSpecifier)) {
</ins><span class="cx">             if (CSSValueID sizeIdentifier = style-&gt;fontDescription().keywordSizeAsIdentifier()) {
</span><span class="cx">                 auto&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</span><span class="cx">                 if (primitiveValue.isValueID() &amp;&amp; primitiveValue.valueID() == sizeIdentifier)
</span><span class="lines">@@ -4014,12 +4027,12 @@
</span><span class="cx">     return computedValue &amp;&amp; value &amp;&amp; computedValue-&gt;equals(*value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;MutableStyleProperties&gt; ComputedStyleExtractor::copyProperties() const
</del><ins>+Ref&lt;MutableStyleProperties&gt; ComputedStyleExtractor::copyProperties()
</ins><span class="cx"> {
</span><span class="cx">     return copyPropertiesInSet(computedProperties, numComputedProperties);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSValueList&gt; ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&amp; shorthand) const
</del><ins>+RefPtr&lt;CSSValueList&gt; ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&amp; shorthand)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
</span><span class="cx">     for (size_t i = 0; i &lt; shorthand.length(); ++i) {
</span><span class="lines">@@ -4029,7 +4042,7 @@
</span><span class="cx">     return list;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSValueList&gt; ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&amp; shorthand) const
</del><ins>+RefPtr&lt;CSSValueList&gt; ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&amp; shorthand)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
</span><span class="cx">     // Assume the properties are in the usual order top, right, bottom, left.
</span><span class="lines">@@ -4057,7 +4070,7 @@
</span><span class="cx">     return list;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSValueList&gt; ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&amp; shorthand) const
</del><ins>+RefPtr&lt;CSSValueList&gt; ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&amp; shorthand)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSlashSeparated();
</span><span class="cx">     for (size_t i = 0; i &lt; shorthand.length(); ++i) {
</span><span class="lines">@@ -4067,7 +4080,7 @@
</span><span class="cx">     return list;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;MutableStyleProperties&gt; ComputedStyleExtractor::copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const
</del><ins>+Ref&lt;MutableStyleProperties&gt; ComputedStyleExtractor::copyPropertiesInSet(const CSSPropertyID* set, unsigned length)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;CSSProperty, 256&gt; list;
</span><span class="cx">     list.reserveInitialCapacity(length);
</span><span class="lines">@@ -4087,7 +4100,7 @@
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSComputedStyleDeclaration::getPropertyCSSValue(const String&amp; propertyName)
</span><span class="cx"> {
</span><span class="cx">     if (isCustomPropertyName(propertyName))
</span><del>-        return ComputedStyleExtractor(m_element.copyRef(), m_allowVisitedStyle, m_pseudoElementSpecifier).customPropertyValue(propertyName);
</del><ins>+        return ComputedStyleExtractor(m_element.ptr(), m_allowVisitedStyle, m_pseudoElementSpecifier).customPropertyValue(propertyName);
</ins><span class="cx"> 
</span><span class="cx">     CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><span class="cx">     if (!propertyID)
</span><span class="lines">@@ -4099,7 +4112,7 @@
</span><span class="cx"> String CSSComputedStyleDeclaration::getPropertyValue(const String &amp;propertyName)
</span><span class="cx"> {
</span><span class="cx">     if (isCustomPropertyName(propertyName))
</span><del>-        return ComputedStyleExtractor(m_element.copyRef(), m_allowVisitedStyle, m_pseudoElementSpecifier).customPropertyText(propertyName);
</del><ins>+        return ComputedStyleExtractor(m_element.ptr(), m_allowVisitedStyle, m_pseudoElementSpecifier).customPropertyText(propertyName);
</ins><span class="cx"> 
</span><span class="cx">     CSSPropertyID propertyID = cssPropertyID(propertyName);
</span><span class="cx">     if (!propertyID)
</span><span class="lines">@@ -4148,7 +4161,7 @@
</span><span class="cx">     return Exception { NO_MODIFICATION_ALLOWED_ERR };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;CSSValueList&gt; ComputedStyleExtractor::getBackgroundShorthandValue() const
</del><ins>+Ref&lt;CSSValueList&gt; ComputedStyleExtractor::getBackgroundShorthandValue()
</ins><span class="cx"> {
</span><span class="cx">     static const CSSPropertyID propertiesBeforeSlashSeperator[5] = { CSSPropertyBackgroundColor, CSSPropertyBackgroundImage, CSSPropertyBackgroundRepeat, CSSPropertyBackgroundAttachment, CSSPropertyBackgroundPosition };
</span><span class="cx">     static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyBackgroundSize, CSSPropertyBackgroundOrigin, CSSPropertyBackgroundClip };
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h (207685 => 207686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h        2016-10-21 17:56:09 UTC (rev 207685)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h        2016-10-21 18:20:07 UTC (rev 207686)
</span><span class="lines">@@ -47,40 +47,39 @@
</span><span class="cx"> 
</span><span class="cx"> class ComputedStyleExtractor {
</span><span class="cx"> public:
</span><del>-    ComputedStyleExtractor(RefPtr&lt;Node&gt;&amp;&amp;, bool allowVisitedStyle = false, PseudoId = NOPSEUDO);
</del><ins>+    ComputedStyleExtractor(Node*, bool allowVisitedStyle = false, PseudoId = NOPSEUDO);
+    ComputedStyleExtractor(Element*, bool allowVisitedStyle = false, PseudoId = NOPSEUDO);
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;CSSValue&gt; propertyValue(CSSPropertyID, EUpdateLayout = UpdateLayout) const;
-    String customPropertyText(const String&amp; propertyName) const;
-    RefPtr&lt;CSSValue&gt; customPropertyValue(const String&amp; propertyName) const;
</del><ins>+    RefPtr&lt;CSSValue&gt; propertyValue(CSSPropertyID, EUpdateLayout = UpdateLayout);
+    String customPropertyText(const String&amp; propertyName);
+    RefPtr&lt;CSSValue&gt; customPropertyValue(const String&amp; propertyName);
</ins><span class="cx"> 
</span><span class="cx">     // Helper methods for HTML editing.
</span><del>-    Ref&lt;MutableStyleProperties&gt; copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const;
-    Ref&lt;MutableStyleProperties&gt; copyProperties() const;
-    RefPtr&lt;CSSPrimitiveValue&gt; getFontSizeCSSValuePreferringKeyword() const;
-    bool useFixedFontDefaultSize() const;
-    bool propertyMatches(CSSPropertyID, const CSSValue*) const;
</del><ins>+    Ref&lt;MutableStyleProperties&gt; copyPropertiesInSet(const CSSPropertyID* set, unsigned length);
+    Ref&lt;MutableStyleProperties&gt; copyProperties();
+    RefPtr&lt;CSSPrimitiveValue&gt; getFontSizeCSSValuePreferringKeyword();
+    bool useFixedFontDefaultSize();
+    bool propertyMatches(CSSPropertyID, const CSSValue*);
</ins><span class="cx"> 
</span><span class="cx">     static Ref&lt;CSSValue&gt; valueForFilter(const RenderStyle&amp;, const FilterOperations&amp;, AdjustPixelValuesForComputedStyle = AdjustPixelValues);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    // The styled node is either the node passed into computedPropertyValue, or the
</del><ins>+    // The styled element is either the element passed into computedPropertyValue, or the
</ins><span class="cx">     // PseudoElement for :before and :after if they exist.
</span><del>-    // FIXME: This should be styledElement since in JS getComputedStyle only works
-    // on Elements, but right now editing creates these for text nodes. We should fix that.
-    Node* styledNode() const;
</del><ins>+    Element* styledElement();
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;CSSValue&gt; svgPropertyValue(CSSPropertyID, EUpdateLayout) const;
</del><ins>+    RefPtr&lt;CSSValue&gt; svgPropertyValue(CSSPropertyID, EUpdateLayout);
</ins><span class="cx">     RefPtr&lt;SVGPaint&gt; adjustSVGPaintForCurrentColor(RefPtr&lt;SVGPaint&gt;&amp;&amp;, const RenderStyle*) const;
</span><span class="cx"> 
</span><span class="cx">     static Ref&lt;CSSValue&gt; valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle&amp;, AdjustPixelValuesForComputedStyle = AdjustPixelValues);
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; currentColorOrValidColor(const RenderStyle*, const Color&amp;) const;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;CSSValueList&gt; getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&amp;) const;
-    RefPtr&lt;CSSValueList&gt; getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&amp;) const;
-    Ref&lt;CSSValueList&gt; getBackgroundShorthandValue() const;
-    RefPtr&lt;CSSValueList&gt; getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&amp;) const;
</del><ins>+    RefPtr&lt;CSSValueList&gt; getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&amp;);
+    RefPtr&lt;CSSValueList&gt; getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&amp;);
+    Ref&lt;CSSValueList&gt; getBackgroundShorthandValue();
+    RefPtr&lt;CSSValueList&gt; getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&amp;);
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;Node&gt; m_node;
</del><ins>+    RefPtr&lt;Element&gt; m_element;
</ins><span class="cx">     PseudoId m_pseudoElementSpecifier;
</span><span class="cx">     bool m_allowVisitedStyle;
</span><span class="cx"> };
</span><span class="lines">@@ -121,7 +120,7 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValue&gt; getPropertyCSSValue(CSSPropertyID, EUpdateLayout = UpdateLayout) const;
</span><span class="cx"> 
</span><del>-    Ref&lt;Element&gt; m_element;
</del><ins>+    mutable Ref&lt;Element&gt; m_element;
</ins><span class="cx">     PseudoId m_pseudoElementSpecifier;
</span><span class="cx">     bool m_allowVisitedStyle;
</span><span class="cx">     unsigned m_refCount;
</span></span></pre></div>
<a id="trunkSourceWebCorecssSVGCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp (207685 => 207686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp        2016-10-21 17:56:09 UTC (rev 207685)
+++ trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp        2016-10-21 18:20:07 UTC (rev 207686)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include &quot;CSSPrimitiveValueMappings.h&quot;
</span><span class="cx"> #include &quot;CSSPropertyNames.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><ins>+#include &quot;Element.h&quot;
</ins><span class="cx"> #include &quot;RenderStyle.h&quot;
</span><span class="cx"> #include &quot;SVGPaint.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -100,17 +101,16 @@
</span><span class="cx">     return WTFMove(paint);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSValue&gt; ComputedStyleExtractor::svgPropertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
</del><ins>+RefPtr&lt;CSSValue&gt; ComputedStyleExtractor::svgPropertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout)
</ins><span class="cx"> {
</span><del>-    Node* node = m_node.get();
-    if (!node)
</del><ins>+    if (!m_element)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     // Make sure our layout is up to date before we allow a query on these attributes.
</span><span class="cx">     if (updateLayout)
</span><del>-        node-&gt;document().updateLayout();
</del><ins>+        m_element-&gt;document().updateLayout();
</ins><span class="cx"> 
</span><del>-    auto* style = node-&gt;computedStyle();
</del><ins>+    auto* style = m_element-&gt;computedStyle();
</ins><span class="cx">     if (!style)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (207685 => 207686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingStyle.cpp        2016-10-21 17:56:09 UTC (rev 207685)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp        2016-10-21 18:20:07 UTC (rev 207686)
</span><span class="lines">@@ -1364,7 +1364,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-void EditingStyle::removeEquivalentProperties(const T&amp; style)
</del><ins>+void EditingStyle::removeEquivalentProperties(T&amp; style)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;CSSPropertyID&gt; propertiesToRemove;
</span><span class="cx">     for (auto&amp; property : m_mutableStyle-&gt;m_propertyVector) {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingStyle.h (207685 => 207686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingStyle.h        2016-10-21 17:56:09 UTC (rev 207685)
+++ trunk/Source/WebCore/editing/EditingStyle.h        2016-10-21 18:20:07 UTC (rev 207686)
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx">     void removeBlockProperties();
</span><span class="cx">     void removeStyleAddedByNode(Node*);
</span><span class="cx">     void removeStyleConflictingWithStyleOfNode(Node*);
</span><del>-    template&lt;typename T&gt; void removeEquivalentProperties(const T&amp;);
</del><ins>+    template&lt;typename T&gt; void removeEquivalentProperties(T&amp;);
</ins><span class="cx">     void collapseTextDecorationProperties();
</span><span class="cx">     enum ShouldIgnoreTextOnlyProperties { IgnoreTextOnlyProperties, DoNotIgnoreTextOnlyProperties };
</span><span class="cx">     TriState triStateOfStyle(EditingStyle*) const;
</span></span></pre>
</div>
</div>

</body>
</html>