IE6/Win: ignored margins
Note: This paper remains in very early draft form.
Characterization of the bug in IE6
Suppose we have
- a hasLayout container (necessary)
- with padding-top or border-top (axiom)
- containing a child (necessary)
- AP element (axiom) that is
- immediately followed by (necessary) an
- in-flow (necessary)
- hasLayout (necessary)
- sibling (necessary) X. Then, unless the AP element is the last in
- a consecutive sequence of (necessary)
- any number of (exhaustive)
- arbitrarily ordered (exhaustive)
- floated and AP (necessary)
- siblings (necessary) of which
- at least one is a float (necessary),
the top margin of X is treated as 0.
Example 1 gives one of the most basic test cases, in which a hasLayout container holds an AP element followed by a hasLayout element. This could be simplified further by just making these latter elements direct children of body.
Uninvestigated questions:
- A whole different set of bugs arises when the hasLayout container does not have padding-top or border-top (so permitting margin-collapsing of its first in-flow child’s margin-top).
Notes
None.
Example 1. hasLayout non-RP container with AP child and hasLayout top-margined child. Margin is ignored.
Example 2. hasLayout RP container with AP child and hasLayout top-margined child. Margin is ignored.
Example 3. non-hasLayout container with AP child and hasLayout top-margined child. OK.
Example 4. hasLayout container with AP child and non-hasLayout top-margined child. OK.
Example 5. dimensioned container with AP child and hasLayout top-margined child. Margin is ignored.
Example 6. floated container with AP child and hasLayout top-margined child. Margin is ignored.
Example 7. AP container with AP child and hasLayout top-margined child. Margin is ignored.
Example 8. I-B container with AP child and hasLayout top-margined child. Margin is ignored.
Example 9. hasLayout container with AP child and dimensioned top-margined child. Margin is ignored.
Example 10. hasLayout container with AP child and floated top-margined child. OK.
Example 11. hasLayout container with AP child and AP top-margined child. OK.
Example 12. hasLayout container with AP child and I-B top-margined child. Margin is ignored.
Example 100. hasLayout grandparent with non-hasLayout parent with AP child and hasLayout top-margined child. OK.
Example 1. hasLayout non-RP container with AP child and hasLayout top-margined child. OK.