From 24c35a21858aac6ca23dcd775376ce07fc06fa50 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 13 Nov 2015 20:17:58 -0700 Subject: [PATCH] Draw layers that are under sub-displaylists. Fixes #8325 --- components/gfx/paint_task.rs | 41 +++++++++++++++---- tests/wpt/mozilla/meta/MANIFEST.json | 26 +++++++++++- .../tests/css/transform_scroll_layer.html | 12 ++++++ .../tests/css/transform_scroll_layer_ref.html | 5 +++ 4 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 tests/wpt/mozilla/tests/css/transform_scroll_layer.html create mode 100644 tests/wpt/mozilla/tests/css/transform_scroll_layer_ref.html diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 926aa2fe123..a44e1bd4d54 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -474,15 +474,38 @@ impl PaintTask where C: PaintListener + Send + 'static { perspective, parent_id)); - if let PaintLayerContents::StackingContext(ref context) = paint_layer.contents { - // When there is a new layer, the transforms and origin are handled by the compositor, - // so the new transform and perspective matrices are just the identity. - continue_walking_stacking_context(properties, - &context, - &paint_layer.origin_for_child_layers(), - &Matrix4::identity(), - &Matrix4::identity(), - Some(paint_layer.id)); + match paint_layer.contents { + PaintLayerContents::StackingContext(ref context) => { + // When there is a new layer, the transforms and origin are handled by the compositor, + // so the new transform and perspective matrices are just the identity. + continue_walking_stacking_context(properties, + &context, + &paint_layer.origin_for_child_layers(), + &Matrix4::identity(), + &Matrix4::identity(), + Some(paint_layer.id)); + }, + PaintLayerContents::DisplayList(ref display_list) => { + for kid in display_list.positioned_content.iter() { + if let &DisplayItem::StackingContextClass(ref stacking_context) = kid { + build_from_stacking_context(properties, + &stacking_context, + &parent_origin, + &transform, + &perspective, + parent_id) + + } + } + for kid in display_list.layered_children.iter() { + build_from_paint_layer(properties, + &kid, + &parent_origin, + &transform, + &perspective, + parent_id) + } + }, } } diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 40aabbdb3f6..2dd0440ad73 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -4023,6 +4023,18 @@ "url": "/_mozilla/css/transform_optimization.html" } ], + "css/transform_scroll_layer.html": [ + { + "path": "css/transform_scroll_layer.html", + "references": [ + [ + "/_mozilla/css/transform_scroll_layer_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/transform_scroll_layer.html" + } + ], "css/transform_simple_a.html": [ { "path": "css/transform_simple_a.html", @@ -9202,6 +9214,18 @@ "url": "/_mozilla/css/transform_optimization.html" } ], + "css/transform_scroll_layer.html": [ + { + "path": "css/transform_scroll_layer.html", + "references": [ + [ + "/_mozilla/css/transform_scroll_layer_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/transform_scroll_layer.html" + } + ], "css/transform_simple_a.html": [ { "path": "css/transform_simple_a.html", @@ -9772,4 +9796,4 @@ "rev": null, "url_base": "/_mozilla/", "version": 2 -} +} \ No newline at end of file diff --git a/tests/wpt/mozilla/tests/css/transform_scroll_layer.html b/tests/wpt/mozilla/tests/css/transform_scroll_layer.html new file mode 100644 index 00000000000..a48d8fe749e --- /dev/null +++ b/tests/wpt/mozilla/tests/css/transform_scroll_layer.html @@ -0,0 +1,12 @@ + + + + +
+
+
+
+
+
+
+
diff --git a/tests/wpt/mozilla/tests/css/transform_scroll_layer_ref.html b/tests/wpt/mozilla/tests/css/transform_scroll_layer_ref.html new file mode 100644 index 00000000000..44953c3e7e2 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/transform_scroll_layer_ref.html @@ -0,0 +1,5 @@ + +
+
+
+