Bug 183642 - WebKit ignores the nowrap on <td nowrap="nowrap">, if an absolute width is specified
Summary: WebKit ignores the nowrap on <td nowrap="nowrap">, if an absolute width is sp...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-03-14 13:02 PDT by Daniel Holbert
Modified: 2022-09-14 23:03 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Holbert 2018-03-14 13:02:24 PDT
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
Comment 1 Daniel Holbert 2018-03-14 13:04:48 PDT
(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.)
Comment 2 Ahmad Saleem 2022-09-07 16:25:04 PDT
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!
Comment 3 Ahmad Saleem 2022-09-07 16:43:52 PDT
Let's try to merge Chromium / Blink patch.

https://github.com/WebKit/WebKit/pull/4114
Comment 4 EWS 2022-09-14 23:02:46 PDT
Committed 254505@main (cb185fe86778): <https://commits.webkit.org/254505@main>

Reviewed commits have been landed. Closing PR #4351 and removing active labels.
Comment 5 Radar WebKit Bug Importer 2022-09-14 23:03:19 PDT
<rdar://problem/99953830>