| 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(); |
| 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 |
| OLD | NEW |