Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <style> | |
| 3 * { | |
| 4 box-sizing: border-box; | |
| 5 } | |
| 6 | |
| 7 .container { | |
| 8 width: 400px; | |
| 9 height: 100px; | |
| 10 background: #DDD; | |
| 11 position: relative; | |
| 12 padding: 0 10%; | |
|
mstensho (USE GERRIT)
2016/05/11 08:36:22
I don't think you need to use percents here (they
Deokjin Kim
2016/05/11 14:10:04
Done.
| |
| 13 } | |
| 14 | |
| 15 .item { | |
| 16 width: 100px; | |
| 17 height: 100px; | |
| 18 background: #09F; | |
| 19 left: 10%; | |
| 20 position: absolute; | |
| 21 } | |
| 22 </style> | |
| 23 <script src="../../../resources/js-test.js"></script> | |
| 24 <div class="container"> | |
| 25 <div class="item"> | |
| 26 </div> | |
| 27 </div> | |
| 28 <script> | |
| 29 description("Blue item box is 10% left in container. Box should display 40px a s getComputedStyle( item ).left should return 40px (400px * 10%)"); | |
| 30 var item = document.querySelector('.item'); | |
| 31 var computedStyle = window.getComputedStyle(item); | |
| 32 shouldBe("computedStyle.getPropertyValue('left')", "'40px'"); | |
| 33 </script> | |
| OLD | NEW |