Skip to content
Permalink
Browse files
updateMaskedAncestorShouldIsolateBlending() should check the Nullabil…
…ity 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 <sabouhallawa@apple.com> 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):

Canonical link: https://commits.webkit.org/195220@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Said Abou-Hallawa authored and webkit-commit-queue committed Nov 1, 2017
1 parent 56f063d commit 07b66236f09779601f0986d6b69131cb99192152
Showing 2 changed files with 22 additions and 1 deletion.
@@ -1,3 +1,20 @@
2017-10-31 Said Abou-Hallawa <sabouhallawa@apple.com>

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 <achristensen@webkit.org>

Use asynchronous ResourceHandleClient calls for WebKit1
@@ -485,7 +485,11 @@ void SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending(const RenderEle

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())

0 comments on commit 07b6623

Please sign in to comment.