Open Bug 1069849 Opened 10 years ago Updated 1 year ago

Inline elements with "cancelling" padding and margin wrap differently in Firefox compared to other browsers

Categories

(Core :: Layout, defect)

32 Branch
defect

Tracking

()

People

(Reporter: otoluk, Unassigned)

References

(Depends on 1 open bug, )

Details

(Keywords: reproducible, testcase)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Build ID: 20140911151253

Steps to reproduce:

There is an issue that edit forms and also on some webpages when highlighting text it jumps to new line as it's size changes. See for example this example from Google translate.

http://goo.gl/Q7RLiv


Actual results:

when highlighting word it skips to next line


Expected results:

when highlighting word it  should stay in place.
Simple testcase: http://jsbin.com/cucoh/1/edit .

The issue is that the hovered word gets padding: 2px 3px; and margin: -2px -3px; . In Chrome, this seems to have a net 0 effect on the layout of the span. In Firefox, that isn't the case.

Note that when not wrapping, it's obvious both the "highlighted" element and the "non-highlighted" element take up the same amount of space when both padding and margin have been taken into account.
Status: UNCONFIRMED → NEW
Component: General → Layout
Ever confirmed: true
OS: Windows 7 → All
Product: Firefox → Core
Hardware: x86_64 → All
Summary: Unexpected word wrap when highlighting → Inline elements with "cancelling" padding and margin wrap differently in Firefox compared to other browsers
Added a border to the testcase for clarity.
This is basically the same issue as bug 912777.
Depends on: 912777
(In reply to Boris Zbarsky [:bz] from comment #3)
> This is basically the same issue as bug 912777.

Per summary, I guess this can just be a duplicate? Is there something different between the two bugs that I'm missing?
Flags: needinfo?(bzbarsky)
Original issue was about element highlight not links but technically it could be same issue.
That bug is possibly partially about computing the shrink-wrap width, while this one is purely about the wrapping behavior.

So it's pretty likely that they're the same underlying issue, but it might need fixing in a few different places.
Flags: needinfo?(bzbarsky)
Severity: normal → S3
Duplicate of this bug: 1830997
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: