]> gitweb.michael.orlitzky.com - libsvgtiny.git/blobdiff - test/css/nth-child.svg
test/css: add some visually-verified test cases for our new features
[libsvgtiny.git] / test / css / nth-child.svg
diff --git a/test/css/nth-child.svg b/test/css/nth-child.svg
new file mode 100644 (file)
index 0000000..137298e
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+Test the node_is_root() select handler via the CSS :root
+pseudo-selector. The result should be an empty document,
+because the root SVG node is made fully transparent and
+its one child should inherit that.
+-->
+<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">
+
+  <rect x="0"
+        y="0"
+        width="640"
+        height="480"
+        fill="black" />
+
+  <style>
+    rect:first-child {
+      fill-opacity: 0;
+    }
+    rect:nth-child(3) {
+      fill-opacity: 0;
+    }
+    rect:nth-child(4) {
+      fill-opacity: 0;
+    }
+    rect:last-child {
+      fill-opacity: 0;
+    }
+  </style>
+
+  <rect x="0"
+        y="0"
+        width="640"
+        height="480"
+        fill="red" />
+
+  <rect x="0"
+        y="0"
+        width="640"
+        height="480"
+        fill="blue" />
+
+  <rect x="0"
+        y="0"
+        width="640"
+        height="480"
+        fill="green" />
+</svg>