Closed Bug 1677353 Opened 4 years ago Closed 3 years ago

Absolutely positioned with width auto parent div won't follow child image width

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect, P3)

Firefox 82
defect

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox82 --- wontfix
firefox83 --- wontfix
firefox84 --- wontfix
firefox85 --- fixed

People

(Reporter: ooijunxiang0959, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0

Steps to reproduce:

structure HTML tags with according to this fiddle and the CSS too
Link: https://jsfiddle.net/OoiJX/at95bxpd/2/

I figured out that the problem is because the main tag has padding (I am speaking according to the code in the link above) and when i switched the padding to #root, the problem is solved, but for other browsers, the code in the link works as expected. So i thought it might be a bug in Firefox

P.S : Sorry if i got the version wrongly, i find the version from Help->About Firefox and saw (82.0.3) so i assume it is Firefox 82

Actual results:

The parent width will not follow child width but in other browsers, it works as expected

Expected results:

The parent width should have the same width with the child img

Has Regression Range: --- → yes

The severity field is not set for this bug.
:jwatt, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jwatt)
Attached file testcase from reporter (obsolete) —
Status: UNCONFIRMED → NEW
Component: Layout → Layout: Images, Video, and HTML Frames
Ever confirmed: true
Attached file Simpler test-case.
Attachment #9192615 - Attachment is obsolete: true

Chrome also messes up here, but in the other direction, interestingly.

Percentages in abspos boxes resolve against the padding box, so we're resolving against the wrong box size. I have a patch which I think should fix this.

Assignee: nobody → emilio
Severity: -- → S3
Flags: needinfo?(jwatt)
Priority: -- → P3

As percentages in abspos boxes resolve against the padding box.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b51a3956edfc
Ignore padding when computing definite percentages if we're abspos boxes. r=mats
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/26874 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
Upstream PR merged by jgraham
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: