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

Unified Diff: Source/web/resources/calendarPicker.js

Issue 550853002: AX: Calendar Picker: Initial day selection should notify ActiveDescendantChanged a11y event. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/forms/calendar-picker/date-picker-ax-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/resources/calendarPicker.js
diff --git a/Source/web/resources/calendarPicker.js b/Source/web/resources/calendarPicker.js
index 99d2b470d7fd9b7bef11f0827a6abd07d29067fb..81b54afa21874f0922f4d9046cb462c38bb65d7a 100644
--- a/Source/web/resources/calendarPicker.js
+++ b/Source/web/resources/calendarPicker.js
@@ -3519,6 +3519,7 @@ CalendarTableView.prototype.updateCells = function() {
var currentMonth = this.calendarPicker.currentMonth();
var firstDayInCurrentMonth = currentMonth.firstDay().valueOf();
var lastDayInCurrentMonth = currentMonth.lastDay().valueOf();
+ var activeDayCell = null;
for (var dayString in this._dayCells) {
var dayCell = this._dayCells[dayString];
var day = dayCell.day;
@@ -3527,7 +3528,7 @@ CalendarTableView.prototype.updateCells = function() {
var isHighlighted = day >= firstDayInHighlight && day <= lastDayInHighlight;
dayCell.setHighlighted(isHighlighted);
if (isHighlighted && firstDayInHighlight == lastDayInHighlight)
- this.element.setAttribute("aria-activedescendant", dayCell.element.id);
+ activeDayCell = dayCell;
dayCell.setIsInCurrentMonth(day >= firstDayInCurrentMonth && day <= lastDayInCurrentMonth);
dayCell.setDisabled(!this.calendarPicker.isValidDay(day));
}
@@ -3540,6 +3541,13 @@ CalendarTableView.prototype.updateCells = function() {
weekNumberCell.setDisabled(!this.calendarPicker.isValid(week));
}
}
+ if (activeDayCell) {
+ // Ensure a renderer because an element with no renderer doesn't post
+ // activedescendant events. This shouldn't run in the above |for| loop
+ // to avoid CSS transition.
+ activeDayCell.element.offsetLeft;
+ this.element.setAttribute("aria-activedescendant", activeDayCell.element.id);
+ }
};
/**
« no previous file with comments | « LayoutTests/fast/forms/calendar-picker/date-picker-ax-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698