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

New TextBreakIterator's default behavior breaks after space run #25269

Merged
merged 1 commit into from Sep 15, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,13 @@
<!doctype html>
<meta charset=utf-8>
<meta http-equiv="content-language" content="en, ja" />
<title>CSS test Reference</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com" />
<style>
div { white-space: pre; }
span { background: blue; }
</style>

<p>This test passes if the line is after the white space, which hangs (blue).

<div>ああ<span>&#x0020;<br>X</span></div>
Expand Up @@ -24,7 +24,5 @@
<section class="ideo">
<div>国<br>国</div>
<div>国<br>国</div>
<div>国<br>国</div>
<div>国<br>国</div>
</section>
</body>
@@ -0,0 +1,35 @@
<!doctype html>
<meta charset=utf-8>
<title>CSS Text test: hanging trailing spaces with white-space:pre-wrap</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com">
<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
<link rel="help" title="4.1.3. Phase II: Trimming and Positioning" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-normal">
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-004-ref.html">
<meta name="assert" content="Previous breaking opportunities are not considered if the overflow is caused by hanging trailing spaces.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
div {
font: 10px/1 Ahem;
}
.ref {
position: absolute;
color: red;
z-index: -1;
}
.ref span { color: green; }
span { background: green; }
.test {
color: green;

width: 4ch;
white-space: pre-wrap;
}
</style>

<p>This test passes if there is a green square and no red.
<div class="ref">XX<span>X</span>XX<br>XXXXX</span><br>XXXXX<br>XXXXX<br>XXXXX</div>
<div class="test">XX X<span> X</span><span>XX </span>XXXXX<br>XXXXX<br>XXXXX</div>

@@ -0,0 +1,24 @@
<!doctype html>
<meta charset=utf-8>
<meta http-equiv="content-language" content="en, ja" />
<title>CSS Text test: hanging trailing spaces with white-space:pre-wrap</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com">
<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
<link rel="help" title="4.1.3. Phase II: Trimming and Positioning" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-normal">
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-013-ref.html">
<meta name="assert" content="Previous breaking opportunities are not considered if the overflow is caused by hanging trailing spaces.">
<style>
div {
width: 2em;
white-space: pre-wrap;
}
span { background: blue; } /* If the space is removed instead of hanging, there will be no blue box*/
</style>

<p>This test passes if the line is after the white space, which hangs (blue).

<div>ああ<span>&#x0020;X<span></div>

@@ -0,0 +1,35 @@
<!doctype html>
<meta charset=utf-8>
<title>CSS Text test: hanging trailing spaces with white-space:pre-wrap</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com">
<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
<link rel="help" title="4.1.3. Phase II: Trimming and Positioning" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-normal">
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-004-ref.html">
<meta name="assert" content="Previous breaking opportunities are not considered if the overflow is caused by hanging trailing spaces.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
div {
font: 10px/1 Ahem;
}
.ref {
position: absolute;
color: red;
z-index: -1;
}
span { background: green; }
.ref span { color: green; }
.test {
color: green;

width: 4ch;
white-space: pre-wrap;
}
</style>

<p>This test passes if there is a green square and no red.
<div class="ref">XX<span>X</span>X<span>X</span><br>XXXXX</span><br>XXXXX<br>XXXXX<br>XXXXX</div>
<div class="test">XX<span> X</span> X<span>XX </span>XXXXX<br>XXXXX<br>XXXXX</div>

@@ -0,0 +1,35 @@
<!doctype html>
<meta charset=utf-8>
<title>CSS Text test: hanging trailing spaces with white-space:pre-wrap</title>
<link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com">
<link rel="help" title="3. White Space and Wrapping: the white-space property" href="https://drafts.csswg.org/css-text-3/#white-space-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-white-space-pre-wrap">
<link rel="help" title="4.1.3. Phase II: Trimming and Positioning" href="https://drafts.csswg.org/css-text-3/#white-space-phase-2">
<link rel="help" title="5.2. Breaking Rules for Letters: the word-break property" href="https://drafts.csswg.org/css-text-3/#word-break-property">
<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-word-break-normal">
<link rel="match" href="reference/white-space-pre-wrap-trailing-spaces-004-ref.html">
<meta name="assert" content="Previous breaking opportunities are not considered if the overflow is caused by hanging trailing spaces.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
div {
font: 10px/1 Ahem;
}
.ref {
position: absolute;
color: red;
z-index: -1;
}
span { background: green; }
.ref span { color: green; }
.test {
color: green;

width: 5ch;
white-space: pre-wrap;
}
</style>

<p>This test passes if there is a green square and no red.
<div class="ref">XX<span>XXX</span><br>XXX<span>X</span>X<br>XXXXX</span><br>XXXXX<br>XXXXX<br></div>
<div class="test">XX XX<span>X X</span><br>XXXXX<br>XXXXX<br>XXXXX</div>

Expand Up @@ -35,7 +35,5 @@
<section class="ideo">
<div><span class="nowrap">国</span>国</div>
<div><span class="nowrap">国</span><span class="normal">国</span></div>
<div><span class="nowrap">国<span class="normal">国</span></span></div>
<div class="nowrap">国<span class="normal">国</span></div>
</section>
</body>