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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 } | 718 } |
719 | 719 |
720 void FocusController::setActive(bool active) | 720 void FocusController::setActive(bool active) |
721 { | 721 { |
722 if (m_isActive == active) | 722 if (m_isActive == active) |
723 return; | 723 return; |
724 | 724 |
725 m_isActive = active; | 725 m_isActive = active; |
726 | 726 |
727 Frame* frame = focusedOrMainFrame(); | 727 Frame* frame = focusedOrMainFrame(); |
728 if (frame->isLocalFrame()) | 728 if (frame->isLocalFrame()) { |
| 729 // Invalidate all custom scrollbars because they support the CSS |
| 730 // window-active attribute. This should be applied to the entire page so |
| 731 // we invalidate from the root FrameView instead of just the focused. |
| 732 if (FrameView* view = toLocalFrame(frame)->localFrameRoot()->document()-
>view()) |
| 733 view->invalidateAllCustomScrollbarsOnActiveChanged(); |
729 toLocalFrame(frame)->selection().pageActivationChanged(); | 734 toLocalFrame(frame)->selection().pageActivationChanged(); |
| 735 } |
730 } | 736 } |
731 | 737 |
732 static void updateFocusCandidateIfNeeded(FocusType type, const FocusCandidate& c
urrent, FocusCandidate& candidate, FocusCandidate& closest) | 738 static void updateFocusCandidateIfNeeded(FocusType type, const FocusCandidate& c
urrent, FocusCandidate& candidate, FocusCandidate& closest) |
733 { | 739 { |
734 ASSERT(candidate.visibleNode->isElementNode()); | 740 ASSERT(candidate.visibleNode->isElementNode()); |
735 ASSERT(candidate.visibleNode->renderer()); | 741 ASSERT(candidate.visibleNode->renderer()); |
736 | 742 |
737 // Ignore iframes that don't have a src attribute | 743 // Ignore iframes that don't have a src attribute |
738 if (frameOwnerElement(candidate) && (!frameOwnerElement(candidate)->contentF
rame() || candidate.rect.isEmpty())) | 744 if (frameOwnerElement(candidate) && (!frameOwnerElement(candidate)->contentF
rame() || candidate.rect.isEmpty())) |
739 return; | 745 return; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 return consumed; | 928 return consumed; |
923 } | 929 } |
924 | 930 |
925 void FocusController::trace(Visitor* visitor) | 931 void FocusController::trace(Visitor* visitor) |
926 { | 932 { |
927 visitor->trace(m_page); | 933 visitor->trace(m_page); |
928 visitor->trace(m_focusedFrame); | 934 visitor->trace(m_focusedFrame); |
929 } | 935 } |
930 | 936 |
931 } // namespace blink | 937 } // namespace blink |
OLD | NEW |