|
1 |
| -<style> |
2 |
| -#a { |
3 |
| - position: absolute; |
4 |
| - left: constant(safe-area-inset-right); |
5 |
| - top: constant(safe-area-inset-top); |
6 |
| - width: 100px; |
7 |
| - height: 100px; |
8 |
| - background-color: green; |
9 |
| -} |
| 1 | +<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> |
| 2 | +<head> |
| 3 | + <meta name="viewport" content="initial-scale=1, viewport-fit=cover"> |
| 4 | + <style> |
| 5 | + #a { |
| 6 | + position: absolute; |
| 7 | + left: constant(safe-area-inset-right); |
| 8 | + top: constant(safe-area-inset-top); |
| 9 | + width: 100px; |
| 10 | + height: 100px; |
| 11 | + background-color: green; |
| 12 | + } |
10 | 13 |
|
11 |
| -#b { |
12 |
| - position: absolute; |
13 |
| - left: constant(safe-area-inset-bottom); |
14 |
| - top: constant(safe-area-inset-left); |
15 |
| - width: 100px; |
16 |
| - height: 100px; |
17 |
| - background-color: blue; |
18 |
| -} |
19 |
| -</style> |
20 |
| -<script> |
21 |
| -function getUIScript() |
22 |
| -{ |
23 |
| - return ` |
24 |
| - (function() { |
25 |
| - uiController.setObscuredInsets(200, 100, 300, 250); |
26 |
| - uiController.doAfterVisibleContentRectUpdate(function () { |
27 |
| - uiController.uiScriptComplete(); |
28 |
| - }); |
29 |
| - })();` |
30 |
| -} |
| 14 | + #b { |
| 15 | + position: absolute; |
| 16 | + left: constant(safe-area-inset-bottom); |
| 17 | + top: constant(safe-area-inset-left); |
| 18 | + width: 100px; |
| 19 | + height: 100px; |
| 20 | + background-color: blue; |
| 21 | + } |
| 22 | + </style> |
| 23 | + <script> |
| 24 | + function getUIScript() |
| 25 | + { |
| 26 | + return ` |
| 27 | + (function() { |
| 28 | + uiController.setSafeAreaInsets(50, 25, 75, 100); |
| 29 | + uiController.doAfterVisibleContentRectUpdate(function () { |
| 30 | + uiController.uiScriptComplete(); |
| 31 | + }); |
| 32 | + })();` |
| 33 | + } |
31 | 34 |
|
32 |
| -if (window.testRunner) { |
33 |
| - testRunner.waitUntilDone(); |
34 |
| - testRunner.runUIScript(getUIScript(), function(result) { |
35 |
| - testRunner.notifyDone(); |
36 |
| - }); |
37 |
| -} |
38 |
| -</script> |
| 35 | + if (window.testRunner) { |
| 36 | + testRunner.waitUntilDone(); |
| 37 | + window.onload = function () { |
| 38 | + testRunner.runUIScript(getUIScript(), function(result) { |
| 39 | + testRunner.notifyDone(); |
| 40 | + }); |
| 41 | + } |
| 42 | + } |
| 43 | + </script> |
| 44 | +</head> |
39 | 45 | <body>
|
40 |
| -<div id="a"></div> |
41 |
| -<div id="b"></div> |
42 |
| -<p>The boxes should be at 100, 200 and 300, 250.</p> |
| 46 | + <div id="a"></div> |
| 47 | + <div id="b"></div> |
| 48 | + <p>The boxes should be at 25, 50 and 75, 100.</p> |
| 49 | +</body> |
43 | 50 |
|
0 commit comments