no-break-space before an image or an inline-block does not prevent line breaking
Categories
(Core :: Layout: Block and Inline, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | affected |
People
(Reporter: roger21, Unassigned)
Details
Attachments
(1 file)
275.82 KB,
image/png
|
Details |
adding a no-break-space between a text and an image or an inline block does not prevent line breaking between this text and this image or this inline-block
while doing the same between two texts does prevent line breaking between those two texts
i would expect the same behavior in both case, in both case the no-break-space should prevent the line breaking
an example here https://jsfiddle.net/yue2pLfg/1/
Comment 1•5 years ago
|
||
I expect backward compatibility to require this, but in any case, sending over to the right component.
Comment 2•5 years ago
•
|
||
I can reproduce this on Firefox 71.
Comment 3•5 years ago
•
|
||
The testcase gives me the same results in both Safari and Chrome.
Checking the CSS Text spec for any relevant details, we find:
The line breaking behavior of a replaced element or other atomic inline is equivalent to an ideographic character (Unicode linebreaking class ID [UAX14]), and additionally, for Web-compatibility, introduces a soft wrap opportunity between itself and any adjacent U+00A0 NO-BREAK SPACE character.
So this is behaving correctly according to the spec, is interoperable with other browsers, and is explicitly mentioned as being a web compatibility requirement. Therefore, even though I agree it seems a bit unexpected that NBSP doesn't prevent a break in these cases, I don't think we can/should change this.
(In reply to Jonathan Kew (:jfkthame) from comment #3)
The testcase gives me the same results in both Safari and Chrome.
well, no ?
Chromium_Archive_77.0.3814.0_(665522)Marmaduke_thinLTO_all-codecs_no-sync_win64 https://reho.st/self/05bf9f687cfc4a3a7e19e070f4bc93b8b549646f.png
Chromium_Archive_78.0.3866.0(681261)_Marmaduke_thinLTO_polly_all-codecs_no-sync_win64 https://reho.st/self/ba934e79b3841742b38975bcc3b72fd3583ac22b.png
ff 69 https://reho.st/self/1ab62858ba8b5bc6c1d4f5197d8ccb1135ca7016.png
Comment 5•5 years ago
|
||
Huh, that's interesting. I tried the current release version of Chrome (76), and it gives the same result as Firefox (see screenshot).
Trying Chrome Canary (78), it does indeed change the rendering and no longer allows these line-breaks. I wonder if they're going to get pushback on that, for web-compatibility reasons? Or is Blink going to push for a spec change here?
Comment 6•5 years ago
|
||
I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1001793 to report this to Chromium; let's see whether they argue for it as a deliberate change, or regard it as a regression to be fixed.
Comment 7•5 years ago
|
||
Just to follow up, this is fixed in chromium 79, and looks like they're merging to 78 as well.
Description
•