Bug 183642
| Summary: | WebKit ignores the nowrap on <td nowrap="nowrap">, if an absolute width is specified | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Daniel Holbert <dholbert> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ahmad.saleem792, bfulgham, mmaxfield, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 11 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Daniel Holbert
STEPS TO REPRODUCE:
(1) Load https://jsfiddle.net/b87re0vw/
EXPECTED RESULTS:
None of the text inside the tables should wrap.
ACTUAL RESULTS:
The text inside the second table *does* wrap, for no clear reason.
MORE INFO:
In both cases, there is a <td nowrap="nowrap">.
In the first table, that gives the descendant div a computed "white-space" of "nowrap". But in the second table, it does not, for some reason. The only difference is that the second table has an explicit width on its <td> element (which in this example is quite large, so it's not causing wrapping by being the thing that constrains the width).
Devtools shows me that this nowrap="nowrap" behavior involves the following UA stylesheet rule:
> td[Attributes Style] {
> white-space: -webkit-nowrap;
> }
And apparently -webkit-nowrap has some magic "width" dependence, or something...? not sure. Anyway, Firefox and Edge are consistent on this -- they render both tables with no line wrapping.
Chrome/Blink matches WebKit, for now, though I reported this in their bug tracker as https://bugs.chromium.org/p/chromium/issues/detail?id=821915
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Daniel Holbert
(Note: the devtools referenced in comment 0 are from Chrome, but I assume they correspond to a UA stylesheet that's common between Blink & WebKit. Rendering-wise, I tested in Safari 11 on High Sierra and got "Actual Results" from comment 0.)
Ahmad Saleem
I am able to reproduce this bug in Safari Technology Preview 153 and using JSFiddle from Comment 0 and it shows "td has specified width:" does not respect "no wrap" while both Firefox Nightly 106 and Chrome Canary 107 matches with each other. Thanks!
Ahmad Saleem
Let's try to merge Chromium / Blink patch.
https://github.com/WebKit/WebKit/pull/4114
EWS
Committed 254505@main (cb185fe86778): <https://commits.webkit.org/254505@main>
Reviewed commits have been landed. Closing PR #4351 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/99953830>