Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Issue 17434006: Breaking whitespace in a white-space:pre-wrap should never go on the new line. (Closed)

Created:
7 years, 6 months ago by ojan
Modified:
7 years, 6 months ago
Reviewers:
esprehn, eae, eseidel
CC:
blink-reviews, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering
Visibility:
Public.

Description

Breaking whitespace in a white-space:pre-wrap should never go on the new line. This broke in https://src.chromium.org/viewvc/blink?revision=147837&view=revision. From that patch, currentCharacterIsWS does not get reset when currentCharacterIsSpace does, so previousCharacterIsSpace is now the wrong thing for checking what to do with a white-space:pre-wrap space. Specifically, it's the following line at the end of RenderBlock::LineBreaker::nextSegmentBreak where we reset currentCharacterIsSpace, but not currentCharacterShouldCollapseIfPreWap: if (!collapseWhiteSpace) currentCharacterIsSpace = false; This code brings that bool back. It's a bit gross, but I couldn't come up with a cleaner way to do this. At some point, someone needs to take a hacksaw to RenderBlock::LineBreaker::nextSegmentBreak to break it up into digestible pieces. BUG=246127, 247959 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=152812

Patch Set 1 #

Total comments: 1

Patch Set 2 : address review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -5 lines) Patch
A LayoutTests/fast/text/whitespace/pre-wrap-no-space-at-start-of-line.html View 1 chunk +4 lines, -0 lines 0 comments Download
A LayoutTests/fast/text/whitespace/pre-wrap-no-space-at-start-of-line-expected.html View 1 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderBlockLineLayout.cpp View 1 6 chunks +7 lines, -5 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
ojan
7 years, 6 months ago (2013-06-19 00:21:41 UTC) #1
eae
LGTM with caveat. https://codereview.chromium.org/17434006/diff/1/LayoutTests/fast/text/whitespace/pre-wrap-no-space-at-start-of-line-expected.html File LayoutTests/fast/text/whitespace/pre-wrap-no-space-at-start-of-line-expected.html (right): https://codereview.chromium.org/17434006/diff/1/LayoutTests/fast/text/whitespace/pre-wrap-no-space-at-start-of-line-expected.html#newcode4 LayoutTests/fast/text/whitespace/pre-wrap-no-space-at-start-of-line-expected.html:4: <div style="width: 25px; display: inline-block; white-space: ...
7 years, 6 months ago (2013-06-19 04:26:07 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ojan@chromium.org/17434006/5001
7 years, 6 months ago (2013-06-20 18:11:20 UTC) #3
commit-bot: I haz the power
7 years, 6 months ago (2013-06-20 19:59:08 UTC) #4
Message was sent while issue was closed.
Change committed as 152812

Powered by Google App Engine
This is Rietveld 408576698