Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/core/testing/DummyPageHolder.cpp

Issue 1397713004: Don't bother layout until first navigation is done. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move the check to Document::updateLayoutTree Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, 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 17 matching lines...) Expand all
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "core/testing/DummyPageHolder.h" 31 #include "core/testing/DummyPageHolder.h"
32 32
33 #include "core/frame/LocalDOMWindow.h" 33 #include "core/frame/LocalDOMWindow.h"
34 #include "core/frame/FrameView.h" 34 #include "core/frame/FrameView.h"
35 #include "core/frame/LocalFrame.h" 35 #include "core/frame/LocalFrame.h"
36 #include "core/frame/Settings.h" 36 #include "core/frame/Settings.h"
37 #include "core/loader/EmptyClients.h" 37 #include "core/loader/EmptyClients.h"
38 #include "core/loader/FrameLoaderStateMachine.h"
38 #include "wtf/Assertions.h" 39 #include "wtf/Assertions.h"
39 40
40 namespace blink { 41 namespace blink {
41 42
42 void RootLayerScrollsFrameSettingOverride(Settings& settings) 43 void RootLayerScrollsFrameSettingOverride(Settings& settings)
43 { 44 {
44 settings.setRootLayerScrolls(true); 45 settings.setRootLayerScrolls(true);
45 } 46 }
46 47
47 PassOwnPtr<DummyPageHolder> DummyPageHolder::create( 48 PassOwnPtr<DummyPageHolder> DummyPageHolder::create(
(...skipping 28 matching lines...) Expand all
76 if (settingOverrider) 77 if (settingOverrider)
77 (*settingOverrider)(settings); 78 (*settingOverrider)(settings);
78 79
79 m_frameLoaderClient = frameLoaderClient; 80 m_frameLoaderClient = frameLoaderClient;
80 if (!m_frameLoaderClient) 81 if (!m_frameLoaderClient)
81 m_frameLoaderClient = EmptyFrameLoaderClient::create(); 82 m_frameLoaderClient = EmptyFrameLoaderClient::create();
82 83
83 m_frame = LocalFrame::create(m_frameLoaderClient.get(), &m_page->frameHost() , 0); 84 m_frame = LocalFrame::create(m_frameLoaderClient.get(), &m_page->frameHost() , 0);
84 m_frame->setView(FrameView::create(m_frame.get(), initialViewSize)); 85 m_frame->setView(FrameView::create(m_frame.get(), initialViewSize));
85 m_frame->init(); 86 m_frame->init();
87 // Some tests directly inject content into the initial empty document.
88 // Unmark it so that unforced layout would also run on the document.
89 m_frame->loader().stateMachine()->advanceTo(FrameLoaderStateMachine::Committ edFirstRealLoad);
86 } 90 }
87 91
88 DummyPageHolder::~DummyPageHolder() 92 DummyPageHolder::~DummyPageHolder()
89 { 93 {
90 m_page->willBeDestroyed(); 94 m_page->willBeDestroyed();
91 m_page.clear(); 95 m_page.clear();
92 m_frame.clear(); 96 m_frame.clear();
93 } 97 }
94 98
95 Page& DummyPageHolder::page() const 99 Page& DummyPageHolder::page() const
(...skipping 11 matching lines...) Expand all
107 { 111 {
108 return *m_frame->view(); 112 return *m_frame->view();
109 } 113 }
110 114
111 Document& DummyPageHolder::document() const 115 Document& DummyPageHolder::document() const
112 { 116 {
113 return *m_frame->domWindow()->document(); 117 return *m_frame->domWindow()->document();
114 } 118 }
115 119
116 } // namespace blink 120 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698