- From: Øyvind Stenhaug <oyvinds@opera.com>
- Date: Mon, 10 Sep 2012 11:34:13 +0200
- To: "Public CSS test suite mailing list" <public-css-testsuite@w3.org>, Gérard Talbot <css21testsuite@gtalbot.org>
On Mon, 10 Sep 2012 03:20:24 +0200, Gérard Talbot <css21testsuite@gtalbot.org> wrote: > [RC6] > http://test.csswg.org/suites/css2.1/20110323/html4/abspos-010.htm > > [nightly-unstable] > http://test.csswg.org/suites/css2.1/nightly-unstable/html4/abspos-010.htm > > If you examine this test with various browsers, you'll notice a > difference of rendering (height of green area): > > Opera 12.02, Chrome 21.0.1180.89, Safari 5.1.7, Konqueror 4.9.0 all > render a 48px wide by 48px tall green square. > > Firefox 15.0 and IE8 render a 48px wide by 64px tall green rectangle. > > The difference is due to how vertical margins are supposed to be > rendered: the 2em margin-top of the abs. pos. table (.fixed) should > *not* collapse with margin-bottom of <p>. So, Firefox 15.0 and IE8 are > correct. I disagree with this part. The ".fixed" table is absolutely positioned and has top:auto, so http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height says the vertical position should be determined as if position had been static (and float:none; clear:none). In that case the margins *would* collapse. Of course, the part "user agents are free to make a guess at its probable position" means Firefox and IE can't be said to be violating the spec either... > So, I revisited > > [RC6] > http://test.csswg.org/suites/css2.1/20110323/html4/margin-collapse-012.htm > > [nightly-unstable] > http://test.csswg.org/suites/css2.1/nightly-unstable/html4/margin-collapse-012.htm > > and noticed that a few more tests could be submitted to better cover > possibilities: > > With margin-bottom: > http://test.csswg.org/source/contributors/gtalbot/submitted/margin-collapse-012a.xht > > With a collapsed-through element: > http://test.csswg.org/source/contributors/gtalbot/submitted/margin-collapse-012b.xht > > With with margin-top (with an abs. pos. table): > http://test.csswg.org/source/contributors/gtalbot/submitted/margin-collapse-012c.xht > > With margin-bottom (with an abs. pos. table): > http://test.csswg.org/source/contributors/gtalbot/submitted/margin-collapse-012d.xht > > With a collapsed-through element (with an abs. pos. table): > http://test.csswg.org/source/contributors/gtalbot/submitted/margin-collapse-012e.xht I haven't examined all these in detail, but I think they are wrong because of the above. > abspos-010 test seems wrong too because table-layout: fixed does not > apply if (at minimum) width of table is not specified... and the test > uses a table that has 1 single row which has 1 single cell.. Well, not really wrong, although the .fixed part seems to test the fixed table layout section more than it does the abs. pos. one. > Right now, I think this test is not good, not trustworthy because it > does not achieve the original goal/intent of the test. Such test, as > designed, does not demonstrate the goal of the test. It should probably just refrain from relying on auto abs.pos. position, since that doesn't seem relevant. (The tables could be wrapped in a relatively-positioned div, "top:0; left: 0" be set in the "table" declaration block and "margin-" be deleted from the ".fixed" block or something like that.) Though with the apparent goal of the test being to check that "Absolutely positioned tables must shrink wrap", it is unfortunate that "CSS 2.1 does not define the exact algorithm" for shrink-to-fit... -- Øyvind Stenhaug Core Norway, Opera Software ASA
Received on Monday, 10 September 2012 09:34:45 UTC