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

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

Issue 1762993002: Revert of TextIteratorAlgorithm should not force layout update in constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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();
39 return shadowRoot.release(); 38 return shadowRoot.release();
40 } 39 }
41 40
42 void EditingTestBase::setBodyContent(const char* bodyContent) 41 void EditingTestBase::setBodyContent(const char* bodyContent)
43 { 42 {
44 document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXC EPTION); 43 document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXC EPTION);
45 updateLayoutAndStyleForPainting();
46 } 44 }
47 45
48 PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::setShadowContent(const char* shadowContent, const char* host) 46 PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::setShadowContent(const char* shadowContent, const char* host)
49 { 47 {
50 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithID AndSetInnerHTML(document(), host, shadowContent); 48 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithID AndSetInnerHTML(document(), host, shadowContent);
51 updateLayoutAndStyleForPainting(); 49 document().updateDistribution();
52 return shadowRoot.release(); 50 return shadowRoot.release();
53 } 51 }
54 52
55 void EditingTestBase::updateLayoutAndStyleForPainting() 53 void EditingTestBase::updateLayoutAndStyleForPainting()
56 { 54 {
57 document().view()->updateAllLifecyclePhases(); 55 document().view()->updateAllLifecyclePhases();
58 } 56 }
59 57
60 } // namespace blink 58 } // 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