OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nuanti Ltd. | 3 * Copyright (C) 2008 Nuanti Ltd. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 return; | 792 return; |
793 | 793 |
794 if (selectionStartNode->isInShadowTree() && selectionStartNode->shadowHost()
== newFocusedElement) | 794 if (selectionStartNode->isInShadowTree() && selectionStartNode->shadowHost()
== newFocusedElement) |
795 return; | 795 return; |
796 | 796 |
797 selection.clear(); | 797 selection.clear(); |
798 } | 798 } |
799 | 799 |
800 bool FocusController::setFocusedElement(Element* element, PassRefPtrWillBeRawPtr
<Frame> newFocusedFrame, WebFocusType type, InputDeviceCapabilities* sourceCapab
ilities) | 800 bool FocusController::setFocusedElement(Element* element, PassRefPtrWillBeRawPtr
<Frame> newFocusedFrame, WebFocusType type, InputDeviceCapabilities* sourceCapab
ilities) |
801 { | 801 { |
802 RefPtrWillBeRawPtr<LocalFrame> oldFocusedFrame = toLocalFrame(focusedFrame()
); | 802 RefPtrWillBeRawPtr<LocalFrame> oldFocusedFrame = focusedFrame() && focusedFr
ame()->isLocalFrame() ? toLocalFrame(focusedFrame()) : nullptr; |
803 RefPtrWillBeRawPtr<Document> oldDocument = oldFocusedFrame ? oldFocusedFrame
->document() : nullptr; | 803 RefPtrWillBeRawPtr<Document> oldDocument = oldFocusedFrame ? oldFocusedFrame
->document() : nullptr; |
804 | 804 |
805 Element* oldFocusedElement = oldDocument ? oldDocument->focusedElement() : n
ullptr; | 805 Element* oldFocusedElement = oldDocument ? oldDocument->focusedElement() : n
ullptr; |
806 if (element && oldFocusedElement == element) | 806 if (element && oldFocusedElement == element) |
807 return true; | 807 return true; |
808 | 808 |
809 // FIXME: Might want to disable this check for caretBrowsing | 809 // FIXME: Might want to disable this check for caretBrowsing |
810 if (oldFocusedElement && oldFocusedElement->isRootEditableElement() && !reli
nquishesEditingFocus(*oldFocusedElement)) | 810 if (oldFocusedElement && oldFocusedElement->isRootEditableElement() && !reli
nquishesEditingFocus(*oldFocusedElement)) |
811 return false; | 811 return false; |
812 | 812 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 return consumed; | 1049 return consumed; |
1050 } | 1050 } |
1051 | 1051 |
1052 DEFINE_TRACE(FocusController) | 1052 DEFINE_TRACE(FocusController) |
1053 { | 1053 { |
1054 visitor->trace(m_page); | 1054 visitor->trace(m_page); |
1055 visitor->trace(m_focusedFrame); | 1055 visitor->trace(m_focusedFrame); |
1056 } | 1056 } |
1057 | 1057 |
1058 } // namespace blink | 1058 } // namespace blink |
OLD | NEW |