| OLD | NEW |
| 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 // RenderView::hitTest causes a layout, and we don't want to hit that until
the first | 709 // RenderView::hitTest causes a layout, and we don't want to hit that until
the first |
| 710 // layout because until then, there is nothing shown on the screen - the use
r can't | 710 // layout because until then, there is nothing shown on the screen - the use
r can't |
| 711 // have intentionally clicked on something belonging to this page. Furthermo
re, | 711 // have intentionally clicked on something belonging to this page. Furthermo
re, |
| 712 // mousemove events before the first layout should not lead to a premature l
ayout() | 712 // mousemove events before the first layout should not lead to a premature l
ayout() |
| 713 // happening, which could show a flash of white. | 713 // happening, which could show a flash of white. |
| 714 // See also the similar code in Document::prepareMouseEvent. | 714 // See also the similar code in Document::prepareMouseEvent. |
| 715 if (!m_frame->contentRenderer() || !m_frame->view() || !m_frame->view()->did
FirstLayout()) | 715 if (!m_frame->contentRenderer() || !m_frame->view() || !m_frame->view()->did
FirstLayout()) |
| 716 return result; | 716 return result; |
| 717 | 717 |
| 718 // hitTestResultAtPoint is specifically used to hitTest into all frames, thu
s it always allows child frame content. | 718 // hitTestResultAtPoint is specifically used to hitTest into all frames, thu
s it always allows child frame content. |
| 719 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent); | 719 HitTestRequest request(hitType); |
| 720 m_frame->contentRenderer()->hitTest(request, result); | 720 m_frame->contentRenderer()->hitTest(request, result); |
| 721 if (!request.readOnly()) | 721 if (!request.readOnly()) |
| 722 m_frame->document()->updateHoverActiveState(request, result.innerElement
()); | 722 m_frame->document()->updateHoverActiveState(request, result.innerElement
()); |
| 723 | 723 |
| 724 return result; | 724 return result; |
| 725 } | 725 } |
| 726 | 726 |
| 727 void EventHandler::stopAutoscroll() | 727 void EventHandler::stopAutoscroll() |
| 728 { | 728 { |
| 729 if (AutoscrollController* controller = autoscrollController()) | 729 if (AutoscrollController* controller = autoscrollController()) |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1891 // the final adjusted node. | 1891 // the final adjusted node. |
| 1892 IntPoint hitTestPoint = gestureEvent.position(); | 1892 IntPoint hitTestPoint = gestureEvent.position(); |
| 1893 IntSize touchRadius = gestureEvent.area(); | 1893 IntSize touchRadius = gestureEvent.area(); |
| 1894 touchRadius.scale(1.f / 2); | 1894 touchRadius.scale(1.f / 2); |
| 1895 // FIXME: We should not do a rect-based hit-test if touch adjustment is disa
bled. | 1895 // FIXME: We should not do a rect-based hit-test if touch adjustment is disa
bled. |
| 1896 HitTestResult hitTestResult = hitTestResultAtPoint(hitTestPoint, hitType | H
itTestRequest::ReadOnly, touchRadius); | 1896 HitTestResult hitTestResult = hitTestResultAtPoint(hitTestPoint, hitType | H
itTestRequest::ReadOnly, touchRadius); |
| 1897 | 1897 |
| 1898 // Now apply hover/active state to the final target. | 1898 // Now apply hover/active state to the final target. |
| 1899 // FIXME: This is supposed to send mouseenter/mouseleave events, but doesn't
because we | 1899 // FIXME: This is supposed to send mouseenter/mouseleave events, but doesn't
because we |
| 1900 // aren't passing a PlatformMouseEvent. | 1900 // aren't passing a PlatformMouseEvent. |
| 1901 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent); | 1901 HitTestRequest request(hitType); |
| 1902 if (!request.readOnly()) | 1902 if (!request.readOnly()) |
| 1903 m_frame->document()->updateHoverActiveState(request, hitTestResult.inner
Element()); | 1903 m_frame->document()->updateHoverActiveState(request, hitTestResult.inner
Element()); |
| 1904 | 1904 |
| 1905 if (shouldKeepActiveForMinInterval) { | 1905 if (shouldKeepActiveForMinInterval) { |
| 1906 m_lastDeferredTapElement = hitTestResult.innerElement(); | 1906 m_lastDeferredTapElement = hitTestResult.innerElement(); |
| 1907 m_activeIntervalTimer.startOneShot(minimumActiveInterval - activeInterva
l, FROM_HERE); | 1907 m_activeIntervalTimer.startOneShot(minimumActiveInterval - activeInterva
l, FROM_HERE); |
| 1908 } | 1908 } |
| 1909 | 1909 |
| 1910 return GestureEventWithHitTestResults(gestureEvent, hitTestResult); | 1910 return GestureEventWithHitTestResults(gestureEvent, hitTestResult); |
| 1911 } | 1911 } |
| 1912 | 1912 |
| 1913 HitTestRequest::HitTestRequestType EventHandler::getHitTypeForGestureType(Platfo
rmEvent::Type type) | 1913 HitTestRequest::HitTestRequestType EventHandler::getHitTypeForGestureType(Platfo
rmEvent::Type type) |
| 1914 { | 1914 { |
| 1915 HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent | Hi
tTestRequest::AllowFrameScrollbars; | 1915 HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent; |
| 1916 switch (type) { | 1916 switch (type) { |
| 1917 case PlatformEvent::GestureShowPress: | 1917 case PlatformEvent::GestureShowPress: |
| 1918 case PlatformEvent::GestureTapUnconfirmed: | 1918 case PlatformEvent::GestureTapUnconfirmed: |
| 1919 return hitType | HitTestRequest::Active; | 1919 return hitType | HitTestRequest::Active; |
| 1920 case PlatformEvent::GestureTapDownCancel: | 1920 case PlatformEvent::GestureTapDownCancel: |
| 1921 // A TapDownCancel received when no element is active shouldn't really b
e changing hover state. | 1921 // A TapDownCancel received when no element is active shouldn't really b
e changing hover state. |
| 1922 if (!m_frame->document()->activeHoverElement()) | 1922 if (!m_frame->document()->activeHoverElement()) |
| 1923 hitType |= HitTestRequest::ReadOnly; | 1923 hitType |= HitTestRequest::ReadOnly; |
| 1924 return hitType | HitTestRequest::Release; | 1924 return hitType | HitTestRequest::Release; |
| 1925 case PlatformEvent::GestureTap: | 1925 case PlatformEvent::GestureTap: |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2572 | 2572 |
| 2573 void EventHandler::focusDocumentView() | 2573 void EventHandler::focusDocumentView() |
| 2574 { | 2574 { |
| 2575 Page* page = m_frame->page(); | 2575 Page* page = m_frame->page(); |
| 2576 if (!page) | 2576 if (!page) |
| 2577 return; | 2577 return; |
| 2578 page->focusController().focusDocumentView(m_frame); | 2578 page->focusController().focusDocumentView(m_frame); |
| 2579 } | 2579 } |
| 2580 | 2580 |
| 2581 } // namespace blink | 2581 } // namespace blink |
| OLD | NEW |