Bug 1010538 - Part 4 - Tests. r=mstange
authorKearwood (Kip) Gilbert <kgilbert@mozilla.com>
Mon, 15 Sep 2014 15:54:40 -0700
changeset 227594 92cd29a4e132ab57eb900005fdf700229a71b8ba
parent 227593 5e6ced1dbccec591bc474a08431b24c2d554bab1
child 227595 1c3fcc7507fcb99399e8feced99173cfa110c186
push id7326
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:58:42 +0000
treeherdermozilla-aurora@d3a3b2a0f2f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1010538
milestone36.0a1
Bug 1010538 - Part 4 - Tests. r=mstange scroll-behavior-1.html - Viewport Scrolling, expected to be smooth: - DOM Method not specifying scroll-behavior, for <body> tag with 'scroll-behavior: smooth’ scroll-behavior-2.html - Div Scrolling, expected to be smooth: - DOM Method not specifying scroll-behavior, for <div> tag with 'scroll-behavior: smooth’ - DOM Method specifying ‘auto’ scroll-behavior, for <div> tag with ‘scroll-behavior: smooth’ - DOM Method specifying 'smooth’ scroll-behavior, for <div> tag with ‘scroll-behavior: smooth’ - DOM Method specifying ‘smooth’ scroll-behavior, for <div> tag with ‘scroll-behavior: instant’ - DOM Method specifying ‘smooth’ scroll-behavior, for <div> tag with ‘scroll-behavior: auto’ - DOM Method specifying ‘smooth’ scroll-behavior, for <div> tag with no scroll-behavior attribute. scroll-behavior-3.html - Div Scrolling, expected to be instant: - DOM Method not specifying scroll-behavior, for <div> tag with ‘scroll-behavior: instant’ - DOM Method not specifying scroll-behavior, for <div> tag with ‘scroll-behavior: auto’ - DOM Method not specifying scroll-behavior, for <div> tag with no scroll-behavior attribute. - DOM Method specifying ‘instant’ scroll-behavior, for <div> tag with ‘scroll-behavior: smooth’ - DOM Method specifying ‘instant’ scroll-behavior, for <div> tag with ‘scroll-behavior: instant’ - DOM Method specifying ‘instant’ scroll-behavior, for <div> tag with ‘scroll-behavior: auto’ - DOM Method specifying ‘instant’ scroll-behavior, for <div> tag with no scroll-behavior attribute. - DOM Method specifying ‘auto’ scroll-behavior, for <div> tag with ‘scroll-behavior: instant’ - DOM Method specifying ‘auto’ scroll-behavior, for <div> tag with ‘scroll-behavior: auto’ - DOM Method specifying ‘auto’ scroll-behavior, for <div> tag with no scroll-behavior attribute.
layout/reftests/scrolling/reftest.list
layout/reftests/scrolling/scroll-behavior-1.html
layout/reftests/scrolling/scroll-behavior-2.html
layout/reftests/scrolling/scroll-behavior-3.html
--- a/layout/reftests/scrolling/reftest.list
+++ b/layout/reftests/scrolling/reftest.list
@@ -4,16 +4,19 @@ HTTP == fixed-1.html fixed-1.html?ref
 HTTP == fixed-opacity-1.html fixed-opacity-1.html?ref
 skip-if(B2G) HTTP == fixed-opacity-2.html fixed-opacity-2.html?ref
 skip-if(B2G) random-if(gtk2Widget) fuzzy-if(Android,3,60) HTTP == fixed-text-1.html fixed-text-1.html?ref
 HTTP == fixed-text-2.html fixed-text-2.html?ref
 random-if(Android&&!browserIsRemote) skip-if(B2G&&browserIsRemote) == iframe-border-radius.html iframe-border-radius-ref.html # bug 760269
 random-if(Android) HTTP == image-1.html image-1.html?ref
 random-if(Android&&!browserIsRemote) HTTP == opacity-mixed-scrolling-1.html opacity-mixed-scrolling-1.html?ref # bug 760269
 skip-if(B2G) random-if(cocoaWidget) HTTP == opacity-mixed-scrolling-2.html opacity-mixed-scrolling-2.html?ref # see bug 625357
