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) ...@@ -49,8 +49,8 @@ bool DOMWindowCSS::supports(const String& property, const String& value)
ASSERT(CSSPropertyMetadata::isEnabledProperty(unresolvedProperty)); ASSERT(CSSPropertyMetadata::isEnabledProperty(unresolvedProperty));
// This will return false when !important is present // This will return false when !important is present
RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create(HTMLQuirksMode); RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create(HTMLStandardMode);
return CSSParser::parseValue(dummyStyle.get(), unresolvedProperty, value, false, HTMLStandardMode, 0); return CSSParser::parseValue(dummyStyle.get(), unresolvedProperty, value, false, 0);
} }
bool DOMWindowCSS::supports(const String& conditionText) bool DOMWindowCSS::supports(const String& conditionText)
......
...@@ -504,8 +504,8 @@ bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font) ...@@ -504,8 +504,8 @@ bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font)
return false; return false;
// Interpret fontString in the same way as the 'font' attribute of CanvasRenderingContext2D. // Interpret fontString in the same way as the 'font' attribute of CanvasRenderingContext2D.
RefPtrWillBeRawPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::create(HTMLQuirksMode); RefPtrWillBeRawPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::create(HTMLStandardMode);
CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, HTMLStandardMode, 0); CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, 0);
if (parsedStyle->isEmpty()) if (parsedStyle->isEmpty())
return false; return false;
......
...@@ -251,7 +251,7 @@ bool MutableStylePropertySet::setProperty(CSSPropertyID unresolvedProperty, cons ...@@ -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. // 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. // 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) void MutableStylePropertySet::setProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> prpValue, bool important)
......
...@@ -51,11 +51,12 @@ void CSSParser::parseSheetForInspector(const CSSParserContext& context, StyleShe ...@@ -51,11 +51,12 @@ void CSSParser::parseSheetForInspector(const CSSParserContext& context, StyleShe
return CSSParserImpl::parseStyleSheetForInspector(text, context, styleSheet, observer); 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()) if (string.isEmpty())
return false; return false;
CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty); CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty);
CSSParserMode parserMode = declaration->cssParserMode();
RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(resolvedProperty, string, parserMode); RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(resolvedProperty, string, parserMode);
if (value) if (value)
return declaration->setProperty(CSSProperty(resolvedProperty, value.release(), important)); return declaration->setProperty(CSSProperty(resolvedProperty, value.release(), important));
......
...@@ -33,7 +33,7 @@ public: ...@@ -33,7 +33,7 @@ public:
static void parseSelector(const CSSParserContext&, const String&, CSSSelectorList&); static void parseSelector(const CSSParserContext&, const String&, CSSSelectorList&);
static bool parseDeclarationList(const CSSParserContext&, MutableStylePropertySet*, const String&); static bool parseDeclarationList(const CSSParserContext&, MutableStylePropertySet*, const String&);
// Returns whether anything was changed. // 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 // This is for non-shorthands only
static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID, const String&, const CSSParserContext& = strictCSSParserContext()); static PassRefPtrWillBeRawPtr<CSSValue> parseSingleValue(CSSPropertyID, const String&, const CSSParserContext& = strictCSSParserContext());
......
...@@ -91,8 +91,8 @@ MutableStylePropertySet* CanvasFontCache::parseFont(const String& fontString) ...@@ -91,8 +91,8 @@ MutableStylePropertySet* CanvasFontCache::parseFont(const String& fontString)
m_fontLRUList.remove(fontString); m_fontLRUList.remove(fontString);
m_fontLRUList.add(fontString); m_fontLRUList.add(fontString);
} else { } else {
parsedStyle = MutableStylePropertySet::create(HTMLQuirksMode); parsedStyle = MutableStylePropertySet::create(HTMLStandardMode);
CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, HTMLStandardMode, 0); CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true, 0);
if (parsedStyle->isEmpty()) if (parsedStyle->isEmpty())
return nullptr; return nullptr;
// According to http://lists.w3.org/Archives/Public/public-html/2009Jul/0947.html, // 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