Closed
Bug 75878
Opened 25 years ago
Closed 23 years ago
sibling elements move elements with absolute position
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
mozilla1.1alpha
People
(Reporter: wo, Assigned: attinasi)
Details
(Keywords: compat, testcase, Whiteboard: WONTFIX?)
Attachments
(2 files)
If an element has position:absolute, its position should not depend upon the
position of its siblings. So the H1 element in this document
<body>
<p></p>
<h1 style="position:absolute;left:0;top:0;">This should be at 0/0</h1>
</body>
should appear at position 0/0. But in M0.8, M.081 and NB2001041004 (win98) it is
at about 0/20. If you remove the paragraph, it is at 0/0.
| Reporter | ||
Comment 1•25 years ago
|
||
Comment 2•25 years ago
|
||
looks like a problem with margin collapse... seeing this on a 2001-04-12 linux
build too.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 98 → All
Comment 3•24 years ago
|
||
I checked, and this also occurs in strict mode. (So it's not just a quirks
thing from people using <p> for line spacing or whatever.)
Comment 4•24 years ago
|
||
The bug doesn't really work as described.
1) There is no bug in strict mode. With or without the empty P element, the H1
is always about 20px from the top because html.css defines:
H1 {margin: .67em 0}
2) In quirks mode the problem is that without the empty P between the BODY and
the H1, the H1 matches the collapsing margin rule in quirks.css that says:
body > h1:first-node {margin-top: 0}
3) The difference of behavior happens with any empty element: an empty SPAN does
it as well an an empty P.
So... the bug is not that in most cases the H1 is at 20px from the top. The bug
is that in quirks mode and without empty element, the margin-top of the H1 is set
to 0 even though it is an absolutely positioned element.
I'm afraid the collapsing margins issues cannot be solved with style rules in
quirks.css as we have been doing in bug 97361, bug 83839 and others because they
should not apply to fixed or absolutely positioned elements. It is annoying but I
think it can be marked WontFix. For a correct absolute positioning of elements
that have a margin defined in the UA stylesheet, the author should set (or in
that case reset) the margin anyhow.
Reassigned to Marc and CCd Dbaron who worked on it too.
Assignee: pierre → attinasi
Comment 5•24 years ago
|
||
Doing the collapsing margins stuff any other way without causing author style
rules that specify margins to be ignored would be very difficult.
Updated•24 years ago
|
Target Milestone: --- → mozilla1.1
Updated•24 years ago
|
Comment 7•24 years ago
|
||
WONTFIX?
Comment 8•23 years ago
|
||
This is quirks-only, and we've been wontfixing other bugs related to this
issue.. If we ever decide to change the way we handle margins in quirks mode,
this bug will automatically be "fixed".
Note that the testcase in this bug is invalid to start with (the only way that
text could end up at 0,0 with those styles and markup is due to a weird quirk).
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WONTFIX
I'd rather mark this is a duplicate...
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
*** This bug has been marked as a duplicate of 33784 ***
Status: REOPENED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•