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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 163933002: Send early ShowPress on TapDown when page isn't scrollable/pinchable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 { 1100 {
1101 if (!m_page || !m_page->mainFrame()) 1101 if (!m_page || !m_page->mainFrame())
1102 return 0; 1102 return 0;
1103 1103
1104 Node* bestTouchNode = 0; 1104 Node* bestTouchNode = 0;
1105 1105
1106 IntPoint touchEventLocation(tapEvent.position()); 1106 IntPoint touchEventLocation(tapEvent.position());
1107 m_page->mainFrame()->eventHandler().adjustGesturePosition(tapEvent, touchEve ntLocation); 1107 m_page->mainFrame()->eventHandler().adjustGesturePosition(tapEvent, touchEve ntLocation);
1108 1108
1109 IntPoint hitTestPoint = m_page->mainFrame()->view()->windowToContents(touchE ventLocation); 1109 IntPoint hitTestPoint = m_page->mainFrame()->view()->windowToContents(touchE ventLocation);
1110 HitTestResult result = m_page->mainFrame()->eventHandler().hitTestResultAtPo int(hitTestPoint, HitTestRequest::TouchEvent | HitTestRequest::ConfusingAndOften MisusedDisallowShadowContent); 1110 EventHandler& eventHandler = m_page->mainFrame()->eventHandler();
1111 HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent | Hi tTestRequest::ConfusingAndOftenMisusedDisallowShadowContent;
1112 if (eventHandler.tapDownTriggeredActive())
1113 hitType |= HitTestRequest::ReadOnly;
Rick Byers 2014/02/14 21:27:53 Does this normally need to be non-readonly so that
1114 HitTestResult result = eventHandler.hitTestResultAtPoint(hitTestPoint, hitTy pe);
1111 bestTouchNode = result.targetNode(); 1115 bestTouchNode = result.targetNode();
1112 1116
1113 // We might hit something like an image map that has no renderer on it 1117 // We might hit something like an image map that has no renderer on it
1114 // Walk up the tree until we have a node with an attached renderer 1118 // Walk up the tree until we have a node with an attached renderer
1115 while (bestTouchNode && !bestTouchNode->renderer()) 1119 while (bestTouchNode && !bestTouchNode->renderer())
1116 bestTouchNode = bestTouchNode->parentNode(); 1120 bestTouchNode = bestTouchNode->parentNode();
1117 1121
1118 // Check if we're in the subtree of a node with a hand cursor 1122 // Check if we're in the subtree of a node with a hand cursor
1119 // this is the heuristic we use to determine if we show a highlight on tap 1123 // this is the heuristic we use to determine if we show a highlight on tap
1120 while (bestTouchNode && !invokesHandCursor(bestTouchNode, false, m_page->mai nFrame())) 1124 while (bestTouchNode && !invokesHandCursor(bestTouchNode, false, m_page->mai nFrame()))
(...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after
3981 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 3985 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
3982 3986
3983 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 3987 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
3984 return false; 3988 return false;
3985 3989
3986 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 3990 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
3987 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 3991 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
3988 } 3992 }
3989 3993
3990 } // namespace blink 3994 } // namespace blink
OLDNEW
« Source/core/page/EventHandler.cpp ('K') | « Source/web/ChromeClientImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698