New issue
Advanced search Search tips

Issue 768363 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 13
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 767634



Sign in to add a comment

Chrome honors word-break and wraps preserved white-spaces when using break-all even if white-space: pre-wrap is set

Project Member Reported by jfernan...@igalia.com, Sep 25 2017

Issue description

Chrome Version: (62.0.3198.0)
OS: (linux)

What steps will reproduce the problem?
(1) load the attached test case
(2)
(3)

What is the expected result?

Preserved white spaces are not wrapped, but they are collapsed just to prevent overflow.

What happens instead?

White spaces are wrapped and moved to the next line.
 



 
pre-wrap-bug.html
343 bytes View Download
Description: Show this description
Cc: kojii@chromium.org
BTW, this bug is the cause of the following WPT:

https://github.com/w3c/web-platform-tests/blob/master/css/css-text-3/white-space/pre-wrap-002.html

It passes when loaded in Gecko/Firefox and Webkit/Safari
Summary: Chrome honors word-wrap and wraps preserved white-spaces when using break-all even if white-space: pre-wrap is set (was: Chrome honors word-wrap and prevent white-space collapsing when using break-all even if white-space: pre-wrap)
Description: Show this description

Comment 6 by e...@chromium.org, Sep 27 2017

Components: Blink>Layout
Owner: kojii@chromium.org
Status: Assigned (was: Untriaged)

Comment 7 by kojii@chromium.org, Oct 2 2017

I think you meant 'word-break: break-all' applied to the div? I can then reproduce in the current layout engine but not with LayoutNG.

We should probably import these tests too.
Attached a new test case to reproduce the bug.
pre-wrap-bug.html
267 bytes View Download
Summary: Chrome honors word-break and wraps preserved white-spaces when using break-all even if white-space: pre-wrap is set (was: Chrome honors word-wrap and wraps preserved white-spaces when using break-all even if white-space: pre-wrap is set)
Status: WontFix (was: Assigned)
Thank you for the updated test. Confirmed in Canary, and confirmed this was fixed in LayoutNG.

Given this is fixed in LayoutNG and we expect the switch isn't too far, I'm not planning to work on this. But if anyone wants to work on, or have reasons to raise the priority, I'd be happy to hear/advice/review. I guess this is about break-after-space mode, which isn't the first class citizen in the current line breaker, but we refactored in LayoutNG. The fix shouldn't be too hard.
Status: Started (was: WontFix)
I'm planning to work on this now.
Blocking: 767634
Owner: jfernan...@igalia.com
Thank you!
Project Member

Comment 14 by bugdroid1@chromium.org, Nov 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3c9ddfebad716cd1aed2386175bdd1870efa0217

commit 3c9ddfebad716cd1aed2386175bdd1870efa0217
Author: Javier Fernandez <jfernandez@igalia.com>
Date: Tue Nov 13 10:43:28 2018

[css-text] Skip trailing spaces for pre-wrap even if word can be broken

According to the specs, preserved white-spaces should hang, or visually
collapse, when white-space is set to pre-wrap; even if word-break allows
breaing the word at any point.

https://www.w3.org/TR/css-text-3/#line-break-details

Bug:  768363 
Change-Id: I7ab356ed6f789ecef087ff469ad97c50e7af49be
Reviewed-on: https://chromium-review.googlesource.com/c/1318694
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Cr-Commit-Position: refs/heads/master@{#607550}
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/editing/deleting/delete-across-editable-content-boundaries-2.html
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/external/wpt/css/css-text/white-space/pre-wrap-002.html
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/platform/linux/editing/style/table-selection-expected.png
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/platform/linux/editing/style/table-selection-expected.txt
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/basic-textareas-expected.png
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/platform/mac/editing/style/table-selection-expected.png
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/platform/mac/editing/style/table-selection-expected.txt
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/platform/win/editing/style/table-selection-expected.png
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/platform/win/editing/style/table-selection-expected.txt
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/basic-textareas-expected.png
[modify] https://crrev.com/3c9ddfebad716cd1aed2386175bdd1870efa0217/third_party/blink/renderer/core/layout/line/breaking_context_inline_headers.h

Status: Fixed (was: Started)
This issue should be FIXED now.

Sign in to add a comment