| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/editing/EditingTestBase.h" | 6 #include "core/editing/EditingTestBase.h" |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/Range.h" | 9 #include "core/dom/Range.h" |
| 10 #include "core/dom/Text.h" | 10 #include "core/dom/Text.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = scope.getElementById(AtomicStrin
g::fromUTF8(hostElementID))->createShadowRoot(ASSERT_NO_EXCEPTION); | 37 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = scope.getElementById(AtomicStrin
g::fromUTF8(hostElementID))->createShadowRoot(ASSERT_NO_EXCEPTION); |
| 38 shadowRoot->setInnerHTML(String::fromUTF8(shadowRootContent), ASSERT_NO_EXCE
PTION); | 38 shadowRoot->setInnerHTML(String::fromUTF8(shadowRootContent), ASSERT_NO_EXCE
PTION); |
| 39 return shadowRoot.release(); | 39 return shadowRoot.release(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void EditingTestBase::setBodyContent(const char* bodyContent) | 42 void EditingTestBase::setBodyContent(const char* bodyContent) |
| 43 { | 43 { |
| 44 document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXC
EPTION); | 44 document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXC
EPTION); |
| 45 } | 45 } |
| 46 | 46 |
| 47 PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::setShadowContent(const char*
shadowContent) | 47 PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::setShadowContent(const char*
shadowContent, const char* host) |
| 48 { | 48 { |
| 49 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithID
AndSetInnerHTML(document(), "host", shadowContent); | 49 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithID
AndSetInnerHTML(document(), host, shadowContent); |
| 50 document().recalcDistribution(); | 50 document().recalcDistribution(); |
| 51 return shadowRoot.release(); | 51 return shadowRoot.release(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void EditingTestBase::updateLayoutAndStyleForPainting() | 54 void EditingTestBase::updateLayoutAndStyleForPainting() |
| 55 { | 55 { |
| 56 document().view()->updateLayoutAndStyleForPainting(); | 56 document().view()->updateLayoutAndStyleForPainting(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 Position EditingTestBase::positionInDOMTree(Node& anchor, int offset) | 59 Position EditingTestBase::positionInDOMTree(Node& anchor, int offset) |
| 60 { | 60 { |
| 61 return Position(&anchor, offset, Position::PositionIsOffsetInAnchor); | 61 return Position(&anchor, offset, Position::PositionIsOffsetInAnchor); |
| 62 } | 62 } |
| 63 | 63 |
| 64 PositionInComposedTree EditingTestBase::positionInComposedTree(Node& anchor, int
offset) | 64 PositionInComposedTree EditingTestBase::positionInComposedTree(Node& anchor, int
offset) |
| 65 { | 65 { |
| 66 return PositionInComposedTree(&anchor, offset, PositionInComposedTree::Posit
ionIsOffsetInAnchor); | 66 return PositionInComposedTree(&anchor, offset, PositionInComposedTree::Posit
ionIsOffsetInAnchor); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace blink | 69 } // namespace blink |
| OLD | NEW |