Bug 1408310 - Part 1: Fix nsCSSParser if we parse transform property failed.
We have to clean nsCSSParserImpl::mTempData up if the current parsing is failed,
because this nsCSSParserImpl may be reused by other nsCSSParer, and the
incorrect status may cause assertions.
MozReview-Commit-ID: 75h0rHzV1Ua
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -1837,16 +1837,18 @@ CSSParserImpl::ParseTransformProperty(co
css::ErrorReporter reporter(scanner, mSheet, mChildLoader, nullptr);
InitScanner(scanner, reporter, nullptr, nullptr, nullptr);
bool parsedOK = ParseTransform(false, eCSSProperty_transform,
aDisallowRelativeValues);
// We should now be at EOF
if (parsedOK && GetToken(true)) {
parsedOK = false;
+ mTempData.ClearProperty(eCSSProperty_transform);
+ mTempData.AssertInitialState();
}
bool changed = false;
if (parsedOK) {
declaration->ExpandTo(&mData);
changed = mData.TransferFromBlock(mTempData, eCSSProperty_transform,
EnabledState(), false,
true, false, declaration,