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

Changeset 242943 in webkit


Ignore:
Timestamp:
Mar 14, 2019, 9:21:34 AM (7 years ago)
Author:
Alan Bujtas
Message:

Cleanup inline boxes when list marker gets blockified
https://bugs.webkit.org/show_bug.cgi?id=195746
<rdar://problem/48049175>

Reviewed by Antti Koivisto.

Source/WebCore:

Normally when an element gets blockified (inline -> block) we destroy its renderer and construct a new one (RenderInline -> RenderBlock).
During this process the associated inline boxtree gets destroyed as well. Since RenderListMarker is just a generic RenderBox, the blockifying
change does not require a new renderer.
This patch takes care of destroying the inline boxtree when the marker gains block display type.

Test: fast/block/float/list-marker-is-float-crash.html

  • rendering/RenderListMarker.cpp:

(WebCore::RenderListMarker::styleDidChange):

LayoutTests:

  • fast/block/float/list-marker-is-float-crash-expected.txt: Added.
  • fast/block/float/list-marker-is-float-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r242942 r242943  
     12019-03-14  Zalan Bujtas  <zalan@apple.com>
     2
     3        Cleanup inline boxes when list marker gets blockified
     4        https://bugs.webkit.org/show_bug.cgi?id=195746
     5        <rdar://problem/48049175>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * fast/block/float/list-marker-is-float-crash-expected.txt: Added.
     10        * fast/block/float/list-marker-is-float-crash.html: Added.
     11
    1122019-03-14  Ryan Haddad  <ryanhaddad@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r242941 r242943  
     12019-03-14  Zalan Bujtas  <zalan@apple.com>
     2
     3        Cleanup inline boxes when list marker gets blockified
     4        https://bugs.webkit.org/show_bug.cgi?id=195746
     5        <rdar://problem/48049175>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Normally when an element gets blockified (inline -> block) we destroy its renderer and construct a new one (RenderInline -> RenderBlock).
     10        During this process the associated inline boxtree gets destroyed as well. Since RenderListMarker is just a generic RenderBox, the blockifying
     11        change does not require a new renderer.
     12        This patch takes care of destroying the inline boxtree when the marker gains block display type.
     13
     14        Test: fast/block/float/list-marker-is-float-crash.html
     15
     16        * rendering/RenderListMarker.cpp:
     17        (WebCore::RenderListMarker::styleDidChange):
     18
    1192019-03-14  Devin Rousso  <drousso@apple.com>
    220
  • trunk/Source/WebCore/rendering/RenderListMarker.cpp

    r242921 r242943  
    11451145    RenderBox::styleDidChange(diff, oldStyle);
    11461146
    1147     if (oldStyle && (style().listStylePosition() != oldStyle->listStylePosition() || style().listStyleType() != oldStyle->listStyleType()))
    1148         setNeedsLayoutAndPrefWidthsRecalc();
     1147    if (oldStyle) {
     1148        if (style().listStylePosition() != oldStyle->listStylePosition() || style().listStyleType() != oldStyle->listStyleType())
     1149            setNeedsLayoutAndPrefWidthsRecalc();
     1150        if (oldStyle->isDisplayInlineType() && !style().isDisplayInlineType()) {
     1151            delete m_inlineBoxWrapper;
     1152            m_inlineBoxWrapper = nullptr;
     1153        }
     1154    }
    11491155
    11501156    if (m_image != style().listStyleImage()) {
Note: See TracChangeset for help on using the changeset viewer.