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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 setFocusedFrame(frame); | 300 setFocusedFrame(frame); |
301 } | 301 } |
302 | 302 |
303 Frame* FocusController::focusedOrMainFrame() const | 303 Frame* FocusController::focusedOrMainFrame() const |
304 { | 304 { |
305 if (Frame* frame = focusedFrame()) | 305 if (Frame* frame = focusedFrame()) |
306 return frame; | 306 return frame; |
| 307 |
| 308 for (Frame* frame = m_page->mainFrame()->tree().top(); frame; frame = frame-
>tree().traverseNext()) { |
| 309 if (frame->isLocalRoot()) |
| 310 return frame; |
| 311 } |
| 312 |
307 return m_page->mainFrame(); | 313 return m_page->mainFrame(); |
308 } | 314 } |
309 | 315 |
310 void FocusController::setFocused(bool focused) | 316 void FocusController::setFocused(bool focused) |
311 { | 317 { |
312 if (isFocused() == focused) | 318 if (isFocused() == focused) |
313 return; | 319 return; |
314 | 320 |
315 m_isFocused = focused; | 321 m_isFocused = focused; |
316 | 322 |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 if (m_isActive == active) | 726 if (m_isActive == active) |
721 return; | 727 return; |
722 | 728 |
723 m_isActive = active; | 729 m_isActive = active; |
724 | 730 |
725 if (m_page->mainFrame()->isLocalFrame()) { | 731 if (m_page->mainFrame()->isLocalFrame()) { |
726 if (FrameView* view = m_page->deprecatedLocalMainFrame()->view()) | 732 if (FrameView* view = m_page->deprecatedLocalMainFrame()->view()) |
727 view->updateControlTints(); | 733 view->updateControlTints(); |
728 } | 734 } |
729 | 735 |
730 toLocalFrame(focusedOrMainFrame())->selection().pageActivationChanged(); | 736 Frame* frame = focusedOrMainFrame(); |
| 737 if (frame->isLocalFrame()) |
| 738 toLocalFrame(frame)->selection().pageActivationChanged(); |
731 } | 739 } |
732 | 740 |
733 static void updateFocusCandidateIfNeeded(FocusType type, const FocusCandidate& c
urrent, FocusCandidate& candidate, FocusCandidate& closest) | 741 static void updateFocusCandidateIfNeeded(FocusType type, const FocusCandidate& c
urrent, FocusCandidate& candidate, FocusCandidate& closest) |
734 { | 742 { |
735 ASSERT(candidate.visibleNode->isElementNode()); | 743 ASSERT(candidate.visibleNode->isElementNode()); |
736 ASSERT(candidate.visibleNode->renderer()); | 744 ASSERT(candidate.visibleNode->renderer()); |
737 | 745 |
738 // Ignore iframes that don't have a src attribute | 746 // Ignore iframes that don't have a src attribute |
739 if (frameOwnerElement(candidate) && (!frameOwnerElement(candidate)->contentF
rame() || candidate.rect.isEmpty())) | 747 if (frameOwnerElement(candidate) && (!frameOwnerElement(candidate)->contentF
rame() || candidate.rect.isEmpty())) |
740 return; | 748 return; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b
order */); | 925 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b
order */); |
918 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type,
container); | 926 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type,
container); |
919 if (container && container->isDocumentNode()) | 927 if (container && container->isDocumentNode()) |
920 toDocument(container)->updateLayoutIgnorePendingStylesheets(); | 928 toDocument(container)->updateLayoutIgnorePendingStylesheets(); |
921 } while (!consumed && container); | 929 } while (!consumed && container); |
922 | 930 |
923 return consumed; | 931 return consumed; |
924 } | 932 } |
925 | 933 |
926 } // namespace WebCore | 934 } // namespace WebCore |
OLD | NEW |