| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <style> | |
| 3 #container { | |
| 4 width: 500px; | |
| 5 } | |
| 6 #container > div { | |
| 7 background-color: red; | |
| 8 position: relative; | |
| 9 left: 5px; | |
| 10 right: auto; | |
| 11 top: 5px; | |
| 12 bottom: 5px; | |
| 13 } | |
| 14 </style> | |
| 15 <script src="../../../resources/js-test.js"></script> | |
| 16 <p> | |
| 17 getComputedStyle should return minus the value of left as right when right is
auto. | |
| 18 </p> | |
| 19 <div id="container"> | |
| 20 <div id=ltr> | |
| 21 If direction of containing block is ltr, bottom and right should be negative | |
| 22 </div> | |
| 23 bottom and right should be negative | |
| 24 </div> | |
| 25 <div id="container" dir="rtl"> | |
| 26 <div id=rtl> | |
| 27 If direction of containing block is rtl, bottom and right should be negative | |
| 28 </div> | |
| 29 bottom and right should be negative | |
| 30 </div> | |
| 31 <script> | |
| 32 var ltrElement = document.getElementById("ltr"); | |
| 33 var rtlElement = document.getElementById("rtl"); | |
| 34 | |
| 35 shouldBe("window.getComputedStyle(ltrElement).top", "'5px'"); | |
| 36 shouldBe("window.getComputedStyle(ltrElement).right", "'-5px'"); | |
| 37 shouldBe("window.getComputedStyle(ltrElement).bottom", "'-5px'"); | |
| 38 shouldBe("window.getComputedStyle(ltrElement).left", "'5px'"); | |
| 39 | |
| 40 shouldBe("window.getComputedStyle(rtlElement).top", "'5px'"); | |
| 41 shouldBe("window.getComputedStyle(rtlElement).right", "'-5px'"); | |
| 42 shouldBe("window.getComputedStyle(rtlElement).bottom", "'-5px'"); | |
| 43 shouldBe("window.getComputedStyle(rtlElement).left", "'5px'"); | |
| 44 </script> | |
| OLD | NEW |