Bug 1467346 [wpt PR 11373] - [css-text-3] Tests for percentage text indent, a=testonly
authorFlorian Rivoal <git@florian.rivoal.net>
Thu, 11 Oct 2018 09:32:01 +0000
changeset 496784 47592c094a7b01ec9fef60f9dcdd4c5842f50d3a
parent 496783 31a20d731a4041d04f4dd6f0d896b9444634ac1a
child 496785 a74fa7d2b1f3ad43b8133b3af9632745bcba0a0b
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1467346, 11373
milestone64.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 1467346 [wpt PR 11373] - [css-text-3] Tests for percentage text indent, a=testonly Automatic update from web-platform-tests[css-text-3] Tests for percentage text indent Relates to the spec changes decided in https://github.com/w3c/csswg-drafts/issues/2394 -- wpt-commits: e124e1645d1527a99652e9e510e15d5fc2bac055 wpt-pr: 11373
testing/web-platform/tests/css/css-text/text-indent/reference/text-indent-percentage-002-ref.html
testing/web-platform/tests/css/css-text/text-indent/text-indent-percentage-002.html
testing/web-platform/tests/css/css-text/text-indent/text-indent-percentage-003.html
testing/web-platform/tests/css/css-text/text-indent/text-indent-percentage-004.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-indent/reference/text-indent-percentage-002-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html lang=en>
+<meta charset="utf-8">
+<title>CSS Text Test reference</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<style>
+div { padding-left: 50px; }
+</style>
+
+<p>Test passes if there is a single black X below and no red.
+<div>X</div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-indent/text-indent-percentage-002.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang=en>
+<meta charset="utf-8">
+<title>CSS Text Test: text-indent percentage resolution basis</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">
+<meta name="flags" content="">
+<link rel="match" href="reference/text-indent-percentage-002-ref.html">
+<meta name="assert" content="Percentages in text-indent refer to width of the element's content box">
+<style>
+section { position: absolute; }
+section, div {
+  border-right: 10px solid white;
+  margin-right: 10px;
+  padding-right: 10px;
+}
+div {
+  box-sizing: border-box;
+  width: 120px;
+}
+.test div { text-indent: 50%; color: red; }
+.ref div { text-indent: 50px; }
+</style>
+
+<p>Test passes if there is a single black X below and no red.
+<section class=test><div>X</div></section>
+<section class=ref><div>X</div></section>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-indent/text-indent-percentage-003.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang=en>
+<meta charset="utf-8">
+<title>CSS Text Test: text-indent percentage resolution basis</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">
+<meta name="flags" content="">
+<link rel="match" href="reference/text-indent-percentage-002-ref.html">
+<meta name="assert" content="Percentages in text-indent refer to width of the element's content box">
+<style>
+section { position: absolute; }
+section, div {
+  border-right: 10px solid white;
+  margin-right: 10px;
+  padding-right: 10px;
+}
+div {
+  box-sizing: border-box;
+  width: 120px;
+}
+.test div { text-indent: 50%; color: red; overflow: hidden; } /* overflow:hidden should not make any difference, but it does in some browsers */
+.ref div { text-indent: 50px; }
+</style>
+
+<p>Test passes if there is a single black X below and no red.
+<section class=test><div>X</div></section>
+<section class=ref><div>X</div></section>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-indent/text-indent-percentage-004.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang=en>
+<meta charset="utf-8">
+<title>CSS Text Test: text-indent percentage resolution basis, in a calc expressiong</title>
+<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-indent-property">
+<meta name="flags" content="">
+<link rel="match" href="reference/text-indent-percentage-002-ref.html">
+<meta name="assert" content="Percentages in text-indent refer to width of the element's content box, when used in a calc expression">
+<style>
+section { position: absolute; }
+section, div {
+  border-right: 10px solid white;
+  margin-right: 10px;
+  padding-right: 10px;
+}
+div {
+  box-sizing: border-box;
+  width: 120px;
+}
+.test div { text-indent: calc(25px + 25%); color: red; }
+.ref div { text-indent: 50px; }
+</style>
+
+<p>Test passes if there is a single black X below and no red.
+<section class=test><div>X</div></section>
+<section class=ref><div>X</div></section>