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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 220343002: Update touch-action hit-testing to match latest spec changes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove comment Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/rendering/RenderBlock.h » ('j') | Source/core/rendering/RenderBox.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 elements supporting
3944 // the target node up to the nearest scrollable ancestor and exclude any 3944 // touch-action from the target node up to the nearest scrollable ancestor
3945 // prohibited actions. For now this is trivial, but when we add more types 3945 // and exclude any prohibited actions.
3946 // of actions it'll get a little more complex.
3947 TouchAction effectiveTouchAction = TouchActionAuto; 3946 TouchAction effectiveTouchAction = TouchActionAuto;
3948 for (const Node* curNode = node; curNode; curNode = NodeRenderingTraversal:: parent(curNode)) { 3947 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()) { 3948 if (RenderObject* renderer = curNode->renderer()) {
3952 if (renderer->isRenderBlockFlow()) { 3949 if (renderer->visibleForTouchAction()) {
3953 TouchAction action = renderer->style()->touchAction(); 3950 TouchAction action = renderer->style()->touchAction();
3954 effectiveTouchAction = intersectTouchAction(action, effectiveTou chAction); 3951 effectiveTouchAction = intersectTouchAction(action, effectiveTou chAction);
3955 if (effectiveTouchAction == TouchActionNone) 3952 if (effectiveTouchAction == TouchActionNone)
3956 break; 3953 break;
3957 } 3954 }
3958 3955
3959 // If we've reached an ancestor that supports a touch action, search no further. 3956 // If we've reached an ancestor that supports a touch action, search no further.
3960 if (renderer->isBox() && toRenderBox(renderer)->scrollsOverflow()) 3957 if (renderer->isBox() && toRenderBox(renderer)->scrollsOverflow())
3961 break; 3958 break;
3962 } 3959 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
4042 unsigned EventHandler::accessKeyModifiers() 4039 unsigned EventHandler::accessKeyModifiers()
4043 { 4040 {
4044 #if OS(MACOSX) 4041 #if OS(MACOSX)
4045 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4042 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4046 #else 4043 #else
4047 return PlatformEvent::AltKey; 4044 return PlatformEvent::AltKey;
4048 #endif 4045 #endif
4049 } 4046 }
4050 4047
4051 } // namespace WebCore 4048 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderBlock.h » ('j') | Source/core/rendering/RenderBox.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698