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

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: update 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 | 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 /* 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 if (m_offsetInContainer == invalidOffset) { 122 if (m_offsetInContainer == invalidOffset) {
123 DCHECK(!m_containerNode->isTextNode()); 123 DCHECK(!m_containerNode->isTextNode());
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 return Position(m_containerNode.get(), m_offsetInContainer);
yosin_UTC9 2017/03/30 05:44:58 Could you keep this TODO? We still want to return
yoichio 2017/03/30 07:04:09 Could you explain why ?
133 // |m_containerNode| isn't |Text| node.
134 return Position::editingPositionOf(m_containerNode.get(),
135 m_offsetInContainer);
136 } 133 }
137 134
138 inline unsigned RangeBoundaryPoint::offset() const { 135 inline unsigned RangeBoundaryPoint::offset() const {
139 ensureOffsetIsValid(); 136 ensureOffsetIsValid();
140 return m_offsetInContainer; 137 return m_offsetInContainer;
141 } 138 }
142 139
143 inline void RangeBoundaryPoint::clear() { 140 inline void RangeBoundaryPoint::clear() {
144 m_containerNode.clear(); 141 m_containerNode.clear();
145 m_offsetInContainer = 0; 142 m_offsetInContainer = 0;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } else { 223 } else {
227 if (a.offset() != b.offset()) 224 if (a.offset() != b.offset())
228 return false; 225 return false;
229 } 226 }
230 return true; 227 return true;
231 } 228 }
232 229
233 } // namespace blink 230 } // namespace blink
234 231
235 #endif 232 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698