 Chromium Code Reviews
 Chromium Code Reviews Issue 87973002:
  add pan-x and pan-y support to CSS touch-action parsing.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 87973002:
  add pan-x and pan-y support to CSS touch-action parsing.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| Index: Source/core/css/CSSComputedStyleDeclaration.cpp | 
| diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp | 
| old mode 100644 | 
| new mode 100755 | 
| index 82d0c741688d8cd2ba4159284ff508c06120f53c..671a0bf84c9e9456b2e34f2cd54f34747086cda4 | 
| --- a/Source/core/css/CSSComputedStyleDeclaration.cpp | 
| +++ b/Source/core/css/CSSComputedStyleDeclaration.cpp | 
| @@ -1542,6 +1542,23 @@ static PassRefPtr<CSSPrimitiveValue> valueForFontWeight(RenderStyle& style) | 
| return cssValuePool().createIdentifierValue(CSSValueNormal); | 
| } | 
| +static PassRefPtr<CSSValue> touchActionFlagsToCSSValue(int touchAction) | 
| 
Rick Byers
2013/12/06 21:44:04
This should take a TouchAction.   You could always
 
gnana
2013/12/10 18:24:37
Done.
 | 
| +{ | 
| + RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 
| + if (touchAction & TouchActionNone) | 
| + list->append(cssValuePool().createIdentifierValue(CSSValueNone)); | 
| + if (touchAction & TouchActionAuto) | 
| + list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); | 
| + if (touchAction & TouchActionPanX) | 
| 
Rick Byers
2013/12/06 21:44:04
We should probably ASSERT or otherwise reject the
 
gnana
2013/12/10 18:24:37
I m checking on this. i will update this in next p
 
Rick Byers
2013/12/10 21:57:14
Ok.  Whatever the common error-handling pattern se
 
gnana
2013/12/11 14:02:53
Done.
 | 
| + list->append(cssValuePool().createIdentifierValue(CSSValuePanX)); | 
| + if (touchAction & TouchActionPanY) | 
| + list->append(cssValuePool().createIdentifierValue(CSSValuePanY)); | 
| + | 
| + if (!list->length()) | 
| + return cssValuePool().createIdentifierValue(CSSValueAuto); | 
| + return list.release(); | 
| +} | 
| + | 
| static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle> style, RenderObject* renderer) | 
| { | 
| // Some properties only depend on layout in certain conditions which | 
| @@ -2316,7 +2333,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert | 
| case CSSPropertyTop: | 
| return valueForPositionOffset(*style, CSSPropertyTop, renderer, m_node->document().renderView()); | 
| case CSSPropertyTouchAction: | 
| - return cssValuePool().createValue(style->touchAction()); | 
| + return touchActionFlagsToCSSValue(style->touchAction()); | 
| case CSSPropertyTouchActionDelay: | 
| return cssValuePool().createValue(style->touchActionDelay()); | 
| case CSSPropertyUnicodeBidi: |