Bug 1316270 - Test cases for boxing model change. draft
authorcku <cku@mozilla.com>
Wed, 09 Nov 2016 16:26:44 +0800
changeset 438803 88982fb19bcb55f0156bd6ee99d8694491673c72
parent 438550 71fd23fa0803a548b6e571aa25d0533a06cd0421
child 536996 ca3b1e695a253cbd3adeb74588a324399c8fc2ea
push id35818
push userbmo:cku@mozilla.com
push dateTue, 15 Nov 2016 02:58:53 +0000
bugs1316270
milestone53.0a1
Bug 1316270 - Test cases for boxing model change. MozReview-Commit-ID: JUQfZOTUDj
layout/reftests/w3c-css/submitted/masking/mask-boxModel-1-ref.html
layout/reftests/w3c-css/submitted/masking/mask-boxModel-1a.html
layout/reftests/w3c-css/submitted/masking/mask-boxModel-1b.html
layout/reftests/w3c-css/submitted/masking/reftest.list
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/masking/mask-boxModel-1-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>CSS Masking: mask repainting.</title>
+    <link rel="author" title="CJ Ku" href="mailto:cku@mozilla.com">
+    <link rel="author" title="Mozilla" href="https://www.mozilla.org">
+    <style type="text/css">
+      div {
+        background-color: purple;
+        position: absolute;
+        margin: 1px 2px 3px 4px;
+        border: solid purple;
+        width: 44px;
+        height: 9px;
+      }
+    </style>
+  </head>
+  <body>
+    <div class="outer" style="top: 15px; left: 15px;"></div>
+    <div class="outer" style="top: 15px; left: 115px;"></div>
+    <div class="outer" style="top: 15px; left: 215px;"></div>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/masking/mask-boxModel-1a.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+  <head>
+    <meta charset="utf-8">
+    <title>CSS Masking: mask repaint.</title>
+    <link rel="author" title="CJ Ku" href="mailto:cku@mozilla.com">
+    <link rel="author" title="Mozilla" href="https://www.mozilla.org">
+    <link rel="help" href="http://www.w3.org/TR/css-masking-1/>
+    <link rel="match" href="mask-boxModel-1-ref.html">
+    <meta name="assert" content="mask should be updated after boxing area of masked element change.">
+    <style type="text/css">
+      div.outer {
+        background-color: purple;
+        position: absolute;
+        margin: 1px 2px 3px 4px;
+        border: solid purple;
+        width: 40px;
+        height: 20px;
+      }
+
+      div.mask {
+        mask-size: 100% 100%;
+        mask-origin: border-box;
+        mask-image: url(support/transparent-100x50-blue-100x50.svg);
+      }
+
+      #d1 {
+        top: 10px;
+        left: 10px;
+        mask-clip: padding-box;
+        border-width: 10px;
+        padding: 0px;
+      }
+
+      #d2 {
+        top: 10px;
+        left: 110px;
+        mask-clip: padding-box;
+        border-width: 0px;
+        padding: 10px;
+      }
+
+      #d3 {
+        top: 15px;
+        left: 215px;
+        mask-clip: content-box;
+        border-width: 10px;
+        padding: 0px;
+      }
+    </style>
+  </head>
+  <body>
+    <div id="d1" class="outer mask"></div>
+    <div id="d2" class="outer mask"></div>
+    <div id="d3" class="outer mask"></div>
+    <script type="text/javascript">
+      function changeBoxingArea()
+      {
+        // Shrink border area, thicken padding area. Keep ths size of this
+        // division still.
+        document.getElementById("d1").style.borderWidth = "5px";
+        document.getElementById("d1").style.padding = "5px";
+
+        // Shrink padding area, thicken border area. Keep ths size of this
+        // division still.
+        document.getElementById("d2").style.borderWidth = "5px";
+        document.getElementById("d2").style.padding = "5px";
+
+        // Shrink border area, thicken content area. Keep ths size of this
+        // division still.
+        document.getElementById("d3").style.width = "50px";
+        document.getElementById("d3").style.height = "30px";
+        document.getElementById("d3").style.borderWidth = "0px";
+
+        document.documentElement.removeAttribute("class");
+      }
+      document.addEventListener("MozReftestInvalidate",
+                                changeBoxingArea, false);
+      window.onload = function() {
+        setTimeout(changeBoxingArea, 1000);
+      }
+    </script>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/masking/mask-boxModel-1b.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+  <head>
+    <meta charset="utf-8">
+    <title>CSS Masking: mask repaint.</title>
+    <link rel="author" title="CJ Ku" href="mailto:cku@mozilla.com">
+    <link rel="author" title="Mozilla" href="https://www.mozilla.org">
+    <link rel="help" href="http://www.w3.org/TR/css-masking-1">
+    <link rel="match" href="mask-boxModel-1-ref.html">
+    <meta name="assert" content="mask should be updated after boxing area of masked element change.">
+    <style type="text/css">
+      div.outer {
+        background-color: purple;
+        position: absolute;
+        margin: 1px 2px 3px 4px;
+        border: solid purple;
+        width: 40px;
+        height: 20px;
+      }
+
+      div.mask {
+        mask-size: 100% 100%;
+        mask-origin: border-box;
+        mask-image: url(support/transparent-100x50-blue-100x50.svg);
+      }
+
+      #d1 {
+        top: 10px;
+        left: 10px;
+        mask-clip: padding-box;
+        border-width: 10px;
+        padding: 0px;
+      }
+
+      #d2 {
+        top: 10px;
+        left: 110px;
+        mask-clip: padding-box;
+        border-width: 0px;
+        padding: 10px;
+      }
+
+      #d3 {
+        top: 15px;
+        left: 215px;
+        mask-clip: content-box;
+        border-width: 10px;
+        padding: 0px;
+      }
+    </style>
+  </head>
+  <body>
+    <div id="d1" class="outer mask">
+      <div style="position: absolute; background-color: purple; will-change: transform;"></div>
+    </div>
+    <div id="d2" class="outer mask">
+      <div style="background-color: purple; will-change: transform;"></div>
+    </div>
+    <div id="d3" class="outer mask">
+      <div style="background-color: purple; will-change: transform;"></div>
+    </div>
+    <script type="text/javascript">
+      function changeBoxingArea()
+      {
+        // Shrink border area, thicken padding area. Keep ths size of this
+        // division still.
+        document.getElementById("d1").style.borderWidth = "5px";
+        document.getElementById("d1").style.padding = "5px";
+
+        // Shrink padding area, thicken border area. Keep ths size of this
+        // division still.
+        document.getElementById("d2").style.borderWidth = "5px";
+        document.getElementById("d2").style.padding = "5px";
+
+        // Shrink border area, thicken content area. Keep ths size of this
+        // division still.
+        document.getElementById("d3").style.width = "50px";
+        document.getElementById("d3").style.height = "30px";
+        document.getElementById("d3").style.borderWidth = "0px";
+
+        document.documentElement.removeAttribute("class");
+      }
+      document.addEventListener("MozReftestInvalidate",
+                                changeBoxingArea, false);
+      window.onload = function() {
+        setTimeout(changeBoxingArea, 1000);
+     }
+    </script>
+  </body>
+</html>
--- a/layout/reftests/w3c-css/submitted/masking/reftest.list
+++ b/layout/reftests/w3c-css/submitted/masking/reftest.list
@@ -104,9 +104,12 @@ fuzzy-if(winWidget,9,98) == clip-path-ge
 
 default-preferences
 
 # mask with opacity test cases
 fuzzy(1,5000) == mask-opacity-1a.html mask-opacity-1-ref.html
 fuzzy(1,5000) == mask-opacity-1b.html mask-opacity-1-ref.html
 fuzzy(1,5000) == mask-opacity-1c.html mask-opacity-1-ref.html
 
-== clip-path-mix-blend-mode-1.html clip-path-mix-blend-mode-1-ref.html
\ No newline at end of file
+== clip-path-mix-blend-mode-1.html clip-path-mix-blend-mode-1-ref.html
+
+== mask-boxModel-1a.html mask-boxModel-1-ref.html
+== mask-boxModel-1b.html mask-boxModel-1-ref.html