blob: acbdd48e345cc41d4ae019c80e523ebc913ae9bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
<!DOCTYPE html>
<html>
<head>
<title>Inserting an @viewport rule before an existing one (CSSOM)</title>
<style>
@viewport {
width: 500px;
}
</style>
<script>
if (window.testRunner)
testRunner.injectStyleSheet("@viewport { width: extend-to-zoom 980px; min-zoom: 0.25; max-zoom: 5; height: auto; zoom: auto; user-zoom: zoom; orientation: auto }", true);
function test() {
if (window.testRunner) {
testRunner.dumpAsText();
document.styleSheets[0].insertRule("@viewport {width: 1000px}", 0);
document.body.offsetWidth; // Trigger style resolving
alert(internals.viewportAsText(document, 1, 320, 352));
}
}
</script>
</head>
<body onload="test()"></body>
</html>
|