OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1656 ASSERT(m_frame == m_frame->localFrameRoot()); | 1656 ASSERT(m_frame == m_frame->localFrameRoot()); |
1657 // Scrolling events get hit tested per frame (like wheel events do). | 1657 // Scrolling events get hit tested per frame (like wheel events do). |
1658 ASSERT(!gestureEvent.isScrollEvent()); | 1658 ASSERT(!gestureEvent.isScrollEvent()); |
1659 | 1659 |
1660 HitTestRequest::HitTestRequestType hitType = | 1660 HitTestRequest::HitTestRequestType hitType = |
1661 m_gestureManager->getHitTypeForGestureType(gestureEvent.type()); | 1661 m_gestureManager->getHitTypeForGestureType(gestureEvent.type()); |
1662 TimeDelta activeInterval; | 1662 TimeDelta activeInterval; |
1663 bool shouldKeepActiveForMinInterval = false; | 1663 bool shouldKeepActiveForMinInterval = false; |
1664 if (readOnly) { | 1664 if (readOnly) { |
1665 hitType |= HitTestRequest::ReadOnly; | 1665 hitType |= HitTestRequest::ReadOnly; |
1666 } else if (gestureEvent.type() == WebInputEvent::GestureTap) { | 1666 } else if (gestureEvent.type() == WebInputEvent::GestureTap && |
1667 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.
| |
1667 // If the Tap is received very shortly after ShowPress, we want to | 1668 // If the Tap is received very shortly after ShowPress, we want to |
1668 // delay clearing of the active state so that it's visible to the user | 1669 // delay clearing of the active state so that it's visible to the user |
1669 // for at least a couple of frames. | 1670 // for at least a couple of frames. |
1670 activeInterval = | 1671 activeInterval = TimeTicks::Now() - |
1671 TimeTicks::Now() - m_gestureManager->getLastShowPressTimestamp(); | 1672 m_gestureManager->getLastShowPressTimestamp().value(); |
1672 shouldKeepActiveForMinInterval = | 1673 shouldKeepActiveForMinInterval = activeInterval < minimumActiveInterval; |
1673 !m_gestureManager->getLastShowPressTimestamp().isNull() && | |
1674 activeInterval < minimumActiveInterval; | |
1675 if (shouldKeepActiveForMinInterval) | 1674 if (shouldKeepActiveForMinInterval) |
1676 hitType |= HitTestRequest::ReadOnly; | 1675 hitType |= HitTestRequest::ReadOnly; |
1677 } | 1676 } |
1678 | 1677 |
1679 GestureEventWithHitTestResults eventWithHitTestResults = | 1678 GestureEventWithHitTestResults eventWithHitTestResults = |
1680 hitTestResultForGestureEvent(gestureEvent, hitType); | 1679 hitTestResultForGestureEvent(gestureEvent, hitType); |
1681 // Now apply hover/active state to the final target. | 1680 // Now apply hover/active state to the final target. |
1682 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent); | 1681 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent); |
1683 if (!request.readOnly()) | 1682 if (!request.readOnly()) |
1684 updateGestureHoverActiveState( | 1683 updateGestureHoverActiveState( |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2125 } | 2124 } |
2126 | 2125 |
2127 FrameHost* EventHandler::frameHost() const { | 2126 FrameHost* EventHandler::frameHost() const { |
2128 if (!m_frame->page()) | 2127 if (!m_frame->page()) |
2129 return nullptr; | 2128 return nullptr; |
2130 | 2129 |
2131 return &m_frame->page()->frameHost(); | 2130 return &m_frame->page()->frameHost(); |
2132 } | 2131 } |
2133 | 2132 |
2134 } // namespace blink | 2133 } // namespace blink |
OLD | NEW |