Skip to content

Commit

Permalink
[pointerevents] Serialization of touch-action (web-platform-tests#18439)
Browse files Browse the repository at this point in the history
Tests that the CSS property touch-action supports each
value specified in the spec, and serializes correctly.

Tests that touch-action has initial value auto, and does
not inherit.

https://w3c.github.io/pointerevents/#the-touch-action-css-property
  • Loading branch information
ewilligers authored and natechapin committed Aug 23, 2019
1 parent 3ebfad5 commit efd5297
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pointerevents/inheritance.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Inheritance of touch-action</title>
<link rel="help" href="https://w3c.github.io/pointerevents/#the-touch-action-css-property">
<meta name="assert" content="touch-action does not inherit.">
<meta name="assert" content="touch-action initial value is auto.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/inheritance-testcommon.js"></script>
</head>
<body>
<div id="container">
<div id="target"></div>
</div>
<script>
assert_not_inherited('touch-action', 'auto', 'none');
</script>
</body>
</html>
24 changes: 24 additions & 0 deletions pointerevents/parsing/touch-action-computed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Pointer Events: getComputedStyle().touchAction</title>
<link rel="help" href="https://w3c.github.io/pointerevents/#the-touch-action-css-property">
<meta name="assert" content="touch-action computed value is as specified.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value("touch-action", "auto");
test_computed_value("touch-action", "none");
test_computed_value("touch-action", "manipulation");

test_computed_value("touch-action", "pan-x");
test_computed_value("touch-action", "pan-y");
test_computed_value("touch-action", "pan-x pan-y");
</script>
</body>
</html>
18 changes: 18 additions & 0 deletions pointerevents/parsing/touch-action-invalid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Pointer Events: parsing touch-action with invalid values</title>
<link rel="help" href="https://w3c.github.io/pointerevents/#the-touch-action-css-property">
<meta name="assert" content="touch-action supports only the grammar 'auto | none | [ pan-x || pan-y ] | manipulation'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("touch-action", "auto none");
test_invalid_value("touch-action", "manipulation pan-x");
test_invalid_value("touch-action", "pan-y pan-x pan-y");
</script>
</body>
</html>
23 changes: 23 additions & 0 deletions pointerevents/parsing/touch-action-valid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Pointer Events: parsing touch-action with valid values</title>
<link rel="help" href="https://w3c.github.io/pointerevents/#the-touch-action-css-property">
<meta name="assert" content="touch-action supports the full grammar 'auto | none | [ pan-x || pan-y ] | manipulation'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("touch-action", "auto");
test_valid_value("touch-action", "none");
test_valid_value("touch-action", "manipulation");

// [ pan-x || pan-y ]
test_valid_value("touch-action", "pan-x");
test_valid_value("touch-action", "pan-y");
test_valid_value("touch-action", "pan-y pan-x", "pan-x pan-y");
</script>
</body>
</html>

0 comments on commit efd5297

Please sign in to comment.