⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284871 in webkit


Ignore:
Timestamp:
Oct 26, 2021, 9:00:24 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

ASSERT(parent->element()) triggered in Styleable::fromRenderer
https://bugs.webkit.org/show_bug.cgi?id=232185

Patch by Gabriel Nava Marino <gnavamarino@apple.com> on 2021-10-26
Reviewed by Tim Nguyen and Antti Koivisto.

Source/WebCore:

The marker renderer can be set as a child of RenderMultiColumnFlowThread
instead of RenderListItem in some instances. RenderMultiColumnFlowThread is
an anonymous box and doesn't have an associated element, so we instead should
loop through the parents until we find the RenderListItem which does have an
associated element.

Test: fast/animation/css-animation-marker-crash.html

  • style/Styleable.cpp:

(WebCore::Styleable::fromRenderer):

LayoutTests:

  • fast/animation/css-animation-marker-crash-expected.txt: Added.
  • fast/animation/css-animation-marker-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r284869 r284871  
     12021-10-26  Gabriel Nava Marino  <gnavamarino@apple.com>
     2
     3        ASSERT(parent->element()) triggered in Styleable::fromRenderer
     4        https://bugs.webkit.org/show_bug.cgi?id=232185
     5
     6        Reviewed by Tim Nguyen and Antti Koivisto.
     7
     8        * fast/animation/css-animation-marker-crash-expected.txt: Added.
     9        * fast/animation/css-animation-marker-crash.html: Added.
     10
    1112021-10-26  Martin Robinson  <mrobinson@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r284867 r284871  
     12021-10-26  Gabriel Nava Marino  <gnavamarino@apple.com>
     2
     3        ASSERT(parent->element()) triggered in Styleable::fromRenderer
     4        https://bugs.webkit.org/show_bug.cgi?id=232185
     5
     6        Reviewed by Tim Nguyen and Antti Koivisto.
     7
     8        The marker renderer can be set as a child of RenderMultiColumnFlowThread
     9        instead of RenderListItem in some instances. RenderMultiColumnFlowThread is
     10        an anonymous box and doesn't have an associated element, so we instead should
     11        loop through the parents until we find the RenderListItem which does have an
     12        associated element.
     13
     14        Test: fast/animation/css-animation-marker-crash.html
     15
     16        * style/Styleable.cpp:
     17        (WebCore::Styleable::fromRenderer):
     18
    1192021-10-26  Philippe Normand  <pnormand@igalia.com>
    220
  • trunk/Source/WebCore/style/Styleable.cpp

    r284693 r284871  
    6262        break;
    6363    case PseudoId::Marker:
    64         if (auto* parent = renderer.parent()) {
    65             ASSERT(parent->element());
    66             ASSERT(is<RenderListItem>(parent));
    67             ASSERT(downcast<RenderListItem>(*parent).markerRenderer() == &renderer);
    68             return Styleable(*parent->element(), PseudoId::Marker);
     64        if (auto* ancestor = renderer.parent()) {
     65            while (ancestor && !ancestor->element())
     66                ancestor = ancestor->parent();
     67            ASSERT(is<RenderListItem>(ancestor));
     68            ASSERT(downcast<RenderListItem>(ancestor)->markerRenderer() == &renderer);
     69            return Styleable(*ancestor->element(), PseudoId::Marker);
    6970        }
    7071        break;
Note: See TracChangeset for help on using the changeset viewer.