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

Issue 2719223002: Use correct position when setting pos_in_set for tabs.

Created:
3 years, 9 months ago by David Tseng
Modified:
3 years, 9 months ago
Reviewers:
dmazzoni, sky
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use correct position when setting pos_in_set for tabs. The aria spec says (of pos in set): Authors MUST set the value for aria-posinset to an integer greater than or equal to 1, and less than or equal to the size of the set. TEST=manual. Verify you don't get things like "... 0 of 5", and that you can get to "... 5 of 5".

Patch Set 1 #

Total comments: 4

Patch Set 2 : Add comment, make check before setting data. #

Total comments: 1

Patch Set 3 : Alt proposal. #

Patch Set 4 : Potential nit. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -5 lines) Patch
M chrome/browser/ui/views/tabs/tab_strip.cc View 1 2 1 chunk +5 lines, -1 line 1 comment Download
M ui/accessibility/ax_enums.idl View 1 2 2 chunks +10 lines, -1 line 0 comments Download
M ui/accessibility/ax_node_data.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M ui/accessibility/ax_node_data.cc View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
M ui/views/controls/combobox/combobox.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/controls/table/table_view.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 23 (12 generated)
David Tseng
One of those things that's not a big deal except for it sounds glaringly bad ...
3 years, 9 months ago (2017-02-27 22:27:37 UTC) #4
dmazzoni
lgtm Yep, should be 1-based and not zero-based. Should we clarify in any header files ...
3 years, 9 months ago (2017-02-27 23:50:49 UTC) #10
sky
https://codereview.chromium.org/2719223002/diff/1/chrome/browser/ui/views/tabs/tab_strip.cc File chrome/browser/ui/views/tabs/tab_strip.cc (right): https://codereview.chromium.org/2719223002/diff/1/chrome/browser/ui/views/tabs/tab_strip.cc#newcode1348 chrome/browser/ui/views/tabs/tab_strip.cc:1348: int pos_in_set = tab_count() ? GetModelIndexOfTab(tab) + 1 : ...
3 years, 9 months ago (2017-02-28 04:01:06 UTC) #11
sky
https://codereview.chromium.org/2719223002/diff/1/chrome/browser/ui/views/tabs/tab_strip.cc File chrome/browser/ui/views/tabs/tab_strip.cc (right): https://codereview.chromium.org/2719223002/diff/1/chrome/browser/ui/views/tabs/tab_strip.cc#newcode1349 chrome/browser/ui/views/tabs/tab_strip.cc:1349: node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, pos_in_set); One more comment. Why do we need ...
3 years, 9 months ago (2017-02-28 04:02:33 UTC) #12
David Tseng
https://codereview.chromium.org/2719223002/diff/1/chrome/browser/ui/views/tabs/tab_strip.cc File chrome/browser/ui/views/tabs/tab_strip.cc (right): https://codereview.chromium.org/2719223002/diff/1/chrome/browser/ui/views/tabs/tab_strip.cc#newcode1348 chrome/browser/ui/views/tabs/tab_strip.cc:1348: int pos_in_set = tab_count() ? GetModelIndexOfTab(tab) + 1 : ...
3 years, 9 months ago (2017-02-28 19:26:53 UTC) #13
dmazzoni
> > > One more comment. Why do we need AX_ATTR_POS_IN_SET to be 1s based? ...
3 years, 9 months ago (2017-02-28 19:32:49 UTC) #14
sky
+1 to renaming. On Tue, Feb 28, 2017 at 11:32 AM, Dominic Mazzoni <dmazzoni@chromium.org> wrote: ...
3 years, 9 months ago (2017-02-28 20:51:56 UTC) #17
sky
https://codereview.chromium.org/2719223002/diff/20001/chrome/browser/ui/views/tabs/tab_strip.cc File chrome/browser/ui/views/tabs/tab_strip.cc (right): https://codereview.chromium.org/2719223002/diff/20001/chrome/browser/ui/views/tabs/tab_strip.cc#newcode1346 chrome/browser/ui/views/tabs/tab_strip.cc:1346: if (tab_count() <= 0 || GetModelIndexOfTab(tab) < 0) Why ...
3 years, 9 months ago (2017-02-28 20:52:30 UTC) #18
David Tseng
I'm willing to acknowledge the confusing naming of |pos_in_set|. If we assume that's going to ...
3 years, 9 months ago (2017-02-28 22:12:01 UTC) #21
David Tseng
On Tue, Feb 28, 2017 at 2:11 PM, <dtseng@chromium.org> wrote: > > I'm willing to ...
3 years, 9 months ago (2017-02-28 22:46:29 UTC) #22
sky
3 years, 9 months ago (2017-03-01 00:31:18 UTC) #23
In my opinion adding another member makes this code more confusing. Ideally the
index should be 0 based as anything else is just confusing. If you guys feel
strongly that is wrong, then rename the member to reflect that.

I do agree that both of these are out of scope for this fix. I would rather you
fix the bug in this patch without any renames. Save the rename for a follow on
patch that cleans things up.

https://codereview.chromium.org/2719223002/diff/60001/chrome/browser/ui/views...
File chrome/browser/ui/views/tabs/tab_strip.cc (right):

https://codereview.chromium.org/2719223002/diff/60001/chrome/browser/ui/views...
chrome/browser/ui/views/tabs/tab_strip.cc:1346: if (GetModelIndexOfTab(tab) < 0)
Assign to local variable to avoid multiple calls.

Powered by Google App Engine
This is Rietveld 408576698