4 <script src=
"../../resources/js-test.js"></script>
6 <body style=
"margin: 0; padding: 0;">
7 <div style=
"margin: 0; width: 300px">
8 <div id=
"test" style=
"width: 200px; height: 200px; margin: 0.5px 1.5px 2.5px 3.5px; background: blue;"></div>
9 <div id=
"test2" style=
"width: 299px; height: 200px; margin: 5px auto; background: blue;"></div>
12 // Fixed width margins.
13 var style
= window
.getComputedStyle(document
.getElementById('test'));
14 shouldBe('style.marginTop', "'0.5px'");
15 shouldBe('style.marginRight', "'1.5px'");
16 shouldBe('style.marginBottom', "'2.5px'");
17 shouldBe('style.marginLeft', "'3.5px'");
19 // Auto left/right margin.
20 var style
= window
.getComputedStyle(document
.getElementById('test2'));
21 shouldBe('style.marginLeft', "'0.5px'");
22 shouldBe('style.marginRight', "'0.5px'");