Negative margin doesn't cancel the padding on parent causing undesired line breaking when width is auto
Categories
(Core :: Layout: Block and Inline, defect, P3)
Tracking
()
Webcompat Priority | revisit |
People
(Reporter: roxana.leitan, Unassigned)
References
()
Details
(Whiteboard: [webcompat])
Attachments
(1 file)
350 bytes,
text/html
|
Details |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0 Build ID: 20180718220144 [Affected versions]: Nightly 63.0a1, Firefox Beta 62.0b9 [Affected platforms]: Windows 10 x64, Mac OS X 10.13 [Steps to reproduce]: 1.Launch Firefox with a new profile 2.Go to https://edition.cnn.com/entertainment 3.Hover using mouse over "watch this" or "top stories" [Expected result]: The selection should be correctly highlighted [Actual result] The selection is overlapped while is highlighted
Comment 1•6 years ago
|
||
This appears to be a layout issue; the overlapping occurs because those headings unexpectedly wrap onto two lines, whereas in other browsers they appear on a single line.
Comment 2•6 years ago
|
||
In Firefox, the text here is broken across two lines, whereas in all the other browsers I've tested (Safari, Chrome, Edge) it remains on a single line.
The issue is reproducible also on Firefox Release 61.0.1
Updated•6 years ago
|
Updated•6 years ago
|
I just came across this problem too, and made a JSFiddle: https://jsfiddle.net/brLfc14a/
This example uses Flexbox but the same happens if you remove flex and float the list items.
It seems that whenever you add negative margins the width of the element decreases, but it has always been my understanding that negative left/right margins increase the width of the element.
I'm using Firefox 65.0 (macOS 10.14.2).
Comment 5•5 years ago
|
||
Looking at jfkthame's testcase, it appears to be essentially the same issue as in bug 1502610.
Comment 6•5 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Comment 7•5 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Updated•5 years ago
|
Comment 8•4 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #5)
Looking at jfkthame's testcase, it appears to be essentially the same issue as in bug 1502610.
That bug and this bug are in fact both dupes of much-older bug 871224. Marking as such.
Comment 9•4 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. But they still disagree with us on the testcase here, and the padding-right
is now the key thing that causes testcases to have differing behavior. So this is not a dupe of bug 871224.
So let's use bug 1502610 as the dupe-target for this family of bugs. Technically this one here was filed first, but bug 1502610 has simpler testcases and more spec discussion, so it's a better place to focus the conversation.
Description
•