Bug 1712703 - Add WPT reftests for white-space:pre interaction with text-align. r=dholbert

Of the 15 cases here (combinations of text-align and directionality), mozilla-central
currently fails 9 and passes only 6.

(FTR, a bunch of these tests also currently fail in Chrome, with similar errors to Firefox;
only Safari seems to handle them consistently/correctly.)

Differential Revision: https://phabricator.services.mozilla.com/D174726
This commit is contained in:
Jonathan Kew 2023-04-05 23:58:07 +00:00
parent 3a1ae2ee70
commit cf3daa649d
33 changed files with 701 additions and 0 deletions

View File

@ -0,0 +1,2 @@
[pre-wrap-align-center-001.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[pre-wrap-align-center-002.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[pre-wrap-align-center-003.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[pre-wrap-align-end-001.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[pre-wrap-align-end-003.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[pre-wrap-align-left-003.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[pre-wrap-align-right-001.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[pre-wrap-align-right-002.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[pre-wrap-align-start-002.html]
expected: FAIL

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-center-001-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: center;
}
</style>
</head>
<p>The text on each line should be neatly centered:</p>
<div class=test>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-center-002-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: center;
}
</style>
</head>
<p>The text on each line should be neatly centered:</p>
<div class=test dir=rtl>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-center-003-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: center;
unicode-bidi: bidi-override;
}
</style>
</head>
<p>The text on each line should be neatly centered:</p>
<div class=test dir=rtl>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-right-001-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: end;
}
</style>
</head>
<p>The text on each line should be neatly right-aligned:</p>
<div class=test>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-left-002-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: end;
}
</style>
</head>
<p>The text on each line should be neatly left-aligned:</p>
<div class=test dir=rtl>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-left-003-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: end;
unicode-bidi: bidi-override;
}
</style>
</head>
<p>The text on each line should be neatly left-aligned:</p>
<div class=test dir=rtl>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-left-001-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: left;
}
</style>
</head>
<p>The text on each line should be neatly left-aligned:</p>
<div class=test>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-left-002-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: left;
}
</style>
</head>
<p>The text on each line should be neatly left-aligned:</p>
<div class=test dir=rtl>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-left-003-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: left;
unicode-bidi: bidi-override;
}
</style>
</head>
<p>The text on each line should be neatly left-aligned:</p>
<div class=test dir=rtl>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-right-001-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: right;
}
</style>
</head>
<p>The text on each line should be neatly right-aligned:</p>
<div class=test>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-right-002-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: right;
}
</style>
</head>
<p>The text on each line should be neatly right-aligned:</p>
<div class=test dir=rtl>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-right-003-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: right;
unicode-bidi: bidi-override;
}
</style>
</head>
<p>The text on each line should be neatly right-aligned:</p>
<div class=test dir=rtl>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-left-001-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: start;
}
</style>
</head>
<p>The text on each line should be neatly left-aligned:</p>
<div class=test>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-right-002-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: start;
}
</style>
</head>
<p>The text on each line should be neatly right-aligned:</p>
<div class=test dir=rtl>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text test: white-space:pre-wrap vs text-align</title>
<link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<meta name="assert" content="white-space at end of line must hang">
<link rel="match" href="reference/pre-wrap-align-right-003-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: pre-wrap;
text-align: start;
unicode-bidi: bidi-override;
}
</style>
</head>
<p>The text on each line should be neatly right-aligned:</p>
<div class=test dir=rtl>one two three four five
six seven eight nine ten.
un deux trois quatre cinq
six sept huit neuf dix</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text reference</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: normal;
text-align: center;
}
</style>
</head>
<p>The text on each line should be neatly centered:</p>
<div class=test>one two three<br>
four five<br>
six seven eight<br>
nine ten.<br>
un deux trois<br>
quatre cinq<br>
six sept huit<br>
neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text reference</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: normal;
text-align: center;
}
</style>
</head>
<p>The text on each line should be neatly centered:</p>
<!-- testcase has dir=rtl -->
<div class=test>one two three<br>
four five<br>
six seven eight<br>
.nine ten<br>
un deux trois<br>
quatre cinq<br>
six sept huit<br>
neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text reference</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: normal;
text-align: center;
}
</style>
</head>
<p>The text on each line should be neatly centered:</p>
<!-- testcase has dir=rtl and bidi-override -->
<div class=test>eerht owt eno<br>
evif ruof<br>
thgie neves xis<br>
.net enin<br>
siort xued nu<br>
qnic ertauq<br>
tiuh tpes xis<br>
xid fuen</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text reference</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: normal;
text-align: left;
}
</style>
</head>
<p>The text on each line should be neatly left-aligned:</p>
<div class=test>one two three<br>
four five<br>
six seven eight<br>
nine ten.<br>
un deux trois<br>
quatre cinq<br>
six sept huit<br>
neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text reference</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: normal;
text-align: left;
}
</style>
</head>
<p>The text on each line should be neatly left-aligned:</p>
<!-- testcase has dir=rtl -->
<div class=test>one two three<br>
four five<br>
six seven eight<br>
.nine ten<br>
un deux trois<br>
quatre cinq<br>
six sept huit<br>
neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text reference</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: normal;
text-align: left;
}
</style>
</head>
<p>The text on each line should be neatly left-aligned:</p>
<!-- testcase has dir=rtl and bidi-override -->
<div class=test>eerht owt eno<br>
evif ruof<br>
thgie neves xis<br>
.net enin<br>
siort xued nu<br>
qnic ertauq<br>
tiuh tpes xis<br>
xid fuen</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text reference</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: normal;
text-align: right;
}
</style>
</head>
<p>The text on each line should be neatly right-aligned:</p>
<div class=test>one two three<br>
four five<br>
six seven eight<br>
nine ten.<br>
un deux trois<br>
quatre cinq<br>
six sept huit<br>
neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text reference</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: normal;
text-align: right;
}
</style>
</head>
<p>The text on each line should be neatly right-aligned:</p>
<!-- testcase has dir=rtl -->
<div class=test>one two three<br>
four five<br>
six seven eight<br>
.nine ten<br>
un deux trois<br>
quatre cinq<br>
six sept huit<br>
neuf dix</div>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text reference</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
.test {
font: 20px Ahem, monospace;
width: 15ch;
border: 1px solid gray;
padding: 5px;
white-space: normal;
text-align: right;
}
</style>
</head>
<p>The text on each line should be neatly right-aligned:</p>
<!-- testcase has dir=rtl and bidi-override -->
<div class=test>eerht owt eno<br>
evif ruof<br>
thgie neves xis<br>
.net enin<br>
siort xued nu<br>
qnic ertauq<br>
tiuh tpes xis<br>
xid fuen</div>