4 https://bugzilla.mozilla.org/show_bug.cgi?id=874919
7 <title>Test for Bug
874919</title>
8 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=874919">Mozilla Bug
874919</a>
15 <div id=
"content" style=
"width: 150px">
16 <svg id=
"outer_SVG" style=
"display: inline; width: 100%">
17 <circle cx=
"120" cy=
"120" r=
"120" fill=
"blue"></circle>
19 <circle id=
"circle" cx=
"120" cy=
"120" r=
"120" fill=
"red"></circle>
25 <script type=
"text/javascript">
27 var shouldUseComputed
= ["inner_SVG"]
28 var shouldUseUsed
= ["outer_SVG"]
30 shouldUseUsed
.forEach(function(elemId
) {
32 var style
= window
.getComputedStyle(document
.getElementById(elemId
));
34 ok(style
.width
.match(/^\d+px$/),
35 "Inline Outer SVG element's getComputedStyle.width should be used value. ");
37 ok(style
.height
.match(/^\d+px$/),
38 "Inline Outer SVG element's getComputedStyle.height should be used value.");
41 shouldUseComputed
.forEach(function(elemId
) {
42 var style
= window
.getComputedStyle(document
.getElementById(elemId
));
44 // Computed value should match either the percentage used, or "auto" in the case of the inner SVG element.
45 ok(style
.width
.match(/^\d+%$|^auto$/),
46 "Inline inner SVG element's getComputedStyle.width should be computed value. " + style
.width
);
48 ok(style
.height
.match(/^\d+%$|^auto$/),
49 "Inline inner SVG element's getComputedStyle.height should be computed value. " + style
.height
);