Bug 1519441 - WR fix scroll frame rectangle r=gw
authorDzmitry Malyshau <dmalyshau@mozilla.com>
Wed, 16 Jan 2019 14:49:59 +0000
changeset 514078 078e5984f999de05c3987fd04679b8703a042cb3
parent 514077 987910383af00b26d557da874c16d039fba18da5
child 514079 400434070f20f902659434c8e7d437f800613e35
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1519441
milestone66.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 1519441 - WR fix scroll frame rectangle r=gw This is a follow-up fix to https://github.com/servo/webrender/pull/3251 Accidentally, the reference frame relative offset was applied twice. Differential Revision: https://phabricator.services.mozilla.com/D16658
gfx/wr/webrender/src/display_list_flattener.rs
gfx/wr/wrench/reftests/scrolling/reftest.list
gfx/wr/wrench/reftests/scrolling/viewport-offset-ref.yaml
gfx/wr/wrench/reftests/scrolling/viewport-offset.yaml
--- a/gfx/wr/webrender/src/display_list_flattener.rs
+++ b/gfx/wr/webrender/src/display_list_flattener.rs
@@ -561,17 +561,17 @@ impl<'a> DisplayListFlattener<'a> {
             complex_clips,
             info.image_mask,
             reference_frame_relative_offset,
         );
         // Just use clip rectangle as the frame rect for this scroll frame.
         // This is useful when calculating scroll extents for the
         // SpatialNode::scroll(..) API as well as for properly setting sticky
         // positioning offsets.
-        let frame_rect = clip_region.main.translate(reference_frame_relative_offset);
+        let frame_rect = clip_region.main;
         let content_size = item.rect().size;
 
         self.add_clip_node(info.clip_id, item.space_and_clip_info(), clip_region);
 
         self.add_scroll_frame(
             info.scroll_frame_id,
             parent_node_index,
             info.external_id,
--- a/gfx/wr/wrench/reftests/scrolling/reftest.list
+++ b/gfx/wr/wrench/reftests/scrolling/reftest.list
@@ -11,8 +11,9 @@
 == translate-nested.yaml translate-nested-ref.yaml
 == sticky.yaml sticky-ref.yaml
 == sticky-nested.yaml sticky-ref.yaml
 == sticky-applied.yaml sticky-applied-ref.yaml
 == sticky-transformed.yaml sticky-transformed-ref.yaml
 == sibling-hidden-clip.yaml sibling-hidden-clip-ref.yaml
 == scale-offsets.yaml scale-offsets-ref.yaml
 == nested-stickys.yaml nested-stickys-ref.yaml
+== viewport-offset.yaml viewport-offset-ref.yaml
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/scrolling/viewport-offset-ref.yaml
@@ -0,0 +1,9 @@
+---
+root:
+  items:
+    - type: stacking-context
+      bounds: 0 0 0 0
+      items:
+        - type: rect
+          color: red
+          bounds: 0 100 1000 50
new file mode 100644
--- /dev/null
+++ b/gfx/wr/wrench/reftests/scrolling/viewport-offset.yaml
@@ -0,0 +1,20 @@
+# The test assures that the viewport offset is correctly getting
+# the reference_frame_relative_offset applied when flattening
+# a scroll frame.
+---
+root:
+  items:
+    - type: stacking-context
+      bounds: 0 100 0 0
+      items:
+        - type: scroll-frame
+          bounds: 0 0 1000 1000
+          items:
+            - type: sticky-frame
+              bounds: 0 -50 1000 50
+              margin-top: -50
+              vertical-offset-bounds: [0, 2000]
+              items:
+                 - type: rect
+                   bounds: 0 -50 1000 100
+                   color: red