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

Side by Side Diff: third_party/WebKit/Source/core/editing/Position.h

Issue 2949763002: Introduce Position constructor with const Node& (Closed)
Patch Set: 2017-06-20T13:43:23 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 static const TreeScope* CommonAncestorTreeScope( 63 static const TreeScope* CommonAncestorTreeScope(
64 const PositionTemplate<Strategy>&, 64 const PositionTemplate<Strategy>&,
65 const PositionTemplate<Strategy>& b); 65 const PositionTemplate<Strategy>& b);
66 static PositionTemplate<Strategy> EditingPositionOf(Node* anchor_node, 66 static PositionTemplate<Strategy> EditingPositionOf(Node* anchor_node,
67 int offset); 67 int offset);
68 68
69 // For creating before/after positions: 69 // For creating before/after positions:
70 PositionTemplate(Node* anchor_node, PositionAnchorType); 70 PositionTemplate(Node* anchor_node, PositionAnchorType);
71 71
72 // For creating offset positions: 72 // For creating offset positions:
73 // FIXME: This constructor should eventually go away. See bug 63040. 73 PositionTemplate(const Node& anchor_node, int offset);
74 PositionTemplate(Node* anchor_node, int offset); 74 // TODO(editing-dev): We should not pass |nullptr| as |anchor_node| for
75 // |Position| constructor.
76 // TODO(editing-dev): This constructor should eventually go away. See bug
77 // http://wkb.ug/63040.
78 PositionTemplate(const Node* anchor_node, int offset);
75 79
76 PositionTemplate(const PositionTemplate&); 80 PositionTemplate(const PositionTemplate&);
77 81
78 PositionAnchorType AnchorType() const { return anchor_type_; } 82 PositionAnchorType AnchorType() const { return anchor_type_; }
79 bool IsAfterAnchor() const { 83 bool IsAfterAnchor() const {
80 return anchor_type_ == PositionAnchorType::kAfterAnchor; 84 return anchor_type_ == PositionAnchorType::kAfterAnchor;
81 } 85 }
82 bool IsAfterChildren() const { 86 bool IsAfterChildren() const {
83 return anchor_type_ == PositionAnchorType::kAfterChildren; 87 return anchor_type_ == PositionAnchorType::kAfterChildren;
84 } 88 }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 282
279 } // namespace blink 283 } // namespace blink
280 284
281 #ifndef NDEBUG 285 #ifndef NDEBUG
282 // Outside the WebCore namespace for ease of invocation from gdb. 286 // Outside the WebCore namespace for ease of invocation from gdb.
283 void showTree(const blink::Position&); 287 void showTree(const blink::Position&);
284 void showTree(const blink::Position*); 288 void showTree(const blink::Position*);
285 #endif 289 #endif
286 290
287 #endif // Position_h 291 #endif // Position_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698