Add a reftest (bug 1409871, r=mstange)
authorRyan Hunt <rhunt@eqrion.net>
Sun, 05 Nov 2017 10:05:14 -0600
changeset 696778 1c6cf35925b7b17064864f115dc60ee4912aed19
parent 696777 dcb005c6e64be8d53898a4a98f3610691ed676ca
child 696779 bb800ceaeb3acdbfa9e2ff4ebd46d40b7851c22f
push id88784
push usercholler@mozilla.com
push dateSat, 11 Nov 2017 10:21:53 +0000
reviewersmstange
bugs1409871
milestone58.0a1
Add a reftest (bug 1409871, r=mstange) MozReview-Commit-ID: 9UxLeFGZW8E
layout/reftests/layers/component-alpha-enter-1-ref.html
layout/reftests/layers/component-alpha-enter-1.html
layout/reftests/layers/reftest.list
new file mode 100644
--- /dev/null
+++ b/layout/reftests/layers/component-alpha-enter-1-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<title>Test transition from single-alpha layer to component-alpha layer from a display port size change</title>
+<script type="text/javascript">
+  document.addEventListener('MozReftestInvalidate', function() {
+    var scrollbox = document.getElementById('scrollbox');
+    scrollbox.scrollTop = 1000;
+    document.documentElement.className = '';
+  });
+</script>
+<style>
+#scrollbox {
+  margin: 20px;
+  width: 300px;
+  height: 400px;
+  overflow-y: scroll;
+  background: linear-gradient(#FFF, #FFF);
+}
+
+#inner {
+  background-color: #000;
+  margin-top: 10px;
+  height: 5px;
+  line-height: 5px;
+  padding-bottom: 400px;
+}
+</style>
+
+<div id="scrollbox">
+  <div id="inner">
+    Text
+  </div>
+</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/layers/component-alpha-enter-1.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<title>Test transition from single-alpha layer to component-alpha layer from a display port size change</title>
+<script type="text/javascript">
+  document.addEventListener('MozReftestInvalidate', function() {
+    var scrollbox = document.getElementById('scrollbox');
+    scrollbox.scrollTop = 1000;
+
+    window.addEventListener("MozAfterPaint", function() {
+      // Remove dummy to make scrollbox the first scroll element giving it a
+      // display port. The display port will then contain the text forcing the
+      // layer to transition to component alpha.
+      document.getElementById('dummy').remove();
+      document.documentElement.className = '';
+    }, {once: true});
+  });
+</script>
+<style>
+#dummy {
+  margin: 20px;
+  width: 300px;
+  height: 400px;
+  overflow: scroll;
+}
+
+#filler {
+  height: 600px;
+}
+
+#scrollbox {
+  margin: 20px;
+  width: 300px;
+  height: 400px;
+  overflow-y: scroll;
+  background: linear-gradient(#FFF, #FFF);
+}
+
+#inner {
+  background-color: #000;
+  margin-top: 10px;
+  height: 5px;
+  line-height: 5px;
+  padding-bottom: 400px;
+}
+</style>
+
+<div id="dummy">
+  <div id="filler">
+  </div>
+</div>
+
+<div id="scrollbox">
+  <div id="inner">
+    Text
+  </div>
+</div>
--- a/layout/reftests/layers/reftest.list
+++ b/layout/reftests/layers/reftest.list
@@ -1,10 +1,11 @@
 == move-to-background-1.html move-to-background-1-ref.html
 fuzzy-if(cocoaWidget,2,6) random-if(Android) == component-alpha-exit-1.html component-alpha-exit-1-ref.html # bug 760275
+fuzzy-if(cocoaWidget,2,6) random-if(Android) == component-alpha-enter-1.html component-alpha-enter-1-ref.html
 
 != pull-background-1.html about:blank
 skip-if(styloVsGecko) != pull-background-2.html about:blank # skip styloVsGecko for imperceptible pixel rounding differences between Stylo and Gecko
 != pull-background-3.html about:blank
 != pull-background-4.html about:blank
 fuzzy-if(styloVsGecko,1,1) != pull-background-5.html about:blank
 != pull-background-6.html about:blank