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

Unified Diff: Source/WebCore/css/CSSParser.cpp

Issue 13674002: Support intrinsic values for height, min-height and max-height (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CSS table tests Created 7 years, 8 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 | « Source/WebCore/css/CSSParser.h ('k') | Source/WebCore/css/StyleBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/css/CSSParser.cpp
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index 4229058c7b6b79c69a2daefdf81177fd1392905d..4eab4e9c16fc3a87e67dae15ed2017d6420fddf3 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -1694,7 +1694,7 @@ static inline bool isForwardSlashOperator(CSSParserValue* value)
return value->unit == CSSParserValue::Operator && value->iValue == '/';
}
-bool CSSParser::validWidth(CSSParserValue* value)
+bool CSSParser::validWidthOrHeight(CSSParserValue* value)
{
int id = value->id;
if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic || id == CSSValueWebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFillAvailable || id == CSSValueWebkitFitContent)
@@ -1702,15 +1702,6 @@ bool CSSParser::validWidth(CSSParserValue* value)
return !id && validUnit(value, FLength | FPercent | FNonNeg);
}
-// FIXME: Combine this with validWidth when we support fit-content, et al, for heights.
-bool CSSParser::validHeight(CSSParserValue* value)
-{
- int id = value->id;
- if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic)
- return true;
- return !id && validUnit(value, FLength | FPercent | FNonNeg);
-}
-
inline PassRefPtr<CSSPrimitiveValue> CSSParser::parseValidPrimitive(int identifier, CSSParserValue* value)
{
if (identifier)
@@ -2137,32 +2128,23 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyMaxWidth:
case CSSPropertyWebkitMaxLogicalWidth:
- validPrimitive = (id == CSSValueNone || validWidth(value));
- break;
-
- case CSSPropertyMinWidth:
- case CSSPropertyWebkitMinLogicalWidth:
- validPrimitive = validWidth(value);
- break;
-
- case CSSPropertyWidth:
- case CSSPropertyWebkitLogicalWidth:
- validPrimitive = (id == CSSValueAuto || validWidth(value));
- break;
-
case CSSPropertyMaxHeight:
case CSSPropertyWebkitMaxLogicalHeight:
- validPrimitive = (id == CSSValueNone || validHeight(value));
+ validPrimitive = (id == CSSValueNone || validWidthOrHeight(value));
break;
+ case CSSPropertyMinWidth:
+ case CSSPropertyWebkitMinLogicalWidth:
case CSSPropertyMinHeight:
case CSSPropertyWebkitMinLogicalHeight:
- validPrimitive = validHeight(value);
+ validPrimitive = validWidthOrHeight(value);
break;
+ case CSSPropertyWidth:
+ case CSSPropertyWebkitLogicalWidth:
case CSSPropertyHeight:
case CSSPropertyWebkitLogicalHeight:
- validPrimitive = (id == CSSValueAuto || validHeight(value));
+ validPrimitive = (id == CSSValueAuto || validWidthOrHeight(value));
break;
case CSSPropertyFontSize:
« no previous file with comments | « Source/WebCore/css/CSSParser.h ('k') | Source/WebCore/css/StyleBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698