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

Unified Diff: Source/web/WebViewImpl.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/web/WebSearchableFormData.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index c15529413eb9bfa712c871259e142f7ec7adcdc9..bcfa7c3158c8ce8494405d14230a87912344b255 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -579,7 +579,7 @@ void WebViewImpl::mouseContextMenu(const WebMouseEvent& event)
HitTestResult result = hitTestResultForWindowPos(pme.position());
Frame* targetFrame;
if (result.innerNonSharedNode())
- targetFrame = result.innerNonSharedNode()->document()->frame();
+ targetFrame = result.innerNonSharedNode()->document().frame();
else
targetFrame = m_page->focusController().focusedOrMainFrame();
@@ -1086,7 +1086,7 @@ WebRect WebViewImpl::computeBlockBounds(const WebRect& rect, bool ignoreClipping
// Return the bounding box in the window coordinate system.
if (node) {
IntRect rect = node->Node::pixelSnappedBoundingBox();
- Frame* frame = node->document()->frame();
+ Frame* frame = node->document().frame();
return frame->view()->contentsToWindow(rect);
}
return WebRect();
@@ -2288,14 +2288,14 @@ bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const
if (!selectedRange)
return false;
- RefPtr<Range> range(Range::create(selectedRange->startContainer()->document(),
+ RefPtr<Range> range(Range::create(&selectedRange->startContainer()->document(),
selectedRange->startContainer(),
selectedRange->startOffset(),
selectedRange->startContainer(),
selectedRange->startOffset()));
anchor = frame->editor().firstRectForRange(range.get());
- range = Range::create(selectedRange->endContainer()->document(),
+ range = Range::create(&selectedRange->endContainer()->document(),
selectedRange->endContainer(),
selectedRange->endOffset(),
selectedRange->endContainer(),
@@ -2671,10 +2671,10 @@ void WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rect)
void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, float& newScale, IntPoint& newScroll, bool& needAnimation)
{
- focusedNode->document()->updateLayoutIgnorePendingStylesheets();
+ focusedNode->document().updateLayoutIgnorePendingStylesheets();
// 'caret' is rect encompassing the blinking cursor.
- IntRect textboxRect = focusedNode->document()->view()->contentsToWindow(pixelSnappedIntRect(focusedNode->Node::boundingBox()));
+ IntRect textboxRect = focusedNode->document().view()->contentsToWindow(pixelSnappedIntRect(focusedNode->Node::boundingBox()));
WebRect caret, unusedEnd;
selectionBounds(caret, unusedEnd);
IntRect unscaledCaret = caret;
« no previous file with comments | « Source/web/WebSearchableFormData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698