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

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

Issue 137123009: Add hittest mode for Touch-action which ignore inline elements and svg elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 10 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) 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 3655 matching lines...) Expand 10 before | Expand all | Expand 10 after
3666 // Record the originating touch document even if it does not have a touch listener. 3666 // Record the originating touch document even if it does not have a touch listener.
3667 if (freshTouchEvents) { 3667 if (freshTouchEvents) {
3668 m_originatingTouchPointDocument = &doc; 3668 m_originatingTouchPointDocument = &doc;
3669 freshTouchEvents = false; 3669 freshTouchEvents = false;
3670 } 3670 }
3671 if (!doc.hasTouchEventHandlers()) 3671 if (!doc.hasTouchEventHandlers())
3672 continue; 3672 continue;
3673 m_originatingTouchPointTargets.set(touchPointTargetKey, node); 3673 m_originatingTouchPointTargets.set(touchPointTargetKey, node);
3674 touchTarget = node; 3674 touchTarget = node;
3675 3675
3676 // FIXME(rbyers): Should really be doing a second hit test that igno res inline elements - crbug.com/319479. 3676 // FIXME(rbyers): Should really be doing a second hit test that igno res inline elements - crbug.com/319479.
Rick Byers 2014/02/17 14:44:24 Oh, and you can remove this FIXME now of course.
gnana 2014/02/24 18:59:50 Done.
3677 TouchAction effectiveTouchAction = computeEffectiveTouchAction(*node ); 3677 HitTestResult taResult = hitTestResultAtPoint(pagePoint, hitType | H itTestRequest::TouchAction);
Rick Byers 2014/02/17 14:43:52 It's probably worth moving the hit test into compu
gnana 2014/02/24 18:59:50 Done.
3678 if (effectiveTouchAction != TouchActionAuto) 3678 Node* taNode = taResult.innerNode();
3679 m_frame->page()->chrome().client().setTouchAction(effectiveTouch Action); 3679 if (taNode == node) {
Rick Byers 2014/02/17 14:43:52 You'll need to do this even when the hit test retu
gnana 2014/02/24 18:59:50 Done.
3680 TouchAction effectiveTouchAction = computeEffectiveTouchAction(* taNode);
3681 if (effectiveTouchAction != TouchActionAuto)
3682 m_frame->page()->chrome().client().setTouchAction(effectiveT ouchAction);
3683 }
3680 3684
3681 } else if (pointState == PlatformTouchPoint::TouchReleased || pointState == PlatformTouchPoint::TouchCancelled) { 3685 } else if (pointState == PlatformTouchPoint::TouchReleased || pointState == PlatformTouchPoint::TouchCancelled) {
3682 // The target should be the original target for this touch, so get i t from the hashmap. As it's a release or cancel 3686 // The target should be the original target for this touch, so get i t from the hashmap. As it's a release or cancel
3683 // we also remove it from the map. 3687 // we also remove it from the map.
3684 touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKe y); 3688 touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKe y);
3685 } else 3689 } else
3686 // No hittest is performed on move or stationary, since the target i s not allowed to change anyway. 3690 // No hittest is performed on move or stationary, since the target i s not allowed to change anyway.
3687 touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey ); 3691 touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey );
3688 3692
3689 if (!touchTarget.get()) 3693 if (!touchTarget.get())
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
4014 unsigned EventHandler::accessKeyModifiers() 4018 unsigned EventHandler::accessKeyModifiers()
4015 { 4019 {
4016 #if OS(MACOSX) 4020 #if OS(MACOSX)
4017 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4021 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4018 #else 4022 #else
4019 return PlatformEvent::AltKey; 4023 return PlatformEvent::AltKey;
4020 #endif 4024 #endif
4021 } 4025 }
4022 4026
4023 } // namespace WebCore 4027 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/HitTestRequest.h » ('j') | Source/core/rendering/HitTestRequest.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698