OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 3731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3742 return action2; | 3742 return action2; |
3743 if (action2 == TouchActionAuto) | 3743 if (action2 == TouchActionAuto) |
3744 return action1; | 3744 return action1; |
3745 if (!(action1 & action2)) | 3745 if (!(action1 & action2)) |
3746 return TouchActionNone; | 3746 return TouchActionNone; |
3747 return action1 & action2; | 3747 return action1 & action2; |
3748 } | 3748 } |
3749 | 3749 |
3750 TouchAction EventHandler::computeEffectiveTouchAction(const Node& node) | 3750 TouchAction EventHandler::computeEffectiveTouchAction(const Node& node) |
3751 { | 3751 { |
3752 // Optimization to minimize risk of this new feature (behavior should be ide
ntical | |
3753 // since there's no way to get non-default touch-action values). | |
3754 if (!RuntimeEnabledFeatures::cssTouchActionEnabled()) | |
3755 return TouchActionAuto; | |
3756 | |
3757 // Start by permitting all actions, then walk the elements supporting | 3752 // Start by permitting all actions, then walk the elements supporting |
3758 // touch-action from the target node up to the nearest scrollable ancestor | 3753 // touch-action from the target node up to the nearest scrollable ancestor |
3759 // and exclude any prohibited actions. | 3754 // and exclude any prohibited actions. |
3760 TouchAction effectiveTouchAction = TouchActionAuto; | 3755 TouchAction effectiveTouchAction = TouchActionAuto; |
3761 for (const Node* curNode = &node; curNode; curNode = NodeRenderingTraversal:
:parent(curNode)) { | 3756 for (const Node* curNode = &node; curNode; curNode = NodeRenderingTraversal:
:parent(curNode)) { |
3762 if (RenderObject* renderer = curNode->renderer()) { | 3757 if (RenderObject* renderer = curNode->renderer()) { |
3763 if (renderer->supportsTouchAction()) { | 3758 if (renderer->supportsTouchAction()) { |
3764 TouchAction action = renderer->style()->touchAction(); | 3759 TouchAction action = renderer->style()->touchAction(); |
3765 effectiveTouchAction = intersectTouchAction(action, effectiveTou
chAction); | 3760 effectiveTouchAction = intersectTouchAction(action, effectiveTou
chAction); |
3766 if (effectiveTouchAction == TouchActionNone) | 3761 if (effectiveTouchAction == TouchActionNone) |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3853 unsigned EventHandler::accessKeyModifiers() | 3848 unsigned EventHandler::accessKeyModifiers() |
3854 { | 3849 { |
3855 #if OS(MACOSX) | 3850 #if OS(MACOSX) |
3856 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3851 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3857 #else | 3852 #else |
3858 return PlatformEvent::AltKey; | 3853 return PlatformEvent::AltKey; |
3859 #endif | 3854 #endif |
3860 } | 3855 } |
3861 | 3856 |
3862 } // namespace blink | 3857 } // namespace blink |
OLD | NEW |