diff --git a/layout/reftests/bugs/390318-1-ref.html b/layout/reftests/bugs/390318-1-ref.html new file mode 100644 index 00000000000..5524321cdba --- /dev/null +++ b/layout/reftests/bugs/390318-1-ref.html @@ -0,0 +1,9 @@ + + + + + + + This should be green + + diff --git a/layout/reftests/bugs/390318-1a.html b/layout/reftests/bugs/390318-1a.html new file mode 100644 index 00000000000..da4e295fdc8 --- /dev/null +++ b/layout/reftests/bugs/390318-1a.html @@ -0,0 +1,9 @@ + + + + + + + This should be green + + diff --git a/layout/reftests/bugs/390318-1b.html b/layout/reftests/bugs/390318-1b.html new file mode 100644 index 00000000000..39282e02e01 --- /dev/null +++ b/layout/reftests/bugs/390318-1b.html @@ -0,0 +1,9 @@ + + + + + + + This should be green + + diff --git a/layout/reftests/bugs/390318-1c.html b/layout/reftests/bugs/390318-1c.html new file mode 100644 index 00000000000..94853bbccf8 --- /dev/null +++ b/layout/reftests/bugs/390318-1c.html @@ -0,0 +1,9 @@ + + + + + + + This should be green + + diff --git a/layout/reftests/bugs/390318-1d.html b/layout/reftests/bugs/390318-1d.html new file mode 100644 index 00000000000..6c7a1c4d68e --- /dev/null +++ b/layout/reftests/bugs/390318-1d.html @@ -0,0 +1,9 @@ + + + + + + + This should be green + + diff --git a/layout/reftests/bugs/390318-1e.html b/layout/reftests/bugs/390318-1e.html new file mode 100644 index 00000000000..2693566c95b --- /dev/null +++ b/layout/reftests/bugs/390318-1e.html @@ -0,0 +1,9 @@ + + + + + + + This should be green + + diff --git a/layout/reftests/bugs/390318-1f.html b/layout/reftests/bugs/390318-1f.html new file mode 100644 index 00000000000..8107525244c --- /dev/null +++ b/layout/reftests/bugs/390318-1f.html @@ -0,0 +1,9 @@ + + + + + + + This should be green + + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index a3848e308a4..b678af7995d 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -327,3 +327,5 @@ random-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 379316-2.html 379316-2-ref.html # bug == 386470-1c.html 386470-1-ref.html == 386920-1.html 386920-1-ref.html == 387344-1.html 387344-1-ref.html +== 390318-1a.html 390318-1-ref.html +== 390318-1b.html 390318-1-ref.html diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 86ab9df3dce..7f2ae414994 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -3331,9 +3331,8 @@ CSSParserImpl::ParseDeclaration(nsresult& aErrorCode, aMustCallValueAppended, aChanged); return PR_TRUE; } - else { - if (eCSSToken_Symbol == tk->mType) { - if ('!' == tk->mSymbol) { + + if (eCSSToken_Symbol == tk->mType && '!' == tk->mSymbol) { // Look for important ident if (!GetToken(aErrorCode, PR_TRUE)) { // Premature eof is not ok @@ -3355,24 +3354,12 @@ CSSParserImpl::ParseDeclaration(nsresult& aErrorCode, // Not a !important declaration UngetToken(); } - } - else { - // Not a !important declaration - UngetToken(); - } - } // Make sure valid property declaration is terminated with either a - // semicolon or a right-curly-brace (when aCheckForBraces is true). - // When aCheckForBraces is false, proper termination is either - // semicolon or EOF. + // semicolon, EOF or a right-curly-brace (this last only when + // aCheckForBraces is true). if (!GetToken(aErrorCode, PR_TRUE)) { - if (aCheckForBraces) { - // Premature eof is not ok - REPORT_UNEXPECTED_EOF(PEDeclEndEOF); - ClearTempData(propID); - return PR_FALSE; - } + // EOF is a perfectly good way to end a declaration and declaration block TransferTempData(aDeclaration, propID, isImportant, aMustCallValueAppended, aChanged); return PR_TRUE; @@ -3383,16 +3370,9 @@ CSSParserImpl::ParseDeclaration(nsresult& aErrorCode, aMustCallValueAppended, aChanged); return PR_TRUE; } - if (!aCheckForBraces) { - // If we didn't hit eof and we didn't see a semicolon then the - // declaration is not properly terminated. - REPORT_UNEXPECTED_TOKEN(PEBadDeclEnd); - REPORT_UNEXPECTED(PEDeclDropped); - OUTPUT_ERROR(); - ClearTempData(propID); - return PR_FALSE; - } - if ('}' == tk->mSymbol) { + if (aCheckForBraces && '}' == tk->mSymbol) { + // Unget the '}' so we'll be able to tell that this is the end + // of the declaration block when we unwind from here. UngetToken(); TransferTempData(aDeclaration, propID, isImportant, aMustCallValueAppended, aChanged);