Rendering difference with Chrome/Safari being seemingly caused by a line box being forced by white-space:pre.
Categories
(Core :: Layout: Block and Inline, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox95 | --- | fixed |
People
(Reporter: twisniewski, Assigned: jfkthame)
References
(Regressed 1 open bug, )
Details
Attachments
(3 files)
Firefox appears to forced a line box on :after
content with white-space:pre
, where Chrome and Safari do not (despite content:''
being specified).
This is causing the image gallery arrows on https://m.milliyet.com.tr/ to render differently, as reported and diagnosed at https://webcompat.com/issues/76776 .
See the attached reduced test-case for an example; the bordered square is square on Chrome/Safari but taller than it is wide on Firefox. Dropping the white-space rule resolves the difference.
Comment 1•3 years ago
|
||
The severity field is not set for this bug.
:dholbert, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 2•3 years ago
|
||
This isn't specific to pseudo-elements; it's just a difference in behavior about how empty text nodes are handled.
Here's a testcase where we explicitly insert an empty text node into an element with white-space:pre
. Similar to the original testcase, Firefox renders this as tall (honoring the line-height) whereas Chromium does not.
Comment 3•3 years ago
|
||
jfkthame, do you know who's correct here?
Assignee | ||
Comment 4•3 years ago
|
||
According to https://drafts.csswg.org/css-inline/#line-boxes,
Line boxes that contain no text, no preserved white space, no inline boxes with non-zero margins, padding, or borders, and no other in-flow content (such as atomic inlines or ruby annotations), and do not end with a forced line break must be treated as zero-height line boxes for the purposes of determining the positions of any elements inside of them (such as absolutely positioned boxes), and must be treated as not existing for any other purpose (such as collapsing margins).
it looks like we're wrong; an empty text node does not contain any text, and therefore the line box "contain[s] no text" just as it would if the text node were entirely absent.
Assignee | ||
Comment 5•3 years ago
|
||
white-space: pre-wrap
and break-spaces
also trigger this, fwiw, as does -moz-pre-space
.
Assignee | ||
Comment 6•3 years ago
|
||
Assignee | ||
Comment 7•3 years ago
|
||
No great surprise, this does break a couple of existing tests - for example, it causes an <input type=button value="">
to collapse to zero height. So something a bit more refined will be needed...
(FWIW, it seems a bit odd that <input type=button value=""></input>
maintains its line height as if it had text in the label, whereas <button></button>
collapses. But that seems to be consistent across browsers, so I guess we shouldn't mess with it.)
Assignee | ||
Comment 8•3 years ago
|
||
Updated•3 years ago
|
Comment 11•3 years ago
|
||
Backed out for causing android 4.1 shippable build bustages.
Comment 13•3 years ago
|
||
Comment 14•3 years ago
|
||
bugherder |
Assignee | ||
Updated•3 years ago
|
Description
•