If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

margin-top/bottom: auto for absolutely positioned elements wrong when other margin not auto

RESOLVED FIXED in mozilla2.0b7

Status

()

Core
Layout: R & A Pos
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

(Blocks: 1 bug, {css2})

Trunk
mozilla2.0b7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

For absolutely positioned elements, we have a math error when exactly one of margin-top or margin-bottom is auto and the other is nonzero.  We end up subtracting the opposite margin twice when computing how much space to give the auto margin.

This causes the following tests in the CSS 2.1 test suite to fail:
http://test.csswg.org/suites/css2.1/20100917/html4/absolute-non-replaced-height-004.htm
http://test.csswg.org/suites/css2.1/20100917/xhtml1/absolute-non-replaced-height-004.xht
(maybe more)

Patch coming.
Created attachment 483001 [details] [diff] [review]
patch
Attachment #483001 - Flags: review?(bzbarsky)
Also:
http://test.csswg.org/suites/css2.1/20100917/html4/absolute-non-replaced-max-height-004.htm
http://test.csswg.org/suites/css2.1/20100917/xhtml1/absolute-non-replaced-max-height-004.xht
Comment on attachment 483001 [details] [diff] [review]
patch

r=me.

Probably worth taking for 2.0...
Attachment #483001 - Flags: review?(bzbarsky) → review+
Attachment #483001 - Flags: approval2.0?
Attachment #483001 - Flags: approval2.0? → approval2.0+
http://hg.mozilla.org/mozilla-central/rev/7023ebb8417a
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Blocks: 605520
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in before you can comment on or make changes to this bug.