Commit d5fc0020 authored by huangs's avatar huangs Committed by Commit bot

[WebUI] Tweak action-link's .no-outline behavior on blur.

To emulate <a> :focus styling, action-link adds .no-outline on
mousedown, but removes .no-outline on blur. This indiscreminate removal
disregard the edge case where source of blur is from outside the web
page (e.g., Alt-Tab). This CL add an extra check to remedy this.

BUG=698270
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2744893002
Cr-Commit-Position: refs/heads/master@{#456159}
parent 0d84b239
......@@ -75,8 +75,10 @@ var ActionLink = document.registerElement('action-link', {
this.classList.add('no-outline');
});
this.addEventListener('blur', function() {
this.classList.remove('no-outline');
this.addEventListener('blur', function(e) {
// This check helps us exclude external events like application switch.
if (e.sourceCapabilities)
this.classList.remove('no-outline');
});
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment