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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 } | 368 } |
369 | 369 |
370 void EventHandler::nodeWillBeRemoved(Node* nodeToBeRemoved) | 370 void EventHandler::nodeWillBeRemoved(Node* nodeToBeRemoved) |
371 { | 371 { |
372 if (nodeToBeRemoved->contains(m_clickNode.get())) | 372 if (nodeToBeRemoved->contains(m_clickNode.get())) |
373 m_clickNode = 0; | 373 m_clickNode = 0; |
374 } | 374 } |
375 | 375 |
376 static void setSelectionIfNeeded(FrameSelection& selection, const VisibleSelecti
on& newSelection) | 376 static void setSelectionIfNeeded(FrameSelection& selection, const VisibleSelecti
on& newSelection) |
377 { | 377 { |
378 if (selection.selection() != newSelection && selection.shouldChangeSelection
(newSelection)) | 378 if (selection.selection() != newSelection) |
379 selection.setSelection(newSelection); | 379 selection.setSelection(newSelection); |
380 } | 380 } |
381 | 381 |
382 static inline bool dispatchSelectStart(Node* node) | 382 static inline bool dispatchSelectStart(Node* node) |
383 { | 383 { |
384 if (!node || !node->renderer()) | 384 if (!node || !node->renderer()) |
385 return true; | 385 return true; |
386 | 386 |
387 return node->dispatchEvent(Event::createCancelableBubble(EventNames::selects
tart)); | 387 return node->dispatchEvent(Event::createCancelableBubble(EventNames::selects
tart)); |
388 } | 388 } |
(...skipping 3437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3826 { | 3826 { |
3827 // If we're clicking into a frame that is selected, the frame will appear | 3827 // If we're clicking into a frame that is selected, the frame will appear |
3828 // greyed out even though we're clicking on the selection. This looks | 3828 // greyed out even though we're clicking on the selection. This looks |
3829 // really strange (having the whole frame be greyed out), so we deselect the | 3829 // really strange (having the whole frame be greyed out), so we deselect the |
3830 // selection. | 3830 // selection. |
3831 IntPoint p = m_frame->view()->windowToContents(mev.event().position()); | 3831 IntPoint p = m_frame->view()->windowToContents(mev.event().position()); |
3832 if (m_frame->selection().contains(p)) { | 3832 if (m_frame->selection().contains(p)) { |
3833 VisiblePosition visiblePos( | 3833 VisiblePosition visiblePos( |
3834 mev.targetNode()->renderer()->positionForPoint(mev.localPoint())); | 3834 mev.targetNode()->renderer()->positionForPoint(mev.localPoint())); |
3835 VisibleSelection newSelection(visiblePos); | 3835 VisibleSelection newSelection(visiblePos); |
3836 if (m_frame->selection().shouldChangeSelection(newSelection)) | 3836 m_frame->selection().setSelection(newSelection); |
3837 m_frame->selection().setSelection(newSelection); | |
3838 } | 3837 } |
3839 | 3838 |
3840 subframe->eventHandler()->handleMousePressEvent(mev.event()); | 3839 subframe->eventHandler()->handleMousePressEvent(mev.event()); |
3841 return true; | 3840 return true; |
3842 } | 3841 } |
3843 | 3842 |
3844 bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& me
v, Frame* subframe, HitTestResult* hoveredNode) | 3843 bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& me
v, Frame* subframe, HitTestResult* hoveredNode) |
3845 { | 3844 { |
3846 if (m_mouseDownMayStartDrag && !m_mouseDownWasInSubframe) | 3845 if (m_mouseDownMayStartDrag && !m_mouseDownWasInSubframe) |
3847 return false; | 3846 return false; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3894 unsigned EventHandler::accessKeyModifiers() | 3893 unsigned EventHandler::accessKeyModifiers() |
3895 { | 3894 { |
3896 #if OS(MACOSX) | 3895 #if OS(MACOSX) |
3897 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3896 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3898 #else | 3897 #else |
3899 return PlatformEvent::AltKey; | 3898 return PlatformEvent::AltKey; |
3900 #endif | 3899 #endif |
3901 } | 3900 } |
3902 | 3901 |
3903 } // namespace WebCore | 3902 } // namespace WebCore |
OLD | NEW |