| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/properties/CSSPropertyAPITouchAction.h" | 5 #include "core/css/properties/CSSPropertyAPITouchAction.h" |
| 6 | 6 |
| 7 #include "core/css/CSSValueList.h" | 7 #include "core/css/CSSValueList.h" |
| 8 #include "core/css/parser/CSSPropertyParserHelpers.h" | 8 #include "core/css/parser/CSSPropertyParserHelpers.h" |
| 9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } else { | 29 } else { |
| 30 return false; | 30 return false; |
| 31 } | 31 } |
| 32 return true; | 32 return true; |
| 33 } | 33 } |
| 34 | 34 |
| 35 } // namespace | 35 } // namespace |
| 36 | 36 |
| 37 const CSSValue* CSSPropertyAPITouchAction::parseSingleValue( | 37 const CSSValue* CSSPropertyAPITouchAction::parseSingleValue( |
| 38 CSSParserTokenRange& range, | 38 CSSParserTokenRange& range, |
| 39 const CSSParserContext* context) { | 39 const CSSParserContext& context) { |
| 40 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 40 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 41 CSSValueID id = range.peek().id(); | 41 CSSValueID id = range.peek().id(); |
| 42 if (id == CSSValueAuto || id == CSSValueNone || id == CSSValueManipulation) { | 42 if (id == CSSValueAuto || id == CSSValueNone || id == CSSValueManipulation) { |
| 43 list->append(*CSSPropertyParserHelpers::consumeIdent(range)); | 43 list->append(*CSSPropertyParserHelpers::consumeIdent(range)); |
| 44 return list; | 44 return list; |
| 45 } | 45 } |
| 46 | 46 |
| 47 CSSValue* panX = nullptr; | 47 CSSValue* panX = nullptr; |
| 48 CSSValue* panY = nullptr; | 48 CSSValue* panY = nullptr; |
| 49 CSSValue* pinchZoom = nullptr; | 49 CSSValue* pinchZoom = nullptr; |
| 50 if (!consumePan(range, panX, panY, pinchZoom)) | 50 if (!consumePan(range, panX, panY, pinchZoom)) |
| 51 return nullptr; | 51 return nullptr; |
| 52 if (!range.atEnd() && !consumePan(range, panX, panY, pinchZoom)) | 52 if (!range.atEnd() && !consumePan(range, panX, panY, pinchZoom)) |
| 53 return nullptr; | 53 return nullptr; |
| 54 if (!range.atEnd() && !consumePan(range, panX, panY, pinchZoom)) | 54 if (!range.atEnd() && !consumePan(range, panX, panY, pinchZoom)) |
| 55 return nullptr; | 55 return nullptr; |
| 56 | 56 |
| 57 if (panX) | 57 if (panX) |
| 58 list->append(*panX); | 58 list->append(*panX); |
| 59 if (panY) | 59 if (panY) |
| 60 list->append(*panY); | 60 list->append(*panY); |
| 61 if (pinchZoom) | 61 if (pinchZoom) |
| 62 list->append(*pinchZoom); | 62 list->append(*pinchZoom); |
| 63 return list; | 63 return list; |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace blink | 66 } // namespace blink |
| OLD | NEW |