Skip to content

Commit d6c8b6f

Browse files
shubhamg13servo-wpt-sync
authored andcommitted
Add more tests to css-device-adapt to verify clamp behaviour.
Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
1 parent 26a9634 commit d6c8b6f

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!doctype html>
2+
<meta charset=utf-8>
3+
<meta name="viewport" content="width=device-width, initial-scale=10.0, maximum-scale=2.0">
4+
<link rel="help" href="https://drafts.csswg.org/css-device-adapt/">
5+
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/9004">
6+
<link rel=help href="https://github.com/servo/servo/issues/40390">
7+
<link rel="author" title="Shubham Gupta" href="mailto:shubham.gupta@chromium.org">
8+
<style>
9+
body {
10+
margin: 0;
11+
}
12+
#content {
13+
width: 100px;
14+
height: 100px;
15+
background: green;
16+
}
17+
</style>
18+
19+
<div id="content">Content</div>
20+
21+
<script src=/resources/testharness.js></script>
22+
<script src=/resources/testharnessreport.js></script>
23+
<script>
24+
'use strict';
25+
test(() => {
26+
assert_equals(window.visualViewport.scale, 2.0,
27+
'visual viewport scale should be 2.0');
28+
}, 'Page with meta viewport "width=device-width, ' +
29+
'initial-scale=10.0, maximum-scale=2.0" ' +
30+
'should scale to 2.0.');
31+
</script>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!doctype html>
2+
<meta charset=utf-8>
3+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=2.0">
4+
<link rel="help" href="https://drafts.csswg.org/css-device-adapt/">
5+
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/9004">
6+
<link rel=help href="https://github.com/servo/servo/issues/40390">
7+
<link rel="author" title="Shubham Gupta" href="mailto:shubham.gupta@chromium.org">
8+
<style>
9+
body {
10+
margin: 0;
11+
}
12+
#content {
13+
width: 100px;
14+
height: 100px;
15+
background: green;
16+
}
17+
</style>
18+
19+
<div id="content">Content</div>
20+
21+
<script src=/resources/testharness.js></script>
22+
<script src=/resources/testharnessreport.js></script>
23+
<script>
24+
'use strict';
25+
test(() => {
26+
assert_equals(window.visualViewport.scale, 2.0,
27+
'visual viewport scale should be 2.0');
28+
}, 'Page with meta viewport "width=device-width, ' +
29+
'initial-scale=1.0, minimum-scale=2.0" ' +
30+
'should scale to 2.0.');
31+
</script>

0 commit comments

Comments
 (0)