<a is="action-link"> gains blue border it loses focus then regains focus. |
||||||
Issue descriptionChrome Version: 58.0.3028.0 (64-bit) OS: Win10 (should not matter) What steps will reproduce the problem? (1) Open chrome://settings, scroll to bottom "On Start Up". (2) Click "Open a specific page or set of pages". (3) Click "Use current pages". (4) Alt-Tab (assuming some other tabs are open) away. (5) Alt-Tab again. What is the expected result? "Use current pages" stay same as before. What happens instead? "Use current pages" gains blue border.
,
Mar 3 2017
this would be hard to fix. do we have to? i'd just say WontFix.
,
Mar 3 2017
we'd have to somehow detect when focus is being sent back to the tab right now, we just remove .no-outline on 'blur' (which is apparently dispatched when the window loses focus), add it when 'mousedown' is detected.
,
Mar 4 2017
Can we flip the logic, and have no outline by default? Then on 'focus', if |this !== activeElement|, add '.outline' style; and on 'blur', always remove the style (or save .outline existence into a flag, which gets restored on 'focus' and gets cleared on 'keydown')? Some complication probably will arise on timing re. activeElement assignment, and the need to differentiate keyboard vs. mouse navigation. I'll be happy to give this a shot if you don't have time. Thanks!
,
Mar 4 2017
if you can perfectly match <a href>, I'm happy to review patches
,
Mar 10 2017
Did more digging. So the border comes from :focus: If I override outline in :focus then I can remove it, BUT if I change other attribute in :focus (e.g., add background) then I'd change both mouse-select and key-select, but border only appears for key-select?! Turns out the discrepancy goes into the C++ code: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp?l=145 In JS there's no easy way to distinguish mouse-select vs. key-select, but I found a simple solution that would address this scenario. Uploading CL soon.
,
Mar 10 2017
(action-link uses custom elements directly and not really polymer, fwiw)
,
Mar 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d5fc002027195691680b127e58458d1b2b86d5a1 commit d5fc002027195691680b127e58458d1b2b86d5a1 Author: huangs <huangs@chromium.org> Date: Fri Mar 10 21:06:03 2017 [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} [modify] https://crrev.com/d5fc002027195691680b127e58458d1b2b86d5a1/ui/webui/resources/js/action_link.js
,
Mar 10 2017
huangs@: i think what some would call a discrepancy, others would call a feature (as in: I'm pretty sure links are supposed to suppress focus outline on mouse, but not with key)
,
Mar 13 2017
After the change, action-links *still* get focus outline if navigated by key. Moreover, after after Alt-Tab out and Alt-Tab back it keeps the outline. What got changed is the case (1) Click by mouse (no outline). (2) Alt-Tab out. (3) Alt-Tab back. Before change: Outline appears. After change: No outline. This is consistent with vanilla <a>.
,
Mar 13 2017
,
Apr 3 2017
Reopening bug: The fix http://crrev.com/2744893002 causes bug 701268 , so I'm reverting it in http://crbug.com/2796663002.
,
Apr 3 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/57a47c3f25ab6992306269e41e47374a59786f0a commit 57a47c3f25ab6992306269e41e47374a59786f0a Author: huangs <huangs@chromium.org> Date: Mon Apr 03 19:47:54 2017 Revert of [WebUI] Tweak action-link's .no-outline removal behavior on blur. (patchset #1 id:1 of https://codereview.chromium.org/2744893002/ ) Reason for revert: This fixes http://crbug.com/698270 but leads to http://crbug.com/701268 , which seems more serious. Original issue's description: > [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} > Committed: https://chromium.googlesource.com/chromium/src/+/d5fc002027195691680b127e58458d1b2b86d5a1 TBR=dbeam@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG= 698270 Review-Url: https://codereview.chromium.org/2796663002 Cr-Commit-Position: refs/heads/master@{#461508} [modify] https://crrev.com/57a47c3f25ab6992306269e41e47374a59786f0a/ui/webui/resources/js/action_link.js
,
Sep 19
Archiving old bugs that have only received trivial updates for some time. If you feel this issue should still be addressed, feel free to reopen it or to file a new issue. Thanks! |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by hua...@chromium.org
, Mar 3 2017Status: Assigned (was: Untriaged)