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

Changeset 276137 in webkit


Ignore:
Timestamp:
Apr 16, 2021, 8:33:37 AM (5 years ago)
Author:
Alan Bujtas
Message:

[RenderTreeBuilder] Do not try to collapse anonymous blocks when cleaning up the first-letter subtree
https://bugs.webkit.org/show_bug.cgi?id=224667
<rdar://76616098>

Reviewed by Antti Koivisto.

We construct a dedicated renderer for the first letter content and in some cases wrap it into an anonymous block.
This subtree needs to be destroyed when the associated RenderText is getting deleted. During this cleanup process
we may find the wrapper anonymous block redundant and initiate a sibling block collapsing. However this collapsing
may interfere with the initial delete (the associated RenderText) and lead to unexpected result.
Let's reserve the anonymous collapsing for the initial remove.

  • rendering/updating/RenderTreeBuilderFirstLetter.cpp:

(WebCore::RenderTreeBuilder::FirstLetter::cleanupOnDestroy):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r276135 r276137  
     12021-04-16  Zalan Bujtas  <zalan@apple.com>
     2
     3        [RenderTreeBuilder] Do not try to collapse anonymous blocks when cleaning up the first-letter subtree
     4        https://bugs.webkit.org/show_bug.cgi?id=224667
     5        <rdar://76616098>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        We construct a dedicated renderer for the first letter content and in some cases wrap it into an anonymous block.
     10        This subtree needs to be destroyed when the associated RenderText is getting deleted. During this cleanup process
     11        we may find the wrapper anonymous block redundant and initiate a sibling block collapsing. However this collapsing
     12        may interfere with the initial delete (the associated RenderText) and lead to unexpected result.
     13        Let's reserve the anonymous collapsing for the initial remove.
     14
     15        * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
     16        (WebCore::RenderTreeBuilder::FirstLetter::cleanupOnDestroy):
     17
    1182021-04-16  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp

    r267191 r276137  
    158158    if (!textFragment.firstLetter())
    159159        return;
    160     m_builder.destroy(*textFragment.firstLetter());
     160    m_builder.destroy(*textFragment.firstLetter(), CanCollapseAnonymousBlock::No);
    161161}
    162162
Note: See TracChangeset for help on using the changeset viewer.