Skip to content

Commit

Permalink
[balance-text] Fix when text-align is not left
Browse files Browse the repository at this point in the history
The `NGParagraphLineBreaker` adjusts the available width for
the `NGLineBreaker`, but the adjustments should not be visible
for `CreateLine` because it is used for aligning lines within
the original available width.

This patch restores the `line_opportunity` after the
`NGLineBreaker` is done.

Bug: 1251079
Change-Id: I83cdf1c120a6de0741180a27d7860ef8b70475cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4304620
Auto-Submit: Koji Ishii <kojii@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1112644}
  • Loading branch information
kojiishi authored and chromium-wpt-export-bot committed Mar 3, 2023
1 parent 48994db commit ad172b1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<style>
.container {
font-family: monospace;
font-size: 20px;
width: 20ch;
border: solid 1px;
}
</style>
<div class="container" style="text-align: right">
123456789 123 567
123456789 123 567
</div>
<div class="container" style="text-align: center">
123456789 123 567
123456789 123 567
</div>
<div class="container" style="text-align: justify">
123456789 123 567
123456789 123 567
</div>
24 changes: 24 additions & 0 deletions css/css-text/white-space/text-wrap-balance-align-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<link rel="help" href="https://w3c.github.io/csswg-drafts/css-text-4/#valdef-text-wrap-balance">
<link rel="match" href="reference/text-wrap-balance-align-001-ref.html">
<style>
.container {
font-family: monospace;
font-size: 20px;
width: 20ch;
border: solid 1px;
text-wrap: balance;
}
</style>
<div class="container" style="text-align: right">
123456789 123 567
123456789 123 567
</div>
<div class="container" style="text-align: center">
123456789 123 567
123456789 123 567
</div>
<div class="container" style="text-align: justify">
123456789 123 567
123456789 123 567
</div>

0 comments on commit ad172b1

Please sign in to comment.