Commit eeb3f7df authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] Hit test floats in the same pseudo-stacking context.

We gave up when entering a new formatting context. But we should only
stop when entering a child that's painted atomically.

Bug: 1043787
Change-Id: I83bd88237311aa7edde00e5a3814a555cd56f112
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2044210Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739425}
parent 0d129bfe
...@@ -2118,7 +2118,7 @@ bool NGBoxFragmentPainter::HitTestFloatingChildren( ...@@ -2118,7 +2118,7 @@ bool NGBoxFragmentPainter::HitTestFloatingChildren(
continue; continue;
} }
if (child_fragment.IsBlockFormattingContextRoot()) if (child_fragment.IsPaintedAtomically())
continue; continue;
if (const auto* child_container = if (const auto* child_container =
......
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/CSS22/visuren.html#floats">
<link rel="help" href="https://www.w3.org/TR/CSS22/zindex.html">
<div id="error" style="overflow:hidden; width:100px; height:100px;"></div>
<div style="margin-top:-100px; overflow:hidden; width:100px; height:100px;">
<div id="target" style="float:left; width:100px; height:100px;"></div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
var elm = document.elementFromPoint(50, 50);
assert_equals(elm.id, "target");
}, "Miss float below something else");
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment