13 border:
1px solid blue;
23 text-decoration: none;
26 <script src=
"../../resources/js-test.js"></script>
31 <li><a href=
"#">About Us
</a></li>
32 <li><a href=
"#">Contact Us
</a></li>
36 if (window
.testRunner
)
37 testRunner
.waitUntilDone();
39 var list
= document
.getElementsByTagName('ul')[0];
40 var firstLinkTop
= list
.firstElementChild
.getBoundingClientRect().top
;
41 var lastLinkTop
= list
.lastElementChild
.getBoundingClientRect().top
;
43 if (firstLinkTop
== lastLinkTop
)
44 testPassed('Links are on the same line.');
46 shouldBe('firstLinkTop', 'lastLinkTop');
48 window
.onload = function() {
49 list
.style
.marginRight
= '-10px';
51 list
.style
.marginRight
= 'auto';
53 if (firstLinkTop
== list
.firstElementChild
.getBoundingClientRect().top
)
54 testPassed('First link didn\'t move after layout.');
56 shouldBe('list.firstElementChild.getBoundingClientRect().top', 'firstLinkTop');
58 if (lastLinkTop
== list
.lastElementChild
.getBoundingClientRect().top
)
59 testPassed('Last link didn\'t move after layout.');
61 shouldBe('list.lastElementChild.getBoundingClientRect().top', 'lastLinkTop');
63 if (window
.testRunner
)
64 testRunner
.notifyDone();