Unnecessary line break when using negative margins on an inline-child of an inline-block element
Categories
(Core :: Layout: Block and Inline, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox65 | --- | wontfix |
People
(Reporter: mstange, Unassigned)
References
Details
Attachments
(4 files)
| Reporter | ||
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Comment 5•6 years ago
|
||
Comment 7•6 years ago
|
||
Fwiw, I re-tested this in the latest Canary with LayoutNG enabled
and it's still compatible with Firefox, so hopefully they'll ship
that soon :-)
Comment 8•6 years ago
|
||
Indeed, Chrome LayoutNG works like us... I filed a bug on the W3C to fix their stylesheet. It feels like we are doing the right thing here (bug in Safari then ;) ).
It feels like we are doing the right thing here
Um. I'm pretty sure the testcase here should pass. The point of shrink-to-fit sizing is to size the box to fit its content exactly without triggering any unforced line breaks. We're sizing to fit the content, we're just failing to fit the content into the resulting custom-fitted size... I'm guessing because the "extra space" created by the negative margin isn't accounted for when we're placing the text.
Comment 10•6 years ago
|
||
I'm not able to reproduce this via the following anymore in Nightly (web render enabled):
https://w3c.github.io/navigation-timing/#issue-container-generatedID-3
Maybe it got fixed by something else?
Comment 11•6 years ago
|
||
Not sure what's changed about the example at https://w3c.github.io/navigation-timing/#issue-container-generatedID-3, but Markus' testcase here (attachment 9020527 [details]) still fails on Nightly for me.
| Reporter | ||
Comment 12•6 years ago
•
|
||
(In reply to Jonathan Kew (:jfkthame) from comment #11)
Not sure what's changed about the example at https://w3c.github.io/navigation-timing/#issue-container-generatedID-3
The content was updated so that respec is no longer "offended" by the element, and it was also regenerated with a version that includes the following workaround for this very issue:
/* TODO: Remove once https://github.com/w3c/tr-design/pull/176 is merged. */
.respec-offending-element a[href] {
margin: 0;
}
Comment 13•6 years ago
|
||
While it's nice that the original site has been modified to work around the issue, the underlying bug in Gecko (as per comment 9) is still present. We should fix this.
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
Comment 17•5 years ago
|
||
Sorry, my mistake -- per bug 871224 comment 27, it turns out Chrome has changed behavior and matches us on that bug's testcases now. So this is not a dupe of that bug after all.
I'll dupe this family of bugs (which have unexpectedly-linewrapped text, with intrinsic sizing & margin-right & padding-right) to this bug here.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 20•4 years ago
|
||
Both Chrome and Firefox break the words with data:text/html,<span style="display:inline-block"><span style="margin-right:-1px">Two words</span></span>, while Safari doesn't.
However, if you use data:text/html,<span style="display:inline-block"><span style="padding-right:1px;margin-right:-1px">Two words</span></span>, only Firefox breaks the words.
This is a problem for me at https://explained-from-first-principles.com/email/tools/#dkim-record. Please fix! 🙂
Updated•3 years ago
|
Comment 22•3 years ago
|
||
The severity field for this bug is relatively low, S3. However, the bug has 5 duplicates.
:jfkthame, could you consider increasing the bug severity?
For more information, please visit auto_nag documentation.
Comment 23•3 years ago
|
||
The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.
Comment 24•2 years ago
|
||
I've noticed this bug affecting the subtitles on the BBC website — I'm going to work around it by removing the negative margins from the subtitles, but I think this bug is still causing problems in the wild.
Comment 25•2 years ago
|
||
Comment 26•2 years ago
|
||
I've been looking at this with Robert Bryer and agree that this bug is causing us a significant subtitle and caption rendering issue, only on Firefox.
Additional observation: the unwanted line break happens with a negative margin only on the edge that the direction is pointing to, i.e. margin-right for direction: ltr and margin-left for direction:rtl.
If we do what he suggests and remove the negative margin, then we will not be able to render conformant to the subtitle spec (see EBU-TT-D Annex D) on any browser unless we try to detect the presence of this bug. If we leave it as is, then it will be conformant on other browsers, but unusably broken on Firefox. I would back the request to increase the severity of this bug.
Comment 27•2 years ago
|
||
Further observation: merely moving the last character on the line into a separate <span> and shifting the negative margin to that <span> causes the behaviour to look normal, i.e. it avoids the line wrap. That inconsistency also looks like a bug!
Description
•