mirror of
https://github.com/servo/servo.git
synced 2025-09-16 18:08:23 +01:00
layout: Fix scrollParent
to skip ancestors with display: contents
(#39153)
When encountering such an ancestor, we were returning null instead of skipping it. Testing: Adding new subtest for this. And while I'm at it, another one for the root element, unrelated to this fix. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
cf1f64e73f
commit
0f9f507b46
3 changed files with 14 additions and 4 deletions
2
tests/wpt/meta/MANIFEST.json
vendored
2
tests/wpt/meta/MANIFEST.json
vendored
|
@ -630047,7 +630047,7 @@
|
|||
]
|
||||
],
|
||||
"scrollParent.html": [
|
||||
"344ee522ef2664e0b963e79812074f08f343f5bf",
|
||||
"b1c6898af349691d357a3d39cc8fd8e578612d94",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
|
|
|
@ -57,6 +57,10 @@
|
|||
<div id="hidden" class="hidden">
|
||||
<div id="childOfHidden"></div>
|
||||
</div>
|
||||
<!-- No box with `display: contents` -->
|
||||
<div style="display: contents">
|
||||
<div id="childOfDisplayContents"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -82,6 +86,9 @@ test(() => { assert_equals(fixedContainedByRoot.scrollParent, document.scrolling
|
|||
"scrollParent of fixed element contained within root is document scrolling element.");
|
||||
test(() => { assert_equals(document.body.scrollParent, null); },
|
||||
"scrollParent of body is null.");
|
||||
|
||||
test(() => { assert_equals(document.documentElement.scrollParent, null); },
|
||||
"scrollParent of root is null.");
|
||||
test(() => { assert_equals(childOfDisplayContents.scrollParent, scroller1); },
|
||||
"scrollParent skips ancestors with `display: contents`.");
|
||||
</script>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue