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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 | 739 |
740 if (&newDocument != document) { | 740 if (&newDocument != document) { |
741 // Focus is going away from this document, so clear the focused node. | 741 // Focus is going away from this document, so clear the focused node. |
742 document->setFocusedElement(nullptr); | 742 document->setFocusedElement(nullptr); |
743 } | 743 } |
744 | 744 |
745 setFocusedFrame(newDocument.frame()); | 745 setFocusedFrame(newDocument.frame()); |
746 | 746 |
747 if (caretBrowsing) { | 747 if (caretBrowsing) { |
748 Position position = firstPositionInOrBeforeNode(element.get()); | 748 Position position = firstPositionInOrBeforeNode(element.get()); |
749 VisibleSelection newSelection(position, position, DOWNSTREAM); | 749 VisibleSelection newSelection(position, position); |
750 frame->selection().setSelection(newSelection); | 750 frame->selection().setSelection(newSelection); |
751 } | 751 } |
752 | 752 |
753 element->focus(false, type, sourceCapabilities); | 753 element->focus(false, type, sourceCapabilities); |
754 return true; | 754 return true; |
755 } | 755 } |
756 | 756 |
757 Element* FocusController::findFocusableElement(WebFocusType type, Node& node) | 757 Element* FocusController::findFocusableElement(WebFocusType type, Node& node) |
758 { | 758 { |
759 // FIXME: No spacial navigation code yet. | 759 // FIXME: No spacial navigation code yet. |
(...skipping 289 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 |