Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / getComputedStyle / getComputedStyle-border-width.html
blobd9d70c315a9694c0ce37f5af8b35d295bb4d7e2e
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script src="../../../resources/js-test.js"></script>
6 </head>
7 <body>
8 <script>
10 description("Tests that the border-width shorthand is computed properly.")
12 var testContainer = document.createElement("div");
13 testContainer.contentEditable = true;
14 document.body.appendChild(testContainer);
16 testContainer.innerHTML = '<div id="test" style="border-width: 10px 5px 4px 3px; border-style: solid solid;">hello</div>';
18 e = document.getElementById('test');
19 computedStyle = window.getComputedStyle(e, null);
21 shouldBe("computedStyle.getPropertyValue('border-width')", "'10px 5px 4px 3px'");
23 e.style.borderWidth="20em 10em 4em 5em";
24 shouldBe("computedStyle.getPropertyValue('border-width')", "'320px 160px 64px 80px'");
26 e.style.borderWidth=""
27 e.style.borderStyle=""
28 e.style.borderTop = "10px solid"
29 shouldBe("computedStyle.getPropertyValue('border-width')", "'10px 0px 0px'");
31 e.style.borderTop=""
32 e.style.borderWidth="10px 5px 4px 3px"
33 e.style.borderStyle="none";
34 shouldBe("computedStyle.getPropertyValue('border-width')", "'0px'");
36 e.style.borderStyle="hidden";
37 shouldBe("computedStyle.getPropertyValue('border-width')", "'0px'");
39 document.body.removeChild(testContainer);
41 </script>
42 </body>
43 </html>