From 6b49034a412103f1ae48040aad1854a3e037d5d9 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 24 Jan 2009 13:22:09 +0000 Subject: Have orphans and widows treat negative values as illegal. The spec doesn't explicitly outlaw this, but it's clearly nonsensical. svn path=/trunk/libcss/; revision=6230 --- src/parse/properties.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/parse/properties.c b/src/parse/properties.c index f9b8c4c..de30f07 100644 --- a/src/parse/properties.c +++ b/src/parse/properties.c @@ -3969,6 +3969,10 @@ css_error parse_orphans(css_language *c, if (consumed != token->ilower->len) return CSS_INVALID; + /* Negative values are nonsensical */ + if (num < 0) + return CSS_INVALID; + value = ORPHANS_SET; } else return CSS_INVALID; @@ -6308,6 +6312,10 @@ css_error parse_widows(css_language *c, if (consumed != token->ilower->len) return CSS_INVALID; + /* Negative values are nonsensical */ + if (num < 0) + return CSS_INVALID; + value = WIDOWS_SET; } else return CSS_INVALID; -- cgit v1.2.3