From e7ba847fd28f75afc487471922d5823964fbad5c Mon Sep 17 00:00:00 2001 From: buliabyak Date: Wed, 14 Mar 2007 23:55:00 +0000 Subject: [PATCH] even if one declaration is broken, try to still read all others per http://www.w3.org/TR/CSS21/syndata.html#declaration; fixes bug 1266843 --- src/libcroco/cr-declaration.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libcroco/cr-declaration.c b/src/libcroco/cr-declaration.c index ba8e0c95f..530085b52 100644 --- a/src/libcroco/cr-declaration.c +++ b/src/libcroco/cr-declaration.c @@ -210,14 +210,15 @@ cr_declaration_parse_list_from_buf (const guchar * a_str, cr_parser_try_to_skip_spaces_and_comments (parser); status = cr_tknzr_peek_char (tokenizer, &c); if (status != CR_OK) { - if (status == CR_END_OF_INPUT_ERROR) + if (status == CR_END_OF_INPUT_ERROR) status = CR_OK; goto cleanup; } if (c == ';') { status = cr_tknzr_read_char (tokenizer, &c); } else { - break; + cr_tknzr_read_char (tokenizer, &c); + continue; // try to keep reading until we reach the end or a ; } important = FALSE; cr_parser_try_to_skip_spaces_and_comments (parser); @@ -225,9 +226,11 @@ cr_declaration_parse_list_from_buf (const guchar * a_str, &value, &important); if (status != CR_OK || !property) { if (status == CR_END_OF_INPUT_ERROR) { - status = CR_OK; - } - break; + status = CR_OK; // simply the end of input, do not delete what we got so far, just finish + break; + } else { + continue; // even if one declaration is broken, it's no reason to discard others (see http://www.w3.org/TR/CSS21/syndata.html#declaration) + } } cur_decl = cr_declaration_new (NULL, property, value); if (cur_decl) { -- 2.30.2