-
Notifications
You must be signed in to change notification settings - Fork 41
/
touch-action-parsing.html
executable file
·53 lines (50 loc) · 2.27 KB
/
touch-action-parsing.html
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE HTML>
<html>
<head>
<script src="js-test.js"></script>
<style>
/*
Give some rules below something to override in order to test
that they really are being parsed
*/
.defnone {
touch-action: none;
}
</style>
</head>
<body>
<p id="description"></p>
<div class="test" id="default" expected="auto"></div>
<div class="test defnone" id="stylesheet-none" expected="none"></div>
<div class="test defnone" id="explicit-auto" style="touch-action: auto;" expected="auto"></div>
<div class="test" id="explicit-pan-x" style="touch-action: pan-x;" expected="pan-x"></div>
<div class="test" id="explicit-pan-y" style="touch-action: pan-y;" expected="pan-y"></div>
<div class="test" id="explicit-pan-x-pan-y" style="touch-action: pan-x pan-y;" expected="pan-x pan-y"></div>
<div class="test" id="explicit-pan-y-pan-x" style="touch-action: pan-y pan-x;" expected="pan-x pan-y"></div>
<div class="test" id="explicit-manipulation" style="touch-action: manipulation;" expected="manipulation"></div>
<div class="test" id="explicit-none" style="touch-action: none;" expected="none"></div>
<div class="test" id="explicit-invalid-1" style="touch-action: bogus;" expected="auto"></div>
<div class="test defnone" id="explicit-invalid-2" style="touch-action: auto pan-x;" expected="none"></div>
<div class="test" id="explicit-invalid-3" style="touch-action: pan-y none;" expected="auto"></div>
<div class="test" id="explicit-invalid-4" style="touch-action: pan-x pan-x;" expected="auto"></div>
<div class="test" id="explicit-invalid-5" style="touch-action: manipulation pan-x;" expected="auto"></div>
<div style="touch-action: none;">
<div class="test" id="not-inherited" expected="auto"></div>
<div class="test" id="inherit" style="touch-action: inherit;" expected="none"></div>
</div>
<div class="test defnone" id="initial" style="touch-action: initial;" expected="auto"></div>
<div id="console"></div>
<script>
description("Test the parsing and application of the touch-action property.");
var tests = document.querySelectorAll('.test');
var style;
for (var i = 0; i < tests.length; i++) {
debug('Test case: ' + tests[i].id);
style = window.getComputedStyle(tests[i]);
shouldBeEqualToString('style.touchAction', tests[i].attributes.expected.value);
debug('');
}
successfullyParsed = true;
</script>
</body>
</html>