Bug 1246764 - Part 5: Tests. r=jwatt
authorBoris Chiou <boris.chiou@gmail.com>
Thu, 16 Aug 2018 16:07:13 -0700
changeset 481633 21b885b5fc62ce75eb92b9412ea2e0eba1287e7d
parent 481632 fff761953caf5e8bf979636ad58b5b6cdad83f98
child 481634 3c0c1c501562f1cf15f10a689bcd1a9b107200ca
child 481688 90c564d87a5efe1481f403a0731e4e7dc896fc06
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersjwatt
bugs1246764
milestone63.0a1
Bug 1246764 - Part 5: Tests. r=jwatt Add some chrome-only reftests. Differential Revision: https://phabricator.services.mozilla.com/D3637
layout/reftests/svg/svg-integration/clip-path/clip-path-path-001-ref.html
layout/reftests/svg/svg-integration/clip-path/clip-path-path-001.html
layout/reftests/svg/svg-integration/clip-path/clip-path-path-002-ref.html
layout/reftests/svg/svg-integration/clip-path/clip-path-path-002.html
layout/reftests/svg/svg-integration/clip-path/path.css
layout/reftests/svg/svg-integration/clip-path/reftest.list
layout/tools/reftest/jar.mn
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/svg-integration/clip-path/clip-path-path-001-ref.html
@@ -0,0 +1,29 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<!DOCTYPE html>
+<html>
+<head>
+  <title>CSS Masking: Reference for clip-path's path function with nonzero</title>
+  <style type="text/css">
+    #rect {
+      width: 100px;
+      height: 100px;
+      background-color: green;
+      clip-path: url("#clip");
+    }
+  </style>
+</head>
+<body>
+  <p>The test passes if there are a green filled rect.</p>
+  <div id="rect"></div>
+  <svg height="0" width="0">
+    <defs>
+      <clipPath id="clip">
+        <path clip-rule="nonzero" d="M10,10h80v80h-80zM25,25h50v50h-50z"/>
+      </clipPath>
+    </defs>
+  </svg>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/svg-integration/clip-path/clip-path-path-001.html
@@ -0,0 +1,24 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<!DOCTYPE html>
+<html>
+<head>
+  <title>CSS Masking: Test clip-path property and path function with nonzero</title>
+  <link rel="help" href="https://drafts.csswg.org/css-shapes-2/#funcdef-path">
+  <link rel="stylesheet" href="chrome://reftest/content/path.css">
+  <link rel="match" href="clip-path-path-001-ref.html">
+</head>
+<style>
+  #rect {
+    width: 100px;
+    height: 100px;
+    background-color: green;
+  }
+</style>
+<body>
+  <p>The test passes if there are a green filled rect.</p>
+  <div id="rect" class="path_nonzero_rect"></div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/svg-integration/clip-path/clip-path-path-002-ref.html
@@ -0,0 +1,29 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<!DOCTYPE html>
+<html>
+<head>
+  <title>CSS Masking: Reference for clip-path's path function with evenodd</title>
+  <style type="text/css">
+    #rect {
+      width: 100px;
+      height: 100px;
+      background-color: green;
+      clip-path: url("#clip");
+    }
+  </style>
+</head>
+<body>
+  <p>The test passes if there are a green hollow rect.</p>
+  <div id="rect"></div>
+  <svg height="0" width="0">
+    <defs>
+      <clipPath id="clip">
+        <path clip-rule="evenodd" d="M10,10h80v80h-80zM25,25h50v50h-50z"/>
+      </clipPath>
+    </defs>
+  </svg>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/svg-integration/clip-path/clip-path-path-002.html
@@ -0,0 +1,24 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<!DOCTYPE html>
+<html>
+<head>
+  <title>CSS Masking: Test clip-path property and path function with evenodd</title>
+  <link rel="help" href="https://drafts.csswg.org/css-shapes-2/#funcdef-path">
+  <link rel="stylesheet" href="chrome://reftest/content/path.css">
+  <link rel="match" href="clip-path-path-002-ref.html">
+</head>
+<style>
+  #rect {
+    width: 100px;
+    height: 100px;
+    background-color: green;
+  }
+</style>
+<body>
+  <p>The test passes if there are a green hollow rect.</p>
+  <div id="rect" class="path_evenodd_rect"></div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/svg-integration/clip-path/path.css
@@ -0,0 +1,7 @@
+.path_nonzero_rect {
+  clip-path: path(nonzero, 'M10,10h80v80h-80zM25,25h50v50h-50z');
+}
+
+.path_evenodd_rect {
+  clip-path: path(evenodd, 'M10,10h80v80h-80zM25,25h50v50h-50z');
+}
--- a/layout/reftests/svg/svg-integration/clip-path/reftest.list
+++ b/layout/reftests/svg/svg-integration/clip-path/reftest.list
@@ -54,8 +54,11 @@ fuzzy-if(webrender,64-64,1106-1106) == c
 fuzzy(0-64,0-146) fuzzy-if(webrender,90-90,132-132) == clip-path-inset-002a.html clip-path-inset-002-ref.html
 fuzzy(0-64,0-146) fuzzy-if(webrender,90-90,132-132) == clip-path-inset-002b.html clip-path-inset-002-ref.html
 fuzzy(0-64,0-146) fuzzy-if(webrender,90-90,132-132) == clip-path-inset-002c.html clip-path-inset-002-ref.html
 fuzzy(0-64,0-340) fuzzy-if(webrender,104-104,311-311) == clip-path-inset-003.html clip-path-inset-003-ref.html
 
 == clip-path-stroke-001.html clip-path-stroke-001-ref.html
 
 == clip-path-transform-001.html clip-path-transform-001-ref.html
+
+== clip-path-path-001.html clip-path-path-001-ref.html
+== clip-path-path-002.html clip-path-path-002-ref.html
--- a/layout/tools/reftest/jar.mn
+++ b/layout/tools/reftest/jar.mn
@@ -3,12 +3,13 @@ reftest.jar:
   content/globals.jsm (globals.jsm)
   content/reftest-content.js (reftest-content.js)
   content/AsyncSpellCheckTestHelper.jsm (../../../editor/AsyncSpellCheckTestHelper.jsm)
   content/httpd.jsm (../../../netwerk/test/httpserver/httpd.js)
   content/StructuredLog.jsm (../../../testing/modules/StructuredLog.jsm)
   content/PerTestCoverageUtils.jsm (../../../tools/code-coverage/PerTestCoverageUtils.jsm)
   content/input.css (../../../editor/reftests/xul/input.css)
   content/moz-bool-pref.css (../../../layout/reftests/css-parsing/moz-bool-pref.css)
+  content/path.css (../../../layout/reftests/svg/svg-integration/clip-path/path.css)
   content/progress.css (../../../layout/reftests/forms/progress/style.css)
 *  content/manifest.jsm (manifest.jsm)
 *  content/reftest.jsm (reftest.jsm)
   content/reftest.xul (reftest.xul)