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

Side by Side Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 1137483003: Implement direction-specific touch-action values (blink side) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix minor nit from patch set 1 Created 5 years, 7 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 7289 matching lines...) Expand 10 before | Expand all | Expand 10 after
7300 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTouchAction() 7300 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTouchAction()
7301 { 7301 {
7302 CSSParserValue* value = m_valueList->current(); 7302 CSSParserValue* value = m_valueList->current();
7303 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ; 7303 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ;
7304 if (m_valueList->size() == 1 && value && (value->id == CSSValueAuto || value ->id == CSSValueNone || value->id == CSSValueManipulation)) { 7304 if (m_valueList->size() == 1 && value && (value->id == CSSValueAuto || value ->id == CSSValueNone || value->id == CSSValueManipulation)) {
7305 list->append(cssValuePool().createIdentifierValue(value->id)); 7305 list->append(cssValuePool().createIdentifierValue(value->id));
7306 m_valueList->next(); 7306 m_valueList->next();
7307 return list.release(); 7307 return list.release();
7308 } 7308 }
7309 7309
7310 bool xSet = false;
7311 bool ySet = false;
7310 while (value) { 7312 while (value) {
7311 switch (value->id) { 7313 switch (value->id) {
7312 case CSSValuePanX: 7314 case CSSValuePanX:
7313 case CSSValuePanY: { 7315 case CSSValuePanRight:
7316 case CSSValuePanLeft: {
7317 if (xSet)
7318 return nullptr;
7319 xSet = true;
7320 if (value->id != CSSValuePanX && !RuntimeEnabledFeatures::cssTouchAc tionPanDirectionsEnabled())
7321 return nullptr;
7322
7314 RefPtrWillBeRawPtr<CSSValue> panValue = cssValuePool().createIdentif ierValue(value->id); 7323 RefPtrWillBeRawPtr<CSSValue> panValue = cssValuePool().createIdentif ierValue(value->id);
7315 if (list->hasValue(panValue.get()))
7316 return nullptr;
7317 list->append(panValue.release()); 7324 list->append(panValue.release());
7318 break; 7325 break;
7319 } 7326 }
7327 case CSSValuePanY:
7328 case CSSValuePanDown:
7329 case CSSValuePanUp: {
7330 if (ySet)
7331 return nullptr;
7332 ySet = true;
7333 if (value->id != CSSValuePanY && !RuntimeEnabledFeatures::cssTouchAc tionPanDirectionsEnabled())
7334 return nullptr;
7335 RefPtrWillBeRawPtr<CSSValue> panValue = cssValuePool().createIdentif ierValue(value->id);
7336 list->append(panValue.release());
7337 break;
7338 }
7320 default: 7339 default:
7321 return nullptr; 7340 return nullptr;
7322 } 7341 }
7323 value = m_valueList->next(); 7342 value = m_valueList->next();
7324 } 7343 }
7325 7344
7326 if (list->length()) 7345 if (list->length())
7327 return list.release(); 7346 return list.release();
7328 7347
7329 return nullptr; 7348 return nullptr;
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
8406 } 8425 }
8407 } 8426 }
8408 8427
8409 if (!list->length()) 8428 if (!list->length())
8410 return nullptr; 8429 return nullptr;
8411 8430
8412 return list.release(); 8431 return list.release();
8413 } 8432 }
8414 8433
8415 } // namespace blink 8434 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/ComputedStyleCSSValueMapping.cpp ('k') | Source/core/style/ComputedStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698