Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-text-3] White space pre wrap end of line #5283

Merged
merged 6 commits into from
Sep 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions css/css-text-3/white-space/pre-wrap-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap is not wrapped</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="preserved white space at the end of the line is not wrapped when the white-space property is set to pre-wrap">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 4ch;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX XX</div>
</body>
25 changes: 25 additions & 0 deletions css/css-text-3/white-space/pre-wrap-002.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap does not change based on word-break:break-all</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="preserved white space at the end of the line is not wrapped when the white-space property is set to pre-wrap, even if word-break is break-all">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 4ch;
word-break: break-all;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX XX</div>
</body>
25 changes: 25 additions & 0 deletions css/css-text-3/white-space/pre-wrap-003.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap does not change based on word-break:keep-all</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="preserved white space at the end of the line is not wrapped when the white-space property is set to pre-wrap, even if word-break is keep-all.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 4ch;
word-break: keep-all;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX XX</div>
</body>
25 changes: 25 additions & 0 deletions css/css-text-3/white-space/pre-wrap-004.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap does not change based on line-break:loose</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="preserved white space at the end of the line is not wrapped when the white-space property is set to pre-wrap, even if line-break is loose.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 4ch;
line-break: loose;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX XX</div>
</body>
25 changes: 25 additions & 0 deletions css/css-text-3/white-space/pre-wrap-005.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap does not change based on line-break:normal</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="preserved white space at the end of the line is not wrapped when the white-space property is set to pre-wrap, even if line-break is normal.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 4ch;
line-break: normal;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX XX</div>
</body>
25 changes: 25 additions & 0 deletions css/css-text-3/white-space/pre-wrap-006.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap does not change based on line-break:strict</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="preserved white space at the end of the line is not wrapped when the white-space property is set to pre-wrap, even if line-break is strict.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 4ch;
line-break: strict;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX XX</div>
</body>
26 changes: 26 additions & 0 deletions css/css-text-3/white-space/pre-wrap-007.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap does not change based on overflow-wrap:break-word</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="preserved white space at the end of the line is not wrapped when the white-space property is set to pre-wrap, even if overflow-wrap is break-word.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 4ch;
word-wrap: break-word; /* deprecated alias */
overflow-wrap: break-word;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX XX</div>
</body>
27 changes: 27 additions & 0 deletions css/css-text-3/white-space/pre-wrap-008.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap is wrapped when overflow-wrap is break-spaces</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-overflow-wrap-break-spaces">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="preserved white space at the end of the line is wrapped when the white-space property is set to pre-wrap and overflow-wrap is break-spaces.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 1ch 0/2ch 2ch no-repeat;

width: 4ch;
overflow-wrap: break-spaces;
margin-left: -1ch;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div> XX XX</div>
</body>
27 changes: 27 additions & 0 deletions css/css-text-3/white-space/pre-wrap-009.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: single preserved white space at the end of with white-space:pre-wrap overflow-wrap:break-spaces</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-overflow-wrap-break-spaces">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="a single preserved white space at the end of the line is not wrapped when the white-space property is set to pre-wrap and overflow-wrap is break-spaces.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 2ch;
overflow-wrap: break-spaces;
}

</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX XX</div>
</body>
27 changes: 27 additions & 0 deletions css/css-text-3/white-space/pre-wrap-010.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: single preserved white space at the end of with white-space:pre-wrap overflow-wrap:break-spaces break-word</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#overflow-wrap-property">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="a single preserved white space at the end of the line is wrapped when the white-space property is set to pre-wrap and overflow-wrap is break-spaces break-word.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 1ch 0/2ch 2ch no-repeat;

width: 3ch;
overflow-wrap: break-spaces break-word;
margin-left: -1ch;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div> XX XX</div>
</body>
27 changes: 27 additions & 0 deletions css/css-text-3/white-space/pre-wrap-011.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap does not cause wrapping</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#overflow-wrap-property">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="When the white-space property is set to pre-wrap, preserved white space at the end of the line must hang or be collapsed, and must not cause preceeding content to be wrapped.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 1ch 0/2ch 2ch no-repeat;

width: 3ch;
margin-left: -1ch;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div> XX&#x20;
XX </div>
</body>
26 changes: 26 additions & 0 deletions css/css-text-3/white-space/pre-wrap-012.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap with right alignement</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="When white-space is pre-wrap, only spaces that overflow the line get collapsed or hanged, the ones that fit have an effect when right-aligning.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 3ch;
text-align: right;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX&#x20;
XX </div>
</body>
26 changes: 26 additions & 0 deletions css/css-text-3/white-space/pre-wrap-013.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap with center alignement</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="When white-space is pre-wrap, only spaces that overflow the line get collapsed or hanged, the ones that fit have an effect when centering.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 3ch;
text-align: center;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX&#x20;
XX </div>
</body>
27 changes: 27 additions & 0 deletions css/css-text-3/white-space/pre-wrap-014.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test: preserved white space at the end of and white-space:pre-wrap with justification</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="match" href="reference/pre-wrap-001-ref.html">
<meta name="assert" content="When white-space is pre-wrap, only spaces that overflow the line get collapsed or hanged, the ones that fit have an effect when justifying.">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
white-space: pre-wrap;
color: green;

background: linear-gradient(red, red) 0 0/2ch 2ch no-repeat;

width: 3ch;
text-align: justify;
text-justify: inter-character;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>X&#8203;X&#x20;
X&#8203;X </div>
</body>
16 changes: 16 additions & 0 deletions css/css-text-3/white-space/reference/pre-wrap-001-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Text level 3 Test reference file</title>
<link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/">
<style>
div {
font-size: 20px;
font-family: ahem;
line-height: 1em;
color: green;
}
</style>
<body>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div>XX<br>XX</div>
</body>
Loading