Closed
Bug 419100
Opened 18 years ago
Closed 15 years ago
'direction' override for 'auto' margins on absolutely positioned elements happens when only one margin is auto
Categories
(Core :: Layout: Positioned, defect)
Core
Layout: Positioned
Tracking
()
RESOLVED
FIXED
mozilla5
People
(Reporter: dbaron, Unassigned)
References
(Blocks 1 open bug, )
Details
(Keywords: css2)
Attachments
(1 file)
|
17.43 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
In CSS 2.1 sections 10.3.7 and 10.3.8, 'direction' beats 'auto' margins only when both margins are 'auto'. We implement this behavior when only one margin is 'auto'. Safari 3 gets it right. (Opera and IE don't; Opera 9.25 doesn't implement the direction-override at all; IE 7 doesn't implement auto margins.)
Steps to reproduce: load http://dbaron.org/css/test/2008/abs-pos-auto-margin
Expected results:
1. direction:ltr, wide, margin-left:auto should overflow the yellow box to the right
2. direction:rtl, wide, margin-right:auto should overflow the yellow box to the left
Actual results:
1. it overflows to the left
2. it overflows to the right
This should be a simple fix in nsHTMLReflowState::InitAbsoluteConstraints.
| Reporter | ||
Comment 1•18 years ago
|
||
I actually hard-coded the buggy behavior described in this bug into the reference renderings in layout/reftests/box-properties/abspos-non-replaced-width-offset-margin-ref.html and layout/reftests/box-properties/abspos-replaced-width-offset-margin-ref.html ; these should be fixed when we fix this bug.
Comment 2•17 years ago
|
||
Is this still a bug?
| Reporter | ||
Comment 3•17 years ago
|
||
The behavior described is still present; I haven't checked whether the spec has changed in the last 18 months.
| Reporter | ||
Updated•16 years ago
|
Blocks: css2.1-tests
| Reporter | ||
Comment 4•15 years ago
|
||
This fixes the two tests mentioned above (which are also in the CSS 2.1 test suite, with no passing implementations, although every implementation I've checked fails differently).
I still need to (a) write tests for the vertical case (b) figure out whether that FIXME I added in the vertical case should result in a spec change or a code change.
Attachment #493143 -
Flags: review?(roc)
Attachment #493143 -
Flags: review?(roc) → review+
| Reporter | ||
Comment 5•15 years ago
|
||
Whiteboard: fixed-in-birch
| Reporter | ||
Comment 6•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: fixed-in-birch
Target Milestone: --- → mozilla2.2
Comment 7•11 years ago
|
||
> I still need to (a) write tests for the vertical case (b) figure out whether that FIXME I
> added in the vertical case should result in a spec change or a code change.
Given that IE and Blink at least are following the spec, I'd say code change. That's happening in bug 1100073.
Comment 8•10 years ago
|
||
(In reply to David Baron [:dbaron] ⌚️UTC-7 (review requests must explain patch) from comment #4)
> This fixes the two tests mentioned above (which are also in the CSS 2.1 test
> suite, with no passing implementations, although every implementation I've
> checked fails differently).
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/abspos-non-replaced-width-margin-000.htm
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/reference/abspos-non-replaced-width-margin-000-ref.htm
Firefox 46 and Chrome 50 pass these 2 tests.
You need to log in
before you can comment on or make changes to this bug.
Description
•