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

Unified Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

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
Patch Set: incorporated review comments and merge to trunk Created 7 years 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 | « LayoutTests/fast/css/touch-action-parsing-expected.txt ('k') | Source/core/css/CSSParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ffa5b094015f22087ada49fac217cba9acce7dfc..d5888386226f24ab1a29810e1f803841e39499c3
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -1546,6 +1546,24 @@ static PassRefPtr<CSSPrimitiveValue> valueForFontWeight(RenderStyle& style)
return cssValuePool().createIdentifierValue(CSSValueNormal);
}
+static PassRefPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction touchAction)
+{
+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ if (touchAction == TouchActionAuto)
+ list->append(cssValuePool().createIdentifierValue(CSSValueAuto));
+ if (touchAction & TouchActionNone) {
+ ASSERT(touchAction == TouchActionNone);
+ list->append(cssValuePool().createIdentifierValue(CSSValueNone));
+ }
+ if (touchAction & TouchActionPanX)
+ list->append(cssValuePool().createIdentifierValue(CSSValuePanX));
+ if (touchAction & TouchActionPanY)
+ list->append(cssValuePool().createIdentifierValue(CSSValuePanY));
+
+ ASSERT(list->length());
+ return list.release();
+}
+
static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle> style, RenderObject* renderer)
{
// Some properties only depend on layout in certain conditions which
@@ -2320,7 +2338,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:
« no previous file with comments | « LayoutTests/fast/css/touch-action-parsing-expected.txt ('k') | Source/core/css/CSSParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698