Bug 1556041: added web platform tests for text-underline-offset r=emilio
authorCharlie Marlow <cmarlow@mozilla.com>
Wed, 05 Jun 2019 20:02:17 +0000
changeset 477022 83167321bb45d62a1c150e1668656dbd2a74e359
parent 477021 0d39f4b9fe604540219c755ff6d1b95c91c9a89c
child 477023 e1fab8c9b1aa45f5e4e234dc0a021c48bea9d00b
push id36115
push usershindli@mozilla.com
push dateThu, 06 Jun 2019 09:29:49 +0000
treeherdermozilla-central@13ceede08d23 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1556041
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1556041: added web platform tests for text-underline-offset r=emilio One test case for the from-font feature is expected to fail (noted in it's ini file), when this is implemented later it should pass Differential Revision: https://phabricator.services.mozilla.com/D33370
testing/web-platform/meta/css/css-text-decor/text-underline-offset-computed.html.ini
testing/web-platform/meta/css/css-text-decor/text-underline-offset-initial.html.ini
testing/web-platform/meta/css/css-text-decor/text-underline-offset-invalid.html.ini
testing/web-platform/meta/css/css-text-decor/text-underline-offset-valid.html.ini
testing/web-platform/tests/css/css-text-decor/text-underline-offset-computed.html
testing/web-platform/tests/css/css-text-decor/text-underline-offset-initial.html
testing/web-platform/tests/css/css-text-decor/text-underline-offset-invalid.html
testing/web-platform/tests/css/css-text-decor/text-underline-offset-valid.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/css/css-text-decor/text-underline-offset-computed.html.ini
@@ -0,0 +1,4 @@
+[text-underline-offset-computed.html]
+  prefs: [layout.css.text-underline-offset.enabled:true]
+  [Property text-underline-offset value 'from-font' computes to 'from-font']
+    expected: FAIL
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/css/css-text-decor/text-underline-offset-initial.html.ini
@@ -0,0 +1,3 @@
+[text-underline-offset-initial.html]
+  prefs: [layout.css.text-underline-offset.enabled:true]
+
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/css/css-text-decor/text-underline-offset-invalid.html.ini
@@ -0,0 +1,2 @@
+[text-underline-offset-invalid.html]
+  prefs: [layout.css.text-underline-offset.enabled:true]
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/css/css-text-decor/text-underline-offset-valid.html.ini
@@ -0,0 +1,4 @@
+[text-underline-offset-valid.html]
+  prefs: [layout.css.text-underline-offset.enabled:true]
+  [e.style['text-underline-offset'\] = "from-font" should set the property value]
+    expected: FAIL
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text-decor/text-underline-offset-computed.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Text Decoration Test: parsing text-underline-offset computed values</title>
+<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#underline-offset">
+<meta name="assert" content="text-underline-offset 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-underline-offset", "auto");
+test_computed_value("text-underline-offset", "from-font");
+test_computed_value("text-underline-offset", "calc(10px - 8px)", "2px");
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text-decor/text-underline-offset-initial.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" title="2.4 Text Underline Offset: the 'text-underline-offset' property"
+      href="https://drafts.csswg.org/css-text-decor-4/#underline-offset" />
+</head>
+<body>
+<script>
+test(function() {
+   assert_equals(getComputedStyle(document.body)["text-underline-offset"], "auto", "Must be set to value auto as initial value.");
+}, "Initial value of text-underline-offset");
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text-decor/text-underline-offset-invalid.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Text Decoration Test: parsing text-underline-offset with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#underline-offset">
+<meta name="assert" content="text-underline-offset supports the following values: auto | from-font| <length>">
+<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-underline-offset", "otto");
+test_invalid_value("text-underline-offset", "asdlflj");
+test_invalid_value("text-underline-offset", "-10");
+test_invalid_value("text-underline-offset", "60002020");
+test_invalid_value("text-underline-offset", "!@#$%^&");
+test_invalid_value("text-underline-offset", "10e2");
+test_invalid_value("text-underline-offset", "from font");
+test_invalid_value("text-underline-offset", "10%");
+test_invalid_value("text-underline-offset", "-27%");
+test_invalid_value("text-underline-offset", "calc(40% - 20px)");
+test_invalid_value("text-underline-offset", "calc(100% - 40em)");
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text-decor/text-underline-offset-valid.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Text Decoration Test: parsing text-underline-offset with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-text-decor-4/#underline-offset">
+<meta name="assert" content="text-underline-offset supports the following values: auto | from-font| <length>">
+<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-underline-offset", "auto");
+test_valid_value("text-underline-offset", "from-font");
+test_valid_value("text-underline-offset", "-10px");
+test_valid_value("text-underline-offset", "2001em");
+test_valid_value("text-underline-offset", "-49em");
+test_valid_value("text-underline-offset", "53px");
+test_valid_value("text-underline-offset", "calc(40em - 10px)");
+test_valid_value("text-underline-offset", "calc(-13em + 50px)");
+</script>
+</body>
+</html>