[webkit-changes] [WebKit/WebKit] 54cc63: Prevent selection repaint in the middle of multico...

Claudio Saavedra noreply at github.com
Fri May 17 11:36:20 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 54cc63f44f09698e77d1ff0823d90612f844c59c
      https://github.com/WebKit/WebKit/commit/54cc63f44f09698e77d1ff0823d90612f844c59c
  Author: Claudio Saavedra <csaavedra at igalia.com>
  Date:   2024-05-17 (Fri, 17 May 2024)

  Changed paths:
    A LayoutTests/fast/block/multicolumn-with-outline-auto-expected.txt
    A LayoutTests/fast/block/multicolumn-with-outline-auto.html

  Log Message:
  -----------
  Prevent selection repaint in the middle of multicolumn flow destruction
https://bugs.webkit.org/show_bug.cgi?id=263180
rdar://128090627

Reviewed by Alan Baradlay.

During multicolumn fragmented flow destruction, spanners are moved back
to their original DOM position in the tree. This is done through calls
to RenderTreeBuilderBlock::Block::detach(RenderBlockFlow&), which also
calls the more general RenderBlock ::detach() method for each spanner.
The former method results in the destruction of the spanner placeholders
and the merging of the necessary multicolumn sets, but this is not done
immediately, so the tree is temporarily inconsistent, before the
RenderBlock detach() method is called.

RenderTreeBuilderBlock::Block::detach(RenderBlock&), however,
might inadvertely end up triggering a repaint of the selection that the
tree is not ready for. I assume that this is an oversight from the possibility
that this method gets called during RenderBlockFlow detachment. This repaint
happens because RenderTreeBuilder::detachFromRenderElement() clears the
selection if the child being detached is to be destroyed. As
WillBeDestroyed::Yes is the default value in the definition of
detachFromRenderElement(), this is assumed to be the case, even when
that's not what happens during fragmented flow destruction.

The problem with this is that the selection repaint will eventually find itself
needing a consistent tree, and the fact that multicolumn sets are not merged
yet and there are spanners without a placehoder will break assumptions made
in RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded().

Fix this by making it possible for both detach() methods to propagate
WillBeDestroyed, with a default value of WillBeDestroyed::Yes to preserve
current behavior everywhere, but explicitly passing WillBeDestroyed::No
during fragmented flow destruction when detaching spanners, as this is what
is actually happening. This prevents the selection repaint from happening
before the tree is in a consistent state.

* LayoutTests/fast/block/multicolumn-with-outline-auto-expected.txt: Added.
* LayoutTests/fast/block/multicolumn-with-outline-auto.html: Added.

Originally-landed-as: 274097.6 at webkit-2024.2-embargoed (00414cbd744c). rdar://128090627
Canonical link: https://commits.webkit.org/278918@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list