| 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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly; | 805 hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly; |
| 806 HitTestRequest request(hitType); | 806 HitTestRequest request(hitType); |
| 807 MouseEventWithHitTestResults mev = MouseEventWithHitTestResults( | 807 MouseEventWithHitTestResults mev = MouseEventWithHitTestResults( |
| 808 mouseEvent, HitTestResult(request, LayoutPoint())); | 808 mouseEvent, HitTestResult(request, LayoutPoint())); |
| 809 | 809 |
| 810 // We don't want to do a hit-test in forceLeave scenarios because there might | 810 // We don't want to do a hit-test in forceLeave scenarios because there might |
| 811 // actually be some other frame above this one at the specified co-ordinate. | 811 // actually be some other frame above this one at the specified co-ordinate. |
| 812 // So we must force the hit-test to fail, while still clearing hover/active | 812 // So we must force the hit-test to fail, while still clearing hover/active |
| 813 // state. | 813 // state. |
| 814 if (forceLeave) { | 814 if (forceLeave) { |
| 815 m_frame->document()->updateHoverActiveState(request, nullptr, false); | 815 m_frame->document()->updateHoverActiveState(request, nullptr, nullptr); |
| 816 } else { | 816 } else { |
| 817 mev = EventHandlingUtil::performMouseEventHitTest(m_frame, request, | 817 mev = EventHandlingUtil::performMouseEventHitTest(m_frame, request, |
| 818 mouseEvent); | 818 mouseEvent); |
| 819 } | 819 } |
| 820 | 820 |
| 821 if (hoveredNode) | 821 if (hoveredNode) |
| 822 *hoveredNode = mev.hitTestResult(); | 822 *hoveredNode = mev.hitTestResult(); |
| 823 | 823 |
| 824 Scrollbar* scrollbar = nullptr; | 824 Scrollbar* scrollbar = nullptr; |
| 825 | 825 |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 | 1519 |
| 1520 LocalFrame* oldHoverFrame = toLocalFrame(owner->contentFrame()); | 1520 LocalFrame* oldHoverFrame = toLocalFrame(owner->contentFrame()); |
| 1521 Document* doc = oldHoverFrame->document(); | 1521 Document* doc = oldHoverFrame->document(); |
| 1522 if (!doc) | 1522 if (!doc) |
| 1523 break; | 1523 break; |
| 1524 | 1524 |
| 1525 oldHoverNodeInCurDoc = doc->hoverNode(); | 1525 oldHoverNodeInCurDoc = doc->hoverNode(); |
| 1526 // If the old hovered frame is different from the new hovered frame. | 1526 // If the old hovered frame is different from the new hovered frame. |
| 1527 // we should clear the old hovered node from the old hovered frame. | 1527 // we should clear the old hovered node from the old hovered frame. |
| 1528 if (newHoverFrame != oldHoverFrame) | 1528 if (newHoverFrame != oldHoverFrame) |
| 1529 doc->updateHoverActiveState(request, nullptr, false); | 1529 doc->updateHoverActiveState(request, nullptr, nullptr); |
| 1530 } | 1530 } |
| 1531 } | 1531 } |
| 1532 | 1532 |
| 1533 // Recursively set the new active/hover states on every frame in the chain of | 1533 // Recursively set the new active/hover states on every frame in the chain of |
| 1534 // innerElement. | 1534 // innerElement. |
| 1535 m_frame->document()->updateHoverActiveState(request, innerElement, false); | 1535 m_frame->document()->updateHoverActiveState(request, innerElement, nullptr); |
| 1536 } | 1536 } |
| 1537 | 1537 |
| 1538 // Update the mouseover/mouseenter/mouseout/mouseleave events across all frames | 1538 // Update the mouseover/mouseenter/mouseout/mouseleave events across all frames |
| 1539 // for this gesture, before passing the targeted gesture event directly to a hit | 1539 // for this gesture, before passing the targeted gesture event directly to a hit |
| 1540 // frame. | 1540 // frame. |
| 1541 void EventHandler::updateGestureTargetNodeForMouseEvent( | 1541 void EventHandler::updateGestureTargetNodeForMouseEvent( |
| 1542 const GestureEventWithHitTestResults& targetedEvent) { | 1542 const GestureEventWithHitTestResults& targetedEvent) { |
| 1543 ASSERT(m_frame == m_frame->localFrameRoot()); | 1543 ASSERT(m_frame == m_frame->localFrameRoot()); |
| 1544 | 1544 |
| 1545 // Behaviour of this function is as follows: | 1545 // Behaviour of this function is as follows: |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 void EventHandler::activeIntervalTimerFired(TimerBase*) { | 1934 void EventHandler::activeIntervalTimerFired(TimerBase*) { |
| 1935 TRACE_EVENT0("input", "EventHandler::activeIntervalTimerFired"); | 1935 TRACE_EVENT0("input", "EventHandler::activeIntervalTimerFired"); |
| 1936 m_activeIntervalTimer.stop(); | 1936 m_activeIntervalTimer.stop(); |
| 1937 | 1937 |
| 1938 if (m_frame && m_frame->document() && m_lastDeferredTapElement) { | 1938 if (m_frame && m_frame->document() && m_lastDeferredTapElement) { |
| 1939 // FIXME: Enable condition when http://crbug.com/226842 lands | 1939 // FIXME: Enable condition when http://crbug.com/226842 lands |
| 1940 // m_lastDeferredTapElement.get() == m_frame->document()->activeElement() | 1940 // m_lastDeferredTapElement.get() == m_frame->document()->activeElement() |
| 1941 HitTestRequest request(HitTestRequest::TouchEvent | | 1941 HitTestRequest request(HitTestRequest::TouchEvent | |
| 1942 HitTestRequest::Release); | 1942 HitTestRequest::Release); |
| 1943 m_frame->document()->updateHoverActiveState( | 1943 m_frame->document()->updateHoverActiveState( |
| 1944 request, m_lastDeferredTapElement.get(), false); | 1944 request, m_lastDeferredTapElement.get(), nullptr); |
| 1945 } | 1945 } |
| 1946 m_lastDeferredTapElement = nullptr; | 1946 m_lastDeferredTapElement = nullptr; |
| 1947 } | 1947 } |
| 1948 | 1948 |
| 1949 void EventHandler::notifyElementActivated() { | 1949 void EventHandler::notifyElementActivated() { |
| 1950 // Since another element has been set to active, stop current timer and clear | 1950 // Since another element has been set to active, stop current timer and clear |
| 1951 // reference. | 1951 // reference. |
| 1952 m_activeIntervalTimer.stop(); | 1952 m_activeIntervalTimer.stop(); |
| 1953 m_lastDeferredTapElement = nullptr; | 1953 m_lastDeferredTapElement = nullptr; |
| 1954 } | 1954 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2102 } | 2102 } |
| 2103 | 2103 |
| 2104 FrameHost* EventHandler::frameHost() const { | 2104 FrameHost* EventHandler::frameHost() const { |
| 2105 if (!m_frame->page()) | 2105 if (!m_frame->page()) |
| 2106 return nullptr; | 2106 return nullptr; |
| 2107 | 2107 |
| 2108 return &m_frame->page()->frameHost(); | 2108 return &m_frame->page()->frameHost(); |
| 2109 } | 2109 } |
| 2110 | 2110 |
| 2111 } // namespace blink | 2111 } // namespace blink |
| OLD | NEW |