Bug 117780
Summary: | REGRESSION(r143479): Floated elements inside a white-space:nowrap container should still wrap | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | ahmad.saleem792, bdakin, dino, hyatt, karlcow, robert, simon.fraser, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | BlinkMergeCandidate, InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ryosuke Niwa
Consider merging https://chromium.googlesource.com/chromium/blink/+/83e189ab24ed21ecc254805c14e0947bf6eeccd1
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
So, is there a regression on a live web site exposed by r143479? We should prioritize by the symptom then.
Ryosuke Niwa
See https://code.google.com/p/chromium/issues/detail?id=244777
Radar WebKit Bug Importer
<rdar://problem/14213678>
Ahmad Saleem
Took added test from Blink and remove prefixes `min-width: min-content` and then changed it to `JSFiddle`:
Test Case - https://jsfiddle.net/dwhrqkb9/show
^ It seems to run same across WebKit ToT, Chrome Canary 125 and Firefox Nightly 126.
@Alan - any input?
Karl Dubost
yes it is working the same everywhere.