Title: [247418] trunk/Source
- Revision
- 247418
- Author
- commit-qu...@webkit.org
- Date
- 2019-07-13 10:28:41 -0700 (Sat, 13 Jul 2019)
Log Message
Add accessibility support to WKDataListSuggestionsView.
https://bugs.webkit.org/show_bug.cgi?id=199772
<rdar://problem/47095851>
Patch by Andres Gonzalez <andresg...@apple.com> on 2019-07-13
Reviewed by Chris Fleizach.
Source/WebCore:
Localizable strings for accessibility announcements.
* en.lproj/Localizable.strings:
Source/WebKit:
Added accessibility announcement notifications to show, dismiss and selection change for the datalist suggestions view.
* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
(-[WKDataListSuggestionsView notifyAccessibilityClients:]):
(-[WKDataListSuggestionsView moveSelectionByDirection:]):
(-[WKDataListSuggestionsView invalidate]):
(-[WKDataListSuggestionsView showSuggestionsDropdown:]):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (247417 => 247418)
--- trunk/Source/WebCore/ChangeLog 2019-07-13 15:28:51 UTC (rev 247417)
+++ trunk/Source/WebCore/ChangeLog 2019-07-13 17:28:41 UTC (rev 247418)
@@ -1,3 +1,15 @@
+2019-07-13 Andres Gonzalez <andresg...@apple.com>
+
+ Add accessibility support to WKDataListSuggestionsView.
+ https://bugs.webkit.org/show_bug.cgi?id=199772
+ <rdar://problem/47095851>
+
+ Reviewed by Chris Fleizach.
+
+ Localizable strings for accessibility announcements.
+
+ * en.lproj/Localizable.strings:
+
2019-07-13 Chris Dumez <cdu...@apple.com>
Drop non thread-safe usage of WeakPtr in VideoFullscreenInterfaceAVKit
Modified: trunk/Source/WebCore/en.lproj/Localizable.strings (247417 => 247418)
--- trunk/Source/WebCore/en.lproj/Localizable.strings 2019-07-13 15:28:51 UTC (rev 247417)
+++ trunk/Source/WebCore/en.lproj/Localizable.strings 2019-07-13 17:28:41 UTC (rev 247418)
@@ -775,6 +775,12 @@
/* Menu section heading for subtitles */
"Subtitles" = "Subtitles";
+/* Accessibility announcement for the data list suggestions dropdown going away. */
+"Suggestions list hidden." = "Suggestions list hidden.";
+
+/* Accessibility announcement that the suggestions list became visible. The format argument is for the first option in the list. */
+"Suggestions list visible, %@" = "Suggestions list visible, %@";
+
/* Undo action name */
"Superscript (Undo action name)" = "Superscript";
Modified: trunk/Source/WebKit/ChangeLog (247417 => 247418)
--- trunk/Source/WebKit/ChangeLog 2019-07-13 15:28:51 UTC (rev 247417)
+++ trunk/Source/WebKit/ChangeLog 2019-07-13 17:28:41 UTC (rev 247418)
@@ -1,3 +1,18 @@
+2019-07-13 Andres Gonzalez <andresg...@apple.com>
+
+ Add accessibility support to WKDataListSuggestionsView.
+ https://bugs.webkit.org/show_bug.cgi?id=199772
+ <rdar://problem/47095851>
+
+ Reviewed by Chris Fleizach.
+
+ Added accessibility announcement notifications to show, dismiss and selection change for the datalist suggestions view.
+ * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
+ (-[WKDataListSuggestionsView notifyAccessibilityClients:]):
+ (-[WKDataListSuggestionsView moveSelectionByDirection:]):
+ (-[WKDataListSuggestionsView invalidate]):
+ (-[WKDataListSuggestionsView showSuggestionsDropdown:]):
+
2019-07-13 Zalan Bujtas <za...@apple.com>
Cannot bring up custom media controls at all on v.youku.com
Modified: trunk/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm (247417 => 247418)
--- trunk/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm 2019-07-13 15:28:51 UTC (rev 247417)
+++ trunk/Source/WebKit/UIProcess/mac/WebDataListSuggestionsDropdownMac.mm 2019-07-13 17:28:41 UTC (rev 247418)
@@ -30,6 +30,7 @@
#import "WebPageProxy.h"
#import <WebCore/IntRect.h>
+#import <WebCore/LocalizedStrings.h>
#import <pal/spi/cocoa/NSColorSPI.h>
static const CGFloat dropdownTopMargin = 2;
@@ -352,6 +353,14 @@
[_table setVisibleRect:[_enclosingWindow frame]];
}
+- (void)notifyAccessibilityClients:(NSString *)info
+{
+ NSDictionary<NSAccessibilityNotificationUserInfoKey, id> *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
+ NSAccessibilityPriorityKey, @(NSAccessibilityPriorityHigh),
+ NSAccessibilityAnnouncementKey, info, nil];
+ NSAccessibilityPostNotificationWithUserInfo(NSApp, NSAccessibilityAnnouncementRequestedNotification, userInfo);
+}
+
- (void)moveSelectionByDirection:(const String&)direction
{
size_t size = _suggestions.size();
@@ -368,6 +377,10 @@
newSelection = (direction == "Up") ? (size - 1) : 0;
[_table setActiveRow:newSelection];
+
+ // Notify accessibility clients of new selection.
+ NSString *currentSelectedString = [self currentSelectedString];
+ [self notifyAccessibilityClients:currentSelectedString];
}
- (void)invalidate
@@ -383,6 +396,10 @@
[[_view window] removeChildWindow:_enclosingWindow.get()];
[_enclosingWindow close];
_enclosingWindow = nil;
+
+ // Notify accessibility clients that datalist went away.
+ NSString *info = WEB_UI_STRING("Suggestions list hidden.", "Accessibility announcement for the data list suggestions dropdown going away.");
+ [self notifyAccessibilityClients:info];
}
- (NSRect)dropdownRectForElementRect:(const WebCore::IntRect&)rect
@@ -399,6 +416,11 @@
[_table reload];
[[_view window] addChildWindow:_enclosingWindow.get() ordered:NSWindowAbove];
[[_table enclosingScrollView] flashScrollers];
+
+ // Notify accessibility clients of datalist becoming visible.
+ NSString *currentSelectedString = [self currentSelectedString];
+ NSString *info = [NSString stringWithFormat:WEB_UI_STRING("Suggestions list visible, %@", "Accessibility announcement that the suggestions list became visible. The format argument is for the first option in the list."), currentSelectedString];
+ [self notifyAccessibilityClients:info];
}
- (void)selectedRow:(NSTableView *)sender
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes