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

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

Issue 832083008: Allow Spatial Navigation ignore elements with event handlers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: new approach Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « Source/core/page/SpatialNavigation.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
3 * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org> 3 * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org>
4 * 4 *
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 focusableNode = node; 79 focusableNode = node;
80 isOffscreen = hasOffscreenRect(visibleNode); 80 isOffscreen = hasOffscreenRect(visibleNode);
81 isOffscreenAfterScrolling = hasOffscreenRect(visibleNode, type); 81 isOffscreenAfterScrolling = hasOffscreenRect(visibleNode, type);
82 } 82 }
83 83
84 bool isSpatialNavigationEnabled(const LocalFrame* frame) 84 bool isSpatialNavigationEnabled(const LocalFrame* frame)
85 { 85 {
86 return (frame && frame->settings() && frame->settings()->spatialNavigationEn abled()); 86 return (frame && frame->settings() && frame->settings()->spatialNavigationEn abled());
87 } 87 }
88 88
89 bool spatialNavigationIgnoresEventHandlers(const LocalFrame* frame)
90 {
91 return (frame && frame->settings() && frame->settings()->deviceSupportsTouch ());
92 }
93
89 static bool rectsIntersectOnOrthogonalAxis(WebFocusType type, const LayoutRect& a, const LayoutRect& b) 94 static bool rectsIntersectOnOrthogonalAxis(WebFocusType type, const LayoutRect& a, const LayoutRect& b)
90 { 95 {
91 switch (type) { 96 switch (type) {
92 case WebFocusTypeLeft: 97 case WebFocusTypeLeft:
93 case WebFocusTypeRight: 98 case WebFocusTypeRight:
94 return a.maxY() > b.y() && a.y() < b.maxY(); 99 return a.maxY() > b.y() && a.y() < b.maxY();
95 case WebFocusTypeUp: 100 case WebFocusTypeUp:
96 case WebFocusTypeDown: 101 case WebFocusTypeDown:
97 return a.maxX() > b.x() && a.x() < b.maxX(); 102 return a.maxX() > b.x() && a.x() < b.maxX();
98 default: 103 default:
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar ea.document().frame(), area.computeRect(area.imageElement()->renderer())), 1); 622 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar ea.document().frame(), area.computeRect(area.imageElement()->renderer())), 1);
618 return rect; 623 return rect;
619 } 624 }
620 625
621 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate) 626 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate)
622 { 627 {
623 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v isibleNode) : nullptr; 628 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v isibleNode) : nullptr;
624 }; 629 };
625 630
626 } // namespace blink 631 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/SpatialNavigation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698