Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <link href="resources/flexbox.css" rel="stylesheet"> | 3 <link href="resources/flexbox.css" rel="stylesheet"> |
| 4 <style> | 4 <style> |
| 5 body { | 5 body { |
| 6 margin: 0; | 6 margin: 0; |
| 7 } | 7 } |
| 8 .flexbox { | 8 .flexbox { |
| 9 background-color: green; | 9 background-color: green; |
| 10 height: 100px; | 10 height: 100px; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 background-color: red; | 52 background-color: red; |
| 53 } | 53 } |
| 54 .flexbox :nth-child(6) { | 54 .flexbox :nth-child(6) { |
| 55 background-color: orange; | 55 background-color: orange; |
| 56 } | 56 } |
| 57 .flexbox :nth-child(7) { | 57 .flexbox :nth-child(7) { |
| 58 background-color: purple; | 58 background-color: purple; |
| 59 } | 59 } |
| 60 </style> | 60 </style> |
| 61 | 61 |
| 62 <script src="../../resources/js-test.js"></script> | |
| 63 <script src="../../resources/testharness.js"></script> | 62 <script src="../../resources/testharness.js"></script> |
| 64 <script src="../../resources/testharnessreport.js"></script> | 63 <script src="../../resources/testharnessreport.js"></script> |
| 65 <script src="../../resources/check-layout-th.js"></script> | 64 <script src="../../resources/check-layout-th.js"></script> |
| 66 | 65 |
| 67 <body onload="checkLayout('.flexbox')"> | 66 <body onload="checkLayout('.flexbox')"> |
| 68 <div id=log></div> | 67 <div id=log></div> |
| 69 | 68 |
| 70 <div class='flexbox relative align-items-center'> | 69 <div class='flexbox relative align-items-center'> |
| 71 <div id='placed-absolute' class='absolute' data-offset-x=20 data-offset-y=20 ></div> | 70 <div id='placed-absolute' class='absolute' data-offset-x=20 data-offset-y=20 ></div> |
| 72 </div> | 71 </div> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 </div> | 137 </div> |
| 139 | 138 |
| 140 | 139 |
| 141 <script> | 140 <script> |
| 142 var absolute = document.getElementById('placed-absolute'); | 141 var absolute = document.getElementById('placed-absolute'); |
| 143 var beforePosition = absolute.getBoundingClientRect(); | 142 var beforePosition = absolute.getBoundingClientRect(); |
| 144 document.querySelector('.flexbox').style.height = '101px'; | 143 document.querySelector('.flexbox').style.height = '101px'; |
| 145 var afterPosition = absolute.getBoundingClientRect(); | 144 var afterPosition = absolute.getBoundingClientRect(); |
| 146 | 145 |
| 147 // Positioned element should not change position when the height of it's parent flexbox is changed. | 146 // Positioned element should not change position when the height of it's parent flexbox is changed. |
| 148 for (key in beforePosition) | 147 for (key in beforePosition) { |
| 149 shouldBe('beforePosition[key]', 'afterPosition[key]'); | 148 test(function() { |
|
eae
2016/07/12 16:56:54
Shouldn't the for in loop be inside the test funci
cbiesinger
2016/07/12 17:46:13
I liked having one PASS line for each iteration of
| |
| 149 assert_equals(beforePosition[key], afterPosition[key]); | |
| 150 }, 'position of ' + key); | |
| 151 } | |
| 150 </script> | 152 </script> |
| 151 </body> | 153 </body> |
| 152 </html> | 154 </html> |
| OLD | NEW |