[RC6] absolute-non-replaced-max-height-010 and 011: some difficulties and modifications

Arron,

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/absolute-non-replaced-max-height-010.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/absolute-non-replaced-max-height-010.htm

The text assert was stating:

<meta name="assert" content="The 'auto' values for 'margin-top' and
'margin-bottom' are set to '0', when 'top', 'height' and 'bottom' are
all not auto.">

but in the test, top is 'auto'; therefore this rule was triggered:
"
'top' is 'auto', 'height' and 'bottom' are not 'auto', then set 'auto'
values for 'margin-top' and 'margin-bottom' to 0, and solve for 'top'
"

This is how I have fixed this test:

[src]
http://test.csswg.org/source/approved/css2.1/src/positioning/absolute-non-replaced-max-height-010.xht


----------


[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/absolute-non-replaced-max-height-011.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/absolute-non-replaced-max-height-010.htm

This test has more difficulties.

                bottom: 1in;
                height: auto;
                margin-bottom: auto;
                margin-top: auto;
                max-height: 0.5in;
                position: absolute;
                top: 1in;


"
'height' is 'auto', 'top' and 'bottom' are not 'auto', then 'auto'
values for 'margin-top' and 'margin-bottom' are set to 0 and solve for
'height'
"

After solving the height to 1in, it is constrained to 0.5in by
max-height. Since height changed from auto to 0.5in, the parser must
re-enter the algorithm since the height value changed.

"
The tentative used height is calculated (without 'min-height' and
'max-height') following the rules under "Calculating heights and
margins" above.
If this tentative height is greater than 'max-height', the rules above
are applied again, but this time using the value of 'max-height' as the
computed value for 'height'.
"

The "Calculating heights and margins" above is section 10.6.4!


So now, thanks to height being constrained and no longer an 'auto'
value, this new set of conditions applies:

"
If none of the three [top, height, bottom] are 'auto': If both
'margin-top' and 'margin-bottom' are 'auto', solve the equation under
the extra constraint that the two margins get equal values.
"

And this is why the blue rectangle gets vertically centered in the
hollow black square.


This is how I have fixed this test:

[src]
http://test.csswg.org/source/approved/css2.1/src/positioning/absolute-non-replaced-max-height-011.xht


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

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

CSS 2.1 test suite harness:
http://test.csswg.org/harness/

Contributing to to CSS 2.1 test suite:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html

Received on Thursday, 30 August 2012 03:26:58 UTC