W3C home > Mailing lists > Public > www-style@w3.org > August 2010

Re: [CSS 2.1] [Section 8.3.1] Margin collapsing and top: auto (abs. ?pos)

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 3 Aug 2010 11:16:18 -0700
Message-ID: <AANLkTi=hSdxZjwDVAYRe9CcTCcXe0Ka5fxRN5ypEP-=s@mail.gmail.com>
To: www-style@gtalbot.org
Cc: "www-style@w3.org" <www-style@w3.org>
2010/8/2 "Gérard Talbot" <www-style@gtalbot.org>:
> Le Lun 2 aoūt 2010 16:17, Tab Atkins Jr. a écrit :
>> Opera collapses margins correctly in this case, same as anyone else.
>> (Put a height and background on #second-static and check its position
>> in Opera and other browsers.)
> I have done this right here:
> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/margin-collapsing-and-abs-pos-Tab-Atkins.html
> My initial testcase (and Ian Hickson's testcases) involved empty divs with
> margins.

Right, the behavior is different if the first element is empty or not.
 I think everyone agrees about the rendering for that case?

The differing behavior occurs when the first element is empty, and
thus the margin-top of #second-static collapses all the way up into
the top margin of #first-static.

>> It's just computing the auto position differently, which it's allowed
>> to do.  (The spec only provides suggestions for how to calculate the
>> auto position of abspos elements, and explicitly says in 10.3.7 that
>> implementations are allowed to "guess at its probable position".)
>> ~TJ
> Well, then, in such case,
> http://test.csswg.org/suites/css2.1/20100727/html4/abspos-021.htm
> should be rejected because the rendered layout can be rendered differently.

I suspect that *any* testcases based on auto positioning of abspos
elements should be rejected, due to the explicit allowance of
different renderings.

It sucks, and we *should* tighten that up, but right now it's not
something testable, and implementations disagree in several
situations.  (For example, try absposing a table-cell with auto

Received on Tuesday, 3 August 2010 18:17:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:48 UTC