W3C home > Mailing lists > Public > www-style@w3.org > September 2012

Re: [CSS21] Question on percentage, inherit and relative positioning: relpos-calcs-001 test

From: Gérard Talbot <www-style@gtalbot.org>
Date: Tue, 25 Sep 2012 21:15:34 -0400
Message-ID: <32bbc2ac2ba01facbec1a098d4f38cb1.squirrel@ed-sh-cp3.entirelydigital.com>
To: www-style@gtalbot.org
Cc: "Public W3C www-style mailing list" <www-style@w3.org>

Le Mar 25 septembre 2012 21:04, "Gérard Talbot" a écrit :
> Hello,
>
> I have trouble understanding this test:
>
> http://test.csswg.org/suites/css2.1/nightly-unstable/html4/relpos-calcs-001.htm
>
> div.outer's computed bottom value is -50%; therefore, div.outer's top
> computed value should be +50%.
>
> "
> Computed value: (...) if specified as a percentage, [then] the specified
> value
> "
> http://www.w3.org/TR/CSS21/visuren.html#position-props
>
> "
> For relatively positioned elements, 'left' and 'right' move the box(es)
> horizontally, without changing their size. 'Left' moves the boxes to the
> right, and 'right' moves them to the left. Since boxes are not split or
> stretched as a result of 'left' or 'right', the used values are always:
> left = -right.
> "
> http://www.w3.org/TR/CSS21/visuren.html#relative-positioning
>
> div.inner's top specified value should therefore be 50% but no browsers
> (Firefox 15.0.1, Chrome 22.0.1229.79 and Opera 12.02) reports such value.
> They all report 'auto' (Chrome 22.0.1229.79 and Opera 12.02) or 0px
> (Firefox 15.0.1) when I think browsers should make div.inner inherit '50%'
> which then would be applied to div.outer to get its used value.
> div.inner's containing block is div.outer; so, top: 50% should compute as
> 60px since div.outer's height is 120px.
>
> What am I missing here?


I think I found it. There's a subtility between used and computed value.

div.outer's used top value is 60px
div.outer's used bottom value is -60px
div.outer's computed top value is auto!
div.outer's computed bottom value is -50%

Therefore
div.inner's specified top value is auto.


Ok. Sorry for asking.

Gérard
-- 
CSS 2.1 Test suite RC6, March 23rd 2011
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html
Received on Wednesday, 26 September 2012 01:16:04 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:00 GMT