Commit 8ae4d504 authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

CSS: WPTs for dominant-baseline parsing

dominant-baseline is specified to accept
auto | text-bottom | alphabetic | ideographic | middle | central
| mathematical | hanging | text-top

Blink hasn't implemented support for text-bottom or text-top.

https://drafts.csswg.org/css-inline-3/#dominant-baseline-property

Change-Id: I956027066788415063ee0d6b9867af458da365cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728890Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682671}
parent 5818194e
This is a testharness.js-based test.
PASS Property dominant-baseline value 'auto' computes to 'auto'
FAIL Property dominant-baseline value 'text-bottom' computes to 'text-bottom' assert_equals: expected "text-bottom" but got "auto"
PASS Property dominant-baseline value 'alphabetic' computes to 'alphabetic'
PASS Property dominant-baseline value 'ideographic' computes to 'ideographic'
PASS Property dominant-baseline value 'middle' computes to 'middle'
PASS Property dominant-baseline value 'central' computes to 'central'
PASS Property dominant-baseline value 'mathematical' computes to 'mathematical'
PASS Property dominant-baseline value 'hanging' computes to 'hanging'
FAIL Property dominant-baseline value 'text-top' computes to 'text-top' assert_equals: expected "text-top" but got "auto"
Harness: the test ran to completion.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Inline Layout: getComputedStyle().dominantBaseline</title>
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#dominant-baseline-property">
<meta name="assert" content="dominant-baseline 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("dominant-baseline", "auto");
test_computed_value("dominant-baseline", "text-bottom");
test_computed_value("dominant-baseline", "alphabetic");
test_computed_value("dominant-baseline", "ideographic");
test_computed_value("dominant-baseline", "middle");
test_computed_value("dominant-baseline", "central");
test_computed_value("dominant-baseline", "mathematical");
test_computed_value("dominant-baseline", "hanging");
test_computed_value("dominant-baseline", "text-top");
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Inline Layout: parsing dominant-baseline with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#dominant-baseline-property">
<meta name="assert" content="dominant-baseline supports only the grammar 'auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top'.">
<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("dominant-baseline", "normal");
test_invalid_value("dominant-baseline", "none");
test_invalid_value("dominant-baseline", "alphabetic, ideographic");
test_invalid_value("dominant-baseline", "middle central");
</script>
</body>
</html>
This is a testharness.js-based test.
PASS e.style['dominant-baseline'] = "auto" should set the property value
FAIL e.style['dominant-baseline'] = "text-bottom" should set the property value assert_not_equals: property should be set got disallowed value ""
PASS e.style['dominant-baseline'] = "alphabetic" should set the property value
PASS e.style['dominant-baseline'] = "ideographic" should set the property value
PASS e.style['dominant-baseline'] = "middle" should set the property value
PASS e.style['dominant-baseline'] = "central" should set the property value
PASS e.style['dominant-baseline'] = "mathematical" should set the property value
PASS e.style['dominant-baseline'] = "hanging" should set the property value
FAIL e.style['dominant-baseline'] = "text-top" should set the property value assert_not_equals: property should be set got disallowed value ""
Harness: the test ran to completion.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Inline Layout: parsing dominant-baseline with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-inline-3/#dominant-baseline-property">
<meta name="assert" content="dominant-baseline supports the full grammar 'auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top'.">
<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("dominant-baseline", "auto");
test_valid_value("dominant-baseline", "text-bottom");
test_valid_value("dominant-baseline", "alphabetic");
test_valid_value("dominant-baseline", "ideographic");
test_valid_value("dominant-baseline", "middle");
test_valid_value("dominant-baseline", "central");
test_valid_value("dominant-baseline", "mathematical");
test_valid_value("dominant-baseline", "hanging");
test_valid_value("dominant-baseline", "text-top");
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment