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,

http://test.csswg.org/source/contributors/microsoft/submitted/Chapter_10/absolute-non-replaced-width-004.xht

http://test.csswg.org/source/contributors/microsoft/submitted/Chapter_10/absolute-non-replaced-width-004.htm

http://test.csswg.org/suites/css2.1/20101210/xhtml1/absolute-non-replaced-width-004.xht

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

{
'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'
('margin-left').
}
http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width

            #div1
            {
                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
http://test.csswg.org/source/contributors/microsoft/submitted/Chapter_10/absolute-non-replaced-width-005.xht

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:

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/absolute-non-replaced-width-004.xht

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/absolute-non-replaced-width-005.xht

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

CSS 2.1 test suite (RC4; December 10th 2010):
http://test.csswg.org/suites/css2.1/20101210/html4/toc.html

CSS 2.1 test suite contributors:
http://test.csswg.org/source/contributors/
Received on Monday, 13 December 2010 17:15:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 13 December 2010 17:15:41 GMT