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>

This testcase


has problems.

<title>CSS Test: Absolutely positioned non-replaced elements with
over-constrained values ignore the 'left' value when direction is
<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


   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

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

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


  '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

I also believe
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:

CSS 2.1 test suite (RC1; September 17th 2010):

CSS 2.1 test suite contributors:
Received on Monday, 27 September 2010 06:10:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 20 January 2023 19:58:15 UTC