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

Issue 17072005: Floated elements inside a white-space:nowrap container should still wrap. (Closed)

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

Description

Floated elements inside a white-space:nowrap container should still wrap. This behavior matches Firefox and fixes the min-content bug exposed by http://trac.webkit.org/changeset/143479. All the new layout test baselines match Firefox except for fast/css/word-space-extra.html. We incorrectly compute the minPreferredLogicalWidth when there is word-spacing involved. In this case, our old behavior was also wrong. Now it's just slightly worse. I spent 3 days trying to fix our word-spacing implementation to make sense and gave up eventually. Hopefully, as we go through and clean up the code involved it will be come easier to fix this in the future. modified: Source/core/rendering/RenderBlock.cpp The old code here was wrong. In the presence of floats, the minLogicalWidth of a nowrap container can be smaller than it's maxLogicalWidth. Unfortunately, fixing this exposes some bugs in our minLogicalWidth computation. modified: Source/core/rendering/RenderText.cpp This fixes one of the bugs exposed by removing the code in RenderBlock. m_hasBreakableStart and m_hasBreakableEnd are eventually exposed to RenderBlock::computeInlinePreferredLogicalWidths. They are only used in order to determine if the beginning/end of the RenderText is a possible wrapping location. In a nowrap container, spaces do *not* represent wrapping locations, so these bools should be false in that case. But, to make this more fun, we still need to track whether the RenderText ends in spaces or newlines so that we can correctly set the stripFrontSpaces bool, which controls stripping the leading spaces in the *next* RenderText. BUG=244777 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=152691

Patch Set 1 #

Patch Set 2 : add missing expectations lines #

Total comments: 2

Patch Set 3 : Sync to ToT and update comments in header. #

Patch Set 4 : merge to ToT #

Total comments: 4

Patch Set 5 : Sync to ToT #

Patch Set 6 : now sans binary files. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+185 lines, -101 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
A LayoutTests/fast/css-intrinsic-dimensions/nowrap-min-content.html View 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/fast/css-intrinsic-dimensions/nowrap-min-content-expected.html View 1 chunk +38 lines, -0 lines 0 comments Download
M LayoutTests/platform/chromium-linux/fast/replaced/width100percent-menulist-expected.txt View 1 chunk +6 lines, -6 lines 0 comments Download
M LayoutTests/platform/chromium-win/fast/css/word-space-extra-expected.txt View 4 chunks +8 lines, -8 lines 0 comments Download
M LayoutTests/platform/chromium-win/fast/replaced/width100percent-image-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/platform/chromium-win/fast/replaced/width100percent-searchfield-expected.txt View 2 chunks +16 lines, -24 lines 0 comments Download
M LayoutTests/platform/chromium-win/fast/replaced/width100percent-textarea-expected.txt View 3 chunks +36 lines, -22 lines 0 comments Download
M LayoutTests/platform/chromium-win/fast/replaced/width100percent-textfield-expected.txt View 2 chunks +10 lines, -18 lines 0 comments Download
M LayoutTests/platform/chromium-win/tables/mozilla/bugs/bug57828-expected.txt View 1 chunk +8 lines, -8 lines 0 comments Download
M Source/core/rendering/RenderBlock.cpp View 1 2 3 4 1 chunk +3 lines, -6 lines 0 comments Download
M Source/core/rendering/RenderText.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderText.cpp View 1 2 3 4 3 chunks +9 lines, -5 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
ojan
I've included the pngs in this patch for the sake of making the review easier. ...
7 years, 6 months ago (2013-06-14 18:36:58 UTC) #1
cbiesinger
https://codereview.chromium.org/17072005/diff/7001/Source/core/rendering/RenderText.cpp File Source/core/rendering/RenderText.cpp (right): https://codereview.chromium.org/17072005/diff/7001/Source/core/rendering/RenderText.cpp#newcode1017 Source/core/rendering/RenderText.cpp:1017: m_hasEndWhiteSpace = isNewline || isSpace; OK, so the difference ...
7 years, 6 months ago (2013-06-14 22:45:50 UTC) #2
ojan
https://codereview.chromium.org/17072005/diff/7001/Source/core/rendering/RenderText.cpp File Source/core/rendering/RenderText.cpp (right): https://codereview.chromium.org/17072005/diff/7001/Source/core/rendering/RenderText.cpp#newcode1017 Source/core/rendering/RenderText.cpp:1017: m_hasEndWhiteSpace = isNewline || isSpace; On 2013/06/14 22:45:50, cbiesinger ...
7 years, 6 months ago (2013-06-14 22:53:37 UTC) #3
cbiesinger
On 2013/06/14 22:53:37, ojan wrote: > https://codereview.chromium.org/17072005/diff/7001/Source/core/rendering/RenderText.cpp > File Source/core/rendering/RenderText.cpp (right): > > https://codereview.chromium.org/17072005/diff/7001/Source/core/rendering/RenderText.cpp#newcode1017 > ...
7 years, 6 months ago (2013-06-14 22:55:32 UTC) #4
ojan
Also, see http://plexode.com/eval3/#s=aekVQXANJVQMbAx14Hz1PD0RJSk1FAVyYAaMBghsBExFRWRyipIOnqautT6QBi6dRSk9MtLaGpxazmF6YHRCWmMZyAXgePQNYnFVGDlRRQkRGp09QWFNCURylpxKqrAGEwasBhwFUQk1OUE+tA5dPHcx3HpudIofY5yfD6AL8fyegIQgbGhYfAZeAAA==. We do actually wrap floats in white-space:nowrap containers, we just don't compute ...
7 years, 6 months ago (2013-06-15 20:01:10 UTC) #5
ojan
Anyone feel comfortable reviewing this or should I hunt for another reviewer? Not sure we ...
7 years, 6 months ago (2013-06-18 01:54:26 UTC) #6
esprehn
This change isn't making sense to me, why do you change code that only runs ...
7 years, 6 months ago (2013-06-18 02:10:03 UTC) #7
ojan
https://codereview.chromium.org/17072005/diff/26001/Source/core/rendering/RenderBlock.cpp File Source/core/rendering/RenderBlock.cpp (right): https://codereview.chromium.org/17072005/diff/26001/Source/core/rendering/RenderBlock.cpp#newcode5777 Source/core/rendering/RenderBlock.cpp:5777: if (childrenInline() && isMarquee() && toRenderMarquee(this)->isHorizontal()) On 2013/06/18 02:10:03, ...
7 years, 6 months ago (2013-06-18 03:33:46 UTC) #8
ojan
https://codereview.chromium.org/17214005/
7 years, 6 months ago (2013-06-18 18:59:53 UTC) #9
ojan
New and improved version up for review...
7 years, 6 months ago (2013-06-18 22:55:37 UTC) #10
esprehn
LGTM.
7 years, 6 months ago (2013-06-18 23:31:29 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ojan@chromium.org/17072005/41001
7 years, 6 months ago (2013-06-18 23:32:18 UTC) #12
commit-bot: I haz the power
Can't process patch for file LayoutTests/platform/chromium-linux/fast/replaced/width100percent-searchfield-expected.png. Binary file support is temporarilly disabled due to a ...
7 years, 6 months ago (2013-06-18 23:32:21 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ojan@chromium.org/17072005/43005
7 years, 6 months ago (2013-06-18 23:52:49 UTC) #14
commit-bot: I haz the power
7 years, 6 months ago (2013-06-19 02:56:26 UTC) #15
Message was sent while issue was closed.
Change committed as 152691

Powered by Google App Engine
This is Rietveld 408576698