| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 313 } |
| 314 | 314 |
| 315 bool FocusController::advanceFocusInDocumentOrder(FocusType type, bool initialFo
cus) | 315 bool FocusController::advanceFocusInDocumentOrder(FocusType type, bool initialFo
cus) |
| 316 { | 316 { |
| 317 LocalFrame* frame = focusedOrMainFrame(); | 317 LocalFrame* frame = focusedOrMainFrame(); |
| 318 ASSERT(frame); | 318 ASSERT(frame); |
| 319 Document* document = frame->document(); | 319 Document* document = frame->document(); |
| 320 | 320 |
| 321 Node* currentNode = document->focusedElement(); | 321 Node* currentNode = document->focusedElement(); |
| 322 | 322 |
| 323 document->updateLayoutIgnorePendingStylesheets(); | 323 document->updateLayout(); |
| 324 | 324 |
| 325 RefPtr<Node> node = findFocusableNodeAcrossFocusScope(type, FocusNavigationS
cope::focusNavigationScopeOf(currentNode ? currentNode : document), currentNode)
; | 325 RefPtr<Node> node = findFocusableNodeAcrossFocusScope(type, FocusNavigationS
cope::focusNavigationScopeOf(currentNode ? currentNode : document), currentNode)
; |
| 326 | 326 |
| 327 if (!node) { | 327 if (!node) { |
| 328 // We didn't find a node to focus, so we should try to pass focus to Chr
ome. | 328 // We didn't find a node to focus, so we should try to pass focus to Chr
ome. |
| 329 if (!initialFocus && m_page->chrome().canTakeFocus(type)) { | 329 if (!initialFocus && m_page->chrome().canTakeFocus(type)) { |
| 330 document->setFocusedElement(nullptr); | 330 document->setFocusedElement(nullptr); |
| 331 setFocusedFrame(nullptr); | 331 setFocusedFrame(nullptr); |
| 332 m_page->chrome().takeFocus(type); | 332 m_page->chrome().takeFocus(type); |
| 333 return true; | 333 return true; |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 { | 589 { |
| 590 if (m_isActive == active) | 590 if (m_isActive == active) |
| 591 return; | 591 return; |
| 592 | 592 |
| 593 m_isActive = active; | 593 m_isActive = active; |
| 594 | 594 |
| 595 focusedOrMainFrame()->selection().pageActivationChanged(); | 595 focusedOrMainFrame()->selection().pageActivationChanged(); |
| 596 } | 596 } |
| 597 | 597 |
| 598 } // namespace blink | 598 } // namespace blink |
| OLD | NEW |