<!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 <antti@apple.com>
+
+ 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 <cdumez@apple.com>
</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 "CSSTimingFunctionValue.h"
</span><span class="cx"> #include "CSSValueList.h"
</span><span class="cx"> #include "CSSValuePool.h"
</span><ins>+#include "ComposedTreeAncestorIterator.h"
</ins><span class="cx"> #include "ContentData.h"
</span><span class="cx"> #include "CounterContent.h"
</span><span class="cx"> #include "CursorList.h"
</span><span class="lines">@@ -72,6 +73,7 @@
</span><span class="cx"> #include "StylePropertyShorthandFunctions.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "StyleScope.h"
</span><ins>+#include "Text.h"
</ins><span class="cx"> #include "WebKitCSSFilterValue.h"
</span><span class="cx"> #include "WebKitCSSTransformValue.h"
</span><span class="cx"> #include "WebKitFontFamilyNames.h"
</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<Node>&& node, bool allowVisitedStyle, PseudoId pseudoElementSpecifier)
- : m_node(WTFMove(node))
</del><ins>+static Element* styleElementForNode(Node* node)
+{
+ if (!node)
+ return nullptr;
+ if (is<Element>(*node))
+ return downcast<Element>(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& element, bool allowVisitedStyle, const String& 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<CSSPrimitiveValue> ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword() const
</del><ins>+RefPtr<CSSPrimitiveValue> 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->document().updateLayoutIgnorePendingStylesheets();
</del><ins>+ m_element->document().updateLayoutIgnorePendingStylesheets();
</ins><span class="cx">
</span><del>- auto* style = m_node->computedStyle(m_pseudoElementSpecifier);
</del><ins>+ auto* style = m_element->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->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->computedStyle(m_pseudoElementSpecifier);
</del><ins>+ auto* style = m_element->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<Element>(*m_node))
- return m_node.get();
- Element& element = downcast<Element>(*m_node);
</del><span class="cx"> PseudoElement* pseudoElement;
</span><del>- if (m_pseudoElementSpecifier == BEFORE && (pseudoElement = element.beforePseudoElement()))
</del><ins>+ if (m_pseudoElementSpecifier == BEFORE && (pseudoElement = m_element->beforePseudoElement()))
</ins><span class="cx"> return pseudoElement;
</span><del>- if (m_pseudoElementSpecifier == AFTER && (pseudoElement = element.afterPseudoElement()))
</del><ins>+ if (m_pseudoElementSpecifier == AFTER && (pseudoElement = m_element->afterPseudoElement()))
</ins><span class="cx"> return pseudoElement;
</span><del>- return &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<CSSValue> 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<MutableStyleProperties> 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& node)
</del><ins>+static inline bool elementOrItsAncestorNeedsStyleRecalc(Element& 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 = &node;
- const Element* ancestor = currentNode->parentOrShadowHostElement();
- while (ancestor) {
- if (ancestor->needsStyleRecalc())
</del><ins>+ const auto* currentElement = &element;
+ for (auto& ancestor : composedTreeAncestors(element)) {
+ if (ancestor.needsStyleRecalc())
</ins><span class="cx"> return true;
</span><span class="cx">
</span><del>- if (ancestor->directChildNeedsStyleRecalc() && currentNode->styleIsAffectedByPreviousSibling())
</del><ins>+ if (ancestor.directChildNeedsStyleRecalc() && currentElement->styleIsAffectedByPreviousSibling())
</ins><span class="cx"> return true;
</span><span class="cx">
</span><del>- currentNode = ancestor;
- ancestor = currentNode->parentOrShadowHostElement();
</del><ins>+ currentElement = &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& node)
</del><ins>+static bool updateStyleIfNeededForElement(Element& element)
</ins><span class="cx"> {
</span><del>- Document& document = node.document();
</del><ins>+ auto& document = element.document();
</ins><span class="cx">
</span><span class="cx"> document.styleScope().flushPendingUpdate();
</span><span class="cx">
</span><del>- if (!document.hasPendingForcedStyleRecalc() && !(document.childNeedsStyleRecalc() && 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<RenderStyle>& ownedStyle)
</del><ins>+static inline const RenderStyle* computeRenderStyleForProperty(Element& element, PseudoId pseudoElementSpecifier, CSSPropertyID propertyID, std::unique_ptr<RenderStyle>& ownedStyle)
</ins><span class="cx"> {
</span><del>- RenderObject* renderer = styledNode->renderer();
</del><ins>+ auto* renderer = element.renderer();
</ins><span class="cx">
</span><span class="cx"> if (renderer && renderer->isComposited() && AnimationController::supportsAcceleratedAnimationOfProperty(propertyID)) {
</span><del>- ownedStyle = renderer->animation().getAnimatedStyleForRenderer(downcast<RenderElement>(*renderer));
- if (pseudoElementSpecifier && !styledNode->isPseudoElement()) {
</del><ins>+ ownedStyle = renderer->animation().getAnimatedStyleForRenderer(*renderer);
+ if (pseudoElementSpecifier && !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->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->computedStyle(styledNode->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<CSSValue> shapePropertyValue(const RenderStyle& style, const ShapeValue* shapeValue)
</span><span class="lines">@@ -2446,20 +2462,19 @@
</span><span class="cx"> return element && element->computedStyle() && element->computedStyle()->isDisplayFlexibleOrGridBox();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<CSSValue> ComputedStyleExtractor::customPropertyValue(const String& propertyName) const
</del><ins>+RefPtr<CSSValue> ComputedStyleExtractor::customPropertyValue(const String& propertyName)
</ins><span class="cx"> {
</span><del>- Node* styledNode = this->styledNode();
- if (!styledNode)
</del><ins>+ Element* styledElement = this->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->styledNode();
</del><ins>+ if (updateStyleIfNeededForElement(*styledElement)) {
+ // Style update may change styledElement() to PseudoElement or back.
+ styledElement = this->styledElement();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<RenderStyle> 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->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->getCustomPropertyValue(propertyName);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String ComputedStyleExtractor::customPropertyText(const String& propertyName) const
</del><ins>+String ComputedStyleExtractor::customPropertyText(const String& propertyName)
</ins><span class="cx"> {
</span><del>- RefPtr<CSSValue> propertyValue = this->customPropertyValue(propertyName);
</del><ins>+ RefPtr<CSSValue> propertyValue = customPropertyValue(propertyName);
</ins><span class="cx"> return propertyValue ? propertyValue->cssText() : emptyString();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
</del><ins>+RefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout)
</ins><span class="cx"> {
</span><del>- Node* styledNode = this->styledNode();
- if (!styledNode)
</del><ins>+ auto* styledElement = this->styledElement();
+ if (!styledElement)
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<RenderStyle> 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& document = styledNode->document();
</del><ins>+ Document& document = m_element->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->styledNode();
</del><ins>+ if (updateStyleIfNeededForElement(*styledElement)) {
+ // Style update may change styledElement() to PseudoElement or back.
+ styledElement = this->styledElement();
</ins><span class="cx"> }
</span><ins>+ renderer = styledElement->renderer();
</ins><span class="cx">
</span><del>- renderer = styledNode->renderer();
-
- if (propertyID == CSSPropertyDisplay && !renderer && is<SVGElement>(*styledNode) && !downcast<SVGElement>(*styledNode).isValid())
</del><ins>+ if (propertyID == CSSPropertyDisplay && !renderer && is<SVGElement>(*styledElement) && !downcast<SVGElement>(*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->isInShadowTree()
</del><ins>+ || styledElement->isInShadowTree()
</ins><span class="cx"> || (document.styleScope().resolverIfExists() && document.styleScope().resolverIfExists()->hasViewportDependentMediaQueries() && document.ownerElement());
</span><span class="cx">
</span><span class="cx"> if (forceFullLayout) {
</span><span class="cx"> document.updateLayoutIgnorePendingStylesheets();
</span><del>- styledNode = this->styledNode();
</del><ins>+ styledElement = this->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->renderer();
</del><ins>+ style = computeRenderStyleForProperty(*styledElement, m_pseudoElementSpecifier, propertyID, ownedStyle);
+ renderer = styledElement->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->alignItems());
</span><span class="cx"> case CSSPropertyAlignSelf:
</span><del>- return valueForItemPositionWithOverflowAlignment(resolveAlignSelfAuto(style->alignSelf(), styledNode->parentNode()));
</del><ins>+ return valueForItemPositionWithOverflowAlignment(resolveAlignSelfAuto(style->alignSelf(), styledElement->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->justifyContent(), CSSValueFlexStart);
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx"> case CSSPropertyJustifyItems:
</span><del>- return valueForItemPositionWithOverflowAlignment(resolveJustifyItemsAuto(style->justifyItems(), styledNode->parentNode()));
</del><ins>+ return valueForItemPositionWithOverflowAlignment(resolveJustifyItemsAuto(style->justifyItems(), styledElement->parentNode()));
</ins><span class="cx"> case CSSPropertyJustifySelf:
</span><del>- return valueForItemPositionWithOverflowAlignment(resolveJustifySelfAuto(style->justifySelf(), styledNode->parentNode()));
</del><ins>+ return valueForItemPositionWithOverflowAlignment(resolveJustifySelfAuto(style->justifySelf(), styledElement->parentNode()));
</ins><span class="cx"> #endif
</span><span class="cx"> case CSSPropertyOrder:
</span><span class="cx"> return cssValuePool.createValue(style->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->document().settings() && styledNode->document().settings()->variationFontsEnabled()) {
</del><ins>+ if (styledElement->document().settings() && styledElement->document().settings()->variationFontsEnabled()) {
</ins><span class="cx"> const FontVariationSettings& variationSettings = style->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->minHeight().isAuto()) {
</span><del>- if (isFlexOrGrid(styledNode->parentNode()))
</del><ins>+ if (isFlexOrGrid(styledElement->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->minHeight(), *style);
</span><span class="cx"> case CSSPropertyMinWidth:
</span><span class="cx"> if (style->minWidth().isAuto()) {
</span><del>- if (isFlexOrGrid(styledNode->parentNode()))
</del><ins>+ if (isFlexOrGrid(styledElement->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& element = m_element.get();
- updateStyleIfNeededForNode(element);
</del><ins>+ updateStyleIfNeededForElement(m_element.get());
</ins><span class="cx">
</span><del>- auto* style = const_cast<Element&>(element).computedStyle(m_pseudoElementSpecifier);
</del><ins>+ auto* style = m_element->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 < numComputedProperties)
</span><span class="cx"> return getPropertyNameString(computedProperties[i]);
</span><span class="cx">
</span><del>- auto& element = m_element.get();
- auto* style = const_cast<Element&>(element).computedStyle(m_pseudoElementSpecifier);
</del><ins>+ auto* style = m_element->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 && is<CSSPrimitiveValue>(*value) && m_node) {
- m_node->document().updateLayoutIgnorePendingStylesheets();
- if (auto* style = m_node->computedStyle(m_pseudoElementSpecifier)) {
</del><ins>+ if (!m_element)
+ return false;
+ if (propertyID == CSSPropertyFontSize && is<CSSPrimitiveValue>(*value)) {
+ m_element->document().updateLayoutIgnorePendingStylesheets();
+ if (auto* style = m_element->computedStyle(m_pseudoElementSpecifier)) {
</ins><span class="cx"> if (CSSValueID sizeIdentifier = style->fontDescription().keywordSizeAsIdentifier()) {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(*value);
</span><span class="cx"> if (primitiveValue.isValueID() && primitiveValue.valueID() == sizeIdentifier)
</span><span class="lines">@@ -4014,12 +4027,12 @@
</span><span class="cx"> return computedValue && value && computedValue->equals(*value);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<MutableStyleProperties> ComputedStyleExtractor::copyProperties() const
</del><ins>+Ref<MutableStyleProperties> 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<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand& shorthand) const
</del><ins>+RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand& shorthand)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
</span><span class="cx"> for (size_t i = 0; i < 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<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand& shorthand) const
</del><ins>+RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand& shorthand)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<CSSValueList> 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<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand& shorthand) const
</del><ins>+RefPtr<CSSValueList> ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand& shorthand)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
</span><span class="cx"> for (size_t i = 0; i < 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<MutableStyleProperties> ComputedStyleExtractor::copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const
</del><ins>+Ref<MutableStyleProperties> ComputedStyleExtractor::copyPropertiesInSet(const CSSPropertyID* set, unsigned length)
</ins><span class="cx"> {
</span><span class="cx"> Vector<CSSProperty, 256> list;
</span><span class="cx"> list.reserveInitialCapacity(length);
</span><span class="lines">@@ -4087,7 +4100,7 @@
</span><span class="cx"> RefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(const String& 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 &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<CSSValueList> ComputedStyleExtractor::getBackgroundShorthandValue() const
</del><ins>+Ref<CSSValueList> 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<Node>&&, 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<CSSValue> propertyValue(CSSPropertyID, EUpdateLayout = UpdateLayout) const;
- String customPropertyText(const String& propertyName) const;
- RefPtr<CSSValue> customPropertyValue(const String& propertyName) const;
</del><ins>+ RefPtr<CSSValue> propertyValue(CSSPropertyID, EUpdateLayout = UpdateLayout);
+ String customPropertyText(const String& propertyName);
+ RefPtr<CSSValue> customPropertyValue(const String& propertyName);
</ins><span class="cx">
</span><span class="cx"> // Helper methods for HTML editing.
</span><del>- Ref<MutableStyleProperties> copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const;
- Ref<MutableStyleProperties> copyProperties() const;
- RefPtr<CSSPrimitiveValue> getFontSizeCSSValuePreferringKeyword() const;
- bool useFixedFontDefaultSize() const;
- bool propertyMatches(CSSPropertyID, const CSSValue*) const;
</del><ins>+ Ref<MutableStyleProperties> copyPropertiesInSet(const CSSPropertyID* set, unsigned length);
+ Ref<MutableStyleProperties> copyProperties();
+ RefPtr<CSSPrimitiveValue> getFontSizeCSSValuePreferringKeyword();
+ bool useFixedFontDefaultSize();
+ bool propertyMatches(CSSPropertyID, const CSSValue*);
</ins><span class="cx">
</span><span class="cx"> static Ref<CSSValue> valueForFilter(const RenderStyle&, const FilterOperations&, 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<CSSValue> svgPropertyValue(CSSPropertyID, EUpdateLayout) const;
</del><ins>+ RefPtr<CSSValue> svgPropertyValue(CSSPropertyID, EUpdateLayout);
</ins><span class="cx"> RefPtr<SVGPaint> adjustSVGPaintForCurrentColor(RefPtr<SVGPaint>&&, const RenderStyle*) const;
</span><span class="cx">
</span><span class="cx"> static Ref<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle&, AdjustPixelValuesForComputedStyle = AdjustPixelValues);
</span><span class="cx"> RefPtr<CSSPrimitiveValue> currentColorOrValidColor(const RenderStyle*, const Color&) const;
</span><span class="cx">
</span><del>- RefPtr<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&) const;
- RefPtr<CSSValueList> getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&) const;
- Ref<CSSValueList> getBackgroundShorthandValue() const;
- RefPtr<CSSValueList> getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&) const;
</del><ins>+ RefPtr<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&);
+ RefPtr<CSSValueList> getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&);
+ Ref<CSSValueList> getBackgroundShorthandValue();
+ RefPtr<CSSValueList> getCSSPropertyValuesForGridShorthand(const StylePropertyShorthand&);
</ins><span class="cx">
</span><del>- RefPtr<Node> m_node;
</del><ins>+ RefPtr<Element> 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<CSSValue> getPropertyCSSValue(CSSPropertyID, EUpdateLayout = UpdateLayout) const;
</span><span class="cx">
</span><del>- Ref<Element> m_element;
</del><ins>+ mutable Ref<Element> 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 "CSSPrimitiveValueMappings.h"
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "Element.h"
</ins><span class="cx"> #include "RenderStyle.h"
</span><span class="cx"> #include "SVGPaint.h"
</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<CSSValue> ComputedStyleExtractor::svgPropertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
</del><ins>+RefPtr<CSSValue> 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->document().updateLayout();
</del><ins>+ m_element->document().updateLayout();
</ins><span class="cx">
</span><del>- auto* style = node->computedStyle();
</del><ins>+ auto* style = m_element->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<typename T>
</span><del>-void EditingStyle::removeEquivalentProperties(const T& style)
</del><ins>+void EditingStyle::removeEquivalentProperties(T& style)
</ins><span class="cx"> {
</span><span class="cx"> Vector<CSSPropertyID> propertiesToRemove;
</span><span class="cx"> for (auto& property : m_mutableStyle->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<typename T> void removeEquivalentProperties(const T&);
</del><ins>+ template<typename T> void removeEquivalentProperties(T&);
</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>