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 <style> | 3 <style> |
4 dialog { | 4 dialog { |
5 position: fixed; | 5 position: fixed; |
6 } | 6 } |
7 </style> | 7 </style> |
8 <script src="../../../resources/js-test.js"></script> | 8 <script src="../../resources/js-test.js"></script> |
9 <dialog id="dialog">It is my dialog.</dialog> | 9 <dialog id="dialog">It is my dialog.</dialog> |
10 <div id="absolute-div"> | 10 <div id="absolute-div"> |
11 <div id="relative-div"></div> | 11 <div id="relative-div"></div> |
12 </div> | 12 </div> |
13 <script> | 13 <script> |
14 description('Tests layout of fixed positioned dialogs.'); | 14 description('Tests layout of fixed positioned dialogs.'); |
15 | 15 |
16 function checkCentered(dialog) { | 16 function checkCentered(dialog) { |
17 centeredTop = (window.innerHeight - dialog.offsetHeight) / 2; | 17 centeredTop = (window.innerHeight - dialog.offsetHeight) / 2; |
18 shouldBe('dialog.getBoundingClientRect().top', 'centeredTop'); | 18 shouldBe('dialog.getBoundingClientRect().top', 'centeredTop'); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 (function() { | 152 (function() { |
153 debug('<br>A dialog with specified \'top\' should be positioned as usual'); | 153 debug('<br>A dialog with specified \'top\' should be positioned as usual'); |
154 offset = 50; | 154 offset = 50; |
155 dialog.style.top = offset + 'px'; | 155 dialog.style.top = offset + 'px'; |
156 dialog.showModal(); | 156 dialog.showModal(); |
157 shouldBe('dialog.getBoundingClientRect().top', 'offset'); | 157 shouldBe('dialog.getBoundingClientRect().top', 'offset'); |
158 | 158 |
159 reset(); | 159 reset(); |
160 }()); | 160 }()); |
161 </script> | 161 </script> |
OLD | NEW |