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

Unified Diff: Source/core/editing/Caret.cpp

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, 4 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
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | Source/core/editing/DeleteFromTextNodeCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/Caret.cpp
diff --git a/Source/core/editing/Caret.cpp b/Source/core/editing/Caret.cpp
index c8b2f6090c678accee43e40b8201e89abc324077..eb81c803c6eeb0d0e8ae7a16b6156f3e2ec289be 100644
--- a/Source/core/editing/Caret.cpp
+++ b/Source/core/editing/Caret.cpp
@@ -70,7 +70,7 @@ void DragCaretController::setCaretPosition(const VisiblePosition& position)
Document* document = 0;
if (Node* node = m_position.deepEquivalent().deprecatedNode()) {
invalidateCaretRect(node);
- document = node->document();
+ document = &node->document();
}
if (m_position.isNull() || m_position.isOrphan())
clearCaretRect();
@@ -95,7 +95,7 @@ static bool removingNodeRemovesPosition(Node* node, const Position& position)
static void clearRenderViewSelection(const Position& position)
{
- RefPtr<Document> document = position.anchorNode()->document();
+ RefPtr<Document> document = &position.anchorNode()->document();
document->updateStyleIfNeeded();
if (RenderView* view = document->renderView())
view->clearSelection();
@@ -232,7 +232,7 @@ void CaretBase::invalidateCaretRect(Node* node, bool caretRectChanged)
if (caretRectChanged)
return;
- if (RenderView* view = node->document()->renderView()) {
+ if (RenderView* view = node->document().renderView()) {
if (shouldRepaintCaret(view, node->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)))
repaintCaretForLocalRect(node, localCaretRectWithoutUpdate());
}
@@ -268,7 +268,7 @@ void CaretBase::paintCaret(Node* node, GraphicsContext* context, const LayoutPoi
void DragCaretController::paintDragCaret(Frame* frame, GraphicsContext* p, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const
{
- if (m_position.deepEquivalent().deprecatedNode()->document()->frame() == frame)
+ if (m_position.deepEquivalent().deprecatedNode()->document().frame() == frame)
paintCaret(m_position.deepEquivalent().deprecatedNode(), p, paintOffset, clipRect);
}
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | Source/core/editing/DeleteFromTextNodeCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698