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

Microsoft's position-relative-005.htm test assertion to correct

From: Gérard Talbot <css21testsuite@gtalbot.org>
Date: Mon, 15 Mar 2010 17:38:14 -0700
Message-ID: <04f26beb8260b10f45713bbf7baddcba.squirrel@cp3.shieldhost.com>
To: "public-css-testsuite@w3.org" <public-css-testsuite@w3.org>
Cc: "Arron Eicholz" <Arron.Eicholz@microsoft.com>
Hello all,

http://test.csswg.org/source/contributors/microsoft/submitted/Chapter_9/position-relative-005.htm

and

http://www.w3.org/Style/CSS/Test/CSS2.1/20100127/html4/position-relative-005.htm

******

<meta content="Relatively positioned element with the left specified
offsets the element from the left of the containing block."
name="assert">

           div
            {
                height: 1in;
                width: 1in;
            }
            #div1
            {
                background: orange;
                position: absolute;
            }
            #div2
            {
                background: blue;
                left: 1in;
                position: relative;
            }
(...)

    <p>Test passes if the blue box is to the right of the orange box.</p>
        <div id="div1"></div>
        <div id="div2"></div>

******

When left property is given a value with absolute unit (eg 15px, 1in,
2cm, 50mm, 58pc, etc), then the offset is relative to the box's normal
position, the position of the box if it had been static. There is no
reference in the spec to the containing block for relatively positioned
elements offset with absolute length values. The offset is independent
of its containing block.

"
The box's position is calculated according to the normal flow (this is
called the position in normal flow). Then the box is offset relative  to
its normal position.
"
section 9.3.1
http://www.w3.org/TR/CSS21/visuren.html#choose-position

"
For relatively positioned boxes, the offset is with respect to the left
edge of the box itself.
"
http://www.w3.org/TR/CSS21/visuren.html#propdef-left

Things are a bit different when left property is given a value with a
percentage unit (eg 30%). Then, it refers to width of containing block
and, if it can be computed, then it gets resolved to an absolute length
value as well and the relatively positioned box is offset just like with
other absolute length values.

The "from the left of the containing block" chunk of the assert is
incorrect, is wrong.

I propose to change

<meta content="Relatively positioned element with the left specified
offsets the element from the left of the containing block."
name="assert">

to this:

<meta content="A relatively positioned element with the left specified
offsets its own box's normal position (its position according to the
normal flow) by the value given by the left property." name="assert">

Maybe there is a better wording for this.

One other thing. The help link
<link rel="help"
href="http://www.w3.org/TR/CSS21/visuren.html#positioning-scheme">

is inaccurate, unhelpful. I propose

<link rel="help"
href="http://www.w3.org/TR/CSS21/visuren.html#choose-position">
and
<link rel="help"
href="http://www.w3.org/TR/CSS21/visuren.html#position-props">

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

CSS 2.1 test suite (alpha 1; January 27th 2010):
http://www.w3.org/Style/CSS/Test/CSS2.1/20100127/html4/toc.htm

CSS 2.1 test suite contributors:
http://test.csswg.org/source/contributors/
Received on Tuesday, 16 March 2010 00:38:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 20 September 2010 17:52:01 GMT