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

Side by Side Diff: Source/core/page/FocusController.cpp

Issue 105973003: Improve spatial navigation on overlapping elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 737
738 if (candidate.isOffscreenAfterScrolling && candidate.alignment < Full) 738 if (candidate.isOffscreenAfterScrolling && candidate.alignment < Full)
739 return; 739 return;
740 740
741 if (closest.isNull()) { 741 if (closest.isNull()) {
742 closest = candidate; 742 closest = candidate;
743 return; 743 return;
744 } 744 }
745 745
746 LayoutRect intersectionRect = intersection(candidate.rect, closest.rect); 746 LayoutRect intersectionRect = intersection(candidate.rect, closest.rect);
747 if (!intersectionRect.isEmpty() && !areElementsOnSameLine(closest, candidate )) { 747 if (!intersectionRect.isEmpty() && !areElementsOnSameLine(closest, candidate )
748 && intersectionRect == candidate.rect) {
748 // If 2 nodes are intersecting, do hit test to find which node in on top . 749 // If 2 nodes are intersecting, do hit test to find which node in on top .
749 LayoutUnit x = intersectionRect.x() + intersectionRect.width() / 2; 750 LayoutUnit x = intersectionRect.x() + intersectionRect.width() / 2;
750 LayoutUnit y = intersectionRect.y() + intersectionRect.height() / 2; 751 LayoutUnit y = intersectionRect.y() + intersectionRect.height() / 2;
751 HitTestResult result = candidate.visibleNode->document().page()->mainFra me()->eventHandler().hitTestResultAtPoint(IntPoint(x, y), HitTestRequest::ReadOn ly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::C onfusingAndOftenMisusedDisallowShadowContent); 752 HitTestResult result = candidate.visibleNode->document().page()->mainFra me()->eventHandler().hitTestResultAtPoint(IntPoint(x, y), HitTestRequest::ReadOn ly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::C onfusingAndOftenMisusedDisallowShadowContent);
752 if (candidate.visibleNode->contains(result.innerNode())) { 753 if (candidate.visibleNode->contains(result.innerNode())) {
753 closest = candidate; 754 closest = candidate;
754 return; 755 return;
755 } 756 }
756 if (closest.visibleNode->contains(result.innerNode())) 757 if (closest.visibleNode->contains(result.innerNode()))
757 return; 758 return;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b order */); 900 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b order */);
900 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direct ion, container); 901 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direct ion, container);
901 if (container && container->isDocumentNode()) 902 if (container && container->isDocumentNode())
902 toDocument(container)->updateLayoutIgnorePendingStylesheets(); 903 toDocument(container)->updateLayoutIgnorePendingStylesheets();
903 } while (!consumed && container); 904 } while (!consumed && container);
904 905
905 return consumed; 906 return consumed;
906 } 907 }
907 908
908 } // namespace WebCore 909 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698