Commit fa474e4b authored by Daniel Clark's avatar Daniel Clark Committed by Commit Bot

Update date picker ARIA attributes to follow selection instead of highlight

The pre-FormControlsRefresh date picker considered the cell with
'highlight' to be the active cell with respect to ARIA, and it was the
highlighted cell that moved around by arrow-key navigation.  In the
refreshed design, highlight is no longer managed in JS, and the cell
marked as 'selected' in JS is the one that is moved around by arrow-key
navigation and is therefore the one that should be considered focused
by accessibility.  However the management of aria-activedescendant and
aria-selected was never migrated from highlight to selection. This
change does this migration.

For test coverage, the change re-enables
DumpAccessibilityTreeTest.AccessibilityInputDateWithPopupOpen and
modifies it to dump the full popup tree instead of stopping at the
'Today' button.  The column header values are skipped so that the
/blink subtest doesn't produce different results on different
platforms (Windows uses Mo/Tu/We etc instead of M/T/W/etc for the
day  abbreviation localizations).

date/week/month-picker-ax.html are updated to account for the extra
MarkDirty events that are fired to to the fact that focus/selection
is now being managed again for the calendar cells.  month-picker-ax.html
is moved to promise_test to match the format of the other two tests and
changed to assert instead of timing out on failure.

