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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master 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 | « Source/core/dom/NodeRenderingContext.cpp ('k') | Source/core/dom/Position.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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 Node* computeNodeBeforePosition() const; 120 Node* computeNodeBeforePosition() const;
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 Element* rootEditableElement() const 131 Element* rootEditableElement() const
132 { 132 {
133 Node* container = containerNode(); 133 Node* container = containerNode();
134 return container ? container->rootEditableElement() : 0; 134 return container ? container->rootEditableElement() : 0;
135 } 135 }
136 136
137 // These should only be used for PositionIsOffsetInAnchor positions, unless 137 // These should only be used for PositionIsOffsetInAnchor positions, unless
138 // the position is a legacy editing position. 138 // the position is a legacy editing position.
139 void moveToPosition(PassRefPtr<Node> anchorNode, int offset); 139 void moveToPosition(PassRefPtr<Node> anchorNode, int offset);
140 void moveToOffset(int offset); 140 void moveToOffset(int offset);
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 339
340 } // namespace WebCore 340 } // namespace WebCore
341 341
342 #ifndef NDEBUG 342 #ifndef NDEBUG
343 // Outside the WebCore namespace for ease of invocation from gdb. 343 // Outside the WebCore namespace for ease of invocation from gdb.
344 void showTree(const WebCore::Position&); 344 void showTree(const WebCore::Position&);
345 void showTree(const WebCore::Position*); 345 void showTree(const WebCore::Position*);
346 #endif 346 #endif
347 347
348 #endif // Position_h 348 #endif // Position_h
OLDNEW
« no previous file with comments | « Source/core/dom/NodeRenderingContext.cpp ('k') | Source/core/dom/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698