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

Issue 2700863002: MD Settings: adjust focus-outline behaviors on search engine iron-list. (Closed)

Created:
3 years, 10 months ago by scottchen
Modified:
3 years, 10 months ago
Reviewers:
Dan Beam, hcarmona
CC:
chromium-reviews, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-md-ui_chromium.org, dbeam+watch-settings_chromium.org, stevenjb+watch-md-settings_chromium.org, arv+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MD Settings: adjust focus-outline behaviors on search engine iron-list. Goal: Based on offline discussion with dbeam@, the result should be: - mouse clicking anywhere should behave as user were clicking on dead-space. - pressing tab after clicking on an item would go into it's child icon-button (because on web pages when you click somewhere and clicks tab it would go to the "next" focusable thing, next as in right-and-down in pixels) - clicking on an item would not show focus-line, but when you press up and down it'll then show the focus-line on the new items you're focusing. - clicking on a row thats focused by keyboard should not unfocus the row. Caveat #1: We can't simply just add .no-outline to everything the mouse clicks - in case the user clicks on something that was focused by keyboard, the click would appear to unexpectedly unfocus the item. Caveat #2: We can't just do "document.activeElement == this" (as we did for action-links), because document.activeElement only track interactive elements (inputs, buttons etc.) and not divs etc. Explaining the solution in the CL: When user uses keyboard to traverse through the iron-list, key-down is fired on the previously focused item, then key-up is fired on the newly focused item. We use this behavior here to determine if an item is already in focus via keyboard. If it were, we don't add .no-outline. BUG=684152 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2700863002 Cr-Commit-Position: refs/heads/master@{#452601} Committed: https://chromium.googlesource.com/chromium/src/+/f3f17d64c61c095f5d7542bb74e2e7137f339b14

Patch Set 1 #

Total comments: 6

Patch Set 2 : move code to new behavior for reusability #

Patch Set 3 : use polymer's listeners property instead of addEventListener #

Total comments: 4

Patch Set 4 : add tests, fix compiler issue #

Patch Set 5 : add test file #

Total comments: 16

Patch Set 6 : change test to simulate a few focus states intead of using iron-list #

Total comments: 4

Patch Set 7 : fixes based on comments #

Messages

Total messages: 35 (18 generated)
scottchen
Feel free to start reviewing and leaving comments, but I'm going to try to find ...
3 years, 10 months ago (2017-02-16 22:06:16 UTC) #5
hcarmona
https://codereview.chromium.org/2700863002/diff/1/chrome/browser/resources/settings/search_engines_page/search_engine_entry.js File chrome/browser/resources/settings/search_engines_page/search_engine_entry.js (right): https://codereview.chromium.org/2700863002/diff/1/chrome/browser/resources/settings/search_engines_page/search_engine_entry.js#newcode45 chrome/browser/resources/settings/search_engines_page/search_engine_entry.js:45: this.addEventListener('keyup', function(e) { can we use listeners instead? listeners: ...
3 years, 10 months ago (2017-02-16 22:33:06 UTC) #6
Dan Beam
https://codereview.chromium.org/2700863002/diff/1/chrome/browser/resources/settings/search_engines_page/search_engine_entry.js File chrome/browser/resources/settings/search_engines_page/search_engine_entry.js (right): https://codereview.chromium.org/2700863002/diff/1/chrome/browser/resources/settings/search_engines_page/search_engine_entry.js#newcode45 chrome/browser/resources/settings/search_engines_page/search_engine_entry.js:45: this.addEventListener('keyup', function(e) { On 2017/02/16 22:33:06, hcarmona wrote: > ...
3 years, 10 months ago (2017-02-16 22:52:48 UTC) #7
scottchen
https://codereview.chromium.org/2700863002/diff/1/chrome/browser/resources/settings/search_engines_page/search_engine_entry.js File chrome/browser/resources/settings/search_engines_page/search_engine_entry.js (right): https://codereview.chromium.org/2700863002/diff/1/chrome/browser/resources/settings/search_engines_page/search_engine_entry.js#newcode45 chrome/browser/resources/settings/search_engines_page/search_engine_entry.js:45: this.addEventListener('keyup', function(e) { On 2017/02/16 22:52:48, Dan Beam wrote: ...
3 years, 10 months ago (2017-02-16 23:01:54 UTC) #9
hcarmona
Looks good, is it possible to add some tests for the behavior to ensure that ...
3 years, 10 months ago (2017-02-17 23:35:37 UTC) #14
scottchen
I added some tests - however, I wasn't able to test the exact scenarios of ...
3 years, 10 months ago (2017-02-22 07:07:06 UTC) #15
Dan Beam
On 2017/02/22 07:07:06, scottchen wrote: > I added some tests - however, I wasn't able ...
3 years, 10 months ago (2017-02-22 16:42:30 UTC) #20
scottchen
On 2017/02/22 16:42:30, Dan Beam wrote: > On 2017/02/22 07:07:06, scottchen wrote: > > I ...
3 years, 10 months ago (2017-02-22 18:20:41 UTC) #21
Dan Beam
https://codereview.chromium.org/2700863002/diff/80001/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js File chrome/browser/resources/settings/focusable_iron_list_item_behavior.js (right): https://codereview.chromium.org/2700863002/diff/80001/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js#newcode29 chrome/browser/resources/settings/focusable_iron_list_item_behavior.js:29: if(!this.$$('[focused]')) please stop doing this if( ^ and do ...
3 years, 10 months ago (2017-02-22 23:25:46 UTC) #23
scottchen
I changed the test to not be coupled with iron-list and tests the focus states ...
3 years, 10 months ago (2017-02-23 00:31:50 UTC) #24
hcarmona
LGTM w/ some nits https://codereview.chromium.org/2700863002/diff/100001/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js File chrome/browser/resources/settings/focusable_iron_list_item_behavior.js (right): https://codereview.chromium.org/2700863002/diff/100001/chrome/browser/resources/settings/focusable_iron_list_item_behavior.js#newcode9 chrome/browser/resources/settings/focusable_iron_list_item_behavior.js:9: focusedByKey_: {type: Boolean, value: false}, ...
3 years, 10 months ago (2017-02-23 01:02:41 UTC) #25
scottchen
Thanks hcarmona! This one was a bit tricky so I'll also wait for dbeam's LG. ...
3 years, 10 months ago (2017-02-23 01:19:13 UTC) #26
Dan Beam
lgtm but i do wish there was a way to share .no-outline more easily. maybe ...
3 years, 10 months ago (2017-02-23 06:29:54 UTC) #27
scottchen
On 2017/02/23 06:29:54, Dan Beam wrote: > lgtm but i do wish there was a ...
3 years, 10 months ago (2017-02-23 18:55:49 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2700863002/120001
3 years, 10 months ago (2017-02-23 18:56:23 UTC) #31
Dan Beam
On 2017/02/23 18:55:49, scottchen wrote: > On 2017/02/23 06:29:54, Dan Beam wrote: > > lgtm ...
3 years, 10 months ago (2017-02-23 18:59:47 UTC) #32
commit-bot: I haz the power
3 years, 10 months ago (2017-02-23 20:14:21 UTC) #35
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/f3f17d64c61c095f5d7542bb74e2...

Powered by Google App Engine
This is Rietveld 408576698