OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1685 if (this != mainFrameImpl->activeMatchFrame()) | 1685 if (this != mainFrameImpl->activeMatchFrame()) |
1686 return; | 1686 return; |
1687 | 1687 |
1688 if (Range* activeMatch = m_textFinder->activeMatch()) { | 1688 if (Range* activeMatch = m_textFinder->activeMatch()) { |
1689 // If the user has set the selection since the match was found, we | 1689 // If the user has set the selection since the match was found, we |
1690 // don't focus anything. | 1690 // don't focus anything. |
1691 VisibleSelection selection(frame()->selection().selection()); | 1691 VisibleSelection selection(frame()->selection().selection()); |
1692 if (!selection.isNone()) | 1692 if (!selection.isNone()) |
1693 return; | 1693 return; |
1694 | 1694 |
| 1695 // Need to clean out style and layout state before querying Element::isF
ocusable(). |
| 1696 frame()->document()->updateLayoutIgnorePendingStylesheets(); |
| 1697 |
1695 // Try to find the first focusable node up the chain, which will, for | 1698 // Try to find the first focusable node up the chain, which will, for |
1696 // example, focus links if we have found text within the link. | 1699 // example, focus links if we have found text within the link. |
1697 Node* node = activeMatch->firstNode(); | 1700 Node* node = activeMatch->firstNode(); |
1698 if (node && node->isInShadowTree()) { | 1701 if (node && node->isInShadowTree()) { |
1699 if (Node* host = node->shadowHost()) { | 1702 if (Node* host = node->shadowHost()) { |
1700 if (isHTMLInputElement(*host) || isHTMLTextAreaElement(*host)) | 1703 if (isHTMLInputElement(*host) || isHTMLTextAreaElement(*host)) |
1701 node = host; | 1704 node = host; |
1702 } | 1705 } |
1703 } | 1706 } |
1704 for (; node; node = node->parentNode()) { | 1707 for (; node; node = node->parentNode()) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1861 | 1864 |
1862 void WebLocalFrameImpl::invalidateAll() const | 1865 void WebLocalFrameImpl::invalidateAll() const |
1863 { | 1866 { |
1864 ASSERT(frame() && frame()->view()); | 1867 ASSERT(frame() && frame()->view()); |
1865 FrameView* view = frame()->view(); | 1868 FrameView* view = frame()->view(); |
1866 view->invalidateRect(view->frameRect()); | 1869 view->invalidateRect(view->frameRect()); |
1867 invalidateScrollbar(); | 1870 invalidateScrollbar(); |
1868 } | 1871 } |
1869 | 1872 |
1870 } // namespace blink | 1873 } // namespace blink |
OLD | NEW |