diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 981fc49e09f..f76ee24b039 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -797,7 +797,12 @@ impl IOCompositor { pipeline_id: PipelineId, scroll_root_id: ScrollRootId, point: Point2D) { - let id = ClipId::new(scroll_root_id.0 as u64, pipeline_id.to_webrender()); + let id = if scroll_root_id.0 == 0 { + ClipId::root_scroll_node(pipeline_id.to_webrender()) + } else { + ClipId::new(scroll_root_id.0 as u64, pipeline_id.to_webrender()) + }; + self.webrender_api.scroll_node_with_id(LayoutPoint::from_untyped(&point), id); } diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 817747e4869..2f69c026a5d 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -6485,6 +6485,18 @@ {} ] ], + "mozilla/scroll_root.html": [ + [ + "/_mozilla/mozilla/scroll_root.html", + [ + [ + "/_mozilla/mozilla/scroll_root_ref.html", + "==" + ] + ], + {} + ] + ], "mozilla/scrolling_div_background_borders.html": [ [ "/_mozilla/mozilla/scrolling_div_background_borders.html", @@ -11007,6 +11019,11 @@ {} ] ], + "mozilla/scroll_root_ref.html": [ + [ + {} + ] + ], "mozilla/scrolling_div_background_borders_background.png": [ [ {} @@ -31289,6 +31306,14 @@ "b9917be5fed364dbc46264f641f54f275b5c054a", "testharness" ], + "mozilla/scroll_root.html": [ + "21c447dd041a77fb54e2b28c8b76de684afb9560", + "reftest" + ], + "mozilla/scroll_root_ref.html": [ + "ce75eb73232617c77309aca879ba8d34461538a6", + "support" + ], "mozilla/scroll_top_null_target.html": [ "8e419c3f33fba1bc1444cf4c6dd3e5977f6fd841", "testharness" diff --git a/tests/wpt/mozilla/tests/mozilla/scroll_root.html b/tests/wpt/mozilla/tests/mozilla/scroll_root.html new file mode 100644 index 00000000000..b1a9cb590b0 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/scroll_root.html @@ -0,0 +1,17 @@ + + + + + Verify that scrolling the root does actually do a visual scroll + + + + +
+
+ + diff --git a/tests/wpt/mozilla/tests/mozilla/scroll_root_ref.html b/tests/wpt/mozilla/tests/mozilla/scroll_root_ref.html new file mode 100644 index 00000000000..6503ad5d526 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/scroll_root_ref.html @@ -0,0 +1,11 @@ + + + + + + +