Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 71c309ad3050291030aefcb57705fd2a8c6e79b4
      
https://github.com/WebKit/WebKit/commit/71c309ad3050291030aefcb57705fd2a8c6e79b4
  Author: Alan Baradlay <za...@apple.com>
  Date:   2025-04-08 (Tue, 08 Apr 2025)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-hidden-boundingbox-query-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-hidden-boundingbox-query.html
    M Source/WebCore/dom/Document.cpp

  Log Message:
  -----------
  [content-visibility] Incorrect getBoundingClientRect() inside skipped subtree 
on out-of-flow positioned box
https://bugs.webkit.org/show_bug.cgi?id=291223
<rdar://problem/148770252>

Reviewed by Antti Koivisto.

When laying out a previously skipped subtree, we have to treat the subtree as 
if it was never laid out before.
Essentially it means each renderer in the subtree has to have the 
self-needs-layout bit set.

This is what happens here
1, in-flow renderer is inside a skipped tree
2, renderer becomes out-of-flow and JS queries geometry on it
3, we run simplified layout starting at the containing block as what we have 
here is just an out-of-flow renderer requiring layout
4, the containing block does not have this renderer in the out-of-flow map (it 
is added when running inflow layout) so we end up not running layout on the 
stale content.

And the fix is:
1, find the root of the skipped content
2, mark every renderer in the subtree dirty (self needs layout)

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-hidden-boundingbox-query-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-hidden-boundingbox-query.html:
 Added.
* Source/WebCore/dom/Document.cpp:
(WebCore::rootForSkippedLayout):
(WebCore::Document::updateLayout):

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



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

Reply via email to