Commit 84e101f9 authored by timloh@chromium.org's avatar timloh@chromium.org

Remove CSSParserMode argument on CSSParser::parseValue

The StylePropertySet passed in to CSSParser::parseValue already has a
parse mode associated with it, which we can use instead of passing a
separate parser mode argument.

Review URL: https://codereview.chromium.org/1312843008

git-svn-id: svn://svn.chromium.org/blink/trunk@201543 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d8897e60
......@@ -49,8 +49,8 @@ bool DOMWindowCSS::supports(const String& property, const String& value)
ASSERT(CSSPropertyMetadata::isEnabledProperty(unresolvedProperty));
// This will return false when !important is present
RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create(HTMLQuirksMode);
return CSSParser::parseValue(dummyStyle.get(), unresolvedProperty, value, false, HTMLStandardMode, 0);
RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create(HTMLStandardMode);
return CSSParser::parseValue(dummyStyle.get(), unresolvedProperty, value, false, 0);
}
bool DOMWindowCSS::supports(const String& conditionText)
......
......@@ -504,8 +504,8 @@ bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font)
return false;
// Interpret fontString in the same way as the 'font' attribute of CanvasRenderingContext2D.
RefPtrWillBeRawPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::create(HTMLQuirksMode);
CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, HTMLStandardMode, 0);
RefPtrWillBeRawPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::create(HTMLStandardMode);
CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, 0);
if (parsedStyle->isEmpty())
return false;
......
......@@ -251,7 +251,7 @@ bool MutableStylePropertySet::setProperty(CSSPropertyID unresolvedProperty, cons
// When replacing an existing property value, this moves the property to the end of the list.
// Firefox preserves the position, and MSIE moves the property to the beginning.
return CSSParser::parseValue(this, unresolvedProperty, value, important, cssParserMode(), contextStyleSheet);
return CSSParser::parseValue(this, unresolvedProperty, value, important, contextStyleSheet);
}
void MutableStylePropertySet::setProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> prpValue, bool important)
......
......@@ -51,11 +51,12 @@ void CSSParser::parseSheetForInspector(const CSSParserContext& context, StyleShe
return CSSParserImpl::parseStyleSheetForInspector(text, context, styleSheet, observer);
}
bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID unresolvedProperty, const String& string, bool important, CSSParserMode parserMode, StyleSheetContents* styleSheet)
bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID unresolvedProperty, const String& string, bool important, StyleSheetContents* styleSheet)
{
if (string.isEmpty())
return false;
CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty);
CSSParserMode parserMode = declaration->cssParserMode();
RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(resolvedProperty, string, parserMode);
if (value)
return declaration->setProperty(CSSProperty(resolvedProperty, value.release(), important));
......
......@@ -33,7 +33,7 @@ public:
static void parseSelector(const CSSParserContext&, const String&, CSSSelectorList&);
static bool parseDeclarationList(const CSSParserContext&, MutableStylePropertySet*, const String&);
// Returns whether anything was changed.
static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedProperty, const String&, bool important, CSSParserMode, StyleSheetContents*);
static bool parseValue(MutableStylePropertySet*, CSSPropertyID unresolvedProperty, const String&, bool important, StyleSheetContents*);
// This is for non-shorthands only
static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID, const String&, const CSSParserContext& = strictCSSParserContext());
......
......@@ -91,8 +91,8 @@ MutableStylePropertySet* CanvasFontCache::parseFont(const String& fontString)
m_fontLRUList.remove(fontString);
m_fontLRUList.add(fontString);
} else {
parsedStyle = MutableStylePropertySet::create(HTMLQuirksMode);
CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, HTMLStandardMode, 0);
parsedStyle = MutableStylePropertySet::create(HTMLStandardMode);
CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, 0);
if (parsedStyle->isEmpty())
return nullptr;
// According to http://lists.w3.org/Archives/Public/public-html/2009Jul/0947.html,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment