| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1365 scheduleVisualUpdate(); | 1365 scheduleVisualUpdate(); |
| 1366 } | 1366 } |
| 1367 | 1367 |
| 1368 void FrameSelection::focusedOrActiveStateChanged() | 1368 void FrameSelection::focusedOrActiveStateChanged() |
| 1369 { | 1369 { |
| 1370 bool activeAndFocused = isFocusedAndActive(); | 1370 bool activeAndFocused = isFocusedAndActive(); |
| 1371 | 1371 |
| 1372 RefPtr<Document> document = m_frame->document(); | 1372 RefPtr<Document> document = m_frame->document(); |
| 1373 document->updateRenderTreeIfNeeded(); | 1373 document->updateRenderTreeIfNeeded(); |
| 1374 | 1374 |
| 1375 // Because RenderObject::selectionBackgroundColor() and | |
| 1376 // RenderObject::selectionForegroundColor() check if the frame is active, | |
| 1377 // we have to update places those colors were painted. | |
| 1378 if (RenderView* view = document->renderView()) | |
| 1379 view->invalidatePaintForSelection(); | |
| 1380 | |
| 1381 // Caret appears in the active frame. | 1375 // Caret appears in the active frame. |
| 1382 if (activeAndFocused) | 1376 if (activeAndFocused) |
| 1383 setSelectionFromNone(); | 1377 setSelectionFromNone(); |
| 1384 else | 1378 else |
| 1385 m_frame->spellChecker().spellCheckAfterBlur(); | 1379 m_frame->spellChecker().spellCheckAfterBlur(); |
| 1386 setCaretVisibility(activeAndFocused ? Visible : Hidden); | 1380 setCaretVisibility(activeAndFocused ? Visible : Hidden); |
| 1387 | 1381 |
| 1388 // Update for caps lock state | 1382 // Update for caps lock state |
| 1389 m_frame->eventHandler().capsLockStateMayHaveChanged(); | 1383 m_frame->eventHandler().capsLockStateMayHaveChanged(); |
| 1390 | 1384 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 sel.showTreeForThis(); | 1710 sel.showTreeForThis(); |
| 1717 } | 1711 } |
| 1718 | 1712 |
| 1719 void showTree(const blink::FrameSelection* sel) | 1713 void showTree(const blink::FrameSelection* sel) |
| 1720 { | 1714 { |
| 1721 if (sel) | 1715 if (sel) |
| 1722 sel->showTreeForThis(); | 1716 sel->showTreeForThis(); |
| 1723 } | 1717 } |
| 1724 | 1718 |
| 1725 #endif | 1719 #endif |
| OLD | NEW |