Chromium Code Reviews| 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 3922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3933 // Optimization to minimize risk of this new feature (behavior should be ide ntical | 3933 // Optimization to minimize risk of this new feature (behavior should be ide ntical |
| 3934 // since there's no way to get non-default touch-action values). | 3934 // since there's no way to get non-default touch-action values). |
| 3935 if (!RuntimeEnabledFeatures::cssTouchActionEnabled()) | 3935 if (!RuntimeEnabledFeatures::cssTouchActionEnabled()) |
| 3936 return TouchActionAuto; | 3936 return TouchActionAuto; |
| 3937 | 3937 |
| 3938 HitTestResult taResult = hitTestResultAtPoint(point, HitTestRequest::TouchEv ent | HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::TouchA ction); | 3938 HitTestResult taResult = hitTestResultAtPoint(point, HitTestRequest::TouchEv ent | HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::TouchA ction); |
| 3939 Node* node = taResult.innerNode(); | 3939 Node* node = taResult.innerNode(); |
| 3940 if (!node) | 3940 if (!node) |
| 3941 return TouchActionAuto; | 3941 return TouchActionAuto; |
| 3942 | 3942 |
| 3943 // Start by permitting all actions, then walk the block level elements from | 3943 // Start by permitting all actions, then walk the box elements from the |
| 3944 // the target node up to the nearest scrollable ancestor and exclude any | 3944 // target node up to the nearest scrollable ancestor and exclude any |
| 3945 // prohibited actions. For now this is trivial, but when we add more types | 3945 // prohibited actions. For now this is trivial, but when we add more types |
| 3946 // of actions it'll get a little more complex. | 3946 // of actions it'll get a little more complex. |
| 3947 TouchAction effectiveTouchAction = TouchActionAuto; | 3947 TouchAction effectiveTouchAction = TouchActionAuto; |
| 3948 for (const Node* curNode = node; curNode; curNode = NodeRenderingTraversal:: parent(curNode)) { | 3948 for (const Node* curNode = node; curNode; curNode = NodeRenderingTraversal:: parent(curNode)) { |
| 3949 // The spec says only block and SVG elements get touch-action. | |
| 3950 // FIXME(rbyers): Add correct support for SVG, crbug.com/247396. | |
| 3951 if (RenderObject* renderer = curNode->renderer()) { | 3949 if (RenderObject* renderer = curNode->renderer()) { |
| 3952 if (renderer->isRenderBlockFlow()) { | 3950 if (renderer->isBox()) { |
|
Rick Byers
2014/04/02 20:25:20
this should again look only at nodes to which touc
Zeeshan Qureshi
2014/04/04 01:12:31
Done, the row / column case test this and I verifi
| |
| 3953 TouchAction action = renderer->style()->touchAction(); | 3951 TouchAction action = renderer->style()->touchAction(); |
| 3954 effectiveTouchAction = intersectTouchAction(action, effectiveTou chAction); | 3952 effectiveTouchAction = intersectTouchAction(action, effectiveTou chAction); |
| 3955 if (effectiveTouchAction == TouchActionNone) | 3953 if (effectiveTouchAction == TouchActionNone) |
| 3956 break; | 3954 break; |
| 3957 } | 3955 } |
| 3958 | 3956 |
| 3959 // If we've reached an ancestor that supports a touch action, search no further. | 3957 // If we've reached an ancestor that supports a touch action, search no further. |
| 3960 if (renderer->isBox() && toRenderBox(renderer)->scrollsOverflow()) | 3958 if (renderer->isBox() && toRenderBox(renderer)->scrollsOverflow()) |
| 3961 break; | 3959 break; |
| 3962 } | 3960 } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4042 unsigned EventHandler::accessKeyModifiers() | 4040 unsigned EventHandler::accessKeyModifiers() |
| 4043 { | 4041 { |
| 4044 #if OS(MACOSX) | 4042 #if OS(MACOSX) |
| 4045 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 4043 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 4046 #else | 4044 #else |
| 4047 return PlatformEvent::AltKey; | 4045 return PlatformEvent::AltKey; |
| 4048 #endif | 4046 #endif |
| 4049 } | 4047 } |
| 4050 | 4048 |
| 4051 } // namespace WebCore | 4049 } // namespace WebCore |
| OLD | NEW |