Bug 1373159 - Add a bunch of test cases for 'context-fill-opacity' and 'context-stroke-opacity'.
MozReview-Commit-ID: AkSep6phtm8
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-fill-opacity-01.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Basic context-fill-opacity test</title>
+ <style>
+
+img {
+ width: 100px;
+ height: 100px;
+ -moz-context-properties: fill-opacity;
+ fill-opacity: 0.5;
+}
+
+ </style>
+ </head>
+ <body>
+ <img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' fill='blue' fill-opacity='context-fill-opacity'/></svg>">
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-fill-opacity-02.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test context-fill-opacity with different fill-opacity values (test image caching correctness)</title>
+ <style>
+
+img {
+ width: 100px;
+ height: 100px;
+ -moz-context-properties: fill-opacity;
+}
+
+#img1 {
+ fill-opacity: 0.3;
+}
+
+#img2 {
+ fill-opacity: 0.7;
+}
+
+ </style>
+ </head>
+ <body>
+ <img id="img1" src="context-fill-opacity-02.svg">
+ <img id="img2" src="context-fill-opacity-02.svg">
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-fill-opacity-02.svg
@@ -0,0 +1,3 @@
+<svg xmlns='http://www.w3.org/2000/svg'>
+ <rect width='100%' height='100%' fill='blue' fill-opacity='context-fill-opacity'/>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-fill-opacity-03.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test context-fill-opacity works with context-fill</title>
+ <style>
+
+img {
+ width: 100px;
+ height: 100px;
+ -moz-context-properties: fill, fill-opacity;
+ fill: blue;
+ fill-opacity: 0.5;
+}
+
+ </style>
+ </head>
+ <body>
+ <img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' fill='context-fill' fill-opacity='context-fill-opacity'/></svg>">
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-fill-opacity-04.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>No context-fill-opacity value is provided</title>
+ <style>
+
+img {
+ width: 100px;
+ height: 100px;
+ -moz-context-properties: fill-opacity;
+}
+
+ </style>
+ </head>
+ <body>
+ <img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' fill='blue' fill-opacity='context-fill-opacity'/></svg>">
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-fill-opacity-05.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test context-fill-opacity when only '-moz-context-properties: stroke-opacity' is specified</title>
+ <style>
+
+img {
+ width: 100px;
+ height: 100px;
+ -moz-context-properties: stroke-opacity;
+ fill: 0.5;
+ stroke: 0.5;
+}
+
+ </style>
+ </head>
+ <body>
+ <img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' fill='blue' fill-opacity='context-fill-opacity'/></svg>">
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-fill-or-stroke-opacity-01-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <div style="width: 100px; height: 100px; background: rgba(0, 0, 255, 0.5)"></div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-fill-or-stroke-opacity-02-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+
+div {
+ width: 100px;
+ height: 100px;
+ display: inline-block;
+}
+
+ </style>
+</head>
+<body>
+ <div style="background: rgba(0, 0, 255, 0.3); "></div>
+ <div style="background: rgba(0, 0, 255, 0.7); "></div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-fill-or-stroke-opacity-03-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <div style="width: 100px; height: 100px; background: rgba(0, 0, 255, 0.5)"></div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-stroke-opacity-01.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Basic context-stroke-opacity test</title>
+ <style>
+
+img {
+ width: 100px;
+ height: 100px;
+ -moz-context-properties: stroke-opacity;
+ stroke-opacity: 0.5;
+}
+
+ </style>
+ </head>
+ <body>
+ <img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><line x1='0' y1='50%' x2='100%' y2='50%' stroke-width='120%' stroke='blue' stroke-opacity='context-stroke-opacity'/></svg>">
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-stroke-opacity-02.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test context-stroke-opacity with different stroke-opacity values (test image caching correctness)</title>
+ <style>
+
+img {
+ width: 100px;
+ height: 100px;
+ -moz-context-properties: stroke-opacity;
+}
+
+#img1 {
+ stroke-opacity: 0.3;
+}
+
+#img2 {
+ stroke-opacity: 0.7;
+}
+
+ </style>
+ </head>
+ <body>
+ <img id="img1" src="context-stroke-opacity-02.svg">
+ <img id="img2" src="context-stroke-opacity-02.svg">
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-stroke-opacity-02.svg
@@ -0,0 +1,3 @@
+<svg xmlns='http://www.w3.org/2000/svg'>
+ <line x1='0' y1='50%' x2='100%' y2='50%' stroke-width='120%' stroke='blue' stroke-opacity='context-stroke-opacity'/>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-stroke-opacity-03.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test context-stroke-opacity works with context-stroke</title>
+ <style>
+
+img {
+ width: 100px;
+ height: 100px;
+ -moz-context-properties: stroke, stroke-opacity;
+ stroke: blue;
+ stroke-opacity: 0.5;
+}
+
+ </style>
+ </head>
+ <body>
+ <img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><line x1='0' y1='50%' x2='100%' y2='50%' stroke-width='120%' stroke='context-stroke' stroke-opacity='context-stroke-opacity'/></svg>">
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-stroke-opacity-04.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>No context-stroke-opacity value is provided</title>
+ <style>
+
+img {
+ width: 100px;
+ height: 100px;
+ -moz-context-properties: stroke-opacity;
+}
+
+ </style>
+ </head>
+ <body>
+ <img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><line x1='0' y1='50%' x2='100%' y2='50%' stroke-width='120%' stroke='blue' stroke-opacity='context-stroke-opacity'/></svg>">
+ </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/as-image/context-stroke-opacity-05.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test context-stroke-opacity when only '-moz-context-properties: fill-opacity' is specified</title>
+ <style>
+
+img {
+ width: 100px;
+ height: 100px;
+ -moz-context-properties: fill-opacity;
+ stroke-opacity: 0.5;
+}
+
+ </style>
+ </head>
+ <body>
+ <img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><line x1='0' y1='50%' x2='100%' y2='50%' stroke-width='120%' stroke='blue' stroke-opacity='context-stroke-opacity'/></svg>">
+ </body>
+</html>
--- a/layout/reftests/svg/as-image/reftest.list
+++ b/layout/reftests/svg/as-image/reftest.list
@@ -76,16 +76,30 @@ test-pref(svg.context-properties.content
test-pref(svg.context-properties.content.enabled,true) == context-stroke-03.html lime100x100-50pct-ref.html
# fuzz because on win8 the r & b components are off by one
fuzzy-if(winWidget,1,10000) test-pref(svg.context-properties.content.enabled,true) == context-stroke-04.html lime100x100-50pct-ref.html
test-pref(svg.context-properties.content.enabled,true) == context-stroke-05.html context-fill-or-stroke-05-ref.html
test-pref(svg.context-properties.content.enabled,true) == context-stroke-06.html lime100x100-ref.html
test-pref(svg.context-properties.content.enabled,true) == context-stroke-07.html context-stroke-07-ref.html
test-pref(svg.context-properties.content.enabled,true) == context-stroke-08.html blue100x100-border-ref.html
test-pref(svg.context-properties.content.enabled,true) == context-stroke-bg-image-01.html blue100x100-border-ref.html
+# context-fill-opacity:
+== context-fill-opacity-01.html blue100x100-ref.html
+fuzzy-if(winWidget,1,10000) test-pref(svg.context-properties.content.enabled,true) == context-fill-opacity-01.html context-fill-or-stroke-opacity-01-ref.html # Bug 1377327
+fuzzy-if(winWidget,1,20000) test-pref(svg.context-properties.content.enabled,true) == context-fill-opacity-02.html context-fill-or-stroke-opacity-02-ref.html # Bug 1377327
+fuzzy-if(winWidget,1,10000) test-pref(svg.context-properties.content.enabled,true) == context-fill-opacity-03.html context-fill-or-stroke-opacity-03-ref.html # Bug 1377327
+fuzzy-if(winWidget,1,10000) test-pref(svg.context-properties.content.enabled,true) == context-fill-opacity-04.html blue100x100-ref.html # Bug 1377327
+fuzzy-if(winWidget,1,10000) test-pref(svg.context-properties.content.enabled,true) == context-fill-opacity-05.html blue100x100-ref.html # Bug 1377327
+# context-stroke-opacity:
+== context-stroke-opacity-01.html blue100x100-ref.html
+fuzzy-if(winWidget,1,10000) test-pref(svg.context-properties.content.enabled,true) == context-stroke-opacity-01.html context-fill-or-stroke-opacity-01-ref.html # Bug 1377327
+fuzzy-if(winWidget,1,20000) test-pref(svg.context-properties.content.enabled,true) == context-stroke-opacity-02.html context-fill-or-stroke-opacity-02-ref.html # Bug 1377327
+fuzzy-if(winWidget,1,10000) test-pref(svg.context-properties.content.enabled,true) == context-stroke-opacity-03.html context-fill-or-stroke-opacity-03-ref.html # Bug 1377327
+fuzzy-if(winWidget,1,10000) test-pref(svg.context-properties.content.enabled,true) == context-stroke-opacity-04.html blue100x100-ref.html # Bug 1377327
+fuzzy-if(winWidget,1,10000) test-pref(svg.context-properties.content.enabled,true) == context-stroke-opacity-05.html blue100x100-ref.html # Bug 1377327
# Simple <img> tests
== img-simple-1.html lime100x100-ref.html
== img-simple-2.html lime100x100-ref.html
fuzzy-if(skiaContent,255,350) == img-simple-3.html img-simple-3-ref.html
== img-simple-4.html lime100x100-ref.html
fuzzy-if(skiaContent,255,90) == img-simple-5.html img-simple-5-ref.html
== img-simple-6.html lime100x100-ref.html