Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 20cc01a3cca10fa9d05ebf59443924b1d391b962
      
https://github.com/WebKit/WebKit/commit/20cc01a3cca10fa9d05ebf59443924b1d391b962
  Author: Alan Baradlay <[email protected]>
  Date:   2024-07-03 (Wed, 03 Jul 2024)

  Changed paths:
    A LayoutTests/fast/dynamic/block-inside-span-gets-removed-expected.html
    A LayoutTests/fast/dynamic/block-inside-span-gets-removed.html
    M LayoutTests/platform/ios/editing/execCommand/5142012-1-expected.txt
    M LayoutTests/platform/ios/editing/pasteboard/5134759-expected.txt
    M LayoutTests/platform/mac/editing/execCommand/5142012-1-expected.txt
    M LayoutTests/platform/mac/editing/pasteboard/5134759-expected.txt
    M Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp

  Log Message:
  -----------
  [continuation] Merge anonymous block containers when continuation triggering 
box is going away
https://bugs.webkit.org/show_bug.cgi?id=276158
<rdar://127750480>

Reviewed by Antti Koivisto.

When continuation triggering block container goes away

 <div id=container>
  text<span><div id=to-be-removed></div></span>
 </div>

->

 <div id=container>
  text<span></span>
 </div>

With the following initial tree

 Block Container (container)
   Anonymous pre block
     text
     inline box (continuation)
   Block Container (to-be-removed) (continuation)
   Anonymous post block
     inline box (continuation)

and we are left with anonymous pre/next blocks only

 Block Container (container)
   Anonymous pre block
     text
     inline box (continuation)
   Anonymous post block
     inline box (continuation)

we already collapse/merge them.

 Block Container (container)
     text
     inline box (continuation)
     inline box (continuation)

(notice that we (incorrectly) don't merge the inline boxes @1)

However when such anon blocks have a block sibling

 <div>
  text<span><div id=to-be-removed></div></span>
  <div id=block-sibling></div>
 </div>

We incorrectly keep the continuation block around causing extra (implicit) line 
break.

 Block Container (container)
   Anonymous pre block
     text
     inline box (continuation)
   Anonymous post block
     inline box (continuation)
   Block container (block-sibling)

Instead of having a simple block wrapper.

 Block Container (container)
   Anonymous block
     text
     inline box
   Block container (block-sibling)

This change fixes this, however it preserves the slightly incorrect (existing) 
behavior of @1 (see above)
producing the following tree

 Block Container (container)
   Anonymous block
     text
     inline box (continuation)
     inline box (continuation)
   Block container (block-sibling)

* LayoutTests/fast/dynamic/block-inside-span-gets-removed-expected.html: Added.
* LayoutTests/fast/dynamic/block-inside-span-gets-removed.html: Added.
* Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::canMergeContiguousAnonymousBlocks):

Canonical link: https://commits.webkit.org/280630@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to