Bug 1291280 - Part 3. Create mask local-ref test cases.
MozReview-Commit-ID: H9frrUaTFKx
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/652991-4-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <svg width="200" height="200">
+ <defs>
+ <mask id="mask1" x="0" y="0" width="100" height="100" >
+ <circle cx="100" cy="100" r="50" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ </defs>
+ <rect id="drawPath" x="50" y="50" width="100" height="100" fill="blue" stroke="blue" mask="url(#mask1)"/>
+ </svg>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/652991-4.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <svg width="200" height="200">
+ <defs>
+ <mask id="mask1" x="0" y="0" width="100" height="100" >
+ <circle cx="100" cy="100" r="50" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ </defs>
+ <rect id="drawPath" x="50" y="50" width="100" height="100" fill="blue" stroke="blue" mask="url(#mask1)"/>
+ </svg>
+ <script>
+ function doTest() {
+ window.history.pushState(null, "", "new-page");
+
+ drawPath.style.display = "none";
+ window.setTimeout(() => {
+ drawPath.style.display = "inline";
+ document.documentElement.removeAttribute('class');
+ }, 0);
+ }
+
+ drawPath = document.getElementById("drawPath");
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1962,8 +1962,9 @@ random-if(!winWidget) == 1273154-2.html
!= 1276161-1b.html 1276161-1-notref.html
!= 1276161-1a.html 1276161-1b.html
== 1275411-1.html 1275411-1-ref.html
HTTP == 652991-1a.html 652991-1-ref.html
HTTP == 652991-1b.html 652991-1-ref.html
HTTP == 652991-2.html 652991-2-ref.html
HTTP == 652991-3.html 652991-3-ref.html
+HTTP == 652991-4.html 652991-4-ref.html
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -436,8 +436,9 @@ skip-if(Android) pref(layout.css.mix-ble
# test case for Fragment URLs
# https://drafts.csswg.org/css-values/#local-urls
== use-localRef-marker-01.svg use-localRef-marker-01-ref.svg
== use-localRef-clipPath-01.svg use-localRef-clipPath-01-ref.svg
== use-localRef-filter-01.svg use-localRef-filter-01-ref.svg
== use-localRef-fill-01.svg use-localRef-fill-01-ref.svg
== use-localRef-stroke-01.svg use-localRef-stroke-01-ref.svg
+== use-localRef-mask-01.svg use-localRef-mask-01-ref.svg
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/use-localRef-mask-01-ref.svg
@@ -0,0 +1,17 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>Reference for mask linked to local-ref URL</title>
+ <defs>
+ <mask id="circleMask1" x="0" y="0" width="100" height="100" >
+ <circle cx="50" cy="50" r="40" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ <mask id="circleMask2" x="0" y="0" width="100" height="100" >
+ <circle cx="50" cy="150" r="40" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ <mask id="circleMask3" x="0" y="0" width="100" height="100" >
+ <circle cx="50" cy="250" r="40" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ </defs>
+ <rect id="mask1" x="10" y="10" width="80" height="80" fill="blue" mask="url(#circleMask1)"/>
+ <rect id="mask2" x="10" y="110" width="80" fill="blue" height="80" mask="url(#circleMask2)"/>
+ <rect id="mask3" x="10" y="210" width="80" fill="blue" height="80" mask="url(#circleMask3)"/>
+</svg>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/use-localRef-mask-01.svg
@@ -0,0 +1,22 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>Testcase for mask linked to local-ref URL</title>
+ <defs>
+ <mask id="circleMask1" x="0" y="0" width="100" height="100" >
+ <circle cx="50" cy="50" r="0" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ <mask id="circleMask2" x="0" y="0" width="100" height="100" >
+ <circle cx="50" cy="150" r="40" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ <mask id="circleMask3" x="0" y="0" width="100" height="100" >
+ <circle cx="50" cy="250" r="40" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ </defs>
+ <style>
+ #mask3 {
+ mask: url(#circleMask3);
+ }
+ </style>
+ <use xlink:href="use-localRef-mask-resource.svg#mask1"/>
+ <use xlink:href="use-localRef-mask-resource.svg#mask2" mask="url(#circleMask2)"/>
+ <use xlink:href="use-localRef-mask-resource.svg#mask3"/>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/use-localRef-mask-resource.svg
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs>
+ <mask id="circleMask1" x="0" y="0" width="100" height="100" >
+ <circle cx="50" cy="50" r="40" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ <mask id="circleMask2" x="0" y="0" width="100" height="100" >
+ <circle cx="50" cy="150" r="0" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ <mask id="circleMask3" x="0" y="0" width="100" height="100" >
+ <circle cx="50" cy="250" r="0" style="stroke:none; fill: #ffffff"/>
+ </mask>
+ </defs>
+ <rect id="mask1" x="10" y="10" width="80" height="80" fill="blue" mask="url(#circleMask1)"/>
+ <rect id="mask2" x="10" y="110" width="80" fill="blue" height="80"/>
+ <rect id="mask3" x="10" y="210" width="80" fill="blue" height="80"/>
+</svg>
\ No newline at end of file