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

Issue 810493003: Introduce "navigation target classification" for spatial navigation

Created:
5 years, 11 months ago by fs
Modified:
5 years, 11 months ago
Reviewers:
c.shu
CC:
blink-reviews, ed+blinkwatch_opera.com, krit, sof, eae+blinkwatch, fs, kouhei+svg_chromium.org, blink-reviews-dom_chromium.org, dglazkov+blink, f(malita), gyuyoung.kim_webkit.org, Stephen Chennney, pdr+svgwatchlist_chromium.org, rwlbuis
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Introduce "navigation target classification" for spatial navigation Move the functionality of Element::supportsSpatialNavigationFocus to FocusController, by removing the call from Element::supportsFocus and instead explicitly check for the presence of event handlers in FocusController::findFocusCandidateInContainer. Add a 'navigation class' to the FocusCandidate, to allow factoring this into the navigation heuristics.

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -40 lines) Patch
M Source/core/dom/Element.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/dom/Element.cpp View 2 chunks +1 line, -26 lines 0 comments Download
M Source/core/page/FocusController.cpp View 3 chunks +44 lines, -2 lines 2 comments Download
M Source/core/page/SpatialNavigation.h View 3 chunks +13 lines, -2 lines 0 comments Download
M Source/core/page/SpatialNavigation.cpp View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/svg/SVGElement.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/svg/SVGElement.cpp View 1 chunk +0 lines, -6 lines 0 comments Download
M Source/core/svg/SVGGraphicsElement.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/svg/SVGGraphicsElement.cpp View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
c.shu
5 years, 11 months ago (2015-01-07 23:49:48 UTC) #2
Overall I support this code refactory. I think it even helps the performance in
the fact that many useless calls to supportsSpatialNavigationFocus() are
avoided.
With the classified result, we can further decide how to act on the candidate
elements.
I just have a couple of nits.

https://codereview.chromium.org/810493003/diff/1/Source/core/page/FocusContro...
File Source/core/page/FocusController.cpp (right):

https://codereview.chromium.org/810493003/diff/1/Source/core/page/FocusContro...
Source/core/page/FocusController.cpp:821: if (element.isSVGElement() &&
hasFocusEventHandler(element))
I would either expand the four focus event listeners here or use a helper
function for the above click/key events as well, just to make it consistent.

https://codereview.chromium.org/810493003/diff/1/Source/core/page/FocusContro...
Source/core/page/FocusController.cpp:851: FocusCandidate candidate(element,
type, navigationClass);
Can we do some additional code refactory here so that there's only one place to
call classifyNavigationCandidate()? I hope it's possible.

Powered by Google App Engine
This is Rietveld 408576698