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

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

Issue 1202263004: Use EditingTestBase for PositionTest (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/PositionTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 27 matching lines...) Expand all
38 return shadowRoot.release(); 38 return shadowRoot.release();
39 } 39 }
40 40
41 void EditingTestBase::setBodyContent(const char* bodyContent) 41 void EditingTestBase::setBodyContent(const char* bodyContent)
42 { 42 {
43 document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXC EPTION); 43 document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXC EPTION);
44 } 44 }
45 45
46 PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::setShadowContent(const char* shadowContent) 46 PassRefPtrWillBeRawPtr<ShadowRoot> EditingTestBase::setShadowContent(const char* shadowContent)
47 { 47 {
48 return createShadowRootForElementWithIDAndSetInnerHTML(document(), "host", s hadowContent); 48 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootForElementWithID AndSetInnerHTML(document(), "host", shadowContent);
49 document().recalcDistribution();
50 return shadowRoot.release();
49 } 51 }
50 52
51 Position EditingTestBase::positionInDOMTree(Node& anchor, int offset) 53 Position EditingTestBase::positionInDOMTree(Node& anchor, int offset)
52 { 54 {
53 return Position(&anchor, offset, Position::PositionIsOffsetInAnchor); 55 return Position(&anchor, offset, Position::PositionIsOffsetInAnchor);
54 } 56 }
55 57
56 PositionInComposedTree EditingTestBase::positionInComposedTree(Node& anchor, int offset) 58 PositionInComposedTree EditingTestBase::positionInComposedTree(Node& anchor, int offset)
57 { 59 {
58 return PositionInComposedTree(&anchor, offset, PositionInComposedTree::Posit ionIsOffsetInAnchor); 60 return PositionInComposedTree(&anchor, offset, PositionInComposedTree::Posit ionIsOffsetInAnchor);
59 } 61 }
60 62
61 } // namespace blink 63 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/PositionTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698