]> gitweb.michael.orlitzky.com - libsvgtiny.git/blobdiff - test/css/empty-pseudo-class.svg
test/css: add some visually-verified test cases for our new features
[libsvgtiny.git] / test / css / empty-pseudo-class.svg
diff --git a/test/css/empty-pseudo-class.svg b/test/css/empty-pseudo-class.svg
new file mode 100644 (file)
index 0000000..ebe3c28
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+Test the node_is_empty select handler via the :empty pseudo-class.
+The result should be a blue document, because the second rect is
+not empty.
+-->
+<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>
+    :empty {
+      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">
+    <desc>I'm a rectangle.</desc>
+  </rect>
+</svg>
+