| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <link href="resources/dialog-layout.css" rel="stylesheet"> | 2 <link href="resources/dialog-layout.css" rel="stylesheet"> |
| 3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
| 4 <dialog id="dialog">It is my dialog.</dialog> | 4 <dialog id="dialog">It is my dialog.</dialog> |
| 5 <div id="absolute-div"> | 5 <div id="absolute-div"> |
| 6 <div id="relative-div"></div> | 6 <div id="relative-div"></div> |
| 7 </div> | 7 </div> |
| 8 <script> | 8 <script> |
| 9 description('Tests layout of absolutely positioned modal dialogs.'); | 9 description('Tests layout of absolutely positioned modal dialogs.'); |
| 10 | 10 |
| 11 function checkCentered(dialog) { | 11 function checkCentered(dialog) { |
| 12 centeredTop = (window.innerHeight - dialog.offsetHeight) / 2; | 12 centeredTop = (window.innerHeight - dialog.offsetHeight) / 2; |
| 13 shouldBe('dialog.getBoundingClientRect().top', 'centeredTop'); | 13 shouldBe('dialog.getBoundingClientRect().top', 'centeredTop'); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 (function() { | 183 (function() { |
| 184 debug('<br>A dialog with specified \'bottom\' should be positioned as usual'
); | 184 debug('<br>A dialog with specified \'bottom\' should be positioned as usual'
); |
| 185 offset = 50; | 185 offset = 50; |
| 186 dialog.style.bottom = offset + 'px'; | 186 dialog.style.bottom = offset + 'px'; |
| 187 dialog.showModal(); | 187 dialog.showModal(); |
| 188 shouldBe('dialog.getBoundingClientRect().bottom + window.scrollY', 'window.i
nnerHeight - offset'); | 188 shouldBe('dialog.getBoundingClientRect().bottom + window.scrollY', 'window.i
nnerHeight - offset'); |
| 189 dialog.style.bottom = 'auto'; | 189 dialog.style.bottom = 'auto'; |
| 190 reset(); | 190 reset(); |
| 191 }()); | 191 }()); |
| 192 </script> | 192 </script> |
| OLD | NEW |