Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp

Issue 1380083004: Move viewport descriptor handling into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Slight cleanup Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
index d23f9a0d730630f9196c543fd6d5371a524537da..b6a01c31038f76c7492e46166d06ebd697468717 100644
--- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
@@ -6784,87 +6784,6 @@ bool CSSPropertyParser::parseCalculation(CSSParserValue* value, ValueRange range
return true;
}
-bool CSSPropertyParser::parseViewportProperty(CSSPropertyID propId, bool important)
-{
- ASSERT(RuntimeEnabledFeatures::cssViewportEnabled() || isUASheetBehavior(m_context.mode()));
-
- CSSParserValue* value = m_valueList->current();
- if (!value)
- return false;
-
- CSSValueID id = value->id;
- bool validPrimitive = false;
-
- switch (propId) {
- case CSSPropertyMinWidth: // auto | extend-to-zoom | <length> | <percentage>
- case CSSPropertyMaxWidth:
- case CSSPropertyMinHeight:
- case CSSPropertyMaxHeight:
- if (id == CSSValueAuto || id == CSSValueInternalExtendToZoom)
- validPrimitive = true;
- else
- validPrimitive = validUnit(value, FLength | FPercent | FNonNeg);
- break;
- case CSSPropertyWidth: // shorthand
- return parseViewportShorthand(propId, CSSPropertyMinWidth, CSSPropertyMaxWidth, important);
- case CSSPropertyHeight:
- return parseViewportShorthand(propId, CSSPropertyMinHeight, CSSPropertyMaxHeight, important);
- case CSSPropertyMinZoom: // auto | <number> | <percentage>
- case CSSPropertyMaxZoom:
- case CSSPropertyZoom:
- if (id == CSSValueAuto)
- validPrimitive = true;
- else
- validPrimitive = validUnit(value, FNumber | FPercent | FNonNeg);
- break;
- case CSSPropertyUserZoom: // zoom | fixed
- if (id == CSSValueZoom || id == CSSValueFixed)
- validPrimitive = true;
- break;
- case CSSPropertyOrientation: // auto | portrait | landscape
- if (id == CSSValueAuto || id == CSSValuePortrait || id == CSSValueLandscape)
- validPrimitive = true;
- default:
- break;
- }
-
- RefPtrWillBeRawPtr<CSSValue> parsedValue = nullptr;
- if (validPrimitive) {
- parsedValue = parseValidPrimitive(id, value);
- m_valueList->next();
- }
-
- if (parsedValue) {
- if (!m_valueList->current() || inShorthand()) {
- addProperty(propId, parsedValue.release(), important);
- return true;
- }
- }
-
- return false;
-}
-
-bool CSSPropertyParser::parseViewportShorthand(CSSPropertyID propId, CSSPropertyID first, CSSPropertyID second, bool important)
-{
- ASSERT(RuntimeEnabledFeatures::cssViewportEnabled() || isUASheetBehavior(m_context.mode()));
- unsigned numValues = m_valueList->size();
-
- if (numValues > 2)
- return false;
-
- ShorthandScope scope(this, propId);
-
- if (!parseViewportProperty(first, important))
- return false;
-
- // If just one value is supplied, the second value
- // is implicitly initialized with the first value.
- if (numValues == 1)
- m_valueList->previous();
-
- return parseViewportProperty(second, important);
-}
-
template <typename CharacterType>
static CSSPropertyID unresolvedCSSPropertyID(const CharacterType* propertyName, unsigned length)
{

Powered by Google App Engine
This is Rietveld 408576698