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

Unified Diff: Source/core/page/SpatialNavigation.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/page/SpatialNavigation.h ('k') | Source/core/page/TouchAdjustment.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/SpatialNavigation.cpp
diff --git a/Source/core/page/SpatialNavigation.cpp b/Source/core/page/SpatialNavigation.cpp
index 7a4b3f96f90397ce0288a7241b21e9ebf29b4f74..37426cb6a4dc61be1d71a93c753b8fc04dfac1f2 100644
--- a/Source/core/page/SpatialNavigation.cpp
+++ b/Source/core/page/SpatialNavigation.cpp
@@ -292,7 +292,7 @@ bool hasOffscreenRect(Node* node, FocusDirection direction)
// Get the FrameView in which |node| is (which means the current viewport if |node|
// is not in an inner document), so we can check if its content rect is visible
// before we actually move the focus to it.
- FrameView* frameView = node->document()->view();
+ FrameView* frameView = node->document().view();
if (!frameView)
return true;
@@ -437,7 +437,7 @@ Node* scrollableEnclosingBoxOrParentFrameForNodeInDirection(FocusDirection direc
Node* parent = node;
do {
if (parent->isDocumentNode())
- parent = toDocument(parent)->document()->frame()->ownerElement();
+ parent = toDocument(parent)->document().frame()->ownerElement();
else
parent = parent->parentOrShadowHostNode();
} while (parent && !canScrollInDirection(parent, direction) && !parent->isDocumentNode());
@@ -515,11 +515,11 @@ static LayoutRect rectToAbsoluteCoordinates(Frame* initialFrame, const LayoutRec
LayoutRect nodeRectInAbsoluteCoordinates(Node* node, bool ignoreBorder)
{
- ASSERT(node && node->renderer() && !node->document()->view()->needsLayout());
+ ASSERT(node && node->renderer() && !node->document().view()->needsLayout());
if (node->isDocumentNode())
return frameRectInAbsoluteCoordinates(toDocument(node)->frame());
- LayoutRect rect = rectToAbsoluteCoordinates(node->document()->frame(), node->boundingBox());
+ LayoutRect rect = rectToAbsoluteCoordinates(node->document().frame(), node->boundingBox());
// For authors that use border instead of outline in their CSS, we compensate by ignoring the border when calculating
// the rect of the focused element.
@@ -671,7 +671,7 @@ void distanceDataForNode(FocusDirection direction, const FocusCandidate& current
float distance = euclidianDistance + sameAxisDistance + 2 * otherAxisDistance;
candidate.distance = roundf(distance);
- LayoutSize viewSize = candidate.visibleNode->document()->page()->mainFrame()->view()->visibleContentRect().size();
+ LayoutSize viewSize = candidate.visibleNode->document().page()->mainFrame()->view()->visibleContentRect().size();
candidate.alignment = alignmentForRects(direction, currentRect, nodeRect, viewSize);
}
@@ -727,7 +727,7 @@ LayoutRect virtualRectForAreaElementAndDirection(HTMLAreaElement* area, FocusDir
ASSERT(area->imageElement());
// Area elements tend to overlap more than other focusable elements. We flatten the rect of the area elements
// to minimize the effect of overlapping areas.
- LayoutRect rect = virtualRectForDirection(direction, rectToAbsoluteCoordinates(area->document()->frame(), area->computeRect(area->imageElement()->renderer())), 1);
+ LayoutRect rect = virtualRectForDirection(direction, rectToAbsoluteCoordinates(area->document().frame(), area->computeRect(area->imageElement()->renderer())), 1);
return rect;
}
« no previous file with comments | « Source/core/page/SpatialNavigation.h ('k') | Source/core/page/TouchAdjustment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698