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

Side by Side Diff: third_party/WebKit/Source/core/dom/RangeBoundaryPoint.h

Issue 2786853002: Let RangeBoundaryPoint::toPoisition return Position not considering Editing (Closed)
Patch Set: Rebase Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/RangeTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return false; 124 return false;
125 } 125 }
126 return domTreeVersion() == m_domTreeVersion || 126 return domTreeVersion() == m_domTreeVersion ||
127 m_containerNode->isCharacterDataNode(); 127 m_containerNode->isCharacterDataNode();
128 } 128 }
129 129
130 inline const Position RangeBoundaryPoint::toPosition() const { 130 inline const Position RangeBoundaryPoint::toPosition() const {
131 ensureOffsetIsValid(); 131 ensureOffsetIsValid();
132 // TODO(yosin): We should return |Position::beforeAnchor| when 132 // TODO(yosin): We should return |Position::beforeAnchor| when
133 // |m_containerNode| isn't |Text| node. 133 // |m_containerNode| isn't |Text| node.
134 return Position::editingPositionOf(m_containerNode.get(), 134 return Position(m_containerNode.get(), m_offsetInContainer);
135 m_offsetInContainer);
136 } 135 }
137 136
138 inline unsigned RangeBoundaryPoint::offset() const { 137 inline unsigned RangeBoundaryPoint::offset() const {
139 ensureOffsetIsValid(); 138 ensureOffsetIsValid();
140 return m_offsetInContainer; 139 return m_offsetInContainer;
141 } 140 }
142 141
143 inline void RangeBoundaryPoint::clear() { 142 inline void RangeBoundaryPoint::clear() {
144 m_containerNode.clear(); 143 m_containerNode.clear();
145 m_offsetInContainer = 0; 144 m_offsetInContainer = 0;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } else { 225 } else {
227 if (a.offset() != b.offset()) 226 if (a.offset() != b.offset())
228 return false; 227 return false;
229 } 228 }
230 return true; 229 return true;
231 } 230 }
232 231
233 } // namespace blink 232 } // namespace blink
234 233
235 #endif 234 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/RangeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698