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

Unified Diff: third_party/WebKit/Source/core/editing/Position.h

Issue 2949763002: Introduce Position constructor with const Node& (Closed)
Patch Set: 2017-06-21T13:23:13 Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/Position.h
diff --git a/third_party/WebKit/Source/core/editing/Position.h b/third_party/WebKit/Source/core/editing/Position.h
index 5d05192795252006f5632d62bcbeb31d001ec884..81a64ea1b89c96983ad159a6f512c467db3a1f9f 100644
--- a/third_party/WebKit/Source/core/editing/Position.h
+++ b/third_party/WebKit/Source/core/editing/Position.h
@@ -70,8 +70,12 @@ class CORE_TEMPLATE_CLASS_EXPORT PositionTemplate {
PositionTemplate(Node* anchor_node, PositionAnchorType);
// For creating offset positions:
- // FIXME: This constructor should eventually go away. See bug 63040.
- PositionTemplate(Node* anchor_node, int offset);
+ PositionTemplate(const Node& anchor_node, int offset);
+ // TODO(editing-dev): We should not pass |nullptr| as |anchor_node| for
+ // |Position| constructor.
+ // TODO(editing-dev): This constructor should eventually go away. See bug
+ // http://wkb.ug/63040.
+ PositionTemplate(const Node* anchor_node, int offset);
PositionTemplate(const PositionTemplate&);
@@ -209,6 +213,8 @@ class CORE_TEMPLATE_CLASS_EXPORT PositionTemplate {
return IsAfterAnchor() || IsAfterChildren();
}
+ // TODO(editing-dev): Since we should consider |Position| is constant in
+ // tree, we should use |Member<const Node>|. see http://crbug.com/735327
Member<Node> anchor_node_;
// m_offset can be the offset inside m_anchorNode, or if
// editingIgnoresContent(m_anchorNode) returns true, then other places in
« no previous file with comments | « third_party/WebKit/Source/core/editing/PlainTextRange.cpp ('k') | third_party/WebKit/Source/core/editing/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698