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

Unified Diff: Source/core/page/SpatialNavigation.cpp

Issue 994903003: Merge Element::offsetParentForBindings() into offsetParent() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 9 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/html/HTMLElement.idl ('k') | no next file » | 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 952bfd7e0bf67e00b45727706b915133692fd314..1037c8bd21cc1b55974ca9d3dfcd2e4083a0708d 100644
--- a/Source/core/page/SpatialNavigation.cpp
+++ b/Source/core/page/SpatialNavigation.cpp
@@ -366,8 +366,11 @@ static LayoutRect rectToAbsoluteCoordinates(LocalFrame* initialFrame, const Layo
// FIXME: Spatial navigation is broken for OOPI.
Element* element = frame->deprecatedLocalOwner();
if (element) {
- for (; element; element = element->offsetParent())
+ do {
rect.move(element->offsetLeft(), element->offsetTop());
+ LayoutObject* layoutObject = element->layoutObject();
+ element = layoutObject ? layoutObject->offsetParent() : nullptr;
+ } while (element);
rect.move((-toLocalFrame(frame)->view()->scrollOffset()));
}
}
« no previous file with comments | « Source/core/html/HTMLElement.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698