Bug 1637963 - Fix clipping of iframes inside a nested stacking context. r=Bert
authorGlenn Watson <git@intuitionlibrary.com>
Wed, 20 May 2020 17:33:29 +0000
changeset 531311 25f50b4d346e7cc094440600dc6290237876a2f9
parent 531310 7050d098119c2dc261011291ffdf7a90318de3f0
child 531312 d13804ab92d300ad22d7bcf9ba59943835732601
push id37437
push usernerli@mozilla.com
push dateThu, 21 May 2020 02:34:41 +0000
treeherdermozilla-central@3d91ba9e1d25 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBert
bugs1637963
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1637963 - Fix clipping of iframes inside a nested stacking context. r=Bert Ensure that clips from an enclosing stacking context are correctly propagated to nested iframes, and add a regression test for this. Differential Revision: https://phabricator.services.mozilla.com/D76075
gfx/wr/webrender/src/scene_building.rs
gfx/wr/wrench/reftests/clip/iframe-nested-in-stacking-context-ref.yaml
gfx/wr/wrench/reftests/clip/iframe-nested-in-stacking-context.yaml
gfx/wr/wrench/reftests/clip/reftest.list
--- a/gfx/wr/webrender/src/scene_building.rs
+++ b/gfx/wr/webrender/src/scene_building.rs
@@ -805,17 +805,17 @@ impl<'a> SceneBuilder<'a> {
             ClipRegion::create_for_clip_node_with_local_clip(
                 &info.clip_rect,
                 &current_offset,
             ),
         );
 
         self.clip_store.push_clip_root(
             Some(ClipId::root(iframe_pipeline_id)),
-            false,
+            true,
         );
 
         let snap_to_device = &mut self.sc_stack.last_mut().unwrap().snap_to_device;
         snap_to_device.set_target_spatial_node(
             spatial_node_index,
             &self.spatial_tree,
         );
 
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/clip/iframe-nested-in-stacking-context-ref.yaml
@@ -0,0 +1,6 @@
+---
+root:
+  items:
+  - type: rect
+    bounds: [50, 50, 50, 100]
+    color: red
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/clip/iframe-nested-in-stacking-context.yaml
@@ -0,0 +1,23 @@
+# Ensure that a stacking context with a simple clip that encloses
+# an iframe correctly propagates the stacking context clip to the
+# clip on the iframe.
+---
+root:
+  items:
+  - type: clip
+    id: 2
+    bounds: [50, 50, 50, 100]
+  - type: stacking-context
+    bounds: [50, 50, 100, 100]
+    clip-node: 2
+    items:
+      - type: iframe
+        id: [1, 3]
+        bounds: [0, 0, 100, 100]
+pipelines:
+  -
+    id: [1, 3]
+    items:
+      - type: rect
+        color: red
+        bounds: [0, 0, 100, 100]
--- a/gfx/wr/wrench/reftests/clip/reftest.list
+++ b/gfx/wr/wrench/reftests/clip/reftest.list
@@ -10,8 +10,9 @@ fuzzy(8,60) == custom-clip-chains.yaml c
 platform(linux,mac) == segmentation-with-other-coordinate-system-clip.yaml segmentation-with-other-coordinate-system-clip.png
 == segmentation-across-rotation.yaml segmentation-across-rotation-ref.yaml
 skip_on(android,device) == color_targets(3) alpha_targets(1) stacking-context-clip.yaml stacking-context-clip-ref.yaml
 == snapping.yaml snapping-ref.yaml
 fuzzy(70,2400) == clip-and-filter-with-rotation.yaml clip-and-filter-with-rotation-ref.yaml
 color_targets(1) alpha_targets(0) == clip-out-rotation.yaml blank.yaml # Unexpected color targets, see bug 1580795
 == clipped-occlusion.yaml clipped-occlusion-ref.yaml
 == clip-empty-inner-rect.yaml clip-empty-inner-rect-ref.yaml
+== iframe-nested-in-stacking-context.yaml iframe-nested-in-stacking-context-ref.yaml