Don't promote all scrollable regions to stacking contexts

Instead annotate all flows with their owning ScrollRoots. When
processing the display list items into a flattened display list, we add
PushScrollRoot and PopScrollRoot to signal when scrolling regions start
and end. It is possible for content from different scrolling regions to
intersect and when they do, the stack of scrolling regions is
duplicated.  When these duplicated scrolling regions stacks reach
WebRender, it will scroll them in tandem.

The PushScrollRoot and PopScrollRoot items are currently represented as
StackingContexts in WebRender, but eventually these will be replaced
with special WebRender display items.

Fixes #13529.
Fixed #13298.
This commit is contained in:
Martin Robinson 2016-10-31 20:24:27 +01:00
parent f7875dad1a
commit ef82d772c1
15 changed files with 436 additions and 163 deletions

View file

@ -1,4 +0,0 @@
[abspos-overflow-010.htm]
type: reftest
expected:
if os == "linux": FAIL

View file

@ -1,3 +0,0 @@
[abspos-overflow-011.htm]
type: reftest
expected: FAIL

View file

@ -1,3 +0,0 @@
[max-width-106.htm]
type: reftest
expected: FAIL

View file

@ -5016,6 +5016,30 @@
"url": "/_mozilla/css/stacking_context_rtl.html"
}
],
"css/stacking_order_overflow_auto.html": [
{
"path": "css/stacking_order_overflow_auto.html",
"references": [
[
"/_mozilla/css/stacking_order_ref.html",
"=="
]
],
"url": "/_mozilla/css/stacking_order_overflow_auto.html"
}
],
"css/stacking_order_overflow_scroll.html": [
{
"path": "css/stacking_order_overflow_scroll.html",
"references": [
[
"/_mozilla/css/stacking_order_ref.html",
"=="
]
],
"url": "/_mozilla/css/stacking_order_overflow_scroll.html"
}
],
"css/style_is_in_doc.html": [
{
"path": "css/style_is_in_doc.html",
@ -19854,6 +19878,30 @@
"url": "/_mozilla/css/stacking_context_rtl.html"
}
],
"css/stacking_order_overflow_auto.html": [
{
"path": "css/stacking_order_overflow_auto.html",
"references": [
[
"/_mozilla/css/stacking_order_ref.html",
"=="
]
],
"url": "/_mozilla/css/stacking_order_overflow_auto.html"
}
],
"css/stacking_order_overflow_scroll.html": [
{
"path": "css/stacking_order_overflow_scroll.html",
"references": [
[
"/_mozilla/css/stacking_order_ref.html",
"=="
]
],
"url": "/_mozilla/css/stacking_order_overflow_scroll.html"
}
],
"css/style_is_in_doc.html": [
{
"path": "css/style_is_in_doc.html",

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The position:absolute element should be on top of the overflow:auto element</title>
<link rel='match' href='stacking_order_ref.html'>
<style>
body {
margin: 0;
}
.scrollbox {
margin: 50px;
width: 50px;
height: 50px;
overflow: auto;
background: red;
}
.overlay {
position: absolute;
left: 50px;
top: 50px;
width: 50px;
height: 50px;
background: green;
}
</style>
<div class="overlay"></div>
<div class="scrollbox"></div>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The position:absolute element should be on top of the overflow:scroll element</title>
<link rel='match' href='stacking_order_ref.html'>
<style>
body {
margin: 0;
}
.scrollbox {
margin: 50px;
width: 50px;
height: 50px;
overflow: scroll;
background: red;
}
.overlay {
position: absolute;
left: 50px;
top: 50px;
width: 50px;
height: 50px;
background: green;
}
</style>
<div class="overlay"></div>
<div class="scrollbox"></div>

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
body {
margin: 0;
}
.box {
position: absolute;
left: 50px;
top: 50px;
width: 50px;
height: 50px;
background: green;
}
</style>
<div class="box"></div>