]> gitweb.michael.orlitzky.com - libsvgtiny.git/blobdiff - test/css/siblings-and-descendants.svg
test/css: add some visually-verified test cases for our new features
[libsvgtiny.git] / test / css / siblings-and-descendants.svg
diff --git a/test/css/siblings-and-descendants.svg b/test/css/siblings-and-descendants.svg
new file mode 100644 (file)
index 0000000..272ddc4
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+Test the following select handlers via the corresponding CSS
+constructs,
+
+  named_ancestor_node          : node descendant
+  named_parent_node            : node > child
+  named_sibling_node           : node + sibling
+  named_generic_sibling_node   : node ~ sibling
+
+The result should be an empty document, since we're using each of the
+four selectors above to make one of the four rectangles transparent.
+-->
+<svg width="640"
+     height="480"
+     viewBox="0 0 640 480"
+     xmlns="http://www.w3.org/2000/svg"
+     xmlns:svg="http://www.w3.org/2000/svg">
+
+  <style>
+    g rect {
+      fill-opacity: 0;
+    }
+    g > rect {
+      fill-opacity: 0;
+    }
+    g + rect {
+      fill-opacity: 0;
+    }
+    g ~ rect {
+      fill-opacity: 0;
+    }
+  </style>
+
+  <g>
+    <a href="#">
+      <rect x="0"
+            y="0"
+            width="640"
+            height="480"
+            fill="red" />
+    </a>
+  </g>
+
+  <g>
+    <rect x="0"
+          y="0"
+          width="640"
+          height="480"
+         fill="green" />
+  </g>
+
+  <rect x="0"
+        y="0"
+        width="640"
+        height="480"
+       fill="black" />
+
+  <rect x="0"
+        y="0"
+        width="640"
+        height="480"
+       fill="yellow" />
+</svg>