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

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: better fixme comment 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
Index: Source/WebCore/css/CSSParser.cpp
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index 7289672a2d158c6f1d748b67a68ea5ed5c3a7876..733111e3e78ff98961ef8120653564149fc76ebf 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -1762,7 +1762,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)
@@ -1770,15 +1770,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)
@@ -2209,32 +2200,32 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
case CSSPropertyMaxWidth:
case CSSPropertyWebkitMaxLogicalWidth:
- validPrimitive = (id == CSSValueNone || validWidth(value));
+ validPrimitive = (id == CSSValueNone || validWidthOrHeight(value));
break;
case CSSPropertyMinWidth:
case CSSPropertyWebkitMinLogicalWidth:
- validPrimitive = validWidth(value);
+ validPrimitive = validWidthOrHeight(value);
break;
case CSSPropertyWidth:
case CSSPropertyWebkitLogicalWidth:
- validPrimitive = (id == CSSValueAuto || validWidth(value));
+ validPrimitive = (id == CSSValueAuto || validWidthOrHeight(value));
break;
case CSSPropertyMaxHeight:
case CSSPropertyWebkitMaxLogicalHeight:
- validPrimitive = (id == CSSValueNone || validHeight(value));
+ validPrimitive = (id == CSSValueNone || validWidthOrHeight(value));
ojan 2013/04/11 03:21:46 You can merge this with the Width equivalent case.
cbiesinger 2013/04/12 01:17:52 Done.
break;
case CSSPropertyMinHeight:
case CSSPropertyWebkitMinLogicalHeight:
- validPrimitive = validHeight(value);
+ validPrimitive = validWidthOrHeight(value);
break;
case CSSPropertyHeight:
case CSSPropertyWebkitLogicalHeight:
- validPrimitive = (id == CSSValueAuto || validHeight(value));
+ validPrimitive = (id == CSSValueAuto || validWidthOrHeight(value));
break;
case CSSPropertyFontSize:

Powered by Google App Engine
This is Rietveld 408576698