From 5423d3fe0d24a3c3f9c81f0ad03756cafb8a9cca Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Fri, 24 May 2013 09:39:03 +0800 Subject: [PATCH] Bug 585185: Parse font-sizes as non-negative, in 'font' shorthand. r=dbaron --- layout/style/crashtests/585185-1.html | 1 + layout/style/crashtests/crashtests.list | 1 + layout/style/nsCSSParser.cpp | 3 ++- layout/style/test/property_database.js | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 layout/style/crashtests/585185-1.html diff --git a/layout/style/crashtests/585185-1.html b/layout/style/crashtests/585185-1.html new file mode 100644 index 00000000000..17eec73b362 --- /dev/null +++ b/layout/style/crashtests/585185-1.html @@ -0,0 +1 @@ + diff --git a/layout/style/crashtests/crashtests.list b/layout/style/crashtests/crashtests.list index 98167248c13..ae6c1cbb108 100644 --- a/layout/style/crashtests/crashtests.list +++ b/layout/style/crashtests/crashtests.list @@ -64,6 +64,7 @@ load 558943-1.xhtml load 571105-1.xhtml load 573127-1.html load 580685.html +load 585185-1.html load 592698-1.html load 601437-1.html load 601439-1.html diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 29c8f7c4316..f1d77976fb4 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -8610,7 +8610,8 @@ CSSParserImpl::ParseFont() // Get mandatory font-size nsCSSValue size; - if (! ParseVariant(size, VARIANT_KEYWORD | VARIANT_LP, nsCSSProps::kFontSizeKTable)) { + if (! ParseNonNegativeVariant(size, VARIANT_KEYWORD | VARIANT_LP, + nsCSSProps::kFontSizeKTable)) { return false; } diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 684cf284801..072ec2796e8 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -2403,7 +2403,7 @@ var gCSSProperties = { // Gecko-specific system fonts "-moz-window", "-moz-document", "-moz-desktop", "-moz-info", "-moz-dialog", "-moz-button", "-moz-pull-down-menu", "-moz-list", "-moz-field", "-moz-workspace", ], - invalid_values: [ "9 fantasy" ] + invalid_values: [ "9 fantasy", "-2px fantasy" ] }, "font-family": { domProp: "fontFamily",