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

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

Issue 773333002: Fix the rightOf and below conditions for overlapping case. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address review comments Created 6 years 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 | « LayoutTests/fast/spatial-navigation/snav-z-index-expected.txt ('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 efde676b2a9b0f83ea29be70d676cc11d7773ca8..e9ea56911a233c090ba660d29a03419265d2e80c 100644
--- a/Source/core/page/SpatialNavigation.cpp
+++ b/Source/core/page/SpatialNavigation.cpp
@@ -248,7 +248,7 @@ static bool areRectsMoreThanFullScreenApart(FocusType type, const LayoutRect& cu
static inline bool below(const LayoutRect& a, const LayoutRect& b)
{
return a.y() >= b.maxY()
- || (a.y() >= b.y() && a.maxY() > b.maxY());
+ || (a.y() >= b.y() && a.maxY() > b.maxY() && a.x() < b.maxX() && a.maxX() > b.x());
}
// Return true if rect |a| is on the right of |b|. False otherwise.
@@ -257,7 +257,7 @@ static inline bool below(const LayoutRect& a, const LayoutRect& b)
static inline bool rightOf(const LayoutRect& a, const LayoutRect& b)
{
return a.x() >= b.maxX()
- || (a.x() >= b.x() && a.maxX() > b.maxX());
+ || (a.x() >= b.x() && a.maxX() > b.maxX() && a.y() < b.maxY() && a.maxY() > b.y());
}
static bool isRectInDirection(FocusType type, const LayoutRect& curRect, const LayoutRect& targetRect)
« no previous file with comments | « LayoutTests/fast/spatial-navigation/snav-z-index-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698