summaryrefslogtreecommitdiffstats
path: root/layout/reftests/svg/pattern-transform-presence-01.svg
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /layout/reftests/svg/pattern-transform-presence-01.svg
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/reftests/svg/pattern-transform-presence-01.svg')
-rw-r--r--layout/reftests/svg/pattern-transform-presence-01.svg58
1 files changed, 58 insertions, 0 deletions
diff --git a/layout/reftests/svg/pattern-transform-presence-01.svg b/layout/reftests/svg/pattern-transform-presence-01.svg
new file mode 100644
index 000000000..f5e59e3bf
--- /dev/null
+++ b/layout/reftests/svg/pattern-transform-presence-01.svg
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ onload="addTransform()" viewBox="0 0 300 100" class="reftest-wait">
+<!-- Test that the presence/absence of a patternTransform is correctly detected.
+
+ Details are below but, in summary, the first two squares should contain the
+ same pattern (a diagonal checkerbox) whilst the third square should contain
+ a different pattern (actually the same pattern but WITHOUT the rotation).
+ -->
+<script>
+function addTransform()
+{
+ var g = document.getElementById("patternBase");
+ var list = g.patternTransform.baseVal;
+ var t = document.documentElement.createSVGTransform();
+ t.setRotate(45,50,50);
+ list.appendItem(t);
+ document.documentElement.removeAttribute("class");
+}
+</script>
+<defs>
+ <!-- 1. The base pattern that will be referenced by others.
+ When the document loads, script will add a patternTransform to this
+ pattern. It does this using *only SVG DOM APIs* (i.e. not setAttribute)
+ so that we can test that when a transform is not specified by markup but
+ is added via the DOM we still correctly detect its presence. -->
+ <pattern id="patternBase" width="1" height="1">
+ <rect width="50" height="50" fill="blue"/>
+ <rect x="50" width="50" height="50" fill="red"/>
+ <rect y="50" width="50" height="50" fill="red"/>
+ <rect x="50" y="50" width="50" height="50" fill="blue"/>
+ </pattern>
+ <!-- 2. References the base pattern and should detect the base pattern's
+ patternTransform (added by script) and inherit it. (SVG 1.1 F2 13.3,
+ xlink:href 'Any attributes which are defined on the referenced element
+ which are not defined on this element are inherited by this element.').
+ Hence this pattern should look IDENTICAL to patternBase. -->
+ <pattern xlink:href="#patternBase" id="patternRefWithoutTransform"/>
+ <!-- 3. References the base pattern but patternTransform is defined (although
+ empty) and hence the patternTransform should NOT be inherited and this
+ pattern should look DIFFERENT to patternBase. -->
+ <pattern xlink:href="#patternBase" id="patternRefWithTransform"
+ patternTransform=""/>
+ <!-- The case of a patternTransform being supplied by animation is covered by
+ SMIL reftest anim-pattern-attr-presence-01.svg -->
+</defs>
+<rect width="100" height="100" stroke="black"
+ fill="url(#patternBase)"/>
+<g transform="translate(100)">
+ <rect width="100" height="100" stroke="black"
+ fill="url(#patternRefWithoutTransform)"/>
+</g>
+<g transform="translate(200)">
+ <rect width="100" height="100" stroke="black"
+ fill="url(#patternRefWithTransform)"/>
+</g>
+</svg>