Chromium Code Reviews| 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 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 902 { | 902 { |
| 903 bool activeAndFocused = isFocusedAndActive(); | 903 bool activeAndFocused = isFocusedAndActive(); |
| 904 RefPtrWillBeRawPtr<Document> document = m_frame->document(); | 904 RefPtrWillBeRawPtr<Document> document = m_frame->document(); |
| 905 | 905 |
| 906 // Trigger style invalidation from the focused element. Even though | 906 // Trigger style invalidation from the focused element. Even though |
| 907 // the focused element hasn't changed, the evaluation of focus pseudo | 907 // the focused element hasn't changed, the evaluation of focus pseudo |
| 908 // selectors are dependent on whether the frame is focused and active. | 908 // selectors are dependent on whether the frame is focused and active. |
| 909 if (Element* element = document->focusedElement()) | 909 if (Element* element = document->focusedElement()) |
| 910 element->focusStateChanged(); | 910 element->focusStateChanged(); |
| 911 | 911 |
| 912 document->updateLayoutTreeIfNeeded(); | 912 if (!document->isInitialEmptyDocument()) |
|
tkent
2016/01/21 02:19:32
Can you move isInitialEmptyDocument() check to Doc
kouhei (in TOK)
2016/02/18 03:50:49
Done.
| |
| 913 document->updateLayoutTreeIfNeeded(); | |
| 913 | 914 |
| 914 // Because LayoutObject::selectionBackgroundColor() and | 915 // Because LayoutObject::selectionBackgroundColor() and |
| 915 // LayoutObject::selectionForegroundColor() check if the frame is active, | 916 // LayoutObject::selectionForegroundColor() check if the frame is active, |
| 916 // we have to update places those colors were painted. | 917 // we have to update places those colors were painted. |
| 917 if (LayoutView* view = document->layoutView()) | 918 if (LayoutView* view = document->layoutView()) |
| 918 view->invalidatePaintForSelection(); | 919 view->invalidatePaintForSelection(); |
| 919 | 920 |
| 920 // Caret appears in the active frame. | 921 // Caret appears in the active frame. |
| 921 if (activeAndFocused) | 922 if (activeAndFocused) |
| 922 setSelectionFromNone(); | 923 setSelectionFromNone(); |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1405 | 1406 |
| 1406 void showTree(const blink::FrameSelection* sel) | 1407 void showTree(const blink::FrameSelection* sel) |
| 1407 { | 1408 { |
| 1408 if (sel) | 1409 if (sel) |
| 1409 sel->showTreeForThis(); | 1410 sel->showTreeForThis(); |
| 1410 else | 1411 else |
| 1411 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1412 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 1412 } | 1413 } |
| 1413 | 1414 |
| 1414 #endif | 1415 #endif |
| OLD | NEW |