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

Issue 2768673002: [WebUI] Modify action-link's .no-outline on input only.

Created:
3 years, 9 months ago by huangs
Modified:
3 years, 9 months ago
Reviewers:
Dan Beam
CC:
chromium-reviews, oshima+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[WebUI] Modify action-link's .no-outline on input only. This CL updates .no-outline logic for action-link sets to improve how it emulates <a> :focus styling: - On mousedown, add .no-outline (to remove focus ring). - On keyup with Tab, remove .no-outline (to reenable focus ring). - Leave .no-outline as-is for focus and blur events, so when blur source is external to webpage (e.g., Alt-Tab, or Tab exiting content) we preserve same outline as before. - Make .no-outline affect styling only on :focus. This approach is attractive for its simplicity. Known caveats: - Tab-focus followed by click-focus removes focus ring (unlike <a>). - Click-focus, Tab-away and Shift-Tab back: Focus ring appears is delayed since it's applied on keyup event. BUG=701268, 698270 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -9 lines) Patch
M ui/webui/resources/css/action_link.css View 1 chunk +1 line, -1 line 0 comments Download
M ui/webui/resources/html/action_link_css.html View 1 chunk +1 line, -1 line 0 comments Download
M ui/webui/resources/js/action_link.js View 2 chunks +7 lines, -7 lines 1 comment Download

Messages

Total messages: 5 (3 generated)
huangs
PTAL. I listed 2 caveats of this approach, which I think are minor. Please judge ...
3 years, 9 months ago (2017-03-21 22:11:53 UTC) #4
Dan Beam
3 years, 9 months ago (2017-03-22 03:28:53 UTC) #5
https://codereview.chromium.org/2768673002/diff/1/ui/webui/resources/js/actio...
File ui/webui/resources/js/action_link.js (right):

https://codereview.chromium.org/2768673002/diff/1/ui/webui/resources/js/actio...
ui/webui/resources/js/action_link.js:59: if (e.key === 'Tab')
this isn't the only way focus can get to an element.  enter and screenreaders
with configurable shortcuts also can set focus

Powered by Google App Engine
This is Rietveld 408576698