Bug 1013385 - Add some tests for checkerboarding. r=mattwoodrow, r=BenWa, a=bajaj
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 15 Sep 2014 16:10:14 -0400
changeset 224979 6d8a53b071f78b4c54ca34e4aeafd4e0f9e36b36
parent 224978 315cb80abb1e8064a93451ed7206fde0c9221135
child 224980 51f29a050e6346039689992d71a996031a2a552a
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, BenWa, bajaj
bugs1013385
milestone34.0a2
Bug 1013385 - Add some tests for checkerboarding. r=mattwoodrow, r=BenWa, a=bajaj
layout/reftests/async-scrolling/checkerboard-1-ref.html
layout/reftests/async-scrolling/checkerboard-1.html
layout/reftests/async-scrolling/checkerboard-2-ref.html
layout/reftests/async-scrolling/checkerboard-2.html
layout/reftests/async-scrolling/checkerboard-3-ref.html
layout/reftests/async-scrolling/checkerboard-3.html
layout/reftests/async-scrolling/reftest.list
new file mode 100644
--- /dev/null
+++ b/layout/reftests/async-scrolling/checkerboard-1-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE HTML>
+<html>
+<body style="background-color: green; overflow:hidden">
+  <div style="position:absolute; left: 0px; top: 0px; width: 100px; height: 200px; background-color: red"></div>
+</body>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/async-scrolling/checkerboard-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<html reftest-async-scroll
+      reftest-displayport-x="0" reftest-displayport-y="0"
+      reftest-displayport-w="800" reftest-displayport-h="2000"
+      reftest-async-scroll-x="0" reftest-async-scroll-y="1800">
+<!-- This is a simple test where we set the async-scroll position so that it
+     extends outside the displayport, and ensure that the checkerboarded area
+     is filled with the expected background color. -->
+<body style="background-color: green; height: 5000px; overflow:hidden">
+  <div style="position:absolute; left: 0px; top: 1800px; width: 100px; height: 400px; background-color: red"></div>
+</body>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/async-scrolling/checkerboard-2-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body style="background-color: green; overflow:hidden">
+  <div style="position:absolute; left: 0px; top: 0px; background-color: yellow; width: 100px; height: 200px"></div>
+  <div style="position:fixed; left: 10px; top: 10px; width: 10px; height: 10px; background-color: blue"></div>
+</body>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/async-scrolling/checkerboard-2.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html reftest-async-scroll
+      reftest-displayport-x="0" reftest-displayport-y="0"
+      reftest-displayport-w="800" reftest-displayport-h="2000"
+      reftest-async-scroll-x="0" reftest-async-scroll-y="1800">
+<!-- This is a test where we set the async-scroll position so that it
+     extends outside the displayport, but also have some fixed-position
+     elements in the mix. In particular, the purple element is below
+     (in z-order) the main scrolling content and should not be made visible
+     while checkerboarding; the checkerboarding code should cover it up
+     with the appropriate background color. -->
+<body style="background-color: green; height: 5000px; overflow:hidden">
+  <div style="position:fixed; left: 0px; top: 0px; width: 100px; height: 500px; background-color: purple; z-index: -1"></div>
+  <div style="position:absolute; left: 0px; top: 500px; background-color: yellow; width: 100px; height: 4500px"></div>
+  <div style="position:fixed; left: 10px; top: 10px; width: 10px; height: 10px; background-color: blue"></div>
+</body>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/async-scrolling/checkerboard-3-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE HTML>
+<html>
+<body style="background-color: green; overflow:hidden">
+  <div style="position:fixed; left: 10px; top: 10px; width: 10px; height: 10px; background-color: blue"></div>
+</body>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/async-scrolling/checkerboard-3.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<html reftest-async-scroll
+      reftest-displayport-x="0" reftest-displayport-y="0"
+      reftest-displayport-w="800" reftest-displayport-h="2000"
+      reftest-async-scroll-x="0" reftest-async-scroll-y="2100">
+<!-- This is the exact same test as checkerboard-2.html, but we put
+     the scroll position entirely outside of the displayport. This ensures
+     that even we do the proper checkerboarding even if the layer would
+     otherwise be culled out in the compositor because it is not on-screen. -->
+<body style="background-color: green; height: 5000px; overflow:hidden">
+  <div style="position:fixed; left: 0px; top: 0px; width: 100px; height: 500px; background-color: purple; z-index: -1"></div>
+  <div style="position:absolute; left: 0px; top: 500px; background-color: yellow; width: 100px; height: 4500px"></div>
+  <div style="position:fixed; left: 10px; top: 10px; width: 10px; height: 10px; background-color: blue"></div>
+</body>
--- a/layout/reftests/async-scrolling/reftest.list
+++ b/layout/reftests/async-scrolling/reftest.list
@@ -21,8 +21,17 @@ pref(layout.async-containerless-scrollin
 pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
 pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == element-1.html element-1-ref.html
 pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-1.html position-fixed-1-ref.html
 pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-2.html position-fixed-2-ref.html
 pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-cover-1.html position-fixed-cover-1-ref.html
 pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-cover-2.html position-fixed-cover-2-ref.html
 pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-cover-3.html position-fixed-cover-3-ref.html
 
+# for the following tests, we want to disable the low-precision buffer
+# as it will expand the displayport beyond what the test specifies in
+# its reftest-displayport attributes, and interfere with where we expect
+# checkerboarding to occur
+default-preferences pref(layers.low-precision-buffer,false)
+skip-if(!asyncPanZoom) == checkerboard-1.html checkerboard-1-ref.html
+skip-if(!asyncPanZoom) == checkerboard-2.html checkerboard-2-ref.html
+skip-if(!asyncPanZoom) == checkerboard-3.html checkerboard-3-ref.html
+default-preferences