Fix fixed position items with parents with CSS clips

In order to properly handle CSS clipping, we need to keep track of what
the different kinds of clips that we have. On one hand, clipping due to
overflow rules should respect the containing block hierarchy, while CSS
clipping should respect the flow tree hierarchy. In order to represent
the complexity of items that are scrolled via one clip/scroll frame and
clipped by another we keep track of that status with a
ClipAndScrollInfo.
This commit is contained in:
Martin Robinson 2017-07-27 11:25:59 +02:00
parent 46f6e68bad
commit daf638bc3f
11 changed files with 214 additions and 106 deletions

View file

@ -1583,6 +1583,18 @@
{}
]
],
"css/fixed_position_css_clip.html": [
[
"/_mozilla/css/fixed_position_css_clip.html",
[
[
"/_mozilla/css/fixed_position_css_clip_ref.html",
"=="
]
],
{}
]
],
"css/fixed_width_overrides_child_intrinsic_width_a.html": [
[
"/_mozilla/css/fixed_width_overrides_child_intrinsic_width_a.html",
@ -8179,6 +8191,11 @@
{}
]
],
"css/fixed_position_css_clip_ref.html": [
[
{}
]
],
"css/fixed_width_overrides_child_intrinsic_width_ref.html": [
[
{}
@ -23064,6 +23081,14 @@
"fe23d2dc9a4507b3b632518a53f21900d0e4d1d7",
"support"
],
"css/fixed_position_css_clip.html": [
"2bf1fb572a72fbb4a7a35b8c8b08960b48ccf408",
"reftest"
],
"css/fixed_position_css_clip_ref.html": [
"ad0341fc9f843177ccf53a1667b5016c234b7651",
"support"
],
"css/fixed_width_overrides_child_intrinsic_width_a.html": [
"88cf78524712525ad4252c8a420c9b9f545b2621",
"reftest"

View file

@ -0,0 +1,40 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Fixed position elements should be clipped by parent CSS clips</title>
<link rel="match" href="fixed_position_css_clip_ref.html">
<style>
body {
margin: 0px;
}
#base {
position: absolute;
left; 0px;
top: 0px;
background: red;
width: 100px;
height: 100px;
clip: rect(0, auto, auto, 0);
}
#fixed {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: green;
}
</style>
</head>
<body>
<div id="base">
<!-- Even though this fixed position child is positioned and clipped by the
containing block, it should also be clipped by the CSS clip of its
non-containing block parent. -->
<div id="fixed"></div>
</div>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Fixed position elements should be clipped by parent CSS clips</title>
<style>
body {
margin: 0px;
}
#box {
left; 0px;
top: 0px;
background: green;
width: 100px;
height: 100px;
clip: rect(0, auto, auto, 0);
}
</style>
</head>
<body>
<div id="box">
</body>
</html>