W3C home > Mailing lists > Public > www-validator-css@w3.org > December 2017

Inconsistent parsing of font: 0 Arial;

From: Mark Rogers <mark.rogers@powermapper.com>
Date: Thu, 14 Dec 2017 08:50:24 +0000
To: "www-validator-css@w3.org" <www-validator-css@w3.org>
Message-ID: <EF3D7551-F067-4CD7-A6D2-48F34B89F830@powermapper.com>
Hi

There’s some odd behaviour parsing the font: shorthand using different variants of zero (0, 0%, 0pt, 0.0)

/* Jigsaw reports Value Error : font Invalid RGB function : 0.0 Arial */
div { font: 0.0 Arial; } /* font-size: 0.0 – 0.0 is a valid font-size, but invalid font-weight  */

/* Jigsaw reports no error found */
div { font: 0pt Arial; } /* font-size: 0pt – 0pt is a valid font-size, but invalid font-weight  */

/* Jigsaw reports no error found */
div { font: 0% Arial; } /* font-size: 0% - 0% is a valid font-size, but invalid font-weight  */

/* Jigsaw reports Value Error : font 0 is not a font-weight value : 0 Arial */
div { font: 0 Arial; } /* font-size: 0 - 0 is a valid font-size, but invalid font-weight */

/* Jigsaw reports no error found */
div { font: 100 Arial; } /* font-weight: 100 - 100 is a valid font-weight, but invalid font-size */

Chrome treats font: 0 Arial; as font: 0pt Arial; and it looks some of the CSS test suite depends on this happening. For example, these tests check that font: 0 Ahem; is overridden by a subsequent font: inherit:

http://test.csswg.org/suites/css2.1/20110323/html4/font-039.htm

http://test.csswg.org/suites/css2.1/20110323/html4/font-040.htm

http://test.csswg.org/suites/css2.1/20110323/html4/font-041.htm

http://test.csswg.org/suites/css2.1/20110323/html4/font-042.htm

http://test.csswg.org/suites/css2.1/20110323/html4/font-043.htm


Best Regards
Mark

--
Mark Rogers - mark.rogers@powermapper.com<mailto:mark.rogers@powermapper.com>
PowerMapper Software Ltd - www.powermapper.com
Registered in Scotland No 362274 Quartermile 2 Edinburgh EH3 9GL

Received on Thursday, 14 December 2017 08:50:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:01:21 UTC