Skip to content

Commit fd79b59

Browse files
Loirooriolservo-wpt-sync
authored andcommitted
layout: Fix scrollParent to skip ancestors with display: contents
When encounterign such an ancestor, we were returning null instead of skipping it. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
1 parent bc1c54d commit fd79b59

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

css/cssom-view/scrollParent.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
<div id="hidden" class="hidden">
5858
<div id="childOfHidden"></div>
5959
</div>
60+
<!-- No box with `display: contents` -->
61+
<div style="display: contents">
62+
<div id="childOfDisplayContents"></div>
63+
</div>
6064
</div>
6165
</div>
6266
</div>
@@ -82,6 +86,9 @@
8286
"scrollParent of fixed element contained within root is document scrolling element.");
8387
test(() => { assert_equals(document.body.scrollParent, null); },
8488
"scrollParent of body is null.");
85-
89+
test(() => { assert_equals(document.documentElement.scrollParent, null); },
90+
"scrollParent of root is null.");
91+
test(() => { assert_equals(childOfDisplayContents.scrollParent, scroller1); },
92+
"scrollParent skips ancestors with `display: contents`.");
8693
</script>
8794
</html>

0 commit comments

Comments
 (0)