Bug 581579: fix error recovery in parsing of CSS priority suffix. r+a=dbaron
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/581579-1-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<style>p { color: black; }</style>
+<p>This text should be black.</p>
+<p>This text should be black.</p>
+<p>This text should be black.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/581579-1.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<style>p { color: black; }</style>
+<style> #a { color: fuchsia { ; color: red } </style>
+<style> #b { color: fuchsia ! { ; color: red } </style>
+<style> #c { color: fuchsia ! important { ; color: red } </style>
+<p id="a">This text should be black.</p>
+<p id="b">This text should be black.</p>
+<p id="c">This text should be black.</p>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1454,12 +1454,13 @@ random-if(!haveTestPlugin) == 546071-1.h
== 571347-1b.html 571347-1-ref.html
== 571347-2a.html 571347-2-ref.html
== 571347-2b.html 571347-2-ref.html
== 571347-2c.html 571347-2-ref.html
== 571347-2d.html 571347-2-ref.html
== 571347-3.html 571347-3-ref.html
== 572598-1.html 572598-ref.html
== 574898-1.html 574898-ref.html
+== 581579-1.html 581579-1-ref.html
== 584400-dash-length.svg 584400-dash-length-ref.svg
== 580160-1.html 580160-1-ref.html
== 579349-1.html 579349-1-ref.html
== 581317-1.html 581317-1-ref.html
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -4010,16 +4010,17 @@ CSSParserImpl::ParseDeclaration(css::Dec
// semicolon is always ok
} else if (mToken.IsSymbol('}')) {
// brace is ok if aCheckForBraces, but don't eat it
UngetToken();
if (!aCheckForBraces) {
status = ePriority_Error;
}
} else {
+ UngetToken();
status = ePriority_Error;
}
}
if (status == ePriority_Error) {
if (aCheckForBraces) {
REPORT_UNEXPECTED_TOKEN(PEBadDeclOrRuleEnd2);
} else {