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

Side by Side Diff: Source/core/css/parser/BisonCSSParser-in.cpp

Issue 134153016: add 'manipulation' support to CSS touch-action parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 break; 2663 break;
2664 case CSSPropertyShapeMargin: 2664 case CSSPropertyShapeMargin:
2665 case CSSPropertyShapePadding: 2665 case CSSPropertyShapePadding:
2666 validPrimitive = (RuntimeEnabledFeatures::cssShapesEnabled() && !id && v alidUnit(value, FLength | FNonNeg)); 2666 validPrimitive = (RuntimeEnabledFeatures::cssShapesEnabled() && !id && v alidUnit(value, FLength | FNonNeg));
2667 break; 2667 break;
2668 case CSSPropertyShapeImageThreshold: 2668 case CSSPropertyShapeImageThreshold:
2669 validPrimitive = (RuntimeEnabledFeatures::cssShapesEnabled() && !id && v alidUnit(value, FNumber)); 2669 validPrimitive = (RuntimeEnabledFeatures::cssShapesEnabled() && !id && v alidUnit(value, FNumber));
2670 break; 2670 break;
2671 2671
2672 case CSSPropertyTouchAction: 2672 case CSSPropertyTouchAction:
2673 // auto | none | [pan-x || pan-y] 2673 // auto | none | [pan-x || pan-y] | manipulation
2674 return parseTouchAction(important); 2674 return parseTouchAction(important);
2675 2675
2676 case CSSPropertyAlignSelf: 2676 case CSSPropertyAlignSelf:
2677 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 2677 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
2678 return parseItemPositionOverflowPosition(propId, important); 2678 return parseItemPositionOverflowPosition(propId, important);
2679 2679
2680 case CSSPropertyAlignItems: 2680 case CSSPropertyAlignItems:
2681 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 2681 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
2682 return parseItemPositionOverflowPosition(propId, important); 2682 return parseItemPositionOverflowPosition(propId, important);
2683 2683
(...skipping 6218 matching lines...) Expand 10 before | Expand all | Expand 10 after
8902 return value; 8902 return value;
8903 } 8903 }
8904 8904
8905 bool CSSPropertyParser::parseTouchAction(bool important) 8905 bool CSSPropertyParser::parseTouchAction(bool important)
8906 { 8906 {
8907 if (!RuntimeEnabledFeatures::cssTouchActionEnabled()) 8907 if (!RuntimeEnabledFeatures::cssTouchActionEnabled())
8908 return false; 8908 return false;
8909 8909
8910 CSSParserValue* value = m_valueList->current(); 8910 CSSParserValue* value = m_valueList->current();
8911 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ; 8911 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ;
8912 if (m_valueList->size() == 1 && value && (value->id == CSSValueAuto || value ->id == CSSValueNone)) { 8912 if (m_valueList->size() == 1 && value && (value->id == CSSValueAuto || value ->id == CSSValueNone || value->id == CSSValueManipulation)) {
8913 list->append(cssValuePool().createIdentifierValue(value->id)); 8913 list->append(cssValuePool().createIdentifierValue(value->id));
8914 addProperty(CSSPropertyTouchAction, list.release(), important); 8914 addProperty(CSSPropertyTouchAction, list.release(), important);
8915 m_valueList->next(); 8915 m_valueList->next();
8916 return true; 8916 return true;
8917 } 8917 }
8918 8918
8919 bool isValid = true; 8919 bool isValid = true;
8920 while (isValid && value) { 8920 while (isValid && value) {
8921 switch (value->id) { 8921 switch (value->id) {
8922 case CSSValuePanX: 8922 case CSSValuePanX:
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
10162 { 10162 {
10163 // The tokenizer checks for the construct of an+b. 10163 // The tokenizer checks for the construct of an+b.
10164 // However, since the {ident} rule precedes the {nth} rule, some of those 10164 // However, since the {ident} rule precedes the {nth} rule, some of those
10165 // tokens are identified as string literal. Furthermore we need to accept 10165 // tokens are identified as string literal. Furthermore we need to accept
10166 // "odd" and "even" which does not match to an+b. 10166 // "odd" and "even" which does not match to an+b.
10167 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 10167 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
10168 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 10168 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
10169 } 10169 }
10170 10170
10171 } 10171 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698