Bug: 1022920,1054901
Change-Id: Iaa98605582a12fcf44d87748ca3bc572518528fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2111750
Commit-Queue: Dan Clark <daniec@microsoft.com>
Reviewed-by: default avatarKevin Babbitt <kbabbitt@microsoft.com>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarIonel Popescu <iopopesc@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#755938}
parent 0facf065
...@@ -1670,17 +1670,8 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityInputDate) { ...@@ -1670,17 +1670,8 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityInputDate) {
RunHtmlTest(FILE_PATH_LITERAL("input-date.html")); RunHtmlTest(FILE_PATH_LITERAL("input-date.html"));
} }
// TODO(crbug.com/423675): AX tree is different for Win7 and Win10.
// (crbug.com/1054901): Test fails on Builder Mac10.12 Tests.
#if defined(OS_WIN) || defined(OS_MACOSX)
#define MAYBE_AccessibilityInputDateWithPopupOpen \
DISABLED_AccessibilityInputDateWithPopupOpen
#else
#define MAYBE_AccessibilityInputDateWithPopupOpen \
AccessibilityInputDateWithPopupOpen
#endif
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest,
MAYBE_AccessibilityInputDateWithPopupOpen) { AccessibilityInputDateWithPopupOpen) {
RunHtmlTest(FILE_PATH_LITERAL("input-date-with-popup-open.html")); RunHtmlTest(FILE_PATH_LITERAL("input-date-with-popup-open.html"));
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
++++++++++++++++[document frame] ++++++++++++++++[document frame]
++++++++++++++[push button] name='Show next month' ++++++++++++++[push button] name='Show next month'
++++++++++++++++[document frame] ++++++++++++++++[document frame]
++++++++++++++[table] cols=0 headers=(NONE); rows=0 headers=(NONE); caption=false; spans=(all: 1x1) ++++++++++++++[table] cols=7 headers=(NONE); rows=6 headers=(NONE); caption=false; spans=(all: 1x1)
++++++++++++++++[section] ++++++++++++++++[section]
++++++++++++++++++[section] ++++++++++++++++++[section]
++++++++++++++++++++[static] name='S' ++++++++++++++++++++[static] name='S'
...@@ -42,4 +42,94 @@ ...@@ -42,4 +42,94 @@
++++++++++++++++++++[static] name='S' ++++++++++++++++++++[static] name='S'
++++++++++++++++[section] ++++++++++++++++[section]
++++++++++++++++++[section] ++++++++++++++++++[section]
++++++++++++++++++++[table row]
++++++++++++++++++++++[table cell] name='Sunday, August 31, 2008' selectable (row=0, col=0, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='31'
++++++++++++++++++++++[table cell] name='Monday, September 1, 2008' selectable selected (row=0, col=1, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='1'
++++++++++++++++++++++[table cell] name='Tuesday, September 2, 2008' selectable (row=0, col=2, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='2'
++++++++++++++++++++++[table cell] name='Wednesday, September 3, 2008' selectable (row=0, col=3, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='3'
++++++++++++++++++++++[table cell] name='Thursday, September 4, 2008' selectable (row=0, col=4, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='4'
++++++++++++++++++++++[table cell] name='Friday, September 5, 2008' selectable (row=0, col=5, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='5'
++++++++++++++++++++++[table cell] name='Saturday, September 6, 2008' selectable (row=0, col=6, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='6'
++++++++++++++++++++[table row]
++++++++++++++++++++++[table cell] name='Sunday, September 7, 2008' selectable (row=1, col=0, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='7'
++++++++++++++++++++++[table cell] name='Monday, September 8, 2008' selectable (row=1, col=1, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='8'
++++++++++++++++++++++[table cell] name='Tuesday, September 9, 2008' selectable (row=1, col=2, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='9'
++++++++++++++++++++++[table cell] name='Wednesday, September 10, 2008' selectable (row=1, col=3, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='10'
++++++++++++++++++++++[table cell] name='Thursday, September 11, 2008' selectable (row=1, col=4, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='11'
++++++++++++++++++++++[table cell] name='Friday, September 12, 2008' selectable (row=1, col=5, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='12'
++++++++++++++++++++++[table cell] name='Saturday, September 13, 2008' selectable (row=1, col=6, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='13'
++++++++++++++++++++[table row]
++++++++++++++++++++++[table cell] name='Sunday, September 14, 2008' selectable (row=2, col=0, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='14'
++++++++++++++++++++++[table cell] name='Monday, September 15, 2008' selectable (row=2, col=1, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='15'
++++++++++++++++++++++[table cell] name='Tuesday, September 16, 2008' selectable (row=2, col=2, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='16'
++++++++++++++++++++++[table cell] name='Wednesday, September 17, 2008' selectable (row=2, col=3, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='17'
++++++++++++++++++++++[table cell] name='Thursday, September 18, 2008' selectable (row=2, col=4, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='18'
++++++++++++++++++++++[table cell] name='Friday, September 19, 2008' selectable (row=2, col=5, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='19'
++++++++++++++++++++++[table cell] name='Saturday, September 20, 2008' selectable (row=2, col=6, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='20'
++++++++++++++++++++[table row]
++++++++++++++++++++++[table cell] name='Sunday, September 21, 2008' selectable (row=3, col=0, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='21'
++++++++++++++++++++++[table cell] name='Monday, September 22, 2008' selectable (row=3, col=1, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='22'
++++++++++++++++++++++[table cell] name='Tuesday, September 23, 2008' selectable (row=3, col=2, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='23'
++++++++++++++++++++++[table cell] name='Wednesday, September 24, 2008' selectable (row=3, col=3, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='24'
++++++++++++++++++++++[table cell] name='Thursday, September 25, 2008' selectable (row=3, col=4, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='25'
++++++++++++++++++++++[table cell] name='Friday, September 26, 2008' selectable (row=3, col=5, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='26'
++++++++++++++++++++++[table cell] name='Saturday, September 27, 2008' selectable (row=3, col=6, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='27'
++++++++++++++++++++[table row]
++++++++++++++++++++++[table cell] name='Sunday, September 28, 2008' selectable (row=4, col=0, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='28'
++++++++++++++++++++++[table cell] name='Monday, September 29, 2008' selectable (row=4, col=1, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='29'
++++++++++++++++++++++[table cell] name='Tuesday, September 30, 2008' selectable (row=4, col=2, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='30'
++++++++++++++++++++++[table cell] name='Wednesday, October 1, 2008' selectable (row=4, col=3, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='1'
++++++++++++++++++++++[table cell] name='Thursday, October 2, 2008' selectable (row=4, col=4, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='2'
++++++++++++++++++++++[table cell] name='Friday, October 3, 2008' selectable (row=4, col=5, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='3'
++++++++++++++++++++++[table cell] name='Saturday, October 4, 2008' selectable (row=4, col=6, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='4'
++++++++++++++++++++[table row]
++++++++++++++++++++++[table cell] name='Sunday, October 5, 2008' selectable (row=5, col=0, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='5'
++++++++++++++++++++++[table cell] name='Monday, October 6, 2008' selectable (row=5, col=1, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='6'
++++++++++++++++++++++[table cell] name='Tuesday, October 7, 2008' selectable (row=5, col=2, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='7'
++++++++++++++++++++++[table cell] name='Wednesday, October 8, 2008' selectable (row=5, col=3, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='8'
++++++++++++++++++++++[table cell] name='Thursday, October 9, 2008' selectable (row=5, col=4, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='9'
++++++++++++++++++++++[table cell] name='Friday, October 10, 2008' selectable (row=5, col=5, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='10'
++++++++++++++++++++++[table cell] name='Saturday, October 11, 2008' selectable (row=5, col=6, row_span=1, col_span=1, n_row_headers=0, n_col_headers=0)
++++++++++++++++++++++++[static] name='11'
++++++++++++++++[push button] name='Today' ++++++++++++++++[push button] name='Today'
...@@ -26,29 +26,119 @@ rootWebArea ...@@ -26,29 +26,119 @@ rootWebArea
++++++++++++++++++genericContainer ignored ++++++++++++++++++genericContainer ignored
++++++++++++++++++++genericContainer ++++++++++++++++++++genericContainer
++++++++++++++++++++++button name='Show month selection panel' ++++++++++++++++++++++button name='Show month selection panel'
++++++++++++++++++++++++staticText name='September 2008' ++++++++++++++++++++++++staticText
++++++++++++++++++++++++svgRoot ++++++++++++++++++++++++svgRoot
++++++++++++++++++++button name='Show previous month' ++++++++++++++++++++button name='Show previous month'
++++++++++++++++++++++svgRoot ++++++++++++++++++++++svgRoot
++++++++++++++++++++button name='Show next month' ++++++++++++++++++++button name='Show next month'
++++++++++++++++++++++svgRoot ++++++++++++++++++++++svgRoot
++++++++++++++++++grid ++++++++++++++++++grid activedescendantId=cell
++++++++++++++++++++genericContainer ++++++++++++++++++++genericContainer
++++++++++++++++++++++genericContainer ++++++++++++++++++++++genericContainer
++++++++++++++++++++++++staticText name='S' ++++++++++++++++++++++++staticText
++++++++++++++++++++++genericContainer ++++++++++++++++++++++genericContainer
++++++++++++++++++++++++staticText name='M' ++++++++++++++++++++++++staticText
++++++++++++++++++++++genericContainer ++++++++++++++++++++++genericContainer
++++++++++++++++++++++++staticText name='T' ++++++++++++++++++++++++staticText
++++++++++++++++++++++genericContainer ++++++++++++++++++++++genericContainer
++++++++++++++++++++++++staticText name='W' ++++++++++++++++++++++++staticText
++++++++++++++++++++++genericContainer ++++++++++++++++++++++genericContainer
++++++++++++++++++++++++staticText name='T' ++++++++++++++++++++++++staticText
++++++++++++++++++++++genericContainer ++++++++++++++++++++++genericContainer
++++++++++++++++++++++++staticText name='F' ++++++++++++++++++++++++staticText
++++++++++++++++++++++genericContainer ++++++++++++++++++++++genericContainer
++++++++++++++++++++++++staticText name='S' ++++++++++++++++++++++++staticText
++++++++++++++++++++genericContainer ++++++++++++++++++++genericContainer
++++++++++++++++++++++genericContainer ++++++++++++++++++++++genericContainer
++++++++++++++++++++++++row
++++++++++++++++++++++++++cell name='Sunday, August 31, 2008' selected=false
++++++++++++++++++++++++++++staticText name='31'
++++++++++++++++++++++++++cell name='Monday, September 1, 2008' selected=true
++++++++++++++++++++++++++++staticText name='1'
++++++++++++++++++++++++++cell name='Tuesday, September 2, 2008' selected=false
++++++++++++++++++++++++++++staticText name='2'
++++++++++++++++++++++++++cell name='Wednesday, September 3, 2008' selected=false
++++++++++++++++++++++++++++staticText name='3'
++++++++++++++++++++++++++cell name='Thursday, September 4, 2008' selected=false
++++++++++++++++++++++++++++staticText name='4'
++++++++++++++++++++++++++cell name='Friday, September 5, 2008' selected=false
++++++++++++++++++++++++++++staticText name='5'
++++++++++++++++++++++++++cell name='Saturday, September 6, 2008' selected=false
++++++++++++++++++++++++++++staticText name='6'
++++++++++++++++++++++++row
++++++++++++++++++++++++++cell name='Sunday, September 7, 2008' selected=false
++++++++++++++++++++++++++++staticText name='7'
++++++++++++++++++++++++++cell name='Monday, September 8, 2008' selected=false
++++++++++++++++++++++++++++staticText name='8'
++++++++++++++++++++++++++cell name='Tuesday, September 9, 2008' selected=false
++++++++++++++++++++++++++++staticText name='9'
++++++++++++++++++++++++++cell name='Wednesday, September 10, 2008' selected=false
++++++++++++++++++++++++++++staticText name='10'
++++++++++++++++++++++++++cell name='Thursday, September 11, 2008' selected=false
++++++++++++++++++++++++++++staticText name='11'
++++++++++++++++++++++++++cell name='Friday, September 12, 2008' selected=false
++++++++++++++++++++++++++++staticText name='12'
++++++++++++++++++++++++++cell name='Saturday, September 13, 2008' selected=false
++++++++++++++++++++++++++++staticText name='13'
++++++++++++++++++++++++row
++++++++++++++++++++++++++cell name='Sunday, September 14, 2008' selected=false
++++++++++++++++++++++++++++staticText name='14'
++++++++++++++++++++++++++cell name='Monday, September 15, 2008' selected=false
++++++++++++++++++++++++++++staticText name='15'
++++++++++++++++++++++++++cell name='Tuesday, September 16, 2008' selected=false
++++++++++++++++++++++++++++staticText name='16'
++++++++++++++++++++++++++cell name='Wednesday, September 17, 2008' selected=false
++++++++++++++++++++++++++++staticText name='17'
++++++++++++++++++++++++++cell name='Thursday, September 18, 2008' selected=false
++++++++++++++++++++++++++++staticText name='18'
++++++++++++++++++++++++++cell name='Friday, September 19, 2008' selected=false
++++++++++++++++++++++++++++staticText name='19'
++++++++++++++++++++++++++cell name='Saturday, September 20, 2008' selected=false
++++++++++++++++++++++++++++staticText name='20'
++++++++++++++++++++++++row
++++++++++++++++++++++++++cell name='Sunday, September 21, 2008' selected=false
++++++++++++++++++++++++++++staticText name='21'
++++++++++++++++++++++++++cell name='Monday, September 22, 2008' selected=false
++++++++++++++++++++++++++++staticText name='22'
++++++++++++++++++++++++++cell name='Tuesday, September 23, 2008' selected=false
++++++++++++++++++++++++++++staticText name='23'
++++++++++++++++++++++++++cell name='Wednesday, September 24, 2008' selected=false
++++++++++++++++++++++++++++staticText name='24'
++++++++++++++++++++++++++cell name='Thursday, September 25, 2008' selected=false
++++++++++++++++++++++++++++staticText name='25'
++++++++++++++++++++++++++cell name='Friday, September 26, 2008' selected=false
++++++++++++++++++++++++++++staticText name='26'
++++++++++++++++++++++++++cell name='Saturday, September 27, 2008' selected=false
++++++++++++++++++++++++++++staticText name='27'
++++++++++++++++++++++++row
++++++++++++++++++++++++++cell name='Sunday, September 28, 2008' selected=false
++++++++++++++++++++++++++++staticText name='28'
++++++++++++++++++++++++++cell name='Monday, September 29, 2008' selected=false
++++++++++++++++++++++++++++staticText name='29'
++++++++++++++++++++++++++cell name='Tuesday, September 30, 2008' selected=false
++++++++++++++++++++++++++++staticText name='30'
++++++++++++++++++++++++++cell name='Wednesday, October 1, 2008' selected=false
++++++++++++++++++++++++++++staticText name='1'
++++++++++++++++++++++++++cell name='Thursday, October 2, 2008' selected=false
++++++++++++++++++++++++++++staticText name='2'
++++++++++++++++++++++++++cell name='Friday, October 3, 2008' selected=false
++++++++++++++++++++++++++++staticText name='3'
++++++++++++++++++++++++++cell name='Saturday, October 4, 2008' selected=false
++++++++++++++++++++++++++++staticText name='4'
++++++++++++++++++++++++row
++++++++++++++++++++++++++cell name='Sunday, October 5, 2008' selected=false
++++++++++++++++++++++++++++staticText name='5'
++++++++++++++++++++++++++cell name='Monday, October 6, 2008' selected=false
++++++++++++++++++++++++++++staticText name='6'
++++++++++++++++++++++++++cell name='Tuesday, October 7, 2008' selected=false
++++++++++++++++++++++++++++staticText name='7'
++++++++++++++++++++++++++cell name='Wednesday, October 8, 2008' selected=false
++++++++++++++++++++++++++++staticText name='8'
++++++++++++++++++++++++++cell name='Thursday, October 9, 2008' selected=false
++++++++++++++++++++++++++++staticText name='9'
++++++++++++++++++++++++++cell name='Friday, October 10, 2008' selected=false
++++++++++++++++++++++++++++staticText name='10'
++++++++++++++++++++++++++cell name='Saturday, October 11, 2008' selected=false
++++++++++++++++++++++++++++staticText name='11'
++++++++++++++++++++button name='Today' ++++++++++++++++++++button name='Today'
++++++++++++++++++++++staticText name='Today' ++++++++++++++++++++++staticText name='Today'
...@@ -24,7 +24,7 @@ AXWebArea AXRoleDescription='HTML content' ...@@ -24,7 +24,7 @@ AXWebArea AXRoleDescription='HTML content'
++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++AXGroup AXRoleDescription='group'
++++++++++++++AXButton AXRoleDescription='button' AXDescription='Show next month' ++++++++++++++AXButton AXRoleDescription='button' AXDescription='Show next month'
++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++AXGroup AXRoleDescription='group'
++++++++++++++AXTable AXRoleDescription='table' AXDescription='S M T W T F S Today' ++++++++++++++AXTable AXRoleDescription='table' AXDescription='S M T W T F S Sunday, August 31, 2008 Monday, September 1, 2008 Tuesday, September 2, 2008 Wednesday, September 3, 2008 Thursday, September 4, 2008 Friday, September 5, 2008 Saturday, September 6, 2008 Sunday, September 7, 2008 Monday, September 8, 2008 Tuesday, September 9, 2008 Wednesday, September 10, 2008 Thursday, September 11, 2008 Friday, September 12, 2008 Saturday, September 13, 2008 Sunday, September 14, 2008 Monday, September 15, 2008 Tuesday, September 16, 2008 Wednesday, September 17, 2008 Thursday, September 18, 2008 Friday, September 19, 2008 Saturday, September 20, 2008 Sunday, September 21, 2008 Monday, September 22, 2008 Tuesday, September 23, 2008 Wednesday, September 24, 2008 Thursday, September 25, 2008 Friday, September 26, 2008 Saturday, September 27, 2008 Sunday, September 28, 2008 Monday, September 29, 2008 Tuesday, September 30, 2008 Wednesday, October 1, 2008 Thursday, October 2, 2008 Friday, October 3, 2008 Saturday, October 4, 2008 Sunday, October 5, 2008 Monday, October 6, 2008 Tuesday, October 7, 2008 Wednesday, October 8, 2008 Thursday, October 9, 2008 Friday, October 10, 2008 Saturday, October 11, 2008 Today'
++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++AXGroup AXRoleDescription='group'
++++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++++AXGroup AXRoleDescription='group'
++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='S' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='S'
...@@ -42,5 +42,102 @@ AXWebArea AXRoleDescription='HTML content' ...@@ -42,5 +42,102 @@ AXWebArea AXRoleDescription='HTML content'
++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='S' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='S'
++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++AXGroup AXRoleDescription='group'
++++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++++AXGroup AXRoleDescription='group'
++++++++++++++++++++AXRow AXRoleDescription='row'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, August 31, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='31'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 1, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='1'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 2, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='2'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 3, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='3'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 4, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='4'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 5, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='5'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 6, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='6'
++++++++++++++++++++AXRow AXRoleDescription='row'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 7, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='7'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 8, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='8'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 9, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='9'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 10, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='10'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 11, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='11'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 12, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='12'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 13, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='13'
++++++++++++++++++++AXRow AXRoleDescription='row'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 14, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='14'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 15, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='15'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 16, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='16'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 17, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='17'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 18, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='18'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 19, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='19'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 20, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='20'
++++++++++++++++++++AXRow AXRoleDescription='row'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 21, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='21'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 22, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='22'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 23, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='23'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 24, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='24'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 25, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='25'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 26, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='26'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 27, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='27'
++++++++++++++++++++AXRow AXRoleDescription='row'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 28, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='28'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 29, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='29'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 30, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='30'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, October 1, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='1'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, October 2, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='2'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, October 3, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='3'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, October 4, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='4'
++++++++++++++++++++AXRow AXRoleDescription='row'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, October 5, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='5'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, October 6, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='6'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, October 7, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='7'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, October 8, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='8'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, October 9, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='9'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, October 10, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='10'
++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, October 11, 2008'
++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='11'
++++++++++++++++AXButton AXRoleDescription='button' AXDescription='Today' ++++++++++++++++AXButton AXRoleDescription='button' AXDescription='Today'
++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++AXColumn AXRoleDescription='column'
++++++++++++++++AXColumn AXRoleDescription='column'
++++++++++++++++AXColumn AXRoleDescription='column'
++++++++++++++++AXColumn AXRoleDescription='column'
++++++++++++++++AXColumn AXRoleDescription='column'
++++++++++++++++AXColumn AXRoleDescription='column'
++++++++++++++++AXColumn AXRoleDescription='column'
++++++++++++++++AXGroup AXRoleDescription='group'
\ No newline at end of file
<!-- <!--
@BLINK-ALLOW:inputType=* @BLINK-ALLOW:inputType=*
# Exclude the month/year at the top of the table and the weekday name
# abbreviations on the column headers because these differ cross-platform due
# to different localizations ('Mo' on Windows vs 'M' elsewhere, etc).
@BLINK-DENY:name='September? 2008'
@BLINK-DENY:name='S?'
@BLINK-DENY:name='M?'
@BLINK-DENY:name='T?'
@BLINK-DENY:name='W?'
@BLINK-DENY:name='F?'
@MAC-ALLOW:AXRole* @MAC-ALLOW:AXRole*
@WIN-ALLOW:ia2_hypertext=* @WIN-ALLOW:ia2_hypertext=*
@WIN-DENY:ia2_hypertext='September? 2008*'
@WIN-DENY:name='September? 2008'
@UIA-WIN-ALLOW:ControllerFor=* @UIA-WIN-ALLOW:ControllerFor=*
@UIA-WIN-ALLOW:LocalizedControlType='date picker' @UIA-WIN-ALLOW:LocalizedControlType='date picker'
@DEFAULT-ACTION-ON:Show date picker @DEFAULT-ACTION-ON:Show date picker
@WAIT-FOR:Today @WAIT-FOR:Saturday, October 11, 2008
@WIN-ALLOW:localized_extended_role='date picker' @WIN-ALLOW:localized_extended_role='date picker'
--> -->
<!DOCTYPE html> <!DOCTYPE html>
......
...@@ -1753,10 +1753,17 @@ ListCell.prototype.setSelected = function(selected) { ...@@ -1753,10 +1753,17 @@ ListCell.prototype.setSelected = function(selected) {
if (this._selected === selected) if (this._selected === selected)
return; return;
this._selected = selected; this._selected = selected;
if (this._selected) if (this._selected) {
this.element.classList.add('selected'); this.element.classList.add('selected');
else if (global.params.isFormControlsRefreshEnabled) {
this.element.setAttribute('aria-selected', true);
}
} else {
this.element.classList.remove('selected'); this.element.classList.remove('selected');
if (global.params.isFormControlsRefreshEnabled) {
this.element.setAttribute('aria-selected', false);
}
}
}; };
/** /**
...@@ -2866,6 +2873,7 @@ YearListView.prototype.prepareNewCell = function(row) { ...@@ -2866,6 +2873,7 @@ YearListView.prototype.prepareNewCell = function(row) {
'false'); 'false');
} }
cell.monthButtons[i].setAttribute('aria-label', month.toLocaleString()); cell.monthButtons[i].setAttribute('aria-label', month.toLocaleString());
cell.monthButtons[i].setAttribute('aria-selected', false);
} }
if (!global.params.isFormControlsRefreshEnabled && this.highlightedMonth && if (!global.params.isFormControlsRefreshEnabled && this.highlightedMonth &&
row === this.highlightedMonth.year - 1) { row === this.highlightedMonth.year - 1) {
...@@ -2881,6 +2889,10 @@ YearListView.prototype.prepareNewCell = function(row) { ...@@ -2881,6 +2889,10 @@ YearListView.prototype.prepareNewCell = function(row) {
if (this._selectedMonth && (this._selectedMonth.year - 1) === row) { if (this._selectedMonth && (this._selectedMonth.year - 1) === row) {
var monthButton = cell.monthButtons[this._selectedMonth.month]; var monthButton = cell.monthButtons[this._selectedMonth.month];
monthButton.classList.add(YearListCell.ClassNameSelected); monthButton.classList.add(YearListCell.ClassNameSelected);
if (global.params.isFormControlsRefreshEnabled) {
this.element.setAttribute('aria-activedescendant', monthButton.id);
monthButton.setAttribute('aria-selected', true);
}
} }
const todayMonth = Month.createFromToday(); const todayMonth = Month.createFromToday();
if ((todayMonth.year - 1) === row) { if ((todayMonth.year - 1) === row) {
...@@ -3040,6 +3052,7 @@ YearListView.prototype.setSelectedMonth = function(month) { ...@@ -3040,6 +3052,7 @@ YearListView.prototype.setSelectedMonth = function(month) {
var oldMonthButton = this.buttonForMonth(this._selectedMonth); var oldMonthButton = this.buttonForMonth(this._selectedMonth);
if (oldMonthButton) { if (oldMonthButton) {
oldMonthButton.classList.remove(YearListCell.ClassNameSelected); oldMonthButton.classList.remove(YearListCell.ClassNameSelected);
oldMonthButton.setAttribute('aria-selected', false);
} }
this._selectedMonth = month; this._selectedMonth = month;
...@@ -3047,6 +3060,8 @@ YearListView.prototype.setSelectedMonth = function(month) { ...@@ -3047,6 +3060,8 @@ YearListView.prototype.setSelectedMonth = function(month) {
var newMonthButton = this.buttonForMonth(this._selectedMonth); var newMonthButton = this.buttonForMonth(this._selectedMonth);
if (newMonthButton) { if (newMonthButton) {
newMonthButton.classList.add(YearListCell.ClassNameSelected); newMonthButton.classList.add(YearListCell.ClassNameSelected);
this.element.setAttribute('aria-activedescendant', newMonthButton.id);
newMonthButton.setAttribute('aria-selected', true);
} }
}; };
...@@ -4267,9 +4282,13 @@ CalendarTableView.prototype.updateCells = function() { ...@@ -4267,9 +4282,13 @@ CalendarTableView.prototype.updateCells = function() {
var dayCell = this._dayCells[dayString]; var dayCell = this._dayCells[dayString];
var day = dayCell.day; var day = dayCell.day;
dayCell.setIsToday(Day.createFromToday().equals(day)); dayCell.setIsToday(Day.createFromToday().equals(day));
dayCell.setSelected( var isSelected = (day >= firstDayInSelection && day <= lastDayInSelection);
day >= firstDayInSelection && day <= lastDayInSelection); dayCell.setSelected(isSelected);
if (!global.params.isFormControlsRefreshEnabled) { if (global.params.isFormControlsRefreshEnabled) {
if (isSelected && firstDayInSelection == lastDayInSelection) {
activeCell = dayCell;
}
} else {
var isHighlighted = var isHighlighted =
day >= firstDayInHighlight && day <= lastDayInHighlight; day >= firstDayInHighlight && day <= lastDayInHighlight;
dayCell.setHighlighted(isHighlighted); dayCell.setHighlighted(isHighlighted);
...@@ -4289,8 +4308,13 @@ CalendarTableView.prototype.updateCells = function() { ...@@ -4289,8 +4308,13 @@ CalendarTableView.prototype.updateCells = function() {
for (var weekString in this._weekNumberCells) { for (var weekString in this._weekNumberCells) {
var weekNumberCell = this._weekNumberCells[weekString]; var weekNumberCell = this._weekNumberCells[weekString];
var week = weekNumberCell.week; var week = weekNumberCell.week;
weekNumberCell.setSelected(selection && selection.equals(week)); var isSelected = (selection && selection.equals(week));
if (!global.params.isFormControlsRefreshEnabled) { weekNumberCell.setSelected(isSelected);
if (global.params.isFormControlsRefreshEnabled) {
if (isSelected) {
activeCell = weekNumberCell;
}
} else {
var isWeekHighlighted = highlight && highlight.equals(week); var isWeekHighlighted = highlight && highlight.equals(week);
weekNumberCell.setHighlighted(isWeekHighlighted); weekNumberCell.setHighlighted(isWeekHighlighted);
if (isWeekHighlighted) if (isWeekHighlighted)
......
...@@ -40,7 +40,7 @@ promise_test(() => { ...@@ -40,7 +40,7 @@ promise_test(() => {
markDirtyCounter++; markDirtyCounter++;
} }
if (focusCounter == 5 && markDirtyCounter == 2) { if (focusCounter == 5 && markDirtyCounter == 6) {
assert_equals(date1.value, "2000-02-03", "Submitting month switcher should have udpated control value"); assert_equals(date1.value, "2000-02-03", "Submitting month switcher should have udpated control value");
resolve(); resolve();
} }
......
...@@ -12,32 +12,36 @@ ...@@ -12,32 +12,36 @@
<input type="month" id="month1" value="2000-01"> <input type="month" id="month1" value="2000-01">
<script> <script>
async_test((t) => { promise_test((t) => {
var month1 = document.getElementById('month1');
return openPickerWithPromise(month1).then(() => {
var markDirtyCounter = 0; var markDirtyCounter = 0;
var focusCounter = 0; var focusCounter = 0;
accessibilityController.setNotificationListener(function(axnode, type) { let promise = new Promise((resolve, reject) => {
accessibilityController.setNotificationListener(function(axnode, type) {
if (type == 'Focus') { if (type == 'Focus') {
console.log('Focused: ' + accessibilityController.focusedElement.name.replace(/,/g, '')); console.log('Focused: ' + accessibilityController.focusedElement.name.replace(/,/g, ''));
focusCounter++; focusCounter++;
} else if (type == 'MarkDirty') { } else if (type == 'MarkDirty') {
console.log('Received MarkDirty'); console.log('Received MarkDirty');
markDirtyCounter++; markDirtyCounter++;
} }
if (focusCounter == 3 && markDirtyCounter == 1) { if (focusCounter == 1 && markDirtyCounter == 1) {
assert_equals(month1.value, "2000-05", "Arrow key in month picker should have changed value"); assert_equals(month1.value, "2000-05", "Arrow key in month picker should have changed value");
t.done(); t.done();
} }
}); });
var month1 = document.getElementById('month1'); // In case of failure, reject the promise so we get some logs instead of timing out.
function test1() { window.setTimeout(() => {
assert_equals(focusCounter, 2, "Expected 2 Focus events from opening popup."); reject(`Didn't receive expected events. Got ${focusCounter} Focus and ${markDirtyCounter} MarkDirty`);
assert_equals(markDirtyCounter, 1, "Expected 1 MarkDirty events from opening popup."); }, 1500);
eventSender.keyDown('ArrowDown'); });
}
openPicker(month1, test1); eventSender.keyDown('ArrowDown');
return promise;
});
}, 'Tests if typing an arrow key dispatches |Focus| and |MarkDirty| a11y events.'); }, 'Tests if typing an arrow key dispatches |Focus| and |MarkDirty| a11y events.');
</script> </script>
......
...@@ -27,7 +27,7 @@ promise_test(() => { ...@@ -27,7 +27,7 @@ promise_test(() => {
markDirtyCounter++; markDirtyCounter++;
} }
if (focusCounter == 1 && markDirtyCounter == 0) { if (focusCounter == 1 && markDirtyCounter == 1) {
resolve(); resolve();
} }
}); });
...@@ -41,7 +41,6 @@ promise_test(() => { ...@@ -41,7 +41,6 @@ promise_test(() => {
eventSender.keyDown('ArrowDown'); eventSender.keyDown('ArrowDown');
return promise; return promise;
}); });
}, 'Tests if typing an arrow key dispatches |Focus| and |MarkDirty| a11y events.'); }, 'Tests if typing an arrow key dispatches |Focus| and |MarkDirty| a11y events.');
</script> </script>
......
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