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

[RC4] absolute-non-replaced-width-004 and absolute-non-replaced-width-005 proposed assert text

From: Gérard Talbot <css21testsuite@gtalbot.org>
Date: Mon, 13 Dec 2010 09:14:40 -0800
Message-ID: <c927963c6459b48716fbdd8d9dd67a2a.squirrel@cp3.shieldhost.com>
To: "Arron Eicholz" <Arron.Eicholz@microsoft.com>
Cc: "public-css-testsuite@w3.org" <public-css-testsuite@w3.org>
Hello Arron,





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


If none of the three 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'

                border: solid black;
                direction: ltr;
                height: 2in;
                position: relative;
                width: 2in;
            div div
                background: red;
                color: blue;
                font: 1in/1em Ahem;
                left: 1in;
                margin-left: auto;
                margin-right: auto;
                position: absolute;
                right: 1in;
                width: 1in;

So, this means for absolute-non-replaced-width-004

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

So, margin-left and margin-right would be each -0.5in at this point.

"...unless this would make them (the two margins) 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')."

So, under such extra constraint, 'margin-left' must become 0 and
'margin-right' must become -1in.

Proposed replacement

 <meta name="assert" content="When direction is 'ltr' and 'left',
'width' and 'right' are not 'auto', solve for 'margin-right' and
'margin-left' to equal values. If this would make 'margin-left' and
'margin-right' negative (as in this testcase), then set 'margin-left'
to zero and solve for 'margin-right'.">

along with judicious, helpful /* comments */

The same kind of adjustment in

I would rename #div1 to #containing-block and change "is in upper-left
corner..." to "fills the upper-left corner...".

I have uploaded the 2 files with proposed changes here:



regards, Gérard
Contributions to the CSS 2.1 test suite:

CSS 2.1 test suite (RC4; December 10th 2010):

CSS 2.1 test suite contributors:
Received on Monday, 13 December 2010 17:15:16 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:13:22 UTC