Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b96e8988a23a1d8406ed2885ed952a61ed32c0b6
      
https://github.com/WebKit/WebKit/commit/b96e8988a23a1d8406ed2885ed952a61ed32c0b6
  Author: Alan Baradlay <[email protected]>
  Date:   2026-08-10 (Mon, 10 Aug 2026)

  Changed paths:
    A 
LayoutTests/fast/dom/nodesFromRect/nodesFromRect-block-in-inline-expected.txt
    A LayoutTests/fast/dom/nodesFromRect/nodesFromRect-block-in-inline.html
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp

  Log Message:
  -----------
  [block-in-inline] List based hit testing reports the container before a block 
level box on an earlier line
https://bugs.webkit.org/show_bug.cgi?id=321311

Reviewed by Antti Koivisto.

Hit testing returns nodes front to back, so hitTest() visits the display boxes 
in reverse.
A line's root inline box is not content - its renderer is the formatting 
context root - so reporting it adds
the container. On a line with a block level box it is hit tested in the block 
background phases, where a later
line's root inline box is reached before an earlier line's block level box, 
landing the container ahead of its
own descendant. Leave it out of those phases; the container reports itself in 
its own block background phase,
after its children.

* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::hitTest):
* LayoutTests/fast/dom/nodesFromRect/nodesFromRect-block-in-inline.html: Added.
* 
LayoutTests/fast/dom/nodesFromRect/nodesFromRect-block-in-inline-expected.txt: 
Added.

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



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

Reply via email to