+skip-if(Android) pref(layout.css.scroll-behavior.enabled,true) pref(layout.css.scroll-behavior.property-enabled,true) == scroll-behavior-1.html scroll-behavior-1.html?ref # see bug 1041833
+skip-if(Android) pref(layout.css.scroll-behavior.enabled,true) pref(layout.css.scroll-behavior.property-enabled,true) == scroll-behavior-2.html scroll-behavior-2.html?ref # see bug 1041833
+skip-if(Android) pref(layout.css.scroll-behavior.enabled,true) pref(layout.css.scroll-behavior.property-enabled,true) == scroll-behavior-3.html scroll-behavior-3.html?ref # see bug 1041833
 skip-if(B2G&&browserIsRemote) HTTP == simple-1.html simple-1.html?ref
 skip-if(B2G) HTTP == subpixel-1.html#d subpixel-1-ref.html#d
 fuzzy-if(Android,4,120) HTTP == text-1.html text-1.html?ref
 fuzzy-if(Android,4,120) HTTP == text-2.html?up text-2.html?ref
 skip-if(B2G) fuzzy-if(Android&&AndroidVersion<15,251,722) fuzzy-if(d2d,1,4) HTTP == transformed-1.html transformed-1.html?ref
 HTTP == transformed-1.html?up transformed-1.html?ref
 fuzzy-if(Android,5,20000) == uncovering-1.html uncovering-1-ref.html
 fuzzy-if(Android,5,20000) == uncovering-2.html uncovering-2-ref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/scrolling/scroll-behavior-1.html
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+    <meta charset="utf-8">
+    <title>Testcase for bug 1010538, smooth scrolling expected</title>
+    <style type="text/css">
+
+        html,body {
+            color: black;
+            background-color: white;
+            font-size: 16px;
+            padding: 0;
+            margin: 0;
+        }
+
+        body {
+            scroll-behavior: smooth;
+        }
+
+        #a_box {
+            position: relative;
+            left: 10px;
+            top: 10px;
+            width: 20px;
+            height: 20px;
+            background: blue;
+        }
+
+        #another_box {
+            position: relative;
+            left: 2000px;
+            top: 2000px;
+            width: 20px;
+            height: 20px;
+            background: green;
+        }
+
+    </style>
+</head>
+<body>
+  <div id="a_box"></div>
+  <div id="another_box"></div>
+<script>
+  function doTest() {
+    if (document.location.search != '?ref') {
+      window.scrollTo(500, 500);
+      window.scrollTo(window.scrollX, window.scrollY);
+    }
+    document.documentElement.removeAttribute("class");
+  }
+  window.scrollTo(0,0, {behavior: "instant"});
+  window.addEventListener("MozReftestInvalidate", doTest, false);
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/scrolling/scroll-behavior-2.html
@@ -0,0 +1,106 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+    <meta charset="utf-8">
+    <title>Testcase for bug 1010538, smooth scrolling expected</title>
+    <style type="text/css">
+
+        html,body {
+            color: black;
+            background-color: white;
+            font-size: 16px;
+            padding: 0;
+            margin: 0;
+        }
+
+        .a_box {
+            position: relative;
+            left: 0px;
+            top: 0px;
+            width: 20px;
+            height: 20px;
+            background: blue;
+        }
+
+        .another_box {
+            position: relative;
+            left: 2000px;
+            top: 2000px;
+            width: 20px;
+            height: 20px;
+            background: green;
+        }
+
+        .scroll_box {
+            width: 50px;
+            height: 50px;
+            overflow: scroll;
+        }
+
+        #scroll_1, #scroll_2, #scroll_3 {
+            scroll-behavior: smooth;
+        }
+
+        #scroll_4 {
+            scroll-behavior: instant;
+        }
+
+        #scroll_5 {
+            scroll-behavior: auto;
+	}
+
+    </style>
+</head>
+<body>
+  <div id="scroll_1" class="scroll_box">
+    <div id="box1a" class="a_box"></div>
+    <div id="box1b" class="another_box"></div>
+  </div>
+  <div id="scroll_2" class="scroll_box">
+    <div id="box2a" class="a_box"></div>
+    <div id="box2b" class="another_box"></div>
+  </div>
+  <div id="scroll_3" class="scroll_box">
+    <div id="box3a" class="a_box"></div>
+    <div id="box3b" class="another_box"></div>
+  </div>
+  <div id="scroll_4" class="scroll_box">
+    <div id="box4a" class="a_box"></div>
+    <div id="box4b" class="another_box"></div>
+  </div>
+  <div id="scroll_5" class="scroll_box">
+    <div id="box5a" class="a_box"></div>
+    <div id="box5b" class="another_box"></div>
+  </div>
+  <div id="scroll_6" class="scroll_box">
+    <div id="box6a" class="a_box"></div>
+    <div id="box6b" class="another_box"></div>
+  </div>
+<script>
+  function doTest() {
+    if (document.location.search != '?ref') {
+      document.getElementById("box1b").scrollIntoView(false);
+      document.getElementById("box2b").scrollIntoView(false, {behavior: "auto"});
+      document.getElementById("box3b").scrollIntoView(false, {behavior: "smooth"});
+      document.getElementById("box4b").scrollIntoView(false, {behavior: "smooth"});
+      document.getElementById("box5b").scrollIntoView(false, {behavior: "smooth"});
+      document.getElementById("box6b").scrollIntoView(false, {behavior: "smooth"});
+
+      // Interrupt any smooth scrolling
+      for (var i=1; i <= 6; i++) {
+        document.getElementById("scroll_" + i).scrollLeft
+          = document.getElementById("scroll_" + i).scrollLeft;
+        document.getElementById("scroll_" + i).scrollTop
+          = document.getElementById("scroll_" + i).scrollTop;
+      }
+    }
+    document.documentElement.removeAttribute("class");
+  }
+  for (var i=1; i <= 6; i++) {
+    document.getElementById("box" + i + "a")
+      .scrollIntoView(true, {behavior: "instant"});
+  }
+  window.addEventListener("MozReftestInvalidate", doTest, false);
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/scrolling/scroll-behavior-3.html
@@ -0,0 +1,140 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+    <meta charset="utf-8">
+    <title>Testcase for bug 1010538, instant scrolling expected</title>
+    <style type="text/css">
+
+        html,body {
+            color: black;
+            background-color: white;
+            font-size: 16px;
+            padding: 0;
+            margin: 0;
+        }
+
+        .a_box {
+            position: relative;
+            left: 0px;
+            top: 0px;
+            width: 20px;
+            height: 20px;
+            background: blue;
+        }
+
+        .another_box {
+            position: relative;
+            left: 2000px;
+            top: 2000px;
+            width: 20px;
+            height: 20px;
+            background: green;
+        }
+
+        .scroll_box {
+            width: 50px;
+            height: 50px;
+            overflow: scroll;
+        }
+
+        #scroll_2, #scroll_6, #scroll_9 {
+            scroll-behavior: auto;
+        }
+
+        #scroll_1, #scroll_5, #scroll_8 {
+            scroll-behavior: instant;
+        }
+
+        #scroll_4 {
+            scroll-behavior: smooth;
+        }
+
+    </style>
+</head>
+<body>
+  <div id="scroll_1" class="scroll_box">
+    <div id="box1a" class="a_box"></div>
+    <div id="box1b" class="another_box"></div>
+  </div>
+  <div id="scroll_2" class="scroll_box">
+    <div id="box2a" class="a_box"></div>
+    <div id="box2b" class="another_box"></div>
+  </div>
+  <div id="scroll_3" class="scroll_box">
+    <div id="box3a" class="a_box"></div>
+    <div id="box3b" class="another_box"></div>
+  </div>
+  <div id="scroll_4" class="scroll_box">
+    <div id="box4a" class="a_box"></div>
+    <div id="box4b" class="another_box"></div>
+  </div>
+  <div id="scroll_5" class="scroll_box">
+    <div id="box5a" class="a_box"></div>
+    <div id="box5b" class="another_box"></div>
+  </div>
+  <div id="scroll_6" class="scroll_box">
+    <div id="box6a" class="a_box"></div>
+    <div id="box6b" class="another_box"></div>
+  </div>
+  <div id="scroll_7" class="scroll_box">
+    <div id="box7a" class="a_box"></div>
+    <div id="box7b" class="another_box"></div>
+  </div>
+  <div id="scroll_8" class="scroll_box">
+    <div id="box8a" class="a_box"></div>
+    <div id="box8b" class="another_box"></div>
+  </div>
+  <div id="scroll_9" class="scroll_box">
+    <div id="box9a" class="a_box"></div>
+    <div id="box9b" class="another_box"></div>
+  </div>
+  <div id="scroll_10" class="scroll_box">
+    <div id="box10a" class="a_box"></div>
+    <div id="box10b" class="another_box"></div>
+  </div>
+  <div id="scroll_11" class="scroll_box">
+    <div id="box11a" class="a_box"></div>
+    <div id="box11b" class="another_box"></div>
+  </div>
+<script>
+  function doTest() {
+    if (document.location.search != '?ref') {
+      document.getElementById("box1b").scrollIntoView(false);
+      document.getElementById("box2b").scrollIntoView(false);
+      document.getElementById("box3b").scrollIntoView(false);
+      document.getElementById("box4b").scrollIntoView(false, {behavior: "instant"});
+      document.getElementById("box5b").scrollIntoView(false, {behavior: "instant"});
+      document.getElementById("box6b").scrollIntoView(false, {behavior: "instant"});
+      document.getElementById("box7b").scrollIntoView(false, {behavior: "instant"});
+      document.getElementById("box8b").scrollIntoView(false, {behavior: "auto"});
+      document.getElementById("box9b").scrollIntoView(false, {behavior: "auto"});
+      document.getElementById("box10b").scrollIntoView(false, {behavior: "auto"});
+
+      // Scroll_11 is a control, expected to scroll smoothly
+      document.getElementById("box11b").scrollIntoView(false, {behavior: "smooth"});
+
+      // Interrupt any smooth scrolling
+      for (var i=1; i <= 11; i++) {
+        document.getElementById("scroll_" + i).scrollLeft
+          = document.getElementById("scroll_" + i).scrollLeft;
+        document.getElementById("scroll_" + i).scrollTop
+          = document.getElementById("scroll_" + i).scrollTop;
+      }
+    } else {
+      // Scroll all boxes except box 11
+      for (var i=1; i <= 10; i++) {
+        document.getElementById("box" + i + "b").scrollIntoView(false, {behavior: "instant"});
+      }
+    }
+    document.documentElement.removeAttribute("class");
+  }
+
+  for (var i=1; i <= 11; i++) {
+    document.getElementById("box" + i + "a")
+      .scrollIntoView(true, {behavior: "instant"});
+  }
+
+  window.addEventListener("MozReftestInvalidate", doTest, false);
+</script>
+</body>
+</html>