| 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 return advanceFocusInDocumentOrder(to, start, type, false, sourceCapabilitie
s); | 738 return advanceFocusInDocumentOrder(to, start, type, false, sourceCapabilitie
s); |
| 739 } | 739 } |
| 740 | 740 |
| 741 bool FocusController::advanceFocusInDocumentOrder(LocalFrame* frame, Element* st
art, WebFocusType type, bool initialFocus, InputDeviceCapabilities* sourceCapabi
lities) | 741 bool FocusController::advanceFocusInDocumentOrder(LocalFrame* frame, Element* st
art, WebFocusType type, bool initialFocus, InputDeviceCapabilities* sourceCapabi
lities) |
| 742 { | 742 { |
| 743 ASSERT(frame); | 743 ASSERT(frame); |
| 744 Document* document = frame->document(); | 744 Document* document = frame->document(); |
| 745 ASSERT(document->documentElement()); | 745 ASSERT(document->documentElement()); |
| 746 | 746 |
| 747 Element* current = start; | 747 Element* current = start; |
| 748 if (!current) | 748 if (!current && !initialFocus) |
| 749 current = document->sequentialFocusNavigationStartingPoint(type); | 749 current = document->sequentialFocusNavigationStartingPoint(type); |
| 750 | 750 |
| 751 // FIXME: Not quite correct when it comes to focus transitions leaving/enter
ing the WebView itself | 751 // FIXME: Not quite correct when it comes to focus transitions leaving/enter
ing the WebView itself |
| 752 bool caretBrowsing = frame->settings() && frame->settings()->caretBrowsingEn
abled(); | 752 bool caretBrowsing = frame->settings() && frame->settings()->caretBrowsingEn
abled(); |
| 753 | 753 |
| 754 if (caretBrowsing && !current) | 754 if (caretBrowsing && !current) |
| 755 current = adjustToElement(frame->selection().start().anchorNode(), type)
; | 755 current = adjustToElement(frame->selection().start().anchorNode(), type)
; |
| 756 | 756 |
| 757 document->updateLayoutIgnorePendingStylesheets(); | 757 document->updateLayoutIgnorePendingStylesheets(); |
| 758 | 758 |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 return consumed; | 1140 return consumed; |
| 1141 } | 1141 } |
| 1142 | 1142 |
| 1143 DEFINE_TRACE(FocusController) | 1143 DEFINE_TRACE(FocusController) |
| 1144 { | 1144 { |
| 1145 visitor->trace(m_page); | 1145 visitor->trace(m_page); |
| 1146 visitor->trace(m_focusedFrame); | 1146 visitor->trace(m_focusedFrame); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 } // namespace blink | 1149 } // namespace blink |
| OLD | NEW |