summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-text/text-align
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-text/text-align')
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-001.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-002.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-003.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-004.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-005.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-006.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-007.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-008.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-009.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-010.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-014.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-015.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-016.html21
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-001.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-002.html27
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-003.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-004.html27
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-005.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-006.html27
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-shy-ref-001.html10
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-justifyall-ref-001.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-justifyall-ref-002.html20
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-last-wins-001-ref.html16
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-001.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-002.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-003.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-004.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-005.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-006.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-007.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-008.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-009.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-010.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-014.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-015.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-016.html21
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-017.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-006-ref.html13
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-006.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-007-ref.html14
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-007.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-center-last-center.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-center-last-default.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-center-last-end.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-center-last-justify.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-center-last-start.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-default-last-default.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-001.html23
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-002.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-003.html23
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-004.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-005.html23
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-006.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-007.html23
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-008.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-009.html26
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-010.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-014.html29
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-015.html29
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-016.html31
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-017.html32
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-018.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-019.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-020.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-021.html32
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-last-center.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-last-default.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-last-end.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-last-justify.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-end-last-start.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-inline-end-crash.html12
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-001.html26
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-002.html28
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-003.html26
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-004.html28
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-005.html26
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-006.html28
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-center.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-default.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-end.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-justify.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-start.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justify-shy-001.html14
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-001.html24
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-002.html26
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-003.html24
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-004.html26
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-005.html24
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-006.html26
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-001.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-002.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-003.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-004.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-005.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-006.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-007.html20
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-008.html20
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-009.html20
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-010-ref.html14
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-010.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-011.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-012.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-013.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-014.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-015-ref.html21
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-015.html29
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-center-ref.html16
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-center.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-empty-inline.html36
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-end-ref.html16
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-end.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-interpolation.html40
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-ref.html20
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-rtl-ref.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-rtl.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-justify.html17
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-simple-ref.html42
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-simple.html45
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-start-ref.html16
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-start.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-last-wins-001.html20
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-001.html26
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-002.html23
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-01.html40
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-02.html56
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-03.html52
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-04.html52
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-05-ref.html16
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-05.html23
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-ref.html32
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-logical.html21
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-ltr-ref.html14
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-ltr.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-rtl-ref.html14
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-rtl.html18
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-001.html23
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-002.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-003.html23
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-004.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-005.html23
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-006.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-007.html23
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-008.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-009.html26
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-010.html25
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-014.html29
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-015.html29
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-016.html31
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-017.html32
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-018.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-019.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-020.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-021.html32
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-last-center.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-last-default.html19
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-last-end.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-last-justify.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-start-last-start.html22
-rw-r--r--testing/web-platform/tests/css/css-text/text-align/text-align-webkit-match-parent.html11
159 files changed, 3587 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-001.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-001.html
new file mode 100644
index 0000000000..480b568171
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-001.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="ref">REFER</div>
+<div class="ref">REFER</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-002.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-002.html
new file mode 100644
index 0000000000..bab8bd715c
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-002.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div style="direction: rtl;">
+<div class="ref">REFER</div>
+<div class="ref">REFER</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-003.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-003.html
new file mode 100644
index 0000000000..c6710c64e0
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-003.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div class="ref">REFER</div>
+<div class="ref">REFER</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-004.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-004.html
new file mode 100644
index 0000000000..010c665841
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-004.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="ref">REFER</div>
+<div class="ref">REFER</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-005.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-005.html
new file mode 100644
index 0000000000..3510f890f3
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-005.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-006.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-006.html
new file mode 100644
index 0000000000..365e21fe9b
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-006.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div style="direction: rtl;">
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-007.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-007.html
new file mode 100644
index 0000000000..9b7d51c210
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-007.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-008.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-008.html
new file mode 100644
index 0000000000..9196a4de3f
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-008.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-009.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-009.html
new file mode 100644
index 0000000000..563794c61c
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-009.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=auto, RTL first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-010.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-010.html
new file mode 100644
index 0000000000..d4797c93f3
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-010.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=auto, LTR first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-014.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-014.html
new file mode 100644
index 0000000000..65b431fc39
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-014.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, pre, dir=rtl inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="ref">REF<br>ERE</div>
+<div class="ref">REF<br>ERE</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-015.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-015.html
new file mode 100644
index 0000000000..26a8ef62a4
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-015.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, pre, dir=ltr inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div class="ref">REF<br>ERE</div>
+<div class="ref">REF<br>ERE</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-016.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-016.html
new file mode 100644
index 0000000000..f571c9e3d3
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-end-ref-016.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, pre, dir=auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style>
+.ref1, .ref2 { border-inline: 1px solid orange; margin-left: 20px; margin-right: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref1 { border-top: 1px solid orange; margin-top: 20px; text-align: right; }
+.ref2 { border-bottom: 1px solid orange; margin-bottom: 20px; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div class="ref1">REF</div>
+<div class="ref2">ERE</div>
+<div class="ref1">REF</div>
+<div class="ref2">ERE</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-001.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-001.html
new file mode 100644
index 0000000000..f13a494819
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-001.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is the same.</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: right;">REF REF REF</div>
+</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: right;">REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-002.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-002.html
new file mode 100644
index 0000000000..63206ff29e
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-002.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div style="direction: rtl;">
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: left;">REF REF REF</div>
+</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: left;">REF REF REF</div>
+</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-003.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-003.html
new file mode 100644
index 0000000000..9437b4fa2b
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-003.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is the same.</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: right;">REF REF REF</div>
+</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: right;">REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-004.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-004.html
new file mode 100644
index 0000000000..fe2bbe8d46
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-004.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: left;">REF REF REF</div>
+</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: left;">REF REF REF</div>
+</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-005.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-005.html
new file mode 100644
index 0000000000..bb383de0d0
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-005.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, dir=auto, RTL first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is the same.</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: right;">REF REF REF</div>
+</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: right;">REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-006.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-006.html
new file mode 100644
index 0000000000..cead2a2551
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-ref-006.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, dir=auto, LTR first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is the same.</div>
+<div dir="rtl">
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: left;">REF REF REF</div>
+</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: left;">REF REF REF</div>
+</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-shy-ref-001.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-shy-ref-001.html
new file mode 100644
index 0000000000..e7148ece53
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justify-shy-ref-001.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<style>
+div {
+ text-align: justify;
+ width: 10ch;
+}
+</style>
+<div>abc def ghijkl</div>
+<div>abc def ghijkl</div>
+<div>abc def ghijkl</div>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justifyall-ref-001.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justifyall-ref-001.html
new file mode 100644
index 0000000000..e9d071ee99
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justifyall-ref-001.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify-all, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 510px; color: orange; font: 30px/1 Ahem; word-spacing: 20px; }
+div.last-line { word-spacing: 90px; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div class="ref"><div>REF REF REF REF</div><div>REF REF REF REF</div><div class="last-line">REF REF REF </div></div>
+<div class="ref"><div>REF REF REF REF</div><div>REF REF REF REF</div><div class="last-line">REF REF REF </div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justifyall-ref-002.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justifyall-ref-002.html
new file mode 100644
index 0000000000..30160d43f7
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-justifyall-ref-002.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify-all, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 510px; color: orange; font: 30px/1 Ahem; word-spacing: 20px; }
+div.last-line { word-spacing: 90px; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div style="direction: rtl;">
+<div class="ref"><div>REF REF REF REF</div><div>REF REF REF REF</div><div class="last-line">REF REF REF </div></div>
+<div class="ref"><div>REF REF REF REF</div><div>REF REF REF REF</div><div class="last-line">REF REF REF </div></div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-last-wins-001-ref.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-last-wins-001-ref.html
new file mode 100644
index 0000000000..997d58a798
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-last-wins-001-ref.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html lang=en>
+<meta charset=utf-8>
+<title>test reference</title>
+<style>
+div {
+ text-align: right;
+ width: 300px;
+ border: solid;
+}
+</style>
+
+<p>Test passes if the words below are aligned to the right of the box.
+
+<div>right<br>right</div>
+
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-001.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-001.html
new file mode 100644
index 0000000000..5d14b17626
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-001.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="ref">REFER</div>
+<div class="ref">REFER</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-002.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-002.html
new file mode 100644
index 0000000000..fc54ede6cc
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-002.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div style="direction: rtl;">
+<div class="ref">REFER</div>
+<div class="ref">REFER</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-003.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-003.html
new file mode 100644
index 0000000000..fa5e76a275
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-003.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div class="ref">REFER</div>
+<div class="ref">REFER</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-004.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-004.html
new file mode 100644
index 0000000000..1deee0c701
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-004.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="ref">REFER</div>
+<div class="ref">REFER</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-005.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-005.html
new file mode 100644
index 0000000000..701845e993
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-005.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-006.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-006.html
new file mode 100644
index 0000000000..914df4654b
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-006.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div style="direction: rtl;">
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-007.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-007.html
new file mode 100644
index 0000000000..62cca9b99c
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-007.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right;}
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-008.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-008.html
new file mode 100644
index 0000000000..1b09404b2f
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-008.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-009.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-009.html
new file mode 100644
index 0000000000..0cfe79e6c1
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-009.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=auto, RTL first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-010.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-010.html
new file mode 100644
index 0000000000..727fb656e4
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-010.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=auto, LTR first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-014.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-014.html
new file mode 100644
index 0000000000..8113fe23f1
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-014.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, pre, dir=rtl inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="ref">REF<br>ERE</div>
+<div class="ref">REF<br>ERE</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-015.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-015.html
new file mode 100644
index 0000000000..d61b2585e6
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-015.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, pre, dir=ltr inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="ltr">
+<div class="ref">REF<br>ERE</div>
+<div class="ref">REF<br>ERE</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-016.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-016.html
new file mode 100644
index 0000000000..3df6be4048
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-016.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, pre, dir=auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref1, .ref2 { border-left: 1px solid orange; border-right: 1px solid orange; margin-left: 20px; margin-right: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref1 { border-top: 1px solid orange; margin-top: 20px; text-align: left; }
+.ref2 { border-bottom: 1px solid orange; margin-bottom: 20px; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div class="ref1">REF</div>
+<div class="ref2">ERE</div>
+<div class="ref1">REF</div>
+<div class="ref2">ERE</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-017.html b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-017.html
new file mode 100644
index 0000000000..89b5c4028d
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/reference/text-align-start-ref-017.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, pre, dir=auto on surrounding block</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div class="ref">REF<br>ERE</div>
+<div class="ref">REF<br>ERE</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-006-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-006-ref.html
new file mode 100644
index 0000000000..550a03c3b3
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-006-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test Reference File</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<style>
+ div {
+ border: 1px solid blue;
+ }
+</style>
+<body>
+ <p>Test passes if the words "Filler Text" below are aligned to the left, inside the blue box.</p>
+ <div>Filler Text</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-006.html b/testing/web-platform/tests/css/css-text/text-align/text-align-006.html
new file mode 100644
index 0000000000..4e8c097f81
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-006.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align - start (basic)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.1. Text Alignment: the 'text-align' property" href="http://www.w3.org/TR/css-text-3/#text-align">
+<link rel="match" href="text-align-006-ref.html">
+<meta name="assert" content="The 'text-align' property set to 'start' on a block element aligns the text to the start edge.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align: start;
+ }
+</style>
+<body>
+ <p>Test passes if the words "Filler Text" below are aligned to the left, inside the blue box.</p>
+ <div>Filler Text</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-007-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-007-ref.html
new file mode 100644
index 0000000000..68c1642930
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-007-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test Reference File</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<style>
+ div {
+ border: 1px solid blue;
+ direction: rtl;
+ }
+</style>
+<body>
+ <p>Test passes if the words "Filler Text" below are aligned to the right, inside the blue box.</p>
+ <div>Filler Text</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-007.html b/testing/web-platform/tests/css/css-text/text-align/text-align-007.html
new file mode 100644
index 0000000000..4d416123a9
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-007.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align - end (basic)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.1. Text Alignment: the 'text-align' property" href="http://www.w3.org/TR/css-text-3/#text-align">
+<link rel="match" href="text-align-007-ref.html">
+<meta name="assert" content="The 'text-align' property set to 'end' on a block element aligns the text to the end edge.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align: end;
+ }
+</style>
+<body>
+ <p>Test passes if the words "Filler Text" below are aligned to the right, inside the blue box.</p>
+ <div>Filler Text</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-center.html b/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-center.html
new file mode 100644
index 0000000000..97c2b7840f
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-center.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-center-last-start.html">
+ <link rel="mismatch" href="text-align-center-last-end.html">
+ <link rel="mismatch" href="text-align-center-last-justify.html">
+ <style>
+ p {
+ text-align: center;
+ text-align-last: center;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-default.html b/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-default.html
new file mode 100644
index 0000000000..0b3a7ad9eb
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-default.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="match" href="text-align-center-last-center.html">
+ <style>
+ p {
+ text-align: center;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-end.html b/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-end.html
new file mode 100644
index 0000000000..c23eb03812
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-end.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-center-last-start.html">
+ <link rel="mismatch" href="text-align-center-last-center.html">
+ <link rel="mismatch" href="text-align-center-last-justify.html">
+ <style>
+ p {
+ text-align: center;
+ text-align-last: end;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-justify.html b/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-justify.html
new file mode 100644
index 0000000000..10a06696e6
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-justify.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-center-last-start.html">
+ <link rel="mismatch" href="text-align-center-last-end.html">
+ <link rel="mismatch" href="text-align-center-last-center.html">
+ <style>
+ p {
+ text-align: center;
+ text-align-last: justify;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-start.html b/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-start.html
new file mode 100644
index 0000000000..10f68edec3
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-center-last-start.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-center-last-center.html">
+ <link rel="mismatch" href="text-align-center-last-end.html">
+ <link rel="mismatch" href="text-align-center-last-justify.html">
+ <style>
+ p {
+ text-align: center;
+ text-align-last: start;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-default-last-default.html b/testing/web-platform/tests/css/css-text/text-align/text-align-default-last-default.html
new file mode 100644
index 0000000000..ee626a6ac9
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-default-last-default.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="match" href="text-align-start-last-start.html">
+ <style>
+ p {
+ text-align: start;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-001.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-001.html
new file mode 100644
index 0000000000..4570b22708
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-001.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-001.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when direction is horizontal, rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; direction: rtl; }
+.ref { text-align: left; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="test">TESTI</div>
+<div class="ref">REFER</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-002.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-002.html
new file mode 100644
index 0000000000..6144d4d511
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-002.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-002.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is horizontal, ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; direction: ltr; }
+.ref { text-align: right; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div style="direction: rtl;">
+<div class="test">TESTI</div>
+<div class="ref">REFER</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-003.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-003.html
new file mode 100644
index 0000000000..0539f6b79a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-003.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-003.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when direction is horizontal, rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; }
+.ref { text-align: left; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div class="test" dir="rtl">TESTI</div>
+<div class="ref">REFER</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-004.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-004.html
new file mode 100644
index 0000000000..7e5badd945
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-004.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-004.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is horizontal, ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; }
+.ref { text-align: right; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="test" dir="ltr">TESTI</div>
+<div class="ref">REFER</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-005.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-005.html
new file mode 100644
index 0000000000..94a41b59e0
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-005.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-005.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when direction is horizontal, rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; direction: rtl; }
+.ref { text-align: left; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="test">TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-006.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-006.html
new file mode 100644
index 0000000000..9e1006f7ab
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-006.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-006.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is horizontal, ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; direction: ltr; }
+.ref { text-align: right; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div style="direction: rtl;">
+<div class="test">TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-007.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-007.html
new file mode 100644
index 0000000000..2f4b5e4f50
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-007.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-007.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when direction is horizontal, rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; }
+.ref { text-align: left; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="test" dir="rtl">TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-008.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-008.html
new file mode 100644
index 0000000000..88ced38fb5
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-008.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-008.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is horizontal, ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; }
+.ref { text-align: right; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="test" dir="ltr">TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-009.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-009.html
new file mode 100644
index 0000000000..8fdeff7069
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-009.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=auto, RTL first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-009.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when direction is auto and first strong character is rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; }
+.ref { text-align: left; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div class="test" dir="auto">&rlm;TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<!-- Notes:
+The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed.
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-010.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-010.html
new file mode 100644
index 0000000000..fffe06ffe3
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-010.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, dir=auto, LTR first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-010.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is auto and first strong character is ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; }
+.ref { text-align: right; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="test" dir="auto">&lrm;TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-014.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-014.html
new file mode 100644
index 0000000000..d51c7cd0e2
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-014.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, pre, dir=rtl inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-014.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when base direction is rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; }
+.ref { text-align: left; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<pre class="test">TES
+&rlm;ING</pre>
+<div class="ref">REF<br>ERE</div>
+</div>
+<!-- Notes:
+The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed.
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-015.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-015.html
new file mode 100644
index 0000000000..0661c2bd9f
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-015.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, pre, dir=ltr inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-015.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when base direction is ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: end; }
+.ref { text-align: right; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="ltr">
+<pre class="test">TES
+&rlm;ING</pre>
+</div>
+<div class="ref">REF<br>ERE</div>
+<!-- Notes:
+The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed.
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-016.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-016.html
new file mode 100644
index 0000000000..2b8a9b3829
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-016.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, pre, dir=auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-016.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is auto and first strong character is ltr, and left when first strong is rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style>
+.test { text-align: end; }
+/* the CSS below is not part of the test */
+.test, .ref1, .ref2 { width: 300px; color: orange; font: 25px/1 Ahem; }
+.test { border: 1px solid orange; margin: 20px; }
+.ref1, .ref2 { border-inline: 1px solid orange; margin: 0 20px; }
+.ref1 { border-top: 1px solid orange; text-align: right; }
+.ref2 { border-bottom: 1px solid orange; text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<pre class="test" dir="auto">TES
+&rlm;ING</pre>
+<div class="ref1">REF</div>
+<div class="ref2">ERE</div>
+<!-- Notes:
+The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed.
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-017.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-017.html
new file mode 100644
index 0000000000..4420808eaa
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-017.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: end, pre, dir=auto on surrounding block</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-end-ref-015.html'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. since dir=auto is not inherited by pre, to right in ltr context.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style>
+.test { text-align: end; }
+.ref { text-align: right; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="auto">
+<pre class="test">TES
+&rlm;ING</pre>
+</div>
+<div class="ref">REF<br>ERE</div>
+<!-- Notes:
+The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed.
+The rationale for the expected outcome here is described at
+https://drafts.csswg.org/css-writing-modes-3/#valdef-unicode-bidi-plaintext
+"Because the unicode-bidi property does not inherit, setting bidi-override or plaintext on a block box will not affect any descendant blocks. Therefore these values are best used on blocks and inlines that do not contain any block-level structures. "
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-018.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-018.html
new file mode 100644
index 0000000000..d7351da0db
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-018.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8">
+<title>text-align: end, textarea, dir=rtl inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when base direction is rtl.">
+<style type='text/css'>
+.test { text-align: end; }
+/* the CSS below is not part of the test */
+.test { border: 1px solid blue; margin: 20px; width: 300px; font-size: 24px; line-height: 1;}
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if both words are left-aligned in the box.</div>
+<div dir="rtl">
+<textarea class="test">latin
+و·کمی</textarea>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-019.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-019.html
new file mode 100644
index 0000000000..9d5f987148
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-019.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8">
+<title>text-align: end, textarea, dir=ltr inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when base direction is ltr.">
+<style type='text/css'>
+.test { text-align: end; }
+/* the CSS below is not part of the test */
+.test { border: 1px solid blue; margin: 20px; width: 300px; font-size: 24px; line-height: 1;}
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if both words are right-aligned in the box.</div>
+<div dir="ltr">
+<textarea class="test">latin
+و·کمی</textarea>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-020.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-020.html
new file mode 100644
index 0000000000..58c21326a1
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-020.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8">
+<title>text-align: end, textarea dir=auto on control</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. when dir=auto on textarea, right when first strong is ltr, left when rtl.">
+<style type='text/css'>
+.test { text-align: end; }
+/* the CSS below is not part of the test */
+.test { border: 1px solid blue; margin: 20px; width: 300px; font-size: 24px; line-height: 1;}
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the first word is right-aligned, and the second left-aligned in the box.</div>
+<div>
+<textarea class="test" dir="auto">latin
+و·کمی</textarea>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-021.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-021.html
new file mode 100644
index 0000000000..5806cdcad1
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-021.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8">
+<title>text-align: end, textarea, dir=auto on surrounding block</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. since dir=auto is not inherited by textarea, to right in ltr context.">
+<style type='text/css'>
+.test { text-align: end; }
+/* the CSS below is not part of the test */
+.test { border: 1px solid blue; margin: 20px; width: 300px; font-size: 24px; line-height: 1;}
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if both words are right-aligned in both boxes.</div>
+<div dir="auto">
+<textarea class="test">latin
+و·کمی</textarea>
+</div>
+<div dir="auto">
+<textarea class="test">و·کمی
+latin</textarea>
+</div>
+<!--
+Notes:
+The rationale for the expected outcome here is described at
+https://drafts.csswg.org/css-writing-modes-3/#valdef-unicode-bidi-plaintext
+"Because the unicode-bidi property does not inherit, setting bidi-override or plaintext on a block box will not affect any descendant blocks. Therefore these values are best used on blocks and inlines that do not contain any block-level structures. "
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-center.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-center.html
new file mode 100644
index 0000000000..993d98d514
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-center.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-end-last-start.html">
+ <link rel="mismatch" href="text-align-end-last-end.html">
+ <link rel="mismatch" href="text-align-end-last-justify.html">
+ <style>
+ p {
+ text-align: end;
+ text-align-last: center;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-default.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-default.html
new file mode 100644
index 0000000000..b730ba6994
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-default.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="match" href="text-align-end-last-end.html">
+ <style>
+ p {
+ text-align: end;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-end.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-end.html
new file mode 100644
index 0000000000..97ff926347
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-end.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-end-last-start.html">
+ <link rel="mismatch" href="text-align-end-last-center.html">
+ <link rel="mismatch" href="text-align-end-last-justify.html">
+ <style>
+ p {
+ text-align: end;
+ text-align-last: end;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-justify.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-justify.html
new file mode 100644
index 0000000000..3c4957ddb6
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-justify.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-end-last-start.html">
+ <link rel="mismatch" href="text-align-end-last-end.html">
+ <link rel="mismatch" href="text-align-end-last-center.html">
+ <style>
+ p {
+ text-align: end;
+ text-align-last: justify;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-start.html b/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-start.html
new file mode 100644
index 0000000000..d98221f2a0
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-end-last-start.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-end-last-center.html">
+ <link rel="mismatch" href="text-align-end-last-end.html">
+ <link rel="mismatch" href="text-align-end-last-justify.html">
+ <style>
+ p {
+ text-align: end;
+ text-align-last: start;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-inline-end-crash.html b/testing/web-platform/tests/css/css-text/text-align/text-align-inline-end-crash.html
new file mode 100644
index 0000000000..4bfcbd30b8
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-inline-end-crash.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<title>CSS Text: Don't crash with text-align-[last,all]:inline-end</title>
+<link rel="help" href="https://drafts.csswg.org/css-text/#text-align-property">
+<link rel="help" href="https://crbug.com/1313002">
+<style>
+ div {
+ text-align: inline-end;
+ text-align-all: inline-end;
+ text-align-last: inline-end;
+ }
+</style>
+<div></div>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-001.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-001.html
new file mode 100644
index 0000000000..9e1319e91e
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-001.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, direction: rtl</title>
+<link rel='match' href='reference/text-align-justify-ref-001.html'>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:justify aligns text in order to exactly fill the line box. Unless otherwise specified by text-align-last, the last line before a forced break or the end of the block is start-aligned – in this case, to the right.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify; direction: rtl; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is the same.</div>
+<div class="test">TES TES TES TES TES TES TES TES TES TES TES </div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: right;">REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-002.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-002.html
new file mode 100644
index 0000000000..250f680393
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-002.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, direction: ltr</title>
+<link rel='match' href='reference/text-align-justify-ref-002.html'>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:justify aligns text in order to exactly fill the line box. Unless otherwise specified by text-align-last, the last line before a forced break or the end of the block is start-aligned – in this case, to the left.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify; direction: ltr; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div style="direction: rtl;">
+<div class="test">TES TES TES TES TES TES TES TES TES TES TES </div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: left;">REF REF REF</div>
+</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-003.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-003.html
new file mode 100644
index 0000000000..b08cd88e7a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-003.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-justify-ref-003.html'>
+<meta name="assert" content="text-align:justify aligns text in order to exactly fill the line box. Unless otherwise specified by text-align-last, the last line before a forced break or the end of the block is start-aligned – in this case, to the right.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is the same.</div>
+<div class="test" dir="rtl">TES TES TES TES TES TES TES TES TES TES TES </div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: right;">REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-004.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-004.html
new file mode 100644
index 0000000000..20ca4fe242
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-004.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-justify-ref-004.html'>
+<meta name="assert" content="text-align:justify aligns text in order to exactly fill the line box. Unless otherwise specified by text-align-last, the last line before a forced break or the end of the block is start-aligned – in this case, to the left.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="test" dir="ltr">TES TES TES TES TES TES TES TES TES TES TES </div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: left;">REF REF REF</div>
+</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-005.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-005.html
new file mode 100644
index 0000000000..851e1a0950
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-005.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, dir=auto, RTL first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-justify-ref-005.html'>
+<meta name="assert" content="text-align:justify aligns text in order to exactly fill the line box. Unless otherwise specified by text-align-last, the last line before a forced break or the end of the block is start-aligned – in this case, to the right.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is the same.</div>
+<div dir="auto" class="test">&rlm;TES TES TES TES TES TES TES TES TES TES TES</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: right;">REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-006.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-006.html
new file mode 100644
index 0000000000..d02fa47aea
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-006.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify, dir=auto, LTR first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-justify-ref-006.html'>
+<meta name="assert" content="text-align:justify aligns text in order to exactly fill the line box. Unless otherwise specified by text-align-last, the last line before a forced break or the end of the block is start-aligned – in this case, to the left.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 450px; color: orange; font: 25px/1 Ahem; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is the same.</div>
+<div dir="rtl">
+<div dir="auto" class="test">TES TES TES TES TES TES TES TES TES TES TES</div>
+<div class="ref">
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="word-spacing: 1em;">REF REF REF REF</div>
+<div style="text-align: left;">REF REF REF</div>
+</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-center.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-center.html
new file mode 100644
index 0000000000..8aba126e14
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-center.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-justify-last-start.html">
+ <link rel="mismatch" href="text-align-justify-last-end.html">
+ <link rel="mismatch" href="text-align-justify-last-justify.html">
+ <style>
+ p {
+ text-align: justify;
+ text-align-last: center;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-default.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-default.html
new file mode 100644
index 0000000000..b744958c47
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-default.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="match" href="text-align-justify-last-start.html">
+ <style>
+ p {
+ text-align: justify;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-end.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-end.html
new file mode 100644
index 0000000000..6e084f33e8
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-end.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-justify-last-start.html">
+ <link rel="mismatch" href="text-align-justify-last-center.html">
+ <link rel="mismatch" href="text-align-justify-last-justify.html">
+ <style>
+ p {
+ text-align: justify;
+ text-align-last: end;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-justify.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-justify.html
new file mode 100644
index 0000000000..c1bdfc38e5
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-justify.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-justify-last-start.html">
+ <link rel="mismatch" href="text-align-justify-last-center.html">
+ <link rel="mismatch" href="text-align-justify-last-end.html">
+ <style>
+ p {
+ text-align: justify;
+ text-align-last: justify;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-start.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-start.html
new file mode 100644
index 0000000000..ca4f0d9223
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-last-start.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-justify-last-end.html">
+ <link rel="mismatch" href="text-align-justify-last-center.html">
+ <link rel="mismatch" href="text-align-justify-last-justify.html">
+ <style>
+ p {
+ text-align: justify;
+ text-align-last: start;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justify-shy-001.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-shy-001.html
new file mode 100644
index 0000000000..3d15488024
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justify-shy-001.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<title>text-align: justify with soft-hyphens</title>
+<link rel='author' title='Koji Ishii' href='mailto:kojii@chromium.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-justify-shy-ref-001.html'>
+<style>
+div {
+ text-align: justify;
+ width: 10ch;
+}
+</style>
+<div>abc def ghijkl</div>
+<div>ab&shy;c def ghijkl</div>
+<div>ab<span>&shy;</span>c def ghijkl</div>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-001.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-001.html
new file mode 100644
index 0000000000..34b40871ed
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-001.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify-all, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-justifyall-ref-001.html'>
+<meta name="assert" content="text-align:justify-all aligns text in order to exactly fill the line box, forcing the last line to justify as well.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify-all; direction: rtl; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 510px; color: orange; font: 30px/1 Ahem; }
+.ref { word-spacing: 20px; }
+.last-line { word-spacing: 90px; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div class="test">TES TES TES TES TES TES TES TES TES TES TES </div>
+<div class="ref"><div>REF REF REF REF</div><div>REF REF REF REF</div><div class="last-line">REF REF REF </div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-002.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-002.html
new file mode 100644
index 0000000000..d6c631b893
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-002.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify-all, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-justifyall-ref-002.html'>
+<meta name="assert" content="text-align:justify-all aligns text in order to exactly fill the line box, forcing the last line to justify as well.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify-all; direction: ltr; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 510px; color: orange; font: 30px/1 Ahem; }
+.ref { word-spacing: 20px; }
+.last-line { word-spacing: 90px; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div style="direction: rtl;">
+<div class="test">TES TES TES TES TES TES TES TES TES TES TES </div>
+<div class="ref"><div>REF REF REF REF</div><div>REF REF REF REF</div><div class="last-line">REF REF REF </div></div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-003.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-003.html
new file mode 100644
index 0000000000..4826429495
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-003.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify-all, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-justifyall-ref-001.html'>
+<meta name="assert" content="text-align:justify-all aligns text in order to exactly fill the line box, forcing the last line to justify as well.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify-all; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 510px; color: orange; font: 30px/1 Ahem; }
+.ref { word-spacing: 20px; }
+.last-line { word-spacing: 90px; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div class="test" dir="rtl">TES TES TES TES TES TES TES TES TES TES TES </div>
+<div class="ref"><div>REF REF REF REF</div><div>REF REF REF REF</div><div class="last-line">REF REF REF </div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-004.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-004.html
new file mode 100644
index 0000000000..293acea298
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-004.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify-all, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='match' href='reference/text-align-justifyall-ref-002.html'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:justify-all aligns text in order to exactly fill the line box, forcing the last line to justify as well.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify-all; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 510px; color: orange; font: 30px/1 Ahem; }
+.ref { word-spacing: 20px; }
+.last-line { word-spacing: 90px; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="test">TES TES TES TES TES TES TES TES TES TES TES </div>
+<div class="ref"><div>REF REF REF REF</div><div>REF REF REF REF</div><div class="last-line">REF REF REF </div></div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-005.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-005.html
new file mode 100644
index 0000000000..f18d8bbbb4
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-005.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify-all, dir=auto, RTL first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-justifyall-ref-001.html'>
+<meta name="assert" content="text-align:justify-all aligns text in order to exactly fill the line box, forcing the last line to justify as well.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify-all; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 510px; color: orange; font: 30px/1 Ahem; }
+.ref { word-spacing: 20px; }
+.last-line { word-spacing: 90px; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div dir="auto" class="test">&rlm;TES TES TES TES TES TES TES TES TES TES TES</div>
+<div class="ref"><div>REF REF REF REF</div><div>REF REF REF REF</div><div class="last-line">REF REF REF </div></div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-006.html b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-006.html
new file mode 100644
index 0000000000..41a18ef2ff
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-justifyall-006.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: justify-all, dir=auto, LTR first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-justifyall-ref-002.html'>
+<meta name="assert" content="text-align:justify-all aligns text in order to exactly fill the line box, forcing the last line to justify as well.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: justify-all; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 510px; color: orange; font: 30px/1 Ahem; }
+.ref { word-spacing: 20px; }
+.last-line { word-spacing: 90px; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div dir="auto" class="test">TES TES TES TES TES TES TES TES TES TES TES</div>
+<div class="ref"><div>REF REF REF REF</div><div>REF REF REF REF</div><div class="last-line">REF REF REF </div></div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-001.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-001.html
new file mode 100644
index 0000000000..4dce7472db
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-001.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - start (basic)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="The 'text-align-last' property set to 'start' on a block element aligns the last line text to the start edge.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align: right;
+ text-align-last: start;
+ width: 200px;
+ }
+</style>
+<body>
+ <p>Test passes if the last line of "FillerText" below is aligned to the left, inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-002.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-002.html
new file mode 100644
index 0000000000..05023a1342
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-002.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - end (basic)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="The 'text-align-last' property set to 'right' on a block element aligns the last line text to the end edge.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align: left;
+ text-align-last: end;
+ width: 200px;
+ }
+</style>
+<body>
+ <p>Test passes if the last line of "FillerText" below is aligned to the right, inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-003.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-003.html
new file mode 100644
index 0000000000..97c609396a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-003.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - left (basic)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="The 'text-align-last' property set to 'left' on a block element aligns the last line text to the left.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align: right;
+ text-align-last: left;
+ width: 200px;
+ }
+</style>
+<body>
+ <p>Test passes if the last line of "FillerText" below is aligned to the left, inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-004.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-004.html
new file mode 100644
index 0000000000..2877edd49a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-004.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - right (basic)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="The 'text-align-last' property set to 'right' on a block element aligns the last line text to the right.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align: left;
+ text-align-last: right;
+ width: 200px;
+ }
+</style>
+<body>
+ <p>Test passes if the last line of "FillerText" below is aligned to the right, inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-005.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-005.html
new file mode 100644
index 0000000000..0d0b648dc7
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-005.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - center (basic)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="The 'text-align-last' property set to 'center' on a block element aligns the last line text to the center.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align-last: center;
+ width: 200px;
+ }
+</style>
+<body>
+ <p>Test passes if the last line of "FillerText" below is centered inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-006.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-006.html
new file mode 100644
index 0000000000..469df1630a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-006.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - justify (basic)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="The 'text-align-last' property set to 'justify' on a block element aligns the last line text to
+both left and right edges">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align-last: justify;
+ width: 150px;
+ }
+</style>
+<body>
+ <p>Test passes if the last line of "FillerText" below is aligned to both left and right edges inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-007.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-007.html
new file mode 100644
index 0000000000..cdb2f674b2
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-007.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - auto and text-align - right</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="The 'text-align-last' property set to 'auto' on a block element aligns the last line text to the right
+when text-align set 'right'.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align: right;
+ text-align-last: auto;
+ width: 200px;
+ }
+</style>
+<body>
+ <p>Test passes if the last line of "FillerText" below is aligned to the right, inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-008.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-008.html
new file mode 100644
index 0000000000..a93ae9f33a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-008.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - auto and text-align - end</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="The 'text-align-last' property set to 'auto' on a block element aligns the last line text to the right
+when text-align set 'end'.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align: end;
+ text-align-last: auto;
+ width: 200px;
+ }
+</style>
+<body>
+ <p>Test passes if the last line of "FillerText" below is aligned to the right, inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-009.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-009.html
new file mode 100644
index 0000000000..b6fb60e053
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-009.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - auto and text-align - center</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="The 'text-align-last' property set to 'auto' on a block element aligns the last line text to the center
+when text-align set 'center'.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align: center;
+ text-align-last: auto;
+ width: 200px;
+ }
+</style>
+<body>
+ <p>Test passes if the last line of "FillerText" below is centered inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-010-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-010-ref.html
new file mode 100644
index 0000000000..2f26b42723
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-010-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test Reference File</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<style>
+ div {
+ border: 1px solid blue;
+ direction: rtl;
+ }
+</style>
+<body>
+ <p>Test passes if the line of "FillerText" below is aligned to the right, inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-010.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-010.html
new file mode 100644
index 0000000000..40d288ade3
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-010.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - right(one line inside block element)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<link rel="match" href="text-align-last-010-ref.html">
+<meta name="assert" content="The 'text-align-last' property set to 'right' on a block element aligns the only one line text to the right.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align-last: right;
+ }
+</style>
+<body>
+ <p>Test passes if the line of "FillerText" below is aligned to the right, inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-011.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-011.html
new file mode 100644
index 0000000000..83760f81be
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-011.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - end(one line inside block element)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<link rel="match" href="text-align-last-010-ref.html">
+<meta name="assert" content="The 'text-align-last' property set to 'end' on a block element aligns the only one line text to the right.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align-last: end;
+ }
+</style>
+<body>
+ <p>Test passes if the line of "FillerText" below is aligned to the right, inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-012.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-012.html
new file mode 100644
index 0000000000..a2b78acc0b
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-012.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last - center(one line inside block element)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="The 'text-align-last' property set to 'center' on a block element aligns the only one line text to the center.">
+<style>
+ div {
+ border: 1px solid blue;
+ text-align-last: center;
+ }
+</style>
+<body>
+ <p>Test passes if the line of "FillerText" below is centered inside the blue box.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-013.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-013.html
new file mode 100644
index 0000000000..112c79b9b1
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-013.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last applied to "display: inline" div element</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="Test checks that the 'text-align-last' property is invalid if the container element is not block element.">
+<style>
+ div {
+ border: 1px solid blue;
+ display: inline;
+ text-align-last: right;
+ }
+</style>
+<body>
+ <p>Test passes if the line of "FillerText" below is justified inside the blue box and not break line.</p>
+ <div>FillerText FillerText FillerText FillerText FillerText</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-014.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-014.html
new file mode 100644
index 0000000000..4051073aee
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-014.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last applied to "display: block" span element</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last">
+<meta name="assert" content="Test checks that the 'text-align-last' property is valid if the span element set 'display: block'.">
+<style>
+ span {
+ border: 1px solid blue;
+ display: block;
+ text-align-last: center;
+ width: 200px;
+ }
+</style>
+<body>
+ <p>Test passes if the last line of "FillerText" below is centered inside the blue box.</p>
+ <span>FillerText FillerText FillerText FillerText FillerText</span>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-015-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-015-ref.html
new file mode 100644
index 0000000000..75fc7d22c6
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-015-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Reference: text-align-last applied to last line in the second column</title>
+<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+
+<style>
+:root {
+ font: 25px/1 Ahem;
+}
+.multicol {
+ width: 200px;
+ border: 5px solid orange;
+}
+</style>
+
+<div class="multicol">
+ <div>ab&nbsp;&nbsp;ab</div>
+ <div>ab&nbsp;&nbsp;&nbsp;&nbsp;ab</div>
+</div>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-015.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-015.html
new file mode 100644
index 0000000000..a0d8fa4df9
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-015.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align-last applied to last line in the second column</title>
+<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1817235">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<link rel="match" href="text-align-last-015-ref.html">
+
+<style>
+:root {
+ font: 25px/1 Ahem;
+}
+.multicol {
+ width: 200px;
+ column-count: 2;
+ column-gap: 0;
+ border: 5px solid orange;
+}
+.multicol > div {
+ text-align: start;
+ text-align-last: end;
+}
+</style>
+
+<div class="multicol">
+ <div>ab ab ab ab</div>
+</div>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-center-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-center-ref.html
new file mode 100644
index 0000000000..6ad0e6396d
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-center-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last: center</title>
+ <meta charset="utf-8">
+ <style>
+ p {
+ text-align: center;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum</p>
+ <p dir="rtl">אמר המחבר</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-center.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-center.html
new file mode 100644
index 0000000000..639156062d
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-center.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last: center</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="match" href="text-align-last-center-ref.html">
+ <style>
+ p {
+ text-align-last: center;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum</p>
+ <p dir="rtl">אמר המחבר</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-empty-inline.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-empty-inline.html
new file mode 100644
index 0000000000..fd3d706d1e
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-empty-inline.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Tests justification of empty inline element</title>
+<link rel="author" title="Emil A Eklund" href="eae@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property" title="6.3. Last Line Alignment: the text-align-last property">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+ #justify {
+ text-align-last: justify;
+ margin-bottom: 5px;
+ }
+ #justify > span, #reference > span {
+ padding: 1px;
+ background: black;
+ }
+ #reference {
+ text-align: center;
+ }
+</style>
+<body>
+ <div id="justify"><span></span></div>
+ <div id="reference"><span></span></div>
+ <p>
+ The two black line segments above should align.
+ </p>
+</body>
+<script>
+test(function() {
+ const justify_element = document.getElementById('justify');
+ const justify_rect = justify_element.firstElementChild.getBoundingClientRect();
+ const ref_element = document.getElementById('reference');
+ const ref_rect = ref_element.firstElementChild.getBoundingClientRect();
+ assert_equals(justify_rect.left, ref_rect.left);
+ assert_equals(justify_rect.right, ref_rect.right);
+}, 'content that cannot be justified should be centered when text-align-last is justify');
+</script>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-end-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-end-ref.html
new file mode 100644
index 0000000000..ded6defa8a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-end-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last: end</title>
+ <meta charset="utf-8">
+ <style>
+ p {
+ text-align: end;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum</p>
+ <p dir="rtl">אמר המחבר</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-end.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-end.html
new file mode 100644
index 0000000000..4b6fe43392
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-end.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last: end</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="match" href="text-align-last-end-ref.html">
+ <style>
+ p {
+ text-align-last: end;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum</p>
+ <p dir="rtl">אמר המחבר</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-interpolation.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-interpolation.html
new file mode 100644
index 0000000000..1af0f91e7a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-interpolation.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>text-align-last interpolation</title>
+ <link rel="author" title="Kiet Ho" href="mailto:tho22@apple.com">
+ <link rel="help" href="https://drafts.csswg.org/css-text/#text-align-last-property">
+ <meta name="assert" content="text-align-last supports discrete animation">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/css/support/interpolation-testcommon.js"></script>
+ </head>
+ <body>
+ <script>
+ test_no_interpolation({
+ property: 'text-align-last',
+ from: 'auto',
+ to: 'start'
+ });
+
+ test_no_interpolation({
+ property: 'text-align-last',
+ from: 'justify',
+ to: 'center'
+ });
+
+ test_no_interpolation({
+ property: 'text-align-last',
+ from: 'left',
+ to: 'right'
+ });
+
+ test_no_interpolation({
+ property: 'text-align-last',
+ from: 'end',
+ to: 'match-parent'
+ });
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-ref.html
new file mode 100644
index 0000000000..d07bed3f77
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last: justify</title>
+ <meta charset="utf-8">
+ <style>
+ span.left {
+ position: relative;
+ float: left;
+ }
+ span.right {
+ position: relative;
+ float: right;
+ }
+ </style>
+ </head>
+ <body>
+ <p><span class="left">Lorem</span><span class="right">ipsum</span></p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-rtl-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-rtl-ref.html
new file mode 100644
index 0000000000..d3b941e900
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-rtl-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last: justify in RTL</title>
+ <meta charset="utf-8">
+ <style>
+ span.left {
+ float: left;
+ }
+ span.right {
+ float: right;
+ }
+ </style>
+ </head>
+ <body>
+ <p><span class="right">אמר</span><span class="left">המחבר</span></p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-rtl.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-rtl.html
new file mode 100644
index 0000000000..835e4cdd5c
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify-rtl.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last: justify in RTL</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="match" href="text-align-last-justify-rtl-ref.html">
+ <style>
+ p {
+ text-align-last: justify;
+ }
+ </style>
+ </head>
+ <body>
+ <p dir="rtl">אמר המחבר</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify.html
new file mode 100644
index 0000000000..c48678b74a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-justify.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last: justify</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="match" href="text-align-last-justify-ref.html">
+ <style>
+ p {
+ text-align-last: justify;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-simple-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-simple-ref.html
new file mode 100644
index 0000000000..3c8ba2e580
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-simple-ref.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="/fonts/ahem.css">
+<style>
+.test {
+ width: 208px;
+ border: 1px solid #000000;
+ font-family: Ahem, monospace;
+ font-size: 1em;
+}
+</style>
+</head>
+<body>
+<div>
+This test checks that text-align-last property works properly.<br/>
+</div>
+<div class="test" style="text-align: end">start end</div>
+
+<div class="test" style="text-align: start">end start</div>
+
+<div class="test" style="text-align: right">left right</div>
+
+<div class="test" style="text-align: left">right left</div>
+
+<div class="test" style="text-align: left">center left</div>
+
+<div class="test" style="text-align: start">start auto</div>
+
+<div class="test" style="text-align: end">end auto</div>
+
+<div class="test" style="text-align: left">left auto</div>
+
+<div class="test" style="text-align: right">right auto</div>
+
+<div class="test" style="text-align: center">center auto</div>
+
+<div class="test" style="text-align: start">justify auto</div>
+
+<div class="test" style="text-align: start">auto&nbsp; justify</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-simple.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-simple.html
new file mode 100644
index 0000000000..6dabb111fa
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-simple.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>text-align-last</title>
+<link rel="help" href="https://drafts.csswg.org/css-text/#text-align-last-property">
+<link rel="match" href="text-align-last-simple-ref.html">
+<link rel="stylesheet" href="/fonts/ahem.css">
+<style>
+.test {
+ width: 208px;
+ border: 1px solid #000000;
+ font-family: Ahem, monospace;
+ font-size: 1em;
+}
+</style>
+</head>
+<body>
+<div>
+This test checks that text-align-last property works properly.<br/>
+</div>
+<div class="test" style="text-align: start; text-align-last: end">start end</div>
+
+<div class="test" style="text-align: end; text-align-last: start">end start</div>
+
+<div class="test" style="text-align: left; text-align-last: right">left right</div>
+
+<div class="test" style="text-align: right; text-align-last: left">right left</div>
+
+<div class="test" style="text-align: center; text-align-last: left">center left</div>
+
+<div class="test" style="text-align: start; text-align-last: auto">start auto</div>
+
+<div class="test" style="text-align: end; text-align-last: auto">end auto</div>
+
+<div class="test" style="text-align: left; text-align-last: auto">left auto</div>
+
+<div class="test" style="text-align: right; text-align-last: auto">right auto</div>
+
+<div class="test" style="text-align: center; text-align-last: auto">center auto</div>
+
+<div class="test" style="text-align: justify; text-align-last: auto">justify auto</div>
+
+<div class="test" style="text-align: auto; text-align-last: justify">auto justify</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-start-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-start-ref.html
new file mode 100644
index 0000000000..be564fda0b
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-start-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last: start</title>
+ <meta charset="utf-8">
+ <style>
+ p {
+ text-align: start;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum</p>
+ <p dir="rtl">אמר המחבר</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-start.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-start.html
new file mode 100644
index 0000000000..af5b49dd96
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-start.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last: start</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="match" href="text-align-last-start-ref.html">
+ <style>
+ p {
+ text-align: end;
+ text-align-last: start;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum</p>
+ <p dir="rtl">אמר המחבר</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-last-wins-001.html b/testing/web-platform/tests/css/css-text/text-align/text-align-last-wins-001.html
new file mode 100644
index 0000000000..30f1a07864
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-last-wins-001.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<html lang=en>
+<meta charset=utf-8>
+<title>CSS text test: text-align-last has precedence over text-align-all</title>
+<link rel=help href="https://drafts.csswg.org/css-text-3/#text-align-all-property">
+<link rel=help href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+<link rel="match" href="reference/text-align-last-wins-001-ref.html">
+<meta name=assert content="If a line is both the first and last line, text-align-last applies">
+<style>
+div {
+ text-align-last: right;
+ width: 300px;
+ border: solid;
+}
+</style>
+
+<p>Test passes if the words below are aligned to the right of the box.
+
+<div>right<br>right</div>
+
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-001.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-001.html
new file mode 100644
index 0000000000..f1afda9a03
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-001.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align - match-parent (basic)</title>
+<link rel="author" title="Intel" href="http://www.intel.com">
+<link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com">
+<link rel="help" title="7.1. Text Alignment: the 'text-align' property" href="http://www.w3.org/TR/css-text-3/#text-align">
+<link rel="match" href="text-align-007-ref.html">
+<meta name="assert" content="The 'text-align' property set to 'match-parent' on a block element behaves the same as 'inherit'.">
+<style>
+ body {
+ text-align: end;
+ }
+
+ p {
+ text-align: left;
+ }
+
+ div {
+ border: 1px solid blue;
+ text-align: match-parent;
+ }
+</style>
+<body>
+ <p>Test passes if the words "Filler Text" below are aligned to the right, inside the blue box.</p>
+ <div>Filler Text</div>
+</body>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-002.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-002.html
new file mode 100644
index 0000000000..19596e36af
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-002.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Text Test: text-align - computed value for match-parent on the root element</title>
+<link rel="help" href="https://drafts.csswg.org/css-text/#valdef-text-align-match-parent">
+<meta name="assert" content="'text-align: match-parent' on the root element with 'direction: rtl' should compute to 'start'.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+ html {
+ text-align: match-parent;
+ direction: rtl;
+ }
+ #log {
+ direction: ltr;
+ text-align: start;
+ }
+</style>
+<div id="log"></div>
+<script>
+ test(() => {
+ assert_equals(getComputedStyle(document.documentElement).textAlign, 'start');
+ });
+</script>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-01.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-01.html
new file mode 100644
index 0000000000..7560a425ea
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-01.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>CSS Text: text-align: match-parent</title>
+ <link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
+ <meta name="assert" content="Text checks that an element with
+ text-align: match-parent inherits its parent's value and calculates
+ 'start' and 'end' with respect to its parent's direction">
+ <link rel="match" href="text-align-match-parent-ref.html">
+ <style type="text/css">
+div.start { text-align: start; }
+div.end { text-align: end; }
+div.left { text-align: left; }
+div.right { text-align: right; }
+div > div { text-align: match-parent; }
+ </style>
+ </head>
+ <body>
+ <div>Test passes if each line that says "Left" is aligned left and
+ each line that says "Right" is aligned right</div>
+ <div class="start" dir="ltr"><div dir="ltr">Left</div></div>
+ <div class="start" dir="ltr"><div dir="rtl">Left</div></div>
+ <div class="start" dir="rtl"><div dir="ltr">Right</div></div>
+ <div class="start" dir="rtl"><div dir="rtl">Right</div></div>
+ <div class="end" dir="ltr"><div dir="ltr">Right</div></div>
+ <div class="end" dir="ltr"><div dir="rtl">Right</div></div>
+ <div class="end" dir="rtl"><div dir="ltr">Left</div></div>
+ <div class="end" dir="rtl"><div dir="rtl">Left</div></div>
+ <div class="left" dir="ltr"><div dir="ltr">Left</div></div>
+ <div class="left" dir="ltr"><div dir="rtl">Left</div></div>
+ <div class="left" dir="rtl"><div dir="ltr">Left</div></div>
+ <div class="left" dir="rtl"><div dir="rtl">Left</div></div>
+ <div class="right" dir="ltr"><div dir="ltr">Right</div></div>
+ <div class="right" dir="ltr"><div dir="rtl">Right</div></div>
+ <div class="right" dir="rtl"><div dir="ltr">Right</div></div>
+ <div class="right" dir="rtl"><div dir="rtl">Right</div></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-02.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-02.html
new file mode 100644
index 0000000000..0d567cb021
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-02.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <meta charset="utf-8">
+ <title>CSS Text: text-align: match-parent</title>
+ <link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
+ <meta name="flags" content="dom">
+ <meta name="assert" content="Text checks that an element with
+ text-align: match-parent still aligns correctly if the parent's
+ dir attribute is changed">
+ <link rel="match" href="text-align-match-parent-ref.html">
+ <style type="text/css">
+div.start { text-align: start; }
+div.end { text-align: end; }
+div.left { text-align: left; }
+div.right { text-align: right; }
+div > div { text-align: match-parent; }
+ </style>
+ <script type="text/javascript">
+function changeParentDir()
+{
+ for (parent = 0; parent < 16; ++parent) {
+ var parentDiv = document.getElementById("d" + parent);
+ if (parentDiv.dir == "rtl") {
+ parentDiv.dir = "ltr";
+ } else {
+ parentDiv.dir = "rtl";
+ }
+ }
+
+ document.documentElement.removeAttribute("class");
+}
+ </script>
+ </head>
+ <body onload="changeParentDir()">
+ <div>Test passes if each line that says "Left" is aligned left and
+ each line that says "Right" is aligned right</div>
+ <div id="d0" class="start" dir="rtl"><div dir="ltr">Left</div></div>
+ <div id="d1" class="start" dir="rtl"><div dir="rtl">Left</div></div>
+ <div id="d2" class="start" dir="ltr"><div dir="ltr">Right</div></div>
+ <div id="d3" class="start" dir="ltr"><div dir="rtl">Right</div></div>
+ <div id="d4" class="end" dir="rtl"><div dir="ltr">Right</div></div>
+ <div id="d5" class="end" dir="rtl"><div dir="rtl">Right</div></div>
+ <div id="d6" class="end" dir="ltr"><div dir="ltr">Left</div></div>
+ <div id="d7" class="end" dir="ltr"><div dir="rtl">Left</div></div>
+ <div id="d8" class="left" dir="rtl"><div dir="ltr">Left</div></div>
+ <div id="d9" class="left" dir="rtl"><div dir="rtl">Left</div></div>
+ <div id="d10" class="left" dir="ltr"><div dir="ltr">Left</div></div>
+ <div id="d11" class="left" dir="ltr"><div dir="rtl">Left</div></div>
+ <div id="d12" class="right" dir="rtl"><div dir="ltr">Right</div></div>
+ <div id="d13" class="right" dir="rtl"><div dir="rtl">Right</div></div>
+ <div id="d14" class="right" dir="ltr"><div dir="ltr">Right</div></div>
+ <div id="d15" class="right" dir="ltr"><div dir="rtl">Right</div></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-03.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-03.html
new file mode 100644
index 0000000000..55887fd5d0
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-03.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <meta charset="utf-8">
+ <title>CSS Text: text-align: match-parent</title>
+ <link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
+ <meta name="flags" content="dom">
+ <meta name="assert" content="Text checks that an element whose
+ text-align property is changed to match-parent aligns correctly">
+ <link rel="match" href="text-align-match-parent-ref.html">
+ <style type="text/css">
+div.start { text-align: start; }
+div.end { text-align: end; }
+div.left { text-align: left; }
+div.right { text-align: right; }
+div.center { text-align: center; }
+div.match { text-align: match-parent; }
+ </style>
+ <script type="text/javascript">
+function changeChildAlign()
+{
+ for (child = 0; child < 16; ++child) {
+ var childDiv = document.getElementById("d" + child);
+ childDiv.className = "match";
+ }
+
+ document.documentElement.removeAttribute("class");
+}
+ </script>
+ </head>
+ <body onload="changeChildAlign()">
+ <div>Test passes if each line that says "Left" is aligned left and
+ each line that says "Right" is aligned right</div>
+ <div class="start" dir="ltr"><div id="d0" class="center" dir="ltr">Left</div></div>
+ <div class="start" dir="ltr"><div id="d1" class="center" dir="rtl">Left</div></div>
+ <div class="start" dir="rtl"><div id="d2" class="center" dir="ltr">Right</div></div>
+ <div class="start" dir="rtl"><div id="d3" class="center" dir="rtl">Right</div></div>
+ <div class="end" dir="ltr"><div id="d4" class="center" dir="ltr">Right</div></div>
+ <div class="end" dir="ltr"><div id="d5" class="center" dir="rtl">Right</div></div>
+ <div class="end" dir="rtl"><div id="d6" class="center" dir="ltr">Left</div></div>
+ <div class="end" dir="rtl"><div id="d7" class="center" dir="rtl">Left</div></div>
+ <div class="left" dir="ltr"><div id="d8" class="center" dir="ltr">Left</div></div>
+ <div class="left" dir="ltr"><div id="d9" class="center" dir="rtl">Left</div></div>
+ <div class="left" dir="rtl"><div id="d10" class="center" dir="ltr">Left</div></div>
+ <div class="left" dir="rtl"><div id="d11" class="center" dir="rtl">Left</div></div>
+ <div class="right" dir="ltr"><div id="d12" class="center" dir="ltr">Right</div></div>
+ <div class="right" dir="ltr"><div id="d13" class="center" dir="rtl">Right</div></div>
+ <div class="right" dir="rtl"><div id="d14" class="center" dir="ltr">Right</div></div>
+ <div class="right" dir="rtl"><div id="d15" class="center" dir="rtl">Right</div></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-04.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-04.html
new file mode 100644
index 0000000000..dc1c0adcd0
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-04.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <meta charset="utf-8">
+ <title>CSS Text: text-align: match-parent</title>
+ <link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
+ <meta name="flags" content="dom">
+ <meta name="assert" content="Text checks that an element with
+ text-align: match-parent still aligns correctly if the parent's
+ width is changed">
+ <link rel="match" href="text-align-match-parent-ref.html">
+ <style type="text/css">
+div.start { text-align: start; }
+div.end { text-align: end; }
+div.left { text-align: left; }
+div.right { text-align: right; }
+div > div { text-align: match-parent; }
+ </style>
+ <script type="text/javascript">
+function changeParentWidth()
+{
+ for (parent = 0; parent < 16; ++parent) {
+ var parentDiv = document.getElementById("d" + parent);
+ parentDiv.style.width = "";
+ }
+
+ document.documentElement.removeAttribute("class");
+}
+ </script>
+ </head>
+ <body onload="changeParentWidth()">
+ <div>Test passes if each line that says "Left" is aligned left and
+ each line that says "Right" is aligned right</div>
+ <div id="d0" style="width: 50%;" class="start" dir="ltr"><div dir="ltr">Left</div></div>
+ <div id="d1" style="width: 50%;" class="start" dir="ltr"><div dir="rtl">Left</div></div>
+ <div id="d2" style="width: 50%;" class="start" dir="rtl"><div dir="ltr">Right</div></div>
+ <div id="d3" style="width: 50%;" class="start" dir="rtl"><div dir="rtl">Right</div></div>
+ <div id="d4" style="width: 50%;" class="end" dir="ltr"><div dir="ltr">Right</div></div>
+ <div id="d5" style="width: 50%;" class="end" dir="ltr"><div dir="rtl">Right</div></div>
+ <div id="d6" style="width: 50%;" class="end" dir="rtl"><div dir="ltr">Left</div></div>
+ <div id="d7" style="width: 50%;" class="end" dir="rtl"><div dir="rtl">Left</div></div>
+ <div id="d8" style="width: 50%;" class="left" dir="ltr"><div dir="ltr">Left</div></div>
+ <div id="d9" style="width: 50%;" class="left" dir="ltr"><div dir="rtl">Left</div></div>
+ <div id="d10" style="width: 50%;" class="left" dir="rtl"><div dir="ltr">Left</div></div>
+ <div id="d11" style="width: 50%;" class="left" dir="rtl"><div dir="rtl">Left</div></div>
+ <div id="d12" style="width: 50%;" class="right" dir="ltr"><div dir="ltr">Right</div></div>
+ <div id="d13" style="width: 50%;" class="right" dir="ltr"><div dir="rtl">Right</div></div>
+ <div id="d14" style="width: 50%;" class="right" dir="rtl"><div dir="ltr">Right</div></div>
+ <div id="d15" style="width: 50%;" class="right" dir="rtl"><div dir="rtl">Right</div></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-05-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-05-ref.html
new file mode 100644
index 0000000000..de42ee7a5a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-05-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>CSS Text 3 tests: match parent on text-align-last</title>
+<link rel="author" title="Florian RIvoal" href="https://florian.rivoal.net">
+<style>
+section {
+ font-family: monospace;
+ width: 3ch;
+}
+</style>
+
+<p>Test passes if the two “2” are vertically aligned.
+<section>
+ <div>1 2<br>&nbsp; 2</div>
+</section>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-05.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-05.html
new file mode 100644
index 0000000000..390d98acc7
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-05.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>CSS Text 3 tests: match parent on text-align-last</title>
+<link rel="author" title="Florian RIvoal" href="https://florian.rivoal.net">
+<link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
+<meta name="assert" content="Check that setting text-align to match parent has the correct effect on text-align-last (even if text-align-all is overridden).">
+<link rel="match" href="text-align-match-parent-05-ref.html">
+<style>
+section {
+ font-family: monospace;
+ width: 3ch;
+}
+div {
+ text-align: match-parent;
+ text-align-all: left;
+}
+</style>
+
+<p>Test passes if the two “2” are vertically aligned.
+<section dir=rtl>
+ <div dir=ltr>1 2 2</div>
+</section>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-ref.html
new file mode 100644
index 0000000000..f916b44c98
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-ref.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
+ <style type="text/css">
+div.left { text-align: left; }
+div.right { text-align: right; }
+ </style>
+ </head>
+ <body>
+ <div>Test passes if each line that says "Left" is aligned left and
+ each line that says "Right" is aligned right</div>
+ <div class="left">Left</div>
+ <div class="left">Left</div>
+ <div class="right">Right</div>
+ <div class="right">Right</div>
+ <div class="right">Right</div>
+ <div class="right">Right</div>
+ <div class="left">Left</div>
+ <div class="left">Left</div>
+ <div class="left">Left</div>
+ <div class="left">Left</div>
+ <div class="left">Left</div>
+ <div class="left">Left</div>
+ <div class="right">Right</div>
+ <div class="right">Right</div>
+ <div class="right">Right</div>
+ <div class="right">Right</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-logical.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-logical.html
new file mode 100644
index 0000000000..719fa04fe7
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-logical.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html dir="rtl">
+ <head>
+ <meta charset="utf-8">
+ <title>CSS Text: text-align: match-parent on root, ignoring body propagation</title>
+ <link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
+ <link rel="author" title="Florian RIvoal" href="https://florian.rivoal.net">
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
+ <meta name="assert" content="Text checks that
+ text-align: match-parent on a root element with dir=ltr is
+ equivalent to text-align: start (not a physical left or right),
+ inheriting as a logical value">
+ <link rel="match" href="text-align-match-parent-root-ltr-ref.html">
+ <style type="text/css">
+html { text-align: match-parent; }
+ </style>
+ </head>
+ <body dir=ltr>
+ <p>This line should be aligned left</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-ltr-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-ltr-ref.html
new file mode 100644
index 0000000000..422f4fa51d
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-ltr-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html dir="ltr">
+ <head>
+ <meta charset="utf-8">
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
+ <style type="text/css">
+html { text-align: start; }
+ </style>
+ </head>
+ <body>
+ <p>This line should be aligned left</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-ltr.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-ltr.html
new file mode 100644
index 0000000000..6665703b68
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-ltr.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html dir="ltr">
+ <head>
+ <meta charset="utf-8">
+ <title>CSS Text: text-align: match-parent</title>
+ <link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
+ <meta name="assert" content="Text checks that
+ text-align: match-parent on a root element with dir=ltr is
+ equivalent to text-align: start">
+ <link rel="match" href="text-align-match-parent-root-ltr-ref.html">
+ <style type="text/css">
+html { text-align: match-parent; }
+ </style>
+ </head>
+ <body>
+ <p>This line should be aligned left</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-rtl-ref.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-rtl-ref.html
new file mode 100644
index 0000000000..a96db45756
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-rtl-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html dir="rtl">
+ <head>
+ <meta charset="utf-8">
+ <title>CSS Reftest Reference</title>
+ <link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
+ <style type="text/css">
+html { text-align: start; }
+ </style>
+ </head>
+ <body>
+ <p>This line should be aligned right</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-rtl.html b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-rtl.html
new file mode 100644
index 0000000000..a2d8f22904
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-match-parent-root-rtl.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html dir="rtl">
+ <head>
+ <title>CSS Text: text-align: match-parent</title>
+ <link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
+ <link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
+ <meta name="assert" content="Text checks that
+ text-align: match-parent on a root element with dir=rtl is
+ equivalent to text-align: start">
+ <link rel="match" href="text-align-match-parent-root-rtl-ref.html">
+ <style type="text/css">
+html { text-align: match-parent; }
+ </style>
+ </head>
+ <body>
+ <p>This line should be aligned right</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-001.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-001.html
new file mode 100644
index 0000000000..3af1130f2c
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-001.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-001.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. right when direction is horizontal, rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; direction: rtl; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="test">TESTI</div>
+<div class="ref">REFER</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-002.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-002.html
new file mode 100644
index 0000000000..27aad6fde6
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-002.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-002.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. left when direction is horizontal, ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; direction: ltr; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div style="direction: rtl;">
+<div class="test">TESTI</div>
+<div class="ref">REFER</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-003.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-003.html
new file mode 100644
index 0000000000..9a007f09fb
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-003.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-003.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. right when direction is horizontal, rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div class="test" dir="rtl">TESTI</div>
+<div class="ref">REFER</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-004.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-004.html
new file mode 100644
index 0000000000..b1e01e3ed9
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-004.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-004.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. left when direction is horizontal, ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="test" dir="ltr">TESTI</div>
+<div class="ref">REFER</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-005.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-005.html
new file mode 100644
index 0000000000..37c6115480
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-005.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, direction: rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-005.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. right when direction is horizontal, rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; direction: rtl; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="test">TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-006.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-006.html
new file mode 100644
index 0000000000..b55c7cb7da
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-006.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, direction: ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-006.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. left when direction is horizontal, ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; direction: ltr; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes is identical.</div>
+<div style="direction: rtl;">
+<div class="test">TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-007.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-007.html
new file mode 100644
index 0000000000..f79c10947c
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-007.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=rtl</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-007.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. right when direction is horizontal, rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div>
+<div class="test" dir="rtl">TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-008.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-008.html
new file mode 100644
index 0000000000..81ff886f75
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-008.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=ltr</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-008.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. left when direction is horizontal, ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="test" dir="ltr">TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-009.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-009.html
new file mode 100644
index 0000000000..bf231c5642
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-009.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=auto, RTL first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-009.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. right when direction is auto and first strong character is rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div class="test" dir="auto">&rlm;TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+<!-- Notes:
+The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed.
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-010.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-010.html
new file mode 100644
index 0000000000..215e60b389
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-010.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, dir=auto, LTR first strong</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-010.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. left when direction is auto and first strong character is ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<div class="test" dir="auto">TES TES TES TES TES TES TES TES</div>
+<div class="ref">REF REF REF REF REF REF REF REF</div>
+</div>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-014.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-014.html
new file mode 100644
index 0000000000..add058c380
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-014.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, pre, dir=rtl inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-014.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. right when base direction is rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="rtl">
+<pre class="test">TES
+&rlm;TIN</pre>
+<div class="ref">REF<br>ERE</div>
+</div>
+<!-- Notes:
+The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed.
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-015.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-015.html
new file mode 100644
index 0000000000..b8432da1c2
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-015.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, pre, dir=ltr inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-015.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. left when base direction is ltr.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="ltr">
+<pre class="test">TES
+&rlm;TIN</pre>
+<div class="ref">REF<br>ERE</div>
+</div>
+<!-- Notes:
+The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed.
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-016.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-016.html
new file mode 100644
index 0000000000..ab9bc30b59
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-016.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, pre, dir=auto</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-016.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. left when direction is auto and first strong character is ltr, and right when first strong is rtl.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test, .ref1, .ref2 { width: 300px; color: orange; font: 25px/1 Ahem; }
+.test { border: 1px solid orange; margin: 20px; }
+.ref1, .ref2 { border-left: 1px solid orange; border-right: 1px solid orange; margin: 0 20px; }
+.ref1 { border-top: 1px solid orange; text-align: left; }
+.ref2 { border-bottom: 1px solid orange; text-align: right; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<pre class="test" dir="auto">TES
+&rlm;TIN</pre>
+<div class="ref1">REF</div>
+<div class="ref2">ERE</div>
+<!-- Notes:
+The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed.
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-017.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-017.html
new file mode 100644
index 0000000000..554adb8faf
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-017.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>text-align: start, pre, dir=auto on surrounding block</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<link rel='match' href='reference/text-align-start-ref-017.html'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. since dir=auto is not inherited by pre, to left in ltr context.">
+<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; }
+.ref { text-align: left; }
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if shading in both orange boxes is identical.</div>
+<div dir="auto">
+<pre class="test">TES
+&rlm;TIN</pre>
+<div class="ref">REF<br>ERE</div>
+</div>
+<!-- Notes:
+The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed.
+The rationale for the expected outcome here is described at
+https://drafts.csswg.org/css-writing-modes-3/#valdef-unicode-bidi-plaintext
+"Because the unicode-bidi property does not inherit, setting bidi-override or plaintext on a block box will not affect any descendant blocks. Therefore these values are best used on blocks and inlines that do not contain any block-level structures. "
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-018.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-018.html
new file mode 100644
index 0000000000..a090e56921
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-018.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8">
+<title>text-align: start, textarea, dir=rtl inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. right when base direction is rtl.">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test { border: 1px solid blue; margin: 20px; width: 300px; font-size: 24px; line-height: 1;}
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if both words are right-aligned in the box.</div>
+<div dir="rtl">
+<textarea class="test">latin
+و·کمی</textarea>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-019.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-019.html
new file mode 100644
index 0000000000..ec4e4eedde
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-019.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8">
+<title>text-align: start, textarea, dir=ltr inherited</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. left when base direction is ltr.">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test { border: 1px solid blue; margin: 20px; width: 300px; font-size: 24px; line-height: 1;}
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if both words are left-aligned in the box.</div>
+<div dir="ltr">
+<textarea class="test">latin
+و·کمی</textarea>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-020.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-020.html
new file mode 100644
index 0000000000..41e3716c4f
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-020.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8">
+<title>text-align: start, textarea dir=auto on control</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. when dir=auto on textarea, left when first strong is ltr, right when rtl.">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test { border: 1px solid blue; margin: 20px; width: 300px; font-size: 24px; line-height: 1;}
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if the first word is left-aligned, and the second right-aligned in the box.</div>
+<div>
+<textarea class="test" dir="auto">latin
+و·کمی</textarea>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-021.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-021.html
new file mode 100644
index 0000000000..1b8d9728b6
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-021.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html lang="en" >
+<head>
+<meta charset="utf-8">
+<title>text-align: start, textarea, dir=auto on surrounding block</title>
+<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
+<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'>
+<meta name="assert" content="text-align:start aligns inline-level content to the start edge of the line box – ie. since dir=auto is not inherited by textarea, to left in ltr context.">
+<style type='text/css'>
+.test { text-align: start; }
+/* the CSS below is not part of the test */
+.test { border: 1px solid blue; margin: 20px; width: 300px; font-size: 24px; line-height: 1;}
+</style>
+</head>
+<body>
+<div id='instructions'>Test passes if both words are left-aligned in both boxes.</div>
+<div dir="auto">
+<textarea class="test">latin
+و·کمی</textarea>
+</div>
+<div dir="auto">
+<textarea class="test">و·کمی
+latin</textarea>
+</div>
+<!--
+Notes:
+The rationale for the expected outcome here is described at
+https://drafts.csswg.org/css-writing-modes-3/#valdef-unicode-bidi-plaintext
+"Because the unicode-bidi property does not inherit, setting bidi-override or plaintext on a block box will not affect any descendant blocks. Therefore these values are best used on blocks and inlines that do not contain any block-level structures. "
+-->
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-center.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-center.html
new file mode 100644
index 0000000000..3b8af4537d
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-center.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-start-last-start.html">
+ <link rel="mismatch" href="text-align-start-last-end.html">
+ <link rel="mismatch" href="text-align-start-last-justify.html">
+ <style>
+ p {
+ text-align: start;
+ text-align-last: center;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-default.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-default.html
new file mode 100644
index 0000000000..ee626a6ac9
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-default.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="match" href="text-align-start-last-start.html">
+ <style>
+ p {
+ text-align: start;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-end.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-end.html
new file mode 100644
index 0000000000..8c7d153fc0
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-end.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-start-last-start.html">
+ <link rel="mismatch" href="text-align-start-last-center.html">
+ <link rel="mismatch" href="text-align-start-last-justify.html">
+ <style>
+ p {
+ text-align: start;
+ text-align-last: end;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-justify.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-justify.html
new file mode 100644
index 0000000000..2d1714af59
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-justify.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-start-last-start.html">
+ <link rel="mismatch" href="text-align-start-last-center.html">
+ <link rel="mismatch" href="text-align-start-last-end.html">
+ <style>
+ p {
+ text-align: start;
+ text-align-last: justify;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-start.html b/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-start.html
new file mode 100644
index 0000000000..2e33fd15b0
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-start-last-start.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>text-align-last</title>
+ <meta charset="utf-8">
+ <link rel="help" href="https://drafts.csswg.org/css-text-3/#text-align-last-property">
+ <link rel="mismatch" href="text-align-start-last-end.html">
+ <link rel="mismatch" href="text-align-start-last-center.html">
+ <link rel="mismatch" href="text-align-start-last-justify.html">
+ <style>
+ p {
+ text-align: start;
+ text-align-last: start;
+ margin-right: 310px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis odio est, cursus non adipiscing at, fringilla quis eros. Sed volutpat nibh sit amet ante molestie a vehicula nulla gravida. Mauris elementum cursus urna id vestibulum. Etiam volutpat odio tincidunt libero ullamcorper elementum. Suspendisse potenti. Ut ut arcu lorem. Integer mi sapien, porta a pharetra et, varius laoreet eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed ut mi at elit consequat aliquam id eu lectus. Etiam tincidunt diam et ante ullamcorper a convallis erat lobortis. Sed blandit ultrices dui et bibendum. Sed condimentum velit eget nibh rutrum cursus. Quisque pretium iaculis gravida. Proin risus eros, iaculis quis fermentum a, adipiscing&nbsp;id&nbsp;mauris.</p>
+ <p dir="rtl">אמר המחבר: החיבור הזה לא חברתיו ללמד לבני האדם את אשר לא ידעו, אלא להזכירם את הידוע להם כבר ומפורסם אצלם פירסום גדול. כי לא תמצא ברוב דברי, אלא דברים שרוב בני האדם יודעים אותם ולא מסתפקים בהם כלל, אלא שכפי רוב פרסומם וכנגד מה שאמתתם גלויה לכל, כך ההעלם מהם מצוי מאד והשכחה רבה. על כן אין התועלת הנלקט מזה הספר יוצא מן הקריאה בו פעם אחת, כי כבר אפשר שלא ימצא הקורא בשכלו חדושים אחר קריאתו שלא היו בו לפני קריאתו, אלא מעט. אבל התועלת יוצא מן החזרה עליו וההתמדה. כי יזכרו לו הדברים האלה הנשכחים מבני האדם בטבע, וישים אל לבו חובתו אשר הוא&nbsp;מתעלם&nbsp;ממנה.</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-align/text-align-webkit-match-parent.html b/testing/web-platform/tests/css/css-text/text-align/text-align-webkit-match-parent.html
new file mode 100644
index 0000000000..aaf481a9d1
--- /dev/null
+++ b/testing/web-platform/tests/css/css-text/text-align/text-align-webkit-match-parent.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>text-align: -webkit-match-parent should not be supported</title>
+<link rel="help" href="https://drafts.csswg.org/css-text/#valdef-text-align-match-parent">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<script>
+test(function() {
+ assert_false(CSS.supports('text-align: -webkit-match-parent'));
+});
+</script>