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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 return autoscrollController() && autoscrollController()->panScrollInProgress
(); | 841 return autoscrollController() && autoscrollController()->panScrollInProgress
(); |
842 } | 842 } |
843 | 843 |
844 HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, HitTe
stRequest::HitTestRequestType hitType, const LayoutSize& padding) | 844 HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, HitTe
stRequest::HitTestRequestType hitType, const LayoutSize& padding) |
845 { | 845 { |
846 TRACE_EVENT0("webkit", "EventHandler::hitTestResultAtPoint"); | 846 TRACE_EVENT0("webkit", "EventHandler::hitTestResultAtPoint"); |
847 | 847 |
848 // We always send hitTestResultAtPoint to the main frame if we have one, | 848 // We always send hitTestResultAtPoint to the main frame if we have one, |
849 // otherwise we might hit areas that are obscured by higher frames. | 849 // otherwise we might hit areas that are obscured by higher frames. |
850 if (Page* page = m_frame->page()) { | 850 if (Page* page = m_frame->page()) { |
851 LocalFrame* mainFrame = page->mainFrame(); | 851 LocalFrame* mainFrame = page->mainFrame()->isLocalFrame() ? page->deprec
atedLocalMainFrame() : 0; |
852 if (m_frame != mainFrame) { | 852 if (mainFrame && m_frame != mainFrame) { |
853 FrameView* frameView = m_frame->view(); | 853 FrameView* frameView = m_frame->view(); |
854 FrameView* mainView = mainFrame->view(); | 854 FrameView* mainView = mainFrame->view(); |
855 if (frameView && mainView) { | 855 if (frameView && mainView) { |
856 IntPoint mainFramePoint = mainView->rootViewToContents(frameView
->contentsToRootView(roundedIntPoint(point))); | 856 IntPoint mainFramePoint = mainView->rootViewToContents(frameView
->contentsToRootView(roundedIntPoint(point))); |
857 return mainFrame->eventHandler().hitTestResultAtPoint(mainFrameP
oint, hitType, padding); | 857 return mainFrame->eventHandler().hitTestResultAtPoint(mainFrameP
oint, hitType, padding); |
858 } | 858 } |
859 } | 859 } |
860 } | 860 } |
861 | 861 |
862 HitTestResult result(point, padding.height(), padding.width(), padding.heigh
t(), padding.width()); | 862 HitTestResult result(point, padding.height(), padding.width(), padding.heigh
t(), padding.width()); |
(...skipping 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3245 { | 3245 { |
3246 ASSERT(event->type() == EventTypeNames::keydown); | 3246 ASSERT(event->type() == EventTypeNames::keydown); |
3247 | 3247 |
3248 if (event->ctrlKey() || event->metaKey() || event->altKey() || event->altGra
phKey()) | 3248 if (event->ctrlKey() || event->metaKey() || event->altKey() || event->altGra
phKey()) |
3249 return; | 3249 return; |
3250 | 3250 |
3251 if (!m_frame->editor().behavior().shouldNavigateBackOnBackspace()) | 3251 if (!m_frame->editor().behavior().shouldNavigateBackOnBackspace()) |
3252 return; | 3252 return; |
3253 | 3253 |
3254 Page* page = m_frame->page(); | 3254 Page* page = m_frame->page(); |
3255 if (!page) | 3255 if (!page || !page->mainFrame()->isLocalFrame()) |
3256 return; | 3256 return; |
3257 bool handledEvent = page->mainFrame()->loader().client()->navigateBackForwar
d(event->shiftKey() ? 1 : -1); | 3257 bool handledEvent = page->deprecatedLocalMainFrame()->loader().client()->nav
igateBackForward(event->shiftKey() ? 1 : -1); |
3258 if (handledEvent) | 3258 if (handledEvent) |
3259 event->setDefaultHandled(); | 3259 event->setDefaultHandled(); |
3260 } | 3260 } |
3261 | 3261 |
3262 void EventHandler::defaultArrowEventHandler(FocusType focusType, KeyboardEvent*
event) | 3262 void EventHandler::defaultArrowEventHandler(FocusType focusType, KeyboardEvent*
event) |
3263 { | 3263 { |
3264 ASSERT(event->type() == EventTypeNames::keydown); | 3264 ASSERT(event->type() == EventTypeNames::keydown); |
3265 | 3265 |
3266 if (event->ctrlKey() || event->metaKey() || event->altGraphKey() || event->s
hiftKey()) | 3266 if (event->ctrlKey() || event->metaKey() || event->altGraphKey() || event->s
hiftKey()) |
3267 return; | 3267 return; |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3764 unsigned EventHandler::accessKeyModifiers() | 3764 unsigned EventHandler::accessKeyModifiers() |
3765 { | 3765 { |
3766 #if OS(MACOSX) | 3766 #if OS(MACOSX) |
3767 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3767 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3768 #else | 3768 #else |
3769 return PlatformEvent::AltKey; | 3769 return PlatformEvent::AltKey; |
3770 #endif | 3770 #endif |
3771 } | 3771 } |
3772 | 3772 |
3773 } // namespace WebCore | 3773 } // namespace WebCore |
OLD | NEW |