Chromium Code Reviews| Index: Source/core/css/CSSParser-in.cpp |
| diff --git a/Source/core/css/CSSParser-in.cpp b/Source/core/css/CSSParser-in.cpp |
| old mode 100644 |
| new mode 100755 |
| index 42ee2d6562b093c9411593a4a0da33e90e7a4ef6..567c7ea76d7002dc69b90e807e0de743fc797304 |
| --- a/Source/core/css/CSSParser-in.cpp |
| +++ b/Source/core/css/CSSParser-in.cpp |
| @@ -621,10 +621,6 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int |
| if ((valueID >= CSSValueCapitalize && valueID <= CSSValueLowercase) || valueID == CSSValueNone) |
| return true; |
| break; |
| - case CSSPropertyTouchAction: // auto | none |
| - if (RuntimeEnabledFeatures::cssTouchActionEnabled() && (valueID == CSSValueAuto || valueID == CSSValueNone)) |
| - return true; |
| - break; |
| case CSSPropertyTouchActionDelay: // none | script |
| if (RuntimeEnabledFeatures::cssTouchActionEnabled() && (valueID == CSSValueScript || valueID == CSSValueNone)) |
| return true; |
| @@ -882,7 +878,6 @@ static inline bool isKeywordPropertyID(CSSPropertyID propertyId) |
| case CSSPropertyTextTransform: |
| case CSSPropertyTextUnderlineMode: |
| case CSSPropertyTextUnderlineStyle: |
| - case CSSPropertyTouchAction: |
| case CSSPropertyTouchActionDelay: |
| case CSSPropertyVisibility: |
| case CSSPropertyWebkitAppearance: |
| @@ -2706,6 +2701,11 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) |
| case CSSPropertyShapeImageThreshold: |
| validPrimitive = (RuntimeEnabledFeatures::cssShapesEnabled() && !id && validUnit(value, FNumber)); |
| break; |
| + |
| + case CSSPropertyTouchAction: |
| + // auto | none | [pan-x || pan-y] |
| + return parseTouchAction(propId, important); |
| + |
| case CSSPropertyBorderBottomStyle: |
| case CSSPropertyBorderCollapse: |
| case CSSPropertyBorderLeftStyle: |
| @@ -2746,7 +2746,6 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) |
| case CSSPropertyTextTransform: |
| case CSSPropertyTextUnderlineMode: |
| case CSSPropertyTextUnderlineStyle: |
| - case CSSPropertyTouchAction: |
| case CSSPropertyTouchActionDelay: |
| case CSSPropertyVariable: |
| case CSSPropertyVisibility: |
| @@ -9014,6 +9013,50 @@ bool CSSParser::parsePerspectiveOrigin(CSSPropertyID propId, CSSPropertyID& prop |
| return value; |
| } |
| +bool CSSParser::parseTouchAction(CSSPropertyID propId, bool important) |
| +{ |
| + if (propId == CSSPropertyTouchAction |
| + && !RuntimeEnabledFeatures::cssTouchActionEnabled()) |
|
eseidel
2013/12/13 17:19:06
CSSRuntimeFeatures has the ability to enable prope
Rick Byers
2013/12/13 21:16:15
Oh cool, I hadn't noticed RuntimeCSSEnabled.cpp be
|
| + return false; |
| + |
| + CSSParserValue* value = m_valueList->current(); |
| + RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| + if (m_valueList->size() == 1 && value && (value->id == CSSValueAuto || value->id == CSSValueNone)) { |
|
eseidel
2013/12/13 17:19:06
I don't understand the size=1 case. Is this an op
eseidel
2013/12/13 17:34:36
nevermind. This is to distinguis touch-action: si
|
| + list->append(cssValuePool().createIdentifierValue(value->id)); |
| + addProperty(propId, list.release(), important); |
| + m_valueList->next(); |
| + return true; |
| + } |
| + |
| + bool isValid = true; |
| + while (isValid && value) { |
| + switch (value->id) { |
| + case CSSValuePanX: |
| + case CSSValuePanY: { |
| + RefPtr<CSSValue> panValue = cssValuePool().createIdentifierValue(value->id); |
| + if (list->hasValue(panValue.get())) { |
| + isValid = false; |
| + break; |
| + } |
| + list->append(panValue.release()); |
| + break; |
| + } |
| + default: |
| + isValid = false; |
| + break; |
| + } |
| + if (isValid) |
| + value = m_valueList->next(); |
| + } |
| + |
| + if (list->length() && isValid) { |
| + addProperty(propId, list.release(), important); |
| + return true; |
| + } |
| + |
| + return false; |
| +} |
| + |
| void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important) |
| { |
| // The text-decoration-line property takes priority over text-decoration, unless the latter has important priority set. |