| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |