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
--- 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-<svg> resolves against the nearest <svg> ancestor, not the outer-<svg></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