Re: Reftests and Subpixel layout

Le Ven 16 mars 2012 20:42, fantasai a écrit :
> Gérard's been running into a number of issues affecting the creation of
> reftests due to the fact that Firefox does subpixel-precision layout and
> the font APIs on Linux only return pixel-precision data. The workaround
> for this seems to be to use fonts at sizes where it is known their
> metrics
> land on whole-pixel sizes.
>
> Many of our self-describing tests suffer from this problem. Their pass/
> fail results can be determined accurately, but creating a pixel-perfect
> reference is difficult or impossible without altering the original test.
> Similar issues probably exist anywhere there is inconsistent
> pixel-rounding.
> For example, Firefox rounds border widths with different rules than it
> rounds box heights, making a reftest comparison between a solid border
> and a solid-color fixed-height block meaningless if their sizes involve
> fractional pixels.
>
> Which brings us to a suggestion from Jet: to require tests, insofar as
> possible, to align their layout to the px grid, so that they can be
> reliably associated to a reference.
>
> Is this something we want to do? It will drastically reduce our test
> coverage of pixel rounding. If not, what is the alternative?
>
> ~fantasai


Hello all,

Partial list of modified tests so that vertical baseline-alignement
position can be reliable, accurate, trustworthy:

c5501-imrgn-t-000
c5502-mrgn-r-001
c5503-imrgn-b-000
c5504-mrgn-l-001
c5505-mrgn-001
c5505-mrgn-003
c5506-padn-t-000
c5507-padn-r-001
c5508-ipadn-b-003
c526-font-sz-003 (several changes) [1]
c541-word-sp-001
c548-ln-ht-000
c548-ln-ht-001 (several changes) [2]
c548-ln-ht-002
also
support/pattern-gg-gr.png was modified to go with modifications in
c548-ln-ht-001 and c548-ln-ht-002.

These tests have their font-size values modified but the test design,
test logic is just the same as before.
Sometimes, modifying font-size values to be dividable by 5 is not
enough: because in the code, such values must be also dividable by 2.

Fictional example given:

div
{
font: 12px Ahem;
padding: 0.5em;
background: red url(support/pattern-grr-rgg-rgr.png);
}

means that I may have to make 4 kinds of code adjustments:
- one adjustement for accurate vertical baseline-alignment position
(font-size value must be dividable by 5),
- one adjustment for height of line box ('line-height: normal' is 1.2
and not 1 for Ahem font under Firefox; 'line-height: normal' is 1 for
Ahem font under other browsers) and
- one adjustment for padding (font-size value must be dividable by 2)
- one for the red and green background-image pattern

If there is something wrong about those tests or their associated
reftests, please let me know in the list.


[1]:
Compare
http://test.csswg.org/suites/css2.1/20110323/html4/c526-font-sz-003.htm
with
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/c526-font-sz-003.htm

[2]:
Compare
http://test.csswg.org/suites/css2.1/20110323/html4/c548-ln-ht-001.htm
with
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/c548-ln-ht-001.htm

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 Sunday, 1 April 2012 02:18:28 UTC