Skip to content

Commit

Permalink
CSS: Parsing tests for text-size-adjust
Browse files Browse the repository at this point in the history
text-size-adjust: auto | none | <percentage>
https: //drafts.csswg.org/css-size-adjust/#propdef-text-size-adjust
Change-Id: I7304a7f6e94fc7ca979d2b4d095f53d321704cff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1595202
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660272}
  • Loading branch information
ericwilligers authored and chromium-wpt-export-bot committed May 16, 2019
1 parent 17fdc10 commit 9fbe765
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
21 changes: 21 additions & 0 deletions css/css-size-adjust/inheritance.html
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Inheritance of CSS Mobile Text Size Adjustment properties</title>
<link rel="help" href="https://drafts.csswg.org/css-size-adjust/#property-index">
<meta name="assert" content="text-size-adjust inherits according to the spec.">
<meta name="assert" content="text-size-adjust has initial value according to the spec.">
<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_inherited('text-size-adjust', 'auto', '10%');
</script>
</body>
</html>
23 changes: 23 additions & 0 deletions css/css-size-adjust/parsing/text-size-adjust-computed.html
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Mobile Text Size Adjustment: getComputedValue().text-size-adjust</title>
<link rel="help" href="https://drafts.csswg.org/css-size-adjust/#propdef-text-size-adjust">
<meta name="assert" content="text-size-adjust 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("text-size-adjust", 'auto');
test_computed_value("text-size-adjust", 'none', '100%');

test_computed_value("text-size-adjust", '200%');
test_computed_value("text-size-adjust", '100%');
test_computed_value("text-size-adjust", '0%');
</script>
</body>
</html>
21 changes: 21 additions & 0 deletions css/css-size-adjust/parsing/text-size-adjust-invalid.html
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Mobile Text Size Adjustment: parsing text-size-adjust with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-size-adjust/#propdef-text-size-adjust">
<meta name="assert" content="text-size-adjust supports only the grammar 'auto | none | <percentage>'.">
<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("text-size-adjust", 'reverse');

test_invalid_value("text-size-adjust", '0');
test_invalid_value("text-size-adjust", '10px');
test_invalid_value("text-size-adjust", '-100%');
</script>
</body>
</html>
22 changes: 22 additions & 0 deletions css/css-size-adjust/parsing/text-size-adjust-valid.html
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Mobile Text Size Adjustment: parsing text-size-adjust with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-size-adjust/#propdef-text-size-adjust">
<meta name="assert" content="text-size-adjust supports the full grammar 'auto | none | <percentage>'.">
<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("text-size-adjust", 'auto');
test_valid_value("text-size-adjust", 'none');

test_valid_value("text-size-adjust", '200%');
test_valid_value("text-size-adjust", '100%');
test_valid_value("text-size-adjust", '0%');
</script>
</body>
</html>

0 comments on commit 9fbe765

Please sign in to comment.