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

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

Issue 1402963002: Move width/height related properties into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3f4f1a9e361cab2a607ab707874cf17478903c44..760f5ff0a0d514fce4e08500d5a9a53ef5ed3e25 100644
--- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
@@ -309,40 +309,6 @@ static bool isGeneratedImageValue(CSSParserValue* val)
|| id == CSSValueWebkitCrossFade;
}
-bool CSSPropertyParser::validWidthOrHeight(CSSParserValue* value, Units unitless)
-{
- int id = value->id;
- if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic
- || id == CSSValueWebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFillAvailable || id == CSSValueWebkitFitContent
- || id == CSSValueMinContent || id == CSSValueMaxContent || id == CSSValueFitContent) {
- if (m_context.useCounter()) {
- switch (value->id) {
- case CSSValueIntrinsic:
- case CSSValueMinIntrinsic:
- // These two will be counted in StyleAdjuster because they emit a deprecation
- // message, and we don't have access to a Document/LocalFrame here.
- break;
- case CSSValueWebkitMinContent:
- m_context.useCounter()->count(UseCounter::CSSValuePrefixedMinContent);
- break;
- case CSSValueWebkitMaxContent:
- m_context.useCounter()->count(UseCounter::CSSValuePrefixedMaxContent);
- break;
- case CSSValueWebkitFillAvailable:
- m_context.useCounter()->count(UseCounter::CSSValuePrefixedFillAvailable);
- break;
- case CSSValueWebkitFitContent:
- m_context.useCounter()->count(UseCounter::CSSValuePrefixedFitContent);
- break;
- default:
- break;
- }
- }
- return true;
- }
- return validUnit(value, FLength | FPercent | FNonNeg | unitless);
-}
-
inline PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseValidPrimitive(CSSValueID identifier, CSSParserValue* value)
{
if (identifier)
@@ -673,28 +639,6 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
validPrimitive = validUnit(value, FLength | FPercent | FNonNeg | unitless);
break;
- case CSSPropertyMaxWidth:
- case CSSPropertyMaxHeight:
- unitless = FUnitlessQuirk;
- // fall through
- case CSSPropertyWebkitMaxLogicalWidth:
- case CSSPropertyWebkitMaxLogicalHeight:
- validPrimitive = (id == CSSValueNone || validWidthOrHeight(value, unitless));
- break;
-
- case CSSPropertyMinWidth:
- case CSSPropertyMinHeight:
- case CSSPropertyWidth:
- case CSSPropertyHeight:
- unitless = FUnitlessQuirk;
- // fall through
- case CSSPropertyWebkitMinLogicalWidth:
- case CSSPropertyWebkitMinLogicalHeight:
- case CSSPropertyWebkitLogicalWidth:
- case CSSPropertyWebkitLogicalHeight:
- validPrimitive = (id == CSSValueAuto || validWidthOrHeight(value, unitless));
- break;
-
case CSSPropertyVerticalAlign:
// baseline | sub | super | top | text-top | middle | bottom | text-bottom |
// <percentage> | <length> | inherit
@@ -1351,6 +1295,18 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
case CSSPropertyCounterReset:
case CSSPropertySize:
case CSSPropertyTextIndent:
+ case CSSPropertyMaxWidth:
+ case CSSPropertyMaxHeight:
+ case CSSPropertyWebkitMaxLogicalWidth:
+ case CSSPropertyWebkitMaxLogicalHeight:
+ case CSSPropertyMinWidth:
+ case CSSPropertyMinHeight:
+ case CSSPropertyWidth:
+ case CSSPropertyHeight:
+ case CSSPropertyWebkitMinLogicalWidth:
+ case CSSPropertyWebkitMinLogicalHeight:
+ case CSSPropertyWebkitLogicalWidth:
+ case CSSPropertyWebkitLogicalHeight:
validPrimitive = false;
break;
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698