W3C home > Mailing lists > Public > public-css-testsuite@w3.org > September 2010

RC1 : Microsoft's absolute-non-replaced-width-008

From: Gérard Talbot <css21testsuite@gtalbot.org>
Date: Sun, 26 Sep 2010 23:10:10 -0700
Message-ID: <283951606a21d4dac87c651bf545795b.squirrel@cp3.shieldhost.com>
To: "public-css-testsuite@w3.org" <public-css-testsuite@w3.org>
Cc: "Arron Eicholz" <Arron.Eicholz@microsoft.com>
Hello,

This testcase

http://test.csswg.org/suites/css2.1/20100917/html4/absolute-non-replaced-width-008.htm

has problems.

1-
<title>CSS Test: Absolutely positioned non-replaced elements with
over-constrained values ignore the 'left' value when direction is
left-to-right</title>
(...)
<meta name="assert" content="When direction is left-to-right and values
are over-constrained, the width becomes shrink-to-fit and the value for
'left' is ignored.">

If there is over-constraining and direction is left-to-right, then the
spec says to ignore the 'right' value, not the 'left'

Section 10.3.7 Absolutely positioned, non-replaced elements
http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width

2-

   div div
   {
      background: red;
      color: blue;
      font: 1in/1em ahem;
      left: 1in;
      margin-left: auto;
      margin-right: 1in;
      position: absolute;
      right: 1in;
      width: 1in;
   }

There is an over-constraining situation but if margin-left or
margin-right is auto, then the spec says to solve the equation for such
margin:

"
If none of the three ['left', 'width', and 'right'] is 'auto': If both
'margin-left' and 'margin-right' are 'auto', solve the equation under
the extra constraint that the two margins get equal values, unless this
would make them negative, in which case when direction of the containing
block is 'ltr' ('rtl'), set 'margin-left' ('margin-right') to zero and
solve for 'margin-right' ('margin-left'). If one of 'margin-left' or
'margin-right' is 'auto', solve the equation for that value.
"
Section 10.3.7 Absolutely positioned, non-replaced elements
http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width

and here, 'margin-left' is 'auto'

So:

  'left' + 'margin-left' + 'border-left-width' + 'padding-left' +
'width' + 'padding-right' + 'border-right-width' + 'margin-right' +
'right' = width of containing block

   1in (left)
 + ?in (margin-left: auto;)
 + 0in (border-left-width)
 + 0in (padding-left)
 + 1in (width)
 + 0in (padding-right)
 + 0in (border-right-width)
 + 1in (margin-right)
 + 1in (right)
----------------------
   2in (width of containing block)

So, margin-left must be -2in.

So, the blue square should be on the left side of the black bordered
square, out of viewport, just on the left side of the black bordered
square. The blue box should not be in the upper-right corner of the
black box.

Opera 10.62, Chrome 6.0.472.63 and Konqueror 4.4.5 correctly passes this
test.

I also believe
http://test.csswg.org/suites/css2.1/20100917/html4/absolute-non-replaced-width-009.htm
is wrong for the same reasons (with margin-right and rtl values).

I'll be back in 1 week; I must take a break.

regards, Gérard
-- 
Contributions to the CSS 2.1 test suite:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

CSS 2.1 test suite (RC1; September 17th 2010):
http://test.csswg.org/suites/css2.1/20100917/html4/toc.html

CSS 2.1 test suite contributors:
http://test.csswg.org/source/contributors/
Received on Monday, 27 September 2010 06:10:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 September 2010 06:10:53 GMT