Chromium Code Reviews| Index: third_party/WebKit/Source/core/input/EventHandler.cpp |
| diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| index 31405d7b6c4e80e8f9ae74caa40cd00e674843aa..768a336489276e2453ab304e6e833313084204eb 100644 |
| --- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
| +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| @@ -1663,15 +1663,14 @@ GestureEventWithHitTestResults EventHandler::targetGestureEvent( |
| bool shouldKeepActiveForMinInterval = false; |
| if (readOnly) { |
| hitType |= HitTestRequest::ReadOnly; |
| - } else if (gestureEvent.type() == WebInputEvent::GestureTap) { |
| + } else if (gestureEvent.type() == WebInputEvent::GestureTap && |
| + m_gestureManager->getLastShowPressTimestamp()) { |
|
esprehn
2017/02/01 05:25:20
getLastShowPressTimestamp() I suppose is cheap eno
majidvp
2017/02/03 15:42:27
It is cheap. Just a plain data member access.
|
| // If the Tap is received very shortly after ShowPress, we want to |
| // delay clearing of the active state so that it's visible to the user |
| // for at least a couple of frames. |
| - activeInterval = |
| - TimeTicks::Now() - m_gestureManager->getLastShowPressTimestamp(); |
| - shouldKeepActiveForMinInterval = |
| - !m_gestureManager->getLastShowPressTimestamp().isNull() && |
| - activeInterval < minimumActiveInterval; |
| + activeInterval = TimeTicks::Now() - |
| + m_gestureManager->getLastShowPressTimestamp().value(); |
| + shouldKeepActiveForMinInterval = activeInterval < minimumActiveInterval; |
| if (shouldKeepActiveForMinInterval) |
| hitType |= HitTestRequest::ReadOnly; |
| } |