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

Side by Side Diff: Source/core/dom/Position.h

Issue 23450030: Introduce Position::inDocument() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | « no previous file | Source/core/editing/ApplyBlockElementCommand.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) 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 Node* computeNodeAfterPosition() const; 121 Node* computeNodeAfterPosition() const;
122 122
123 Node* anchorNode() const { return m_anchorNode.get(); } 123 Node* anchorNode() const { return m_anchorNode.get(); }
124 124
125 // FIXME: Callers should be moved off of node(), node() is not always the co ntainer for this position. 125 // FIXME: Callers should be moved off of node(), node() is not always the co ntainer for this position.
126 // For nodes which editingIgnoresContent(node()) returns true, positions lik e [ignoredNode, 0] 126 // For nodes which editingIgnoresContent(node()) returns true, positions lik e [ignoredNode, 0]
127 // will be treated as before ignoredNode (thus node() is really after the po sition, not containing it). 127 // will be treated as before ignoredNode (thus node() is really after the po sition, not containing it).
128 Node* deprecatedNode() const { return m_anchorNode.get(); } 128 Node* deprecatedNode() const { return m_anchorNode.get(); }
129 129
130 Document* document() const { return m_anchorNode ? &m_anchorNode->document() : 0; } 130 Document* document() const { return m_anchorNode ? &m_anchorNode->document() : 0; }
131 bool inDocument() const { return m_anchorNode && m_anchorNode->inDocument(); }
131 Element* rootEditableElement() const 132 Element* rootEditableElement() const
132 { 133 {
133 Node* container = containerNode(); 134 Node* container = containerNode();
134 return container ? container->rootEditableElement() : 0; 135 return container ? container->rootEditableElement() : 0;
135 } 136 }
136 137
137 // These should only be used for PositionIsOffsetInAnchor positions, unless 138 // These should only be used for PositionIsOffsetInAnchor positions, unless
138 // the position is a legacy editing position. 139 // the position is a legacy editing position.
139 void moveToPosition(PassRefPtr<Node> anchorNode, int offset); 140 void moveToPosition(PassRefPtr<Node> anchorNode, int offset);
140 void moveToOffset(int offset); 141 void moveToOffset(int offset);
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 340
340 } // namespace WebCore 341 } // namespace WebCore
341 342
342 #ifndef NDEBUG 343 #ifndef NDEBUG
343 // Outside the WebCore namespace for ease of invocation from gdb. 344 // Outside the WebCore namespace for ease of invocation from gdb.
344 void showTree(const WebCore::Position&); 345 void showTree(const WebCore::Position&);
345 void showTree(const WebCore::Position*); 346 void showTree(const WebCore::Position*);
346 #endif 347 #endif
347 348
348 #endif // Position_h 349 #endif // Position_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/ApplyBlockElementCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698