6 window
.testRunner
.dumpAsText()
10 var target
= document
.getElementById("target");
11 if (window
.internals
) {
12 var boundingBox
= internals
.boundingBox(target
);
13 var boundingClientRect
= target
.getBoundingClientRect();
14 var rectsAreEqual
= (boundingBox
.width
=== boundingClientRect
.width
15 && boundingBox
.height
=== boundingClientRect
.height
16 && boundingBox
.left
=== boundingClientRect
.left
17 && boundingBox
.top
=== boundingClientRect
.top
);
19 document
.getElementById("result").innerHTML
= rectsAreEqual
? "PASS" : "FAIL: boundingBox: " + boundingBox
.width
+ " x " + boundingBox
.height
+ " @ (" + boundingBox
.left
+ ", " + boundingBox
.top
+ "), boundingClientRect: "
20 + boundingClientRect
.width
+ " x " + boundingClientRect
.height
+ " @ (" + boundingClientRect
.left
+ ", " + boundingClientRect
.top
+ ")";
25 <body onload=
"runTest()">
26 <div style=
"height: 200px;"></div>
27 <svg width=
400 height=
400>
28 <image width=
200 height=
200 x=
50 y=
50 id=
"target" />
31 Test that -[DOMNode boundingBox] returns reasonable results for SVG elements.
33 <p id=
"result">This test can only be run in DumpRenderTree.
</p>