Bug 1412011 - Test SVG <use> element matching rules. r=dholbert, a=ritu
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 26 Oct 2017 18:14:48 +0200
changeset 689532 ca0924347f3b4c1fc5310a200a1b6de202a61831
parent 689531 a01684654651fcddf12f60f4ac7d5d3798d1ed8a
child 689533 aa8f74f0ad60ab35955e539ac8e1164fe00a7fd1
push id87038
push userbmo:jaws@mozilla.com
push dateTue, 31 Oct 2017 16:52:16 +0000
reviewersdholbert, ritu
bugs1412011
milestone57.0
Bug 1412011 - Test SVG <use> element matching rules. r=dholbert, a=ritu MozReview-Commit-ID: 9syd1Nlx2Iv
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/svg/linking/reftests/use-descendant-combinator-001.html
testing/web-platform/tests/svg/linking/reftests/use-descendant-combinator-002.html
testing/web-platform/tests/svg/linking/reftests/use-descendant-combinator-ref.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -171434,16 +171434,40 @@
       [
        "/svg/linking/reftests/href-use-element-ref.html",
        "=="
       ]
      ],
      {}
     ]
    ],
+   "svg/linking/reftests/use-descendant-combinator-001.html": [
+    [
+     "/svg/linking/reftests/use-descendant-combinator-001.html",
+     [
+      [
+       "/svg/linking/reftests/use-descendant-combinator-ref.html",
+       "=="
+      ]
+     ],
+     {}
+    ]
+   ],
+   "svg/linking/reftests/use-descendant-combinator-002.html": [
+    [
+     "/svg/linking/reftests/use-descendant-combinator-002.html",
+     [
+      [
+       "/svg/linking/reftests/use-descendant-combinator-ref.html",
+       "=="
+      ]
+     ],
+     {}
+    ]
+   ],
    "svg/shapes/rect-01.svg": [
     [
      "/svg/shapes/rect-01.svg",
      [
       [
        "/svg/shapes/rect-01-ref.html",
        "=="
       ]
@@ -307164,16 +307188,21 @@
      {}
     ]
    ],
    "svg/linking/reftests/href-use-element-ref.html": [
     [
      {}
     ]
    ],
+   "svg/linking/reftests/use-descendant-combinator-ref.html": [
+    [
+     {}
+    ]
+   ],
    "svg/linking/scripted/testScripts/dummyScript.js": [
     [
      {}
     ]
    ],
    "svg/linking/scripted/testScripts/externalScript1.js": [
     [
      {}
@@ -414835,17 +414864,17 @@
    "11f3665ec4c491e3c4806c2be17578ccbcaf7840",
    "testharness"
   ],
   "XMLHttpRequest/open-url-base.htm": [
    "d2c5d8d1696112b771a332011c4f33065817ed9a",
    "testharness"
   ],
   "XMLHttpRequest/open-url-encoding.htm": [
-   "ead2b1f6235cdf8e912214ce24f6d23262d2c826",
+   "a36c7b0e5919af7842883582ef9fc415d8f7ef25",
    "testharness"
   ],
   "XMLHttpRequest/open-url-fragment.htm": [
    "79ebcd0817679394df3c8c162fcf56cd91d98c83",
    "testharness"
   ],
   "XMLHttpRequest/open-url-javascript-window-2.htm": [
    "de6712f1db65e2886599d653a253197254b2c0f2",
@@ -625830,16 +625859,28 @@
   "svg/linking/reftests/href-use-element-ref.html": [
    "8a4977599d6f531a76524191cb9bad75803a455e",
    "support"
   ],
   "svg/linking/reftests/href-use-element.html": [
    "3ee77582da34128b38e8e523c553f943ec0e1947",
    "reftest"
   ],
+  "svg/linking/reftests/use-descendant-combinator-001.html": [
+   "323fde648ee2d065bfd945a2c4d5be86f1c308ff",
+   "reftest"
+  ],
+  "svg/linking/reftests/use-descendant-combinator-002.html": [
+   "3d51ca0fc007d52147e7ea03493cac7ee1bb7903",
+   "reftest"
+  ],
+  "svg/linking/reftests/use-descendant-combinator-ref.html": [
+   "fb8aec792684b97151d2964b85d1e70829e141ad",
+   "support"
+  ],
   "svg/linking/scripted/href-animate-element.html": [
    "c224f6b609079f31c256625417e4677b21b5f71a",
    "testharness"
   ],
   "svg/linking/scripted/href-mpath-element.html": [
    "8b13592c688265576addd27027a18f7aea397580",
    "testharness"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/svg/linking/reftests/use-descendant-combinator-001.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>CSS Test: use element doesn't cross shadow tree boundaries in selector-matching</title>
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElement">
+<link rel="match" href="/svg/linking/reftests/use-descendant-combinator-ref.html">
+<style>
+#test rect {
+  stroke: red;
+  stroke-width: 10px;
+}
+</style>
+<p>
+  You should see a green square, and no red.
+</p>
+<svg
+  version="1.1"
+  xmlns="http://www.w3.org/2000/svg"
+  xmlns:xlink="http://www.w3.org/1999/xlink">
+  <defs>
+    <g id="square">
+      <rect width="100" height="100"/>
+    </g>
+  </defs>
+  <g id="test">
+    <use xlink:href="#square" fill="green" />
+  </g>
+</svg>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/svg/linking/reftests/use-descendant-combinator-002.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>CSS Test: use element doesn't cross shadow tree boundaries in selector-matching</title>
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElement">
+<link rel="match" href="/svg/linking/reftests/use-descendant-combinator-ref.html">
+<style>
+#test rect {
+  stroke: red;
+  stroke-width: 10px;
+}
+.inside-use rect {
+  fill: green;
+}
+</style>
+<p>
+  You should see a green square, and no red.
+</p>
+<svg
+  version="1.1"
+  xmlns="http://www.w3.org/2000/svg"
+  xmlns:xlink="http://www.w3.org/1999/xlink">
+  <defs>
+    <g id="square">
+      <g class="inside-use">
+        <rect width="100" height="100"/>
+      </g>
+    </g>
+  </defs>
+  <g id="test">
+    <use xlink:href="#square" />
+  </g>
+</svg>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/svg/linking/reftests/use-descendant-combinator-ref.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>CSS Test reference</title>
+<p>
+  You should see a green square, and no red.
+</p>
+<svg
+  version="1.1"
+  xmlns="http://www.w3.org/2000/svg"
+  xmlns:xlink="http://www.w3.org/1999/xlink">
+  <rect width="100" height="100" fill="green"/>
+</svg>