Changeset 224269 in webkit


Ignore:
Timestamp:
Oct 31, 2017 6:39:09 PM (6 years ago)
Author:
commit-queue@webkit.org
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 <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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r224267 r224269  
     12017-10-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        updateMaskedAncestorShouldIsolateBlending() should check the Nullability of the computedStyle() of the element's ancestors
     4        https://bugs.webkit.org/show_bug.cgi?id=179085
     5        <rdar://problem/30888101>
     6
     7        Reviewed by Ryosuke Niwa.
     8
     9        This is a defensive change. The Element::computedStyle() can be null only
     10        if the element is not a connected to the DOM tree. This may happen if
     11        while the DOM tree is being changed, a different event is handled such
     12        that it requires styleReclac()/layout() to happen. In this case, the render
     13        tree will be in an incorrect state.
     14
     15        * rendering/svg/SVGRenderSupport.cpp:
     16        (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
     17
    1182017-10-31  Alex Christensen  <achristensen@webkit.org>
    219
  • trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp

    r214787 r224269  
    486486    bool maskedAncestorShouldIsolateBlending = renderer.style().hasBlendMode();
    487487    for (auto* ancestor = renderer.element()->parentElement(); ancestor && ancestor->isSVGElement(); ancestor = ancestor->parentElement()) {
    488         if (!downcast<SVGElement>(*ancestor).isSVGGraphicsElement() || !isolatesBlending(*ancestor->computedStyle()))
     488        if (!downcast<SVGElement>(*ancestor).isSVGGraphicsElement())
     489            continue;
     490
     491        const auto* style = ancestor->computedStyle();
     492        if (!style || !isolatesBlending(*style))
    489493            continue;
    490494
Note: See TracChangeset for help on using the changeset viewer.