mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
layout: Do not include position:fixed
children when calculating scrollable overflow for root element (#38618)
Reimplementation of: #35931 For a `FragmentTree` we define a scrollable overflow calculation that includes the overflow all of it's children `Fragments`. In practice we are using this calculation for scrolling area of the viewport and defining the root scroll frames. However, since uncontained fixed positioned element is located outside of the document and should not be scrolled, and therefore it would make no sense to include them in the calculation of its scrollable overflow as well. Testing: New and existing WPT tests Fixes: #38617 Fixes: #38182 --------- Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
This commit is contained in:
parent
7dcd89a6f9
commit
7489a0349f
4 changed files with 58 additions and 5 deletions
7
tests/wpt/meta/MANIFEST.json
vendored
7
tests/wpt/meta/MANIFEST.json
vendored
|
@ -607585,6 +607585,13 @@
|
|||
}
|
||||
]
|
||||
],
|
||||
"scrollable-overflow-fixed-positioned-initial-containing-block.html": [
|
||||
"10f115a012a85230a4641a1d793c0a6df0db2e78",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
]
|
||||
],
|
||||
"scrollable-overflow-float.html": [
|
||||
"f75c0a66cfffdfe9872c6e472966ee3cf639eae6",
|
||||
[
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
[clip-path-fixed-scroll.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Scrollable overflow of Document element with 'position: fixed' which has ICB as containing block</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-overflow/#scrollable">
|
||||
<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth">
|
||||
<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollheight">
|
||||
<link rel="author" title="Jo Steven Novaryo" href="mailto:jo.steven.novaryo@huawei.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
<script>
|
||||
promise_test(async (t) => {
|
||||
let initialScrollHeight = document.scrollingElement.scrollHeight;
|
||||
let initialScrollWidth = document.scrollingElement.scrollWidth;
|
||||
|
||||
let fixedDiv = document.createElement("div");
|
||||
fixedDiv.style.position = "fixed";
|
||||
fixedDiv.style.height = (initialScrollHeight * 2) + "px";
|
||||
fixedDiv.style.width = (initialScrollWidth * 2) + "px";
|
||||
document.body.appendChild(fixedDiv);
|
||||
|
||||
assert_equals(document.scrollingElement.scrollHeight, initialScrollHeight);
|
||||
assert_equals(document.scrollingElement.scrollWidth, initialScrollWidth);
|
||||
|
||||
}, "position: fixed fixed with ICB as CB should not affect scrollable overflow of Document element.");
|
||||
</script>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue