]> gitweb.michael.orlitzky.com - libsvgtiny.git/blobdiff - test/css/inherit.svg
test/css: add some visually-verified test cases for our new features
[libsvgtiny.git] / test / css / inherit.svg
diff --git a/test/css/inherit.svg b/test/css/inherit.svg
new file mode 100644 (file)
index 0000000..8ab3c1f
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+Make sure "inherit" works. The inline rect "inherit" should cause the
+second rect to inherit its fill-opacity from g3<-g2<-g1.
+-->
+<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>
+    rect {
+      fill-opacity: 0.8;
+    }
+    #g1 {
+      fill-opacity: 0.05;
+    }
+    #g2,g3 {
+      fill-opacity: inherit;
+    }
+  </style>
+
+  <rect x="5"
+        y="5"
+        width="390"
+        height="470"
+        fill="red" />
+
+  <g id="g1">
+    <g id="g2">
+      <g id="g3">
+        <rect x="320"
+              y="0"
+              width="320"
+              height="480"
+              fill="blue"
+             style="fill-opacity: inherit;" />
+      </g>
+    </g>
+  </g>
+
+</svg>