aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/gfx/paint_task.rs2
-rw-r--r--components/layout/display_list_builder.rs10
-rw-r--r--components/layout/fragment.rs4
-rw-r--r--tests/ref/basic.list2
-rw-r--r--tests/ref/blur_a.html21
-rw-r--r--tests/ref/blur_ref.html1
-rw-r--r--tests/wpt/metadata-css/css21_dev/html4/margin-collapse-004.htm.ini3
-rw-r--r--tests/wpt/metadata-css/css21_dev/html4/min-height-106.htm.ini3
8 files changed, 27 insertions, 19 deletions
diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs
index 43ca598c38a..6fd677495ae 100644
--- a/components/gfx/paint_task.rs
+++ b/components/gfx/paint_task.rs
@@ -382,7 +382,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send + 'static {
// When there is a new layer, the transforms and origin
// are handled by the compositor.
(Some(paint_layer.id),
- Point2D::zero(),
+ -stacking_context.overflow.origin,
Matrix4::identity(),
Matrix4::identity())
}
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index f7dde7598f8..0485d549c4a 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -1148,9 +1148,6 @@ impl FragmentDisplayListBuilding for Fragment {
layer: StackingContextLayer,
mode: StackingContextCreationMode)
-> Arc<StackingContext> {
- // FIXME(pcwalton): Is this vertical-writing-direction-safe?
- let margin = self.margin.to_physical(base_flow.writing_mode);
-
let border_box = match mode {
StackingContextCreationMode::Normal |
StackingContextCreationMode::OuterScrollWrapper => {
@@ -1167,7 +1164,12 @@ impl FragmentDisplayListBuilding for Fragment {
};
let overflow = match mode {
StackingContextCreationMode::Normal => {
- base_flow.overflow.translate(&-Point2D::new(margin.left, Au(0)))
+ // First, compute the offset of our border box (including relative positioning)
+ // from our flow origin, since that is what `BaseFlow::overflow` is relative to.
+ let border_box_offset =
+ border_box.translate(&-base_flow.stacking_relative_position).origin;
+ // Then, using that, compute our overflow region relative to our border box.
+ base_flow.overflow.translate(&-border_box_offset)
}
StackingContextCreationMode::InnerScrollWrapper |
StackingContextCreationMode::OuterScrollWrapper => {
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 8bf88afc701..02af5569d84 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -2060,8 +2060,8 @@ impl Fragment {
// the time. Can't we handle relative positioning by just adjusting `border_box`?
let relative_position =
self.relative_position(&LogicalSize::zero(self.style.writing_mode));
- border_box =
- border_box.translate_by_size(&relative_position.to_physical(self.style.writing_mode));
+ border_box = border_box.translate_by_size(&relative_position.to_physical(
+ self.style.writing_mode));
let mut overflow = border_box;
// Box shadows cause us to draw outside our border box.
diff --git a/tests/ref/basic.list b/tests/ref/basic.list
index fb1d1867ab4..750dc6d1622 100644
--- a/tests/ref/basic.list
+++ b/tests/ref/basic.list
@@ -54,7 +54,7 @@ flaky_cpu == append_style_a.html append_style_b.html
!= block_image.html noteq_500x300_white.html
== block_replaced_content_a.html block_replaced_content_ref.html
== block_replaced_content_b.html block_replaced_content_ref.html
-== blur_a.html blur_ref.html
+!= blur_a.html blur_ref.html
!= border_black_groove.html border_black_solid.html
!= border_black_ridge.html border_black_groove.html
!= border_black_ridge.html border_black_solid.html
diff --git a/tests/ref/blur_a.html b/tests/ref/blur_a.html
index 937b21445af..8a589b52b80 100644
--- a/tests/ref/blur_a.html
+++ b/tests/ref/blur_a.html
@@ -6,24 +6,35 @@ div {
width: 200px;
height: 200px;
background: green;
+ position: relative;
}
.ex {
- position: relative;
- width: 40px; height: 40px;
- border-style: solid;
- border-color: black;
- top: 50px; left: 50px;
+ position: absolute;
+ width: 80px; height: 80px;
+ background: blue;
+ top: 60px; left: 60px;
-webkit-filter: blur(30px);
-moz-filter: blur(30px);
filter: blur(30px);
}
+.coveritup {
+ position: absolute;
+ background: green;
+ top: 60px;
+ left: 60px;
+ width: 80px;
+ height: 80px;
+ transform: translateX(0px); /* force stacking context */
+}
+
</style>
</head>
<body>
<div>
<div class="ex"></div>
+ <div class="coveritup"></div>
</div>
</body>
</html>
diff --git a/tests/ref/blur_ref.html b/tests/ref/blur_ref.html
index 1f1996f785f..45795a610c0 100644
--- a/tests/ref/blur_ref.html
+++ b/tests/ref/blur_ref.html
@@ -6,6 +6,7 @@ div {
width: 200px;
height: 200px;
background: green;
+ position: relative;
}
</style>
diff --git a/tests/wpt/metadata-css/css21_dev/html4/margin-collapse-004.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/margin-collapse-004.htm.ini
deleted file mode 100644
index 3f42fbbb4e7..00000000000
--- a/tests/wpt/metadata-css/css21_dev/html4/margin-collapse-004.htm.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[margin-collapse-004.htm]
- type: reftest
- expected: FAIL
diff --git a/tests/wpt/metadata-css/css21_dev/html4/min-height-106.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/min-height-106.htm.ini
deleted file mode 100644
index 83bdbfdf497..00000000000
--- a/tests/wpt/metadata-css/css21_dev/html4/min-height-106.htm.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[min-height-106.htm]
- type: reftest
- expected: FAIL