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

Side by Side Diff: third_party/WebKit/Source/core/editing/EditingTestBase.cpp

Issue 1740173003: TextIteratorAlgorithm should not force layout update in constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed my WIP comment. Created 4 years, 9 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/editing/EditingTestBase.h" 5 #include "core/editing/EditingTestBase.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/Range.h" 8 #include "core/dom/Range.h"
9 #include "core/dom/Text.h" 9 #include "core/dom/Text.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
(...skipping 17 matching lines...) Expand all
28 28
29 void EditingTestBase::SetUp() 29 void EditingTestBase::SetUp()
30 { 30 {
31 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); 31 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
32 } 32 }
33 33
34 PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::createShadowRootForElementWi thIDAndSetInnerHTML(TreeScope& scope, const char* hostElementID, const char* sha dowRootContent) 34 PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::createShadowRootForElementWi thIDAndSetInnerHTML(TreeScope& scope, const char* hostElementID, const char* sha dowRootContent)
35 { 35 {
36 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = scope.getElementById(AtomicStrin g::fromUTF8(hostElementID))->createShadowRootInternal(ShadowRootType::V0, ASSERT _NO_EXCEPTION); 36 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = scope.getElementById(AtomicStrin g::fromUTF8(hostElementID))->createShadowRootInternal(ShadowRootType::V0, ASSERT _NO_EXCEPTION);
37 shadowRoot->setInnerHTML(String::fromUTF8(shadowRootContent), ASSERT_NO_EXCE PTION); 37 shadowRoot->setInnerHTML(String::fromUTF8(shadowRootContent), ASSERT_NO_EXCE PTION);
38 scope.document().view()->updateAllLifecyclePhases();
38 return shadowRoot.release(); 39 return shadowRoot.release();
39 } 40 }
40 41
41 void EditingTestBase::setBodyContent(const char* bodyContent) 42 void EditingTestBase::setBodyContent(const char* bodyContent)
42 { 43 {
43 document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXC EPTION); 44 document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXC EPTION);
45 updateLayoutAndStyleForPainting();
44 } 46 }
45 47
46 PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::setShadowContent(const char* shadowContent, const char* host) 48 PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::setShadowContent(const char* shadowContent, const char* host)
47 { 49 {
48 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithID AndSetInnerHTML(document(), host, shadowContent); 50 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithID AndSetInnerHTML(document(), host, shadowContent);
49 document().updateDistribution(); 51 updateLayoutAndStyleForPainting();
50 return shadowRoot.release(); 52 return shadowRoot.release();
51 } 53 }
52 54
53 void EditingTestBase::updateLayoutAndStyleForPainting() 55 void EditingTestBase::updateLayoutAndStyleForPainting()
54 { 56 {
55 document().view()->updateAllLifecyclePhases(); 57 document().view()->updateAllLifecyclePhases();
56 } 58 }
57 59
58 } // namespace blink 60 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/core/editing/PlainTextRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698