Bug 1390088 - Part 2. Add a reftest to check percentage width/height on inner-<svg> resolves against the nearest <svg> ancestor. draft
authorcku <cku@mozilla.com>
Mon, 21 Aug 2017 16:21:38 +0800
changeset 651832 a4f4e267367c49df60bf729b7f9b977cc28d4819
parent 651390 a01ad3c7eb72e4c1fc5ce880d78fc519da65b479
child 651833 362efefd9aa9e184c28133149bf8adbe4b9a33cd
push id75821
push userbmo:cku@mozilla.com
push dateThu, 24 Aug 2017 02:20:38 +0000
bugs1390088
milestone57.0a1
Bug 1390088 - Part 2. Add a reftest to check percentage width/height on inner-<svg> resolves against the nearest <svg> ancestor. MozReview-Commit-ID: KmWd9kMx8j3
layout/reftests/svg/reftest.list
layout/reftests/svg/svg-in-inner-svg-dimensions.svg
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -411,16 +411,17 @@ fuzzy-if(skiaContent,1,340) == stroke-da
 == stroke-width-percentage-02b.svg stroke-width-percentage-02-ref.svg
 == stroke-width-percentage-03.xhtml stroke-width-percentage-03-ref.xhtml
 
 == style-property-on-script-element-01.svg pass.svg
 == style-without-type-attribute.svg pass.svg
 
 == svg-in-foreignObject-01.xhtml svg-in-foreignObject-01-ref.xhtml
 fuzzy-if(skiaContent,1,2600) == svg-in-foreignObject-02.xhtml svg-in-foreignObject-01-ref.xhtml # reuse -01-ref.xhtml
+== svg-in-inner-svg-dimensions.svg pass.svg
 == switch-01.svg pass.svg
 
 == suspend-01.svg pass.svg
 == suspend-02.svg pass.svg
 == suspend-03.svg pass.svg
 == suspend-04.svg pass.svg
 == suspend-05.svg pass.svg
 == suspend-06.svg pass.svg
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/svg-in-inner-svg-dimensions.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+  <title>Test that percentage width/height for inner-&lt;svg&gt; resolves against the nearest &lt;svg&gt; ancestor, not the outer-&lt;svg&gt;</title>
+  <rect width="100%" height="100%" fill="lime"/>
+  <!-- This red rect should be covered by the lime one below -->
+  <rect x="50" y="50" width="50" height="50" fill="red"/>
+  <svg width="100" height="100">
+    <svg viewBox="0 0 100 100">
+      <rect x="50" y="50" width="50" height="50" fill="lime"/>
+    </svg>
+  </svg>
+</svg>
\ No newline at end of file