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

Side by Side Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 1422513006: Simplify TouchAction enum to be a simple bit flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix computed style / layout tests and CR feedback Created 5 years, 1 month 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) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * Copyright (C) 2015 Google Inc. All rights reserved. 7 * Copyright (C) 2015 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 return cssValuePool().createIdentifierValue(CSSValueWavy); 705 return cssValuePool().createIdentifierValue(CSSValueWavy);
706 } 706 }
707 707
708 ASSERT_NOT_REACHED(); 708 ASSERT_NOT_REACHED();
709 return cssValuePool().createExplicitInitialValue(); 709 return cssValuePool().createExplicitInitialValue();
710 } 710 }
711 711
712 static PassRefPtrWillBeRawPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction t ouchAction) 712 static PassRefPtrWillBeRawPtr<CSSValue> touchActionFlagsToCSSValue(TouchAction t ouchAction)
713 { 713 {
714 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ; 714 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ;
715 if (touchAction == TouchActionAuto) 715 if (touchAction == TouchActionAuto) {
716 list->append(cssValuePool().createIdentifierValue(CSSValueAuto)); 716 list->append(cssValuePool().createIdentifierValue(CSSValueAuto));
717 if (touchAction & TouchActionNone) { 717 } else if (touchAction == TouchActionNone) {
718 ASSERT(touchAction == TouchActionNone);
719 list->append(cssValuePool().createIdentifierValue(CSSValueNone)); 718 list->append(cssValuePool().createIdentifierValue(CSSValueNone));
720 } 719 } else if (touchAction == TouchActionManipulation) {
721 if (touchAction == (TouchActionPanX | TouchActionPanY | TouchActionPinchZoom )) {
722 list->append(cssValuePool().createIdentifierValue(CSSValueManipulation)) ; 720 list->append(cssValuePool().createIdentifierValue(CSSValueManipulation)) ;
723 } else { 721 } else {
724 if ((touchAction & TouchActionPanX) == TouchActionPanX) 722 if ((touchAction & TouchActionPanX) == TouchActionPanX)
725 list->append(cssValuePool().createIdentifierValue(CSSValuePanX)); 723 list->append(cssValuePool().createIdentifierValue(CSSValuePanX));
726 else if (touchAction & TouchActionPanLeft) 724 else if (touchAction & TouchActionPanLeft)
727 list->append(cssValuePool().createIdentifierValue(CSSValuePanLeft)); 725 list->append(cssValuePool().createIdentifierValue(CSSValuePanLeft));
728 else if (touchAction & TouchActionPanRight) 726 else if (touchAction & TouchActionPanRight)
729 list->append(cssValuePool().createIdentifierValue(CSSValuePanRight)) ; 727 list->append(cssValuePool().createIdentifierValue(CSSValuePanRight)) ;
730 728
731 if ((touchAction & TouchActionPanY) == TouchActionPanY) 729 if ((touchAction & TouchActionPanY) == TouchActionPanY)
(...skipping 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after
2688 case CSSPropertyAll: 2686 case CSSPropertyAll:
2689 return nullptr; 2687 return nullptr;
2690 default: 2688 default:
2691 break; 2689 break;
2692 } 2690 }
2693 ASSERT_NOT_REACHED(); 2691 ASSERT_NOT_REACHED();
2694 return nullptr; 2692 return nullptr;
2695 } 2693 }
2696 2694
2697 } 2695 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698