Closed Bug 1476925 Opened 6 years ago Closed 4 years ago

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)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1502610
Webcompat Priority revisit
Tracking Status
firefox61 --- affected
firefox62 --- affected
firefox63 --- affected

People

(Reporter: roxana.leitan, Unassigned)

References

()

Details

(Whiteboard: [webcompat])

Attachments

(1 file)

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
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.
Component: Graphics: Text → Layout: Block and Inline
Priority: -- → P3
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
Summary: Text is not correctly highlighted on cnn webpage → Negative margin doesn't cancel the padding on parent causing undesired line breaking when width is auto
Whiteboard: [webcompat]

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).

Looking at jfkthame's testcase, it appears to be essentially the same issue as in bug 1502610.

Depends on: 1502610

Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.

Webcompat Priority: --- → ?

See bug 1547409. Migrating whiteboard priority tags to program flags.

Webcompat Priority: ? → revisit

(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.

Status: NEW → RESOLVED
Closed: 4 years ago
No longer depends on: 1502610
Resolution: --- → DUPLICATE

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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: