Title: [224269] trunk/Source/WebCore
Revision
224269
Author
[email protected]
Date
2017-10-31 18:39:09 -0700 (Tue, 31 Oct 2017)

Log Message

updateMaskedAncestorShouldIsolateBlending() should check the Nullability of the computedStyle() of the element's ancestors
https://bugs.webkit.org/show_bug.cgi?id=179085
<rdar://problem/30888101>

Patch by Said Abou-Hallawa <[email protected]> on 2017-10-31
Reviewed by Ryosuke Niwa.

This is a defensive change. The Element::computedStyle() can be null only
if the element is not a connected to the DOM tree. This may happen if
while the DOM tree is being changed, a different event is handled such
that it requires styleReclac()/layout() to happen. In this case, the render
tree will be in an incorrect state.

* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (224268 => 224269)


--- trunk/Source/WebCore/ChangeLog	2017-11-01 01:27:39 UTC (rev 224268)
+++ trunk/Source/WebCore/ChangeLog	2017-11-01 01:39:09 UTC (rev 224269)
@@ -1,3 +1,20 @@
+2017-10-31  Said Abou-Hallawa  <[email protected]>
+
+        updateMaskedAncestorShouldIsolateBlending() should check the Nullability of the computedStyle() of the element's ancestors
+        https://bugs.webkit.org/show_bug.cgi?id=179085
+        <rdar://problem/30888101>
+
+        Reviewed by Ryosuke Niwa.
+
+        This is a defensive change. The Element::computedStyle() can be null only
+        if the element is not a connected to the DOM tree. This may happen if
+        while the DOM tree is being changed, a different event is handled such
+        that it requires styleReclac()/layout() to happen. In this case, the render
+        tree will be in an incorrect state.
+
+        * rendering/svg/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
+
 2017-10-31  Alex Christensen  <[email protected]>
 
         Use asynchronous ResourceHandleClient calls for WebKit1

Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (224268 => 224269)


--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp	2017-11-01 01:27:39 UTC (rev 224268)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp	2017-11-01 01:39:09 UTC (rev 224269)
@@ -485,9 +485,13 @@
 
     bool maskedAncestorShouldIsolateBlending = renderer.style().hasBlendMode();
     for (auto* ancestor = renderer.element()->parentElement(); ancestor && ancestor->isSVGElement(); ancestor = ancestor->parentElement()) {
-        if (!downcast<SVGElement>(*ancestor).isSVGGraphicsElement() || !isolatesBlending(*ancestor->computedStyle()))
+        if (!downcast<SVGElement>(*ancestor).isSVGGraphicsElement())
             continue;
 
+        const auto* style = ancestor->computedStyle();
+        if (!style || !isolatesBlending(*style))
+            continue;
+
         if (ancestor->computedStyle()->svgStyle().hasMasker())
             downcast<SVGGraphicsElement>(*ancestor).setShouldIsolateBlending(maskedAncestorShouldIsolateBlending);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to