diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2013-08-27 01:01:00 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2013-08-27 01:01:00 +0000 |
commit | 45b25458dd5def3b026049abb81c475025445075 (patch) | |
tree | 0e3d08f9040789d6c4bc246f3333c9125776da3e /third_party/WebKit | |
parent | 3761d6f4b2147cf4abd5240eed57f983988b0285 (diff) | |
download | chromium_src-45b25458dd5def3b026049abb81c475025445075.zip chromium_src-45b25458dd5def3b026049abb81c475025445075.tar.gz chromium_src-45b25458dd5def3b026049abb81c475025445075.tar.bz2 |
Clean up accessibility enums for use in Chromium.
The goal of this change is to make it possible for Chromium to use
Blink accessibility role, state, and event enums throughout
its codebase, rather than copying to separate enums.
* Rename the enums in public/web so they're more concise, e.g.
WebAccessibilityRoleDocumentArticle -> WebAXTypes::ArticleRole
WebAccessibilityNotificationLoadComplete -> WebAXTypes::LoadComplete
* Add missing enum values currently used in Chromium, delete unused values.
* Rename a few enum values that were unclear or confusing.
This will require a cleanup change after Chromium switches over.
BUG=269034
Review URL: https://chromiumcodereview.appspot.com/22331005
git-svn-id: svn://svn.chromium.org/blink/trunk@156740 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit')
35 files changed, 963 insertions, 544 deletions
diff --git a/third_party/WebKit/LayoutTests/accessibility/main-element-expected.txt b/third_party/WebKit/LayoutTests/accessibility/main-element-expected.txt index a4c232b..eefe641 100644 --- a/third_party/WebKit/LayoutTests/accessibility/main-element-expected.txt +++ b/third_party/WebKit/LayoutTests/accessibility/main-element-expected.txt @@ -1,10 +1,10 @@ main -This tests that the HTML5 main element correctly maps to AXLandmarkMain. +This tests that the HTML5 main element correctly maps to AXMain. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS main.role is 'AXRole: AXLandmarkMain' +PASS main.role is 'AXRole: AXMain' PASS successfullyParsed is true TEST COMPLETE diff --git a/third_party/WebKit/LayoutTests/accessibility/main-element.html b/third_party/WebKit/LayoutTests/accessibility/main-element.html index bf1c576..44374b2 100644 --- a/third_party/WebKit/LayoutTests/accessibility/main-element.html +++ b/third_party/WebKit/LayoutTests/accessibility/main-element.html @@ -12,14 +12,14 @@ <script> - description("This tests that the HTML5 main element correctly maps to AXLandmarkMain."); + description("This tests that the HTML5 main element correctly maps to AXMain."); if (window.accessibilityController) { document.getElementById("body").focus(); var body = accessibilityController.focusedElement; var main = accessibilityController.accessibleElementById("main"); - shouldBe("main.role", "'AXRole: AXLandmarkMain'"); + shouldBe("main.role", "'AXRole: AXMain'"); } diff --git a/third_party/WebKit/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification-expected.txt index d4fc8ae..5666f5d 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification-expected.txt @@ -3,9 +3,9 @@ This test checks value changed accessibility notifications. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -FocusedUIElementChanged AXHelp: Month=AXValueDescription: 10 -FocusedUIElementChanged AXHelp: Day=AXValueDescription: 09 -FocusedUIElementChanged AXHelp: Year=AXValueDescription: 2012 +Focus AXHelp: Month=AXValueDescription: 10 +Focus AXHelp: Day=AXValueDescription: 09 +Focus AXHelp: Year=AXValueDescription: 2012 ValueChanged AXHelp: Day=AXValueDescription: 04 ValueChanged AXHelp: Day=AXValueDescription: 04 ValueChanged AXHelp: Year=AXValueDescription: 2013 diff --git a/third_party/WebKit/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification.html b/third_party/WebKit/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification.html index 39790a2..2e99769 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification.html +++ b/third_party/WebKit/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification.html @@ -14,7 +14,7 @@ if (!window.accessibilityController || !window.eventSender) debug("Please run inside DRT or WRT."); else { accessibilityController.addNotificationListener(function (element, notification) { - if (notification == 'FocusedUIElementChanged' || notification == 'ValueChanged') { + if (notification == 'Focus' || notification == 'ValueChanged') { debug(notification + ' ' + element.helpText + '=' + element.valueDescription); } }); diff --git a/third_party/WebKit/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-ax-value-changed-notification-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-ax-value-changed-notification-expected.txt index 54bfdae..775a2a5 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-ax-value-changed-notification-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-ax-value-changed-notification-expected.txt @@ -3,11 +3,11 @@ This test checks value changed accessibility notifications. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -FocusedUIElementChanged AXHelp: Month=AXValueDescription: 10 -FocusedUIElementChanged AXHelp: Day=AXValueDescription: 09 -FocusedUIElementChanged AXHelp: Year=AXValueDescription: 2012 -FocusedUIElementChanged AXHelp: Hours=AXValueDescription: 12 -FocusedUIElementChanged AXHelp: Minutes=AXValueDescription: 34 +Focus AXHelp: Month=AXValueDescription: 10 +Focus AXHelp: Day=AXValueDescription: 09 +Focus AXHelp: Year=AXValueDescription: 2012 +Focus AXHelp: Hours=AXValueDescription: 12 +Focus AXHelp: Minutes=AXValueDescription: 34 ValueChanged AXHelp: Day=AXValueDescription: 04 ValueChanged AXHelp: Day=AXValueDescription: 04 ValueChanged AXHelp: Year=AXValueDescription: 2013 diff --git a/third_party/WebKit/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-ax-value-changed-notification.html b/third_party/WebKit/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-ax-value-changed-notification.html index 80d98d89..40055cf 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-ax-value-changed-notification.html +++ b/third_party/WebKit/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-ax-value-changed-notification.html @@ -14,7 +14,7 @@ if (!window.accessibilityController || !window.eventSender) debug('Please run inside DRT or WRT.'); else { accessibilityController.addNotificationListener(function (element, notification) { - if (notification == 'FocusedUIElementChanged' || notification == 'ValueChanged') { + if (notification == 'Focus' || notification == 'ValueChanged') { debug(notification + ' ' + element.helpText + '=' + element.valueDescription); } }); diff --git a/third_party/WebKit/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-ax-value-changed-notification-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-ax-value-changed-notification-expected.txt index c8e95bb..3926e79 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-ax-value-changed-notification-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-ax-value-changed-notification-expected.txt @@ -3,8 +3,8 @@ This test checks value changed accessibility notifications. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -FocusedUIElementChanged AXHelp: Month=AXValueDescription: October -FocusedUIElementChanged AXHelp: Year=AXValueDescription: 2012 +Focus AXHelp: Month=AXValueDescription: October +Focus AXHelp: Year=AXValueDescription: 2012 ValueChanged AXHelp: Year=AXValueDescription: 0005 ValueChanged AXHelp: Year=AXValueDescription: 0005 ValueChanged AXHelp: Year=AXValueDescription: 0005 diff --git a/third_party/WebKit/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-ax-value-changed-notification.html b/third_party/WebKit/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-ax-value-changed-notification.html index 33f8d86..ab1be04 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-ax-value-changed-notification.html +++ b/third_party/WebKit/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-ax-value-changed-notification.html @@ -14,7 +14,7 @@ if (!window.accessibilityController || !window.eventSender) debug("Please run inside DRT or WRT."); else { accessibilityController.addNotificationListener(function (element, notification) { - if (notification == 'FocusedUIElementChanged' || notification == 'ValueChanged') { + if (notification == 'Focus' || notification == 'ValueChanged') { debug(notification + ' ' + element.helpText + '=' + element.valueDescription); } }); diff --git a/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-value-changed-notification-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-value-changed-notification-expected.txt index 2e5ed9b..da90a6e 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-value-changed-notification-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-value-changed-notification-expected.txt @@ -3,8 +3,8 @@ This test checks value changed accessibility notifications. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -FocusedUIElementChanged AXHelp: Hours=AXValueDescription: 12 -FocusedUIElementChanged AXHelp: Minutes=AXValueDescription: 34 +Focus AXHelp: Hours=AXValueDescription: 12 +Focus AXHelp: Minutes=AXValueDescription: 34 ValueChanged AXHelp: Minutes=AXValueDescription: 05 ValueChanged AXHelp: Minutes=AXValueDescription: 05 ValueChanged AXHelp: Minutes=AXValueDescription: 05 diff --git a/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-value-changed-notification.html b/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-value-changed-notification.html index 0590fa3..fe81cf3 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-value-changed-notification.html +++ b/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-value-changed-notification.html @@ -16,7 +16,7 @@ function enableAccessibility() } accessibilityController.addNotificationListener(function (element, notification) { - if (notification == 'FocusedUIElementChanged' || notification == 'ValueChanged') { + if (notification == 'Focus' || notification == 'ValueChanged') { debug(notification + ' ' + element.helpText + '=' + element.valueDescription); } }); diff --git a/third_party/WebKit/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-ax-value-changed-notification-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-ax-value-changed-notification-expected.txt index 3b7a8a9..4a59bcb 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-ax-value-changed-notification-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-ax-value-changed-notification-expected.txt @@ -3,8 +3,8 @@ This test checks value changed accessibility notifications. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -FocusedUIElementChanged AXHelp: Week=AXValueDescription: 10 -FocusedUIElementChanged AXHelp: Year=AXValueDescription: 2012 +Focus AXHelp: Week=AXValueDescription: 10 +Focus AXHelp: Year=AXValueDescription: 2012 ValueChanged AXHelp: Year=AXValueDescription: 0005 ValueChanged AXHelp: Year=AXValueDescription: 0005 ValueChanged AXHelp: Year=AXValueDescription: 0005 diff --git a/third_party/WebKit/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-ax-value-changed-notification.html b/third_party/WebKit/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-ax-value-changed-notification.html index 209c880..c9b7ebc 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-ax-value-changed-notification.html +++ b/third_party/WebKit/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-ax-value-changed-notification.html @@ -14,7 +14,7 @@ if (!window.accessibilityController || !window.eventSender) debug("Please run inside DRT or WRT."); else { accessibilityController.addNotificationListener(function (element, notification) { - if (notification == 'FocusedUIElementChanged' || notification == 'ValueChanged') { + if (notification == 'Focus' || notification == 'ValueChanged') { debug(notification + ' ' + element.helpText + '=' + element.valueDescription); } }); diff --git a/third_party/WebKit/Source/core/accessibility/AXObjectCache.cpp b/third_party/WebKit/Source/core/accessibility/AXObjectCache.cpp index ef76297..69b2ad6 100644 --- a/third_party/WebKit/Source/core/accessibility/AXObjectCache.cpp +++ b/third_party/WebKit/Source/core/accessibility/AXObjectCache.cpp @@ -728,18 +728,6 @@ void AXObjectCache::selectedChildrenChanged(RenderObject* renderer) postNotification(renderer, AXSelectedChildrenChanged, false); } -void AXObjectCache::nodeTextChangeNotification(Node* node, AXTextChange textChange, unsigned offset, const String& text) -{ - if (!node) - return; - - stopCachingComputedObjectAttributes(); - - // Delegate on the right platform - AccessibilityObject* obj = getOrCreate(node); - nodeTextChangePlatformNotification(obj, textChange, offset, text); -} - void AXObjectCache::handleScrollbarUpdate(ScrollView* view) { if (!view) @@ -945,44 +933,17 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific ChromeClient& client = obj->documentFrameView()->frame()->page()->chrome().client(); - switch (notification) { - case AXActiveDescendantChanged: - if (!obj->document()->focusedElement() || (obj->node() != obj->document()->focusedElement())) - break; - + if (notification == AXActiveDescendantChanged + && obj->document()->focusedElement() + && obj->node() == obj->document()->focusedElement()) { // Calling handleFocusedUIElementChanged will focus the new active // descendant and send the AXFocusedUIElementChanged notification. handleFocusedUIElementChanged(0, obj->document()->focusedElement()); - break; - case AXAriaAttributeChanged: - case AXAutocorrectionOccured: - case AXCheckedStateChanged: - case AXChildrenChanged: - case AXFocusedUIElementChanged: - case AXInvalidStatusChanged: - case AXLayoutComplete: - case AXLiveRegionChanged: - case AXLoadComplete: - case AXMenuListItemSelected: - case AXMenuListValueChanged: - case AXRowCollapsed: - case AXRowCountChanged: - case AXRowExpanded: - case AXScrolledToAnchor: - case AXSelectedChildrenChanged: - case AXSelectedTextChanged: - case AXTextChanged: - case AXValueChanged: - break; } client.postAccessibilityNotification(obj, notification); } -void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&) -{ -} - void AXObjectCache::handleFocusedUIElementChanged(Node*, Node* newFocusedNode) { if (!newFocusedNode) diff --git a/third_party/WebKit/Source/core/accessibility/AXObjectCache.h b/third_party/WebKit/Source/core/accessibility/AXObjectCache.h index c4c7b81..3e37eb9 100644 --- a/third_party/WebKit/Source/core/accessibility/AXObjectCache.h +++ b/third_party/WebKit/Source/core/accessibility/AXObjectCache.h @@ -150,37 +150,38 @@ public: enum AXNotification { AXActiveDescendantChanged, + AXAlert, + AXAriaAttributeChanged, AXAutocorrectionOccured, + AXBlur, AXCheckedStateChanged, AXChildrenChanged, AXFocusedUIElementChanged, + AXHide, + AXInvalidStatusChanged, AXLayoutComplete, - AXLoadComplete, - AXSelectedChildrenChanged, - AXSelectedTextChanged, - AXValueChanged, - AXScrolledToAnchor, AXLiveRegionChanged, + AXLoadComplete, + AXLocationChanged, AXMenuListItemSelected, AXMenuListValueChanged, - AXRowCountChanged, AXRowCollapsed, + AXRowCountChanged, AXRowExpanded, - AXInvalidStatusChanged, + AXScrolledToAnchor, + AXSelectedChildrenChanged, + AXSelectedTextChanged, + AXShow, AXTextChanged, - AXAriaAttributeChanged + AXTextInserted, + AXTextRemoved, + AXValueChanged }; void postNotification(RenderObject*, AXNotification, bool postToElement, PostType = PostAsynchronously); void postNotification(Node*, AXNotification, bool postToElement, PostType = PostAsynchronously); void postNotification(AccessibilityObject*, Document*, AXNotification, bool postToElement, PostType = PostAsynchronously); - enum AXTextChange { - AXTextInserted, - AXTextDeleted, - }; - - void nodeTextChangeNotification(Node*, AXTextChange, unsigned offset, const String&); bool nodeHasRole(Node*, const AtomicString& role); void startCachingComputedObjectAttributesUntilTreeMutates(); @@ -190,7 +191,6 @@ public: protected: void postPlatformNotification(AccessibilityObject*, AXNotification); - void nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned offset, const String&); void textChanged(AccessibilityObject*); void labelChanged(Element*); diff --git a/third_party/WebKit/Source/core/accessibility/AccessibilityImageMapLink.cpp b/third_party/WebKit/Source/core/accessibility/AccessibilityImageMapLink.cpp index 91a43e1..6c36cfdf 100644 --- a/third_party/WebKit/Source/core/accessibility/AccessibilityImageMapLink.cpp +++ b/third_party/WebKit/Source/core/accessibility/AccessibilityImageMapLink.cpp @@ -72,13 +72,13 @@ AccessibilityObject* AccessibilityImageMapLink::parentObject() const AccessibilityRole AccessibilityImageMapLink::roleValue() const { if (!m_areaElement) - return WebCoreLinkRole; + return LinkRole; const AtomicString& ariaRole = getAttribute(roleAttr); if (!ariaRole.isEmpty()) return AccessibilityObject::ariaRoleToWebCoreRole(ariaRole); - return WebCoreLinkRole; + return LinkRole; } Element* AccessibilityImageMapLink::actionElement() const diff --git a/third_party/WebKit/Source/core/accessibility/AccessibilityNodeObject.cpp b/third_party/WebKit/Source/core/accessibility/AccessibilityNodeObject.cpp index a459ffa..399dddd 100644 --- a/third_party/WebKit/Source/core/accessibility/AccessibilityNodeObject.cpp +++ b/third_party/WebKit/Source/core/accessibility/AccessibilityNodeObject.cpp @@ -175,7 +175,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole() return ariaRole; if (node()->isLink()) - return WebCoreLinkRole; + return LinkRole; if (node()->isTextNode()) return StaticTextRole; if (node()->hasTagName(buttonTag)) @@ -214,7 +214,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole() if (node()->isElementNode() && toElement(node())->isFocusable()) return GroupRole; if (node()->hasTagName(aTag) && isClickable()) - return WebCoreLinkRole; + return LinkRole; return UnknownRole; } @@ -513,7 +513,7 @@ bool AccessibilityNodeObject::isInputImage() const bool AccessibilityNodeObject::isLink() const { - return roleValue() == WebCoreLinkRole; + return roleValue() == LinkRole; } bool AccessibilityNodeObject::isMenu() const diff --git a/third_party/WebKit/Source/core/accessibility/AccessibilityObject.cpp b/third_party/WebKit/Source/core/accessibility/AccessibilityObject.cpp index 6b43837..f58aa2e 100644 --- a/third_party/WebKit/Source/core/accessibility/AccessibilityObject.cpp +++ b/third_party/WebKit/Source/core/accessibility/AccessibilityObject.cpp @@ -57,16 +57,16 @@ struct RoleEntry { static ARIARoleMap* createARIARoleMap() { const RoleEntry roles[] = { - { "alert", ApplicationAlertRole }, - { "alertdialog", ApplicationAlertDialogRole }, - { "application", LandmarkApplicationRole }, - { "article", DocumentArticleRole }, - { "banner", LandmarkBannerRole }, + { "alert", AlertRole }, + { "alertdialog", AlertDialogRole }, + { "application", ApplicationRole }, + { "article", ArticleRole }, + { "banner", BannerRole }, { "button", ButtonRole }, { "checkbox", CheckBoxRole }, - { "complementary", LandmarkComplementaryRole }, - { "contentinfo", LandmarkContentInfoRole }, - { "dialog", ApplicationDialogRole }, + { "complementary", ComplementaryRole }, + { "contentinfo", ContentInfoRole }, + { "dialog", DialogRole }, { "directory", DirectoryRole }, { "grid", TableRole }, { "gridcell", CellRole }, @@ -78,41 +78,41 @@ static ARIARoleMap* createARIARoleMap() { "group", GroupRole }, { "heading", HeadingRole }, { "img", ImageRole }, - { "link", WebCoreLinkRole }, + { "link", LinkRole }, { "list", ListRole }, { "listitem", ListItemRole }, { "listbox", ListBoxRole }, - { "log", ApplicationLogRole }, + { "log", LogRole }, // "option" isn't here because it may map to different roles depending on the parent element's role - { "main", LandmarkMainRole }, - { "marquee", ApplicationMarqueeRole }, - { "math", DocumentMathRole }, + { "main", MainRole }, + { "marquee", MarqueeRole }, + { "math", MathRole }, { "menu", MenuRole }, { "menubar", MenuBarRole }, { "menuitem", MenuItemRole }, { "menuitemcheckbox", MenuItemRole }, { "menuitemradio", MenuItemRole }, - { "note", DocumentNoteRole }, - { "navigation", LandmarkNavigationRole }, + { "note", NoteRole }, + { "navigation", NavigationRole }, { "option", ListBoxOptionRole }, { "presentation", PresentationalRole }, { "progressbar", ProgressIndicatorRole }, { "radio", RadioButtonRole }, { "radiogroup", RadioGroupRole }, - { "region", DocumentRegionRole }, + { "region", RegionRole }, { "row", RowRole }, { "scrollbar", ScrollBarRole }, - { "search", LandmarkSearchRole }, + { "search", SearchRole }, { "separator", SplitterRole }, { "slider", SliderRole }, { "spinbutton", SpinButtonRole }, - { "status", ApplicationStatusRole }, + { "status", StatusRole }, { "tab", TabRole }, { "tablist", TabListRole }, { "tabpanel", TabPanelRole }, { "text", StaticTextRole }, { "textbox", TextAreaRole }, - { "timer", ApplicationTimerRole }, + { "timer", TimerRole }, { "toolbar", ToolbarRole }, { "tooltip", UserInterfaceTooltipRole }, { "tree", TreeRole }, @@ -226,7 +226,6 @@ bool AccessibilityObject::isClickable() const case TextAreaRole: case TextFieldRole: case ToggleButtonRole: - case WebCoreLinkRole: return true; default: return false; @@ -331,7 +330,6 @@ String AccessibilityObject::actionVerb() const case CheckBoxRole: return isChecked() ? AXCheckedCheckBoxActionVerb() : AXUncheckedCheckBoxActionVerb(); case LinkRole: - case WebCoreLinkRole: return AXLinkActionVerb(); case PopUpButtonRole: return AXMenuListActionVerb(); diff --git a/third_party/WebKit/Source/core/accessibility/AccessibilityObject.h b/third_party/WebKit/Source/core/accessibility/AccessibilityObject.h index 444348a..72bc24e 100644 --- a/third_party/WebKit/Source/core/accessibility/AccessibilityObject.h +++ b/third_party/WebKit/Source/core/accessibility/AccessibilityObject.h @@ -60,15 +60,12 @@ class Widget; typedef unsigned AXID; enum AccessibilityRole { - AnnotationRole = 1, + AlertDialogRole = 1, + AlertRole, + AnnotationRole, ApplicationRole, - ApplicationAlertRole, - ApplicationAlertDialogRole, - ApplicationDialogRole, - ApplicationLogRole, - ApplicationMarqueeRole, - ApplicationStatusRole, - ApplicationTimerRole, + ArticleRole, + BannerRole, BrowserRole, BusyIndicatorRole, ButtonRole, @@ -76,20 +73,19 @@ enum AccessibilityRole { CellRole, CheckBoxRole, ColorWellRole, - ColumnRole, ColumnHeaderRole, + ColumnRole, ComboBoxRole, + ComplementaryRole, + ContentInfoRole, DefinitionRole, - DescriptionListTermRole, DescriptionListDetailRole, + DescriptionListTermRole, + DialogRole, DirectoryRole, DisclosureTriangleRole, DivRole, DocumentRole, - DocumentArticleRole, - DocumentMathRole, - DocumentNoteRole, - DocumentRegionRole, DrawerRole, EditableTextRole, FooterRole, @@ -101,33 +97,32 @@ enum AccessibilityRole { HelpTagRole, HorizontalRuleRole, IgnoredRole, - ImageRole, - ImageMapRole, ImageMapLinkRole, + ImageMapRole, + ImageRole, IncrementorRole, LabelRole, - LandmarkApplicationRole, - LandmarkBannerRole, - LandmarkComplementaryRole, - LandmarkContentInfoRole, - LandmarkMainRole, - LandmarkNavigationRole, - LandmarkSearchRole, LegendRole, LinkRole, - ListRole, - ListBoxRole, ListBoxOptionRole, + ListBoxRole, ListItemRole, ListMarkerRole, + ListRole, + LogRole, + MainRole, + MarqueeRole, MathElementRole, + MathRole, MatteRole, - MenuRole, MenuBarRole, MenuButtonRole, MenuItemRole, - MenuListPopupRole, MenuListOptionRole, + MenuListPopupRole, + MenuRole, + NavigationRole, + NoteRole, OutlineRole, ParagraphRole, PopUpButtonRole, @@ -135,41 +130,45 @@ enum AccessibilityRole { ProgressIndicatorRole, RadioButtonRole, RadioGroupRole, + RegionRole, + RootWebAreaRole, RowHeaderRole, RowRole, - RulerRole, RulerMarkerRole, + RulerRole, + SVGRootRole, ScrollAreaRole, ScrollBarRole, SeamlessWebAreaRole, + SearchRole, SheetRole, SliderRole, SliderThumbRole, - SpinButtonRole, SpinButtonPartRole, + SpinButtonRole, SplitGroupRole, SplitterRole, StaticTextRole, + StatusRole, SystemWideRole, - SVGRootRole, TabGroupRole, TabListRole, TabPanelRole, TabRole, - TableRole, TableHeaderContainerRole, + TableRole, TextAreaRole, - TreeRole, - TreeGridRole, - TreeItemRole, TextFieldRole, + TimerRole, ToggleButtonRole, ToolbarRole, + TreeGridRole, + TreeItemRole, + TreeRole, UnknownRole, UserInterfaceTooltipRole, ValueIndicatorRole, WebAreaRole, - WebCoreLinkRole, WindowRole, }; @@ -184,6 +183,31 @@ enum AccessibilityTextSource { LabelByElementText, }; +enum AccessibilityState { + AXBusyState, + AXCheckedState, + AXCollapsedState, + AXEnabledState, + AXExpandedState, + AXFocusableState, + AXFocusedState, + AXHaspopupState, + AXHoveredState, + AXIndeterminateState, + AXInvisibleState, + AXLinkedState, + AXMultiselectableState, + AXOffscreenState, + AXPressedState, + AXProtectedState, + AXReadonlyState, + AXRequiredState, + AXSelectableState, + AXSelectedState, + AXVerticalState, + AXVisitedState +}; + struct AccessibilityText { String text; AccessibilityTextSource textSource; diff --git a/third_party/WebKit/Source/core/accessibility/AccessibilityRenderObject.cpp b/third_party/WebKit/Source/core/accessibility/AccessibilityRenderObject.cpp index 49f4a38..5d6aaf8 100644 --- a/third_party/WebKit/Source/core/accessibility/AccessibilityRenderObject.cpp +++ b/third_party/WebKit/Source/core/accessibility/AccessibilityRenderObject.cpp @@ -326,7 +326,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole() if (node && node->isLink()) { if (cssBox && cssBox->isImage()) return ImageMapRole; - return WebCoreLinkRole; + return LinkRole; } if (cssBox && cssBox->isListItem()) return ListItemRole; @@ -420,22 +420,22 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole() return FormRole; if (node && node->hasTagName(articleTag)) - return DocumentArticleRole; + return ArticleRole; if (node && node->hasTagName(mainTag)) - return LandmarkMainRole; + return MainRole; if (node && node->hasTagName(navTag)) - return LandmarkNavigationRole; + return NavigationRole; if (node && node->hasTagName(asideTag)) - return LandmarkComplementaryRole; + return ComplementaryRole; if (node && node->hasTagName(sectionTag)) - return DocumentRegionRole; + return RegionRole; if (node && node->hasTagName(addressTag)) - return LandmarkContentInfoRole; + return ContentInfoRole; // The HTML element should not be exposed as an element. That's what the RenderView element does. if (node && isHTMLHtmlElement(node)) @@ -444,12 +444,12 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole() // There should only be one banner/contentInfo per page. If header/footer are being used within an article or section // then it should not be exposed as whole page's banner/contentInfo if (node && node->hasTagName(headerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag)) - return LandmarkBannerRole; + return BannerRole; if (node && node->hasTagName(footerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag)) return FooterRole; if (node && node->hasTagName(aTag) && isClickable()) - return WebCoreLinkRole; + return LinkRole; if (m_renderer->isBlockFlow()) return GroupRole; @@ -972,7 +972,6 @@ String AccessibilityRenderObject::actionVerb() const case CheckBoxRole: return isChecked() ? AXCheckedCheckBoxActionVerb() : AXUncheckedCheckBoxActionVerb(); case LinkRole: - case WebCoreLinkRole: return AXLinkActionVerb(); default: return emptyString(); @@ -1190,14 +1189,14 @@ const AtomicString& AccessibilityRenderObject::ariaLiveRegionStatus() const // These roles have implicit live region status. if (liveRegionStatus.isEmpty()) { switch (roleValue()) { - case ApplicationAlertDialogRole: - case ApplicationAlertRole: + case AlertDialogRole: + case AlertRole: return liveRegionStatusAssertive; - case ApplicationLogRole: - case ApplicationStatusRole: + case LogRole: + case StatusRole: return liveRegionStatusPolite; - case ApplicationTimerRole: - case ApplicationMarqueeRole: + case TimerRole: + case MarqueeRole: return liveRegionStatusOff; default: break; diff --git a/third_party/WebKit/Source/core/editing/AppendNodeCommand.cpp b/third_party/WebKit/Source/core/editing/AppendNodeCommand.cpp index 6e5d65d..f72b893 100644 --- a/third_party/WebKit/Source/core/editing/AppendNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/AppendNodeCommand.cpp @@ -27,7 +27,6 @@ #include "core/editing/AppendNodeCommand.h" #include "bindings/v8/ExceptionState.h" -#include "core/accessibility/AXObjectCache.h" #include "core/dom/Document.h" namespace WebCore { @@ -44,26 +43,12 @@ AppendNodeCommand::AppendNodeCommand(PassRefPtr<ContainerNode> parent, PassRefPt ASSERT(m_parent->rendererIsEditable() || !m_parent->attached()); } -static void sendAXTextChangedIgnoringLineBreaks(Node* node, AXObjectCache::AXTextChange textChange) -{ - String nodeValue = node->nodeValue(); - // Don't consider linebreaks in this command - if (nodeValue == "\n") - return; - - if (AXObjectCache* cache = node->document()->existingAXObjectCache()) - cache->nodeTextChangeNotification(node, textChange, 0, nodeValue); -} - void AppendNodeCommand::doApply() { if (!m_parent->rendererIsEditable() && m_parent->attached()) return; m_parent->appendChild(m_node.get(), IGNORE_EXCEPTION); - - if (AXObjectCache::accessibilityEnabled()) - sendAXTextChangedIgnoringLineBreaks(m_node.get(), AXObjectCache::AXTextInserted); } void AppendNodeCommand::doUnapply() @@ -71,10 +56,6 @@ void AppendNodeCommand::doUnapply() if (!m_parent->rendererIsEditable()) return; - // Need to notify this before actually deleting the text - if (AXObjectCache::accessibilityEnabled()) - sendAXTextChangedIgnoringLineBreaks(m_node.get(), AXObjectCache::AXTextDeleted); - m_node->remove(IGNORE_EXCEPTION); } diff --git a/third_party/WebKit/Source/core/editing/DeleteFromTextNodeCommand.cpp b/third_party/WebKit/Source/core/editing/DeleteFromTextNodeCommand.cpp index dc5736b..03fb87e0 100644 --- a/third_party/WebKit/Source/core/editing/DeleteFromTextNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/DeleteFromTextNodeCommand.cpp @@ -28,7 +28,6 @@ #include "bindings/v8/ExceptionState.h" #include "bindings/v8/ExceptionStatePlaceholder.h" -#include "core/accessibility/AXObjectCache.h" #include "core/dom/Document.h" #include "core/dom/Text.h" @@ -57,10 +56,6 @@ void DeleteFromTextNodeCommand::doApply() if (es.hadException()) return; - // Need to notify this before actually deleting the text - if (AXObjectCache* cache = document()->existingAXObjectCache()) - cache->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextDeleted, m_offset, m_text); - m_node->deleteData(m_offset, m_count, es, DeprecatedAttachNow); } @@ -72,9 +67,6 @@ void DeleteFromTextNodeCommand::doUnapply() return; m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION, DeprecatedAttachNow); - - if (AXObjectCache* cache = document()->existingAXObjectCache()) - cache->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextInserted, m_offset, m_text); } #ifndef NDEBUG diff --git a/third_party/WebKit/Source/core/editing/InsertIntoTextNodeCommand.cpp b/third_party/WebKit/Source/core/editing/InsertIntoTextNodeCommand.cpp index 4ce67f2..e67c6ce 100644 --- a/third_party/WebKit/Source/core/editing/InsertIntoTextNodeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/InsertIntoTextNodeCommand.cpp @@ -27,7 +27,6 @@ #include "core/editing/InsertIntoTextNodeCommand.h" #include "bindings/v8/ExceptionStatePlaceholder.h" -#include "core/accessibility/AXObjectCache.h" #include "core/dom/Document.h" #include "core/dom/Text.h" #include "core/page/Settings.h" @@ -62,9 +61,6 @@ void InsertIntoTextNodeCommand::doApply() } m_node->insertData(m_offset, m_text, IGNORE_EXCEPTION, DeprecatedAttachNow); - - if (AXObjectCache* cache = document()->existingAXObjectCache()) - cache->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextInserted, m_offset, m_text); } void InsertIntoTextNodeCommand::doUnapply() @@ -72,10 +68,6 @@ void InsertIntoTextNodeCommand::doUnapply() if (!m_node->rendererIsEditable()) return; - // Need to notify this before actually deleting the text - if (AXObjectCache* cache = document()->existingAXObjectCache()) - cache->nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextDeleted, m_offset, m_text); - m_node->deleteData(m_offset, m_text.length(), IGNORE_EXCEPTION, DeprecatedAttachNow); } diff --git a/third_party/WebKit/Source/core/editing/InsertNodeBeforeCommand.cpp b/third_party/WebKit/Source/core/editing/InsertNodeBeforeCommand.cpp index f2ba9b2..f6872e7 100644 --- a/third_party/WebKit/Source/core/editing/InsertNodeBeforeCommand.cpp +++ b/third_party/WebKit/Source/core/editing/InsertNodeBeforeCommand.cpp @@ -27,7 +27,6 @@ #include "core/editing/InsertNodeBeforeCommand.h" #include "bindings/v8/ExceptionStatePlaceholder.h" -#include "core/accessibility/AXObjectCache.h" #include "core/dom/Document.h" namespace WebCore { @@ -55,9 +54,6 @@ void InsertNodeBeforeCommand::doApply() ASSERT(parent->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)); parent->insertBefore(m_insertChild.get(), m_refChild.get(), IGNORE_EXCEPTION); - - if (AXObjectCache* cache = document()->existingAXObjectCache()) - cache->nodeTextChangeNotification(m_insertChild.get(), AXObjectCache::AXTextInserted, 0, m_insertChild->nodeValue()); } void InsertNodeBeforeCommand::doUnapply() @@ -65,10 +61,6 @@ void InsertNodeBeforeCommand::doUnapply() if (!m_insertChild->isContentEditable(Node::UserSelectAllIsAlwaysNonEditable)) return; - // Need to notify this before actually deleting the text - if (AXObjectCache* cache = document()->existingAXObjectCache()) - cache->nodeTextChangeNotification(m_insertChild.get(), AXObjectCache::AXTextDeleted, 0, m_insertChild->nodeValue()); - m_insertChild->remove(IGNORE_EXCEPTION); } diff --git a/third_party/WebKit/Source/testing/runner/AccessibilityUIElementChromium.cpp b/third_party/WebKit/Source/testing/runner/AccessibilityUIElementChromium.cpp index 62b4ca8..e48d75c 100644 --- a/third_party/WebKit/Source/testing/runner/AccessibilityUIElementChromium.cpp +++ b/third_party/WebKit/Source/testing/runner/AccessibilityUIElementChromium.cpp @@ -46,226 +46,230 @@ namespace { // Map role value to string, matching Safari/Mac platform implementation to // avoid rebaselining layout tests. -string roleToString(WebAccessibilityRole role) +string roleToString(WebAXRole role) { string result = "AXRole: AX"; switch (role) { - case WebAccessibilityRoleButton: - return result.append("Button"); - case WebAccessibilityRoleRadioButton: - return result.append("RadioButton"); - case WebAccessibilityRoleCheckBox: - return result.append("CheckBox"); - case WebAccessibilityRoleSlider: - return result.append("Slider"); - case WebAccessibilityRoleTabGroup: - return result.append("TabGroup"); - case WebAccessibilityRoleTextField: - return result.append("TextField"); - case WebAccessibilityRoleStaticText: - return result.append("StaticText"); - case WebAccessibilityRoleTextArea: - return result.append("TextArea"); - case WebAccessibilityRoleScrollArea: - return result.append("ScrollArea"); - case WebAccessibilityRolePopUpButton: - return result.append("PopUpButton"); - case WebAccessibilityRoleMenuButton: - return result.append("MenuButton"); - case WebAccessibilityRoleTable: - return result.append("Table"); - case WebAccessibilityRoleApplication: + case WebAXRoleAlertDialog: + return result.append("AlertDialog"); + case WebAXRoleAlert: + return result.append("Alert"); + case WebAXRoleAnnotation: + return result.append("Annotation"); + case WebAXRoleApplication: return result.append("Application"); - case WebAccessibilityRoleGroup: - return result.append("Group"); - case WebAccessibilityRoleRadioGroup: - return result.append("RadioGroup"); - case WebAccessibilityRoleList: - return result.append("List"); - case WebAccessibilityRoleScrollBar: - return result.append("ScrollBar"); - case WebAccessibilityRoleValueIndicator: - return result.append("ValueIndicator"); - case WebAccessibilityRoleImage: - return result.append("Image"); - case WebAccessibilityRoleMenuBar: - return result.append("MenuBar"); - case WebAccessibilityRoleMenu: - return result.append("Menu"); - case WebAccessibilityRoleMenuItem: - return result.append("MenuItem"); - case WebAccessibilityRoleColumn: - return result.append("Column"); - case WebAccessibilityRoleRow: - return result.append("Row"); - case WebAccessibilityRoleToolbar: - return result.append("Toolbar"); - case WebAccessibilityRoleBusyIndicator: - return result.append("BusyIndicator"); - case WebAccessibilityRoleProgressIndicator: - return result.append("ProgressIndicator"); - case WebAccessibilityRoleWindow: - return result.append("Window"); - case WebAccessibilityRoleDrawer: - return result.append("Drawer"); - case WebAccessibilityRoleSystemWide: - return result.append("SystemWide"); - case WebAccessibilityRoleOutline: - return result.append("Outline"); - case WebAccessibilityRoleIncrementor: - return result.append("Incrementor"); - case WebAccessibilityRoleBrowser: + case WebAXRoleArticle: + return result.append("Article"); + case WebAXRoleBanner: + return result.append("Banner"); + case WebAXRoleBrowser: return result.append("Browser"); - case WebAccessibilityRoleComboBox: - return result.append("ComboBox"); - case WebAccessibilityRoleSplitGroup: - return result.append("SplitGroup"); - case WebAccessibilityRoleSplitter: - return result.append("Splitter"); - case WebAccessibilityRoleColorWell: - return result.append("ColorWell"); - case WebAccessibilityRoleGrowArea: - return result.append("GrowArea"); - case WebAccessibilityRoleSheet: - return result.append("Sheet"); - case WebAccessibilityRoleHelpTag: - return result.append("HelpTag"); - case WebAccessibilityRoleMatte: - return result.append("Matte"); - case WebAccessibilityRoleRuler: - return result.append("Ruler"); - case WebAccessibilityRoleRulerMarker: - return result.append("RulerMarker"); - case WebAccessibilityRoleLink: - return result.append("Link"); - case WebAccessibilityRoleDisclosureTriangle: - return result.append("DisclosureTriangle"); - case WebAccessibilityRoleGrid: - return result.append("Grid"); - case WebAccessibilityRoleCell: + case WebAXRoleBusyIndicator: + return result.append("BusyIndicator"); + case WebAXRoleButton: + return result.append("Button"); + case WebAXRoleCanvas: + return result.append("Canvas"); + case WebAXRoleCell: return result.append("Cell"); - case WebAccessibilityRoleColumnHeader: + case WebAXRoleCheckBox: + return result.append("CheckBox"); + case WebAXRoleColorWell: + return result.append("ColorWell"); + case WebAXRoleColumnHeader: return result.append("ColumnHeader"); - case WebAccessibilityRoleRowHeader: - return result.append("RowHeader"); - case WebAccessibilityRoleWebCoreLink: - // Maps to Link role. - return result.append("Link"); - case WebAccessibilityRoleImageMapLink: - return result.append("ImageMapLink"); - case WebAccessibilityRoleImageMap: - return result.append("ImageMap"); - case WebAccessibilityRoleListMarker: - return result.append("ListMarker"); - case WebAccessibilityRoleWebArea: - return result.append("WebArea"); - case WebAccessibilityRoleHeading: - return result.append("Heading"); - case WebAccessibilityRoleListBox: - return result.append("ListBox"); - case WebAccessibilityRoleListBoxOption: - return result.append("ListBoxOption"); - case WebAccessibilityRoleTableHeaderContainer: - return result.append("TableHeaderContainer"); - case WebAccessibilityRoleDefinition: + case WebAXRoleColumn: + return result.append("Column"); + case WebAXRoleComboBox: + return result.append("ComboBox"); + case WebAXRoleComplementary: + return result.append("Complementary"); + case WebAXRoleContentInfo: + return result.append("ContentInfo"); + case WebAXRoleDefinition: return result.append("Definition"); - case WebAccessibilityRoleDescriptionListTerm: - return result.append("DescriptionListTerm"); - case WebAccessibilityRoleDescriptionListDetail: + case WebAXRoleDescriptionListDetail: return result.append("DescriptionListDetail"); - case WebAccessibilityRoleAnnotation: - return result.append("Annotation"); - case WebAccessibilityRoleSliderThumb: - return result.append("SliderThumb"); - case WebAccessibilityRoleLandmarkApplication: - return result.append("LandmarkApplication"); - case WebAccessibilityRoleLandmarkBanner: - return result.append("LandmarkBanner"); - case WebAccessibilityRoleLandmarkComplementary: - return result.append("LandmarkComplementary"); - case WebAccessibilityRoleLandmarkContentInfo: - return result.append("LandmarkContentInfo"); - case WebAccessibilityRoleLandmarkMain: - return result.append("LandmarkMain"); - case WebAccessibilityRoleLandmarkNavigation: - return result.append("LandmarkNavigation"); - case WebAccessibilityRoleLandmarkSearch: - return result.append("LandmarkSearch"); - case WebAccessibilityRoleApplicationLog: - return result.append("ApplicationLog"); - case WebAccessibilityRoleApplicationMarquee: - return result.append("ApplicationMarquee"); - case WebAccessibilityRoleApplicationStatus: - return result.append("ApplicationStatus"); - case WebAccessibilityRoleApplicationTimer: - return result.append("ApplicationTimer"); - case WebAccessibilityRoleDocument: - return result.append("Document"); - case WebAccessibilityRoleDocumentArticle: - return result.append("DocumentArticle"); - case WebAccessibilityRoleDocumentNote: - return result.append("DocumentNote"); - case WebAccessibilityRoleDocumentRegion: - return result.append("DocumentRegion"); - case WebAccessibilityRoleUserInterfaceTooltip: - return result.append("UserInterfaceTooltip"); - case WebAccessibilityRoleToggleButton: - return result.append("ToggleButton"); - case WebAccessibilityRoleCanvas: - return result.append("Canvas"); - case WebAccessibilityRoleParagraph: - return result.append("Paragraph"); - case WebAccessibilityRoleDiv: - return result.append("Div"); - case WebAccessibilityRoleLabel: - return result.append("Label"); - case WebAccessibilityRoleForm: - return result.append("Form"); - case WebAccessibilityRoleHorizontalRule: - return result.append("HorizontalRule"); - case WebAccessibilityRoleLegend: - return result.append("Legend"); - case WebAccessibilityRoleApplicationAlert: - return result.append("Alert"); - case WebAccessibilityRoleApplicationAlertDialog: - return result.append("AlertDialog"); - case WebAccessibilityRoleApplicationDialog: - return result.append("ApplicationDialog"); - case WebAccessibilityRoleDirectory: + case WebAXRoleDescriptionListTerm: + return result.append("DescriptionListTerm"); + case WebAXRoleDialog: + return result.append("Dialog"); + case WebAXRoleDirectory: return result.append("Directory"); - case WebAccessibilityRoleDocumentMath: - return result.append("Math"); - case WebAccessibilityRoleEditableText: + case WebAXRoleDisclosureTriangle: + return result.append("DisclosureTriangle"); + case WebAXRoleDiv: + return result.append("Div"); + case WebAXRoleDocument: + return result.append("Document"); + case WebAXRoleDrawer: + return result.append("Drawer"); + case WebAXRoleEditableText: return result.append("EditableText"); - case WebAccessibilityRoleFooter: + case WebAXRoleFooter: return result.append("Footer"); - case WebAccessibilityRoleIgnored: + case WebAXRoleForm: + return result.append("Form"); + case WebAXRoleGrid: + return result.append("Grid"); + case WebAXRoleGroup: + return result.append("Group"); + case WebAXRoleGrowArea: + return result.append("GrowArea"); + case WebAXRoleHeading: + return result.append("Heading"); + case WebAXRoleHelpTag: + return result.append("HelpTag"); + case WebAXRoleHorizontalRule: + return result.append("HorizontalRule"); + case WebAXRoleIgnored: return result.append("Ignored"); - case WebAccessibilityRoleListItem: + case WebAXRoleImageMapLink: + return result.append("ImageMapLink"); + case WebAXRoleImageMap: + return result.append("ImageMap"); + case WebAXRoleImage: + return result.append("Image"); + case WebAXRoleIncrementor: + return result.append("Incrementor"); + case WebAXRoleLabel: + return result.append("Label"); + case WebAXRoleLegend: + return result.append("Legend"); + case WebAXRoleLink: + return result.append("Link"); + case WebAXRoleListBoxOption: + return result.append("ListBoxOption"); + case WebAXRoleListBox: + return result.append("ListBox"); + case WebAXRoleListItem: return result.append("ListItem"); - case WebAccessibilityRoleMenuListPopup: - return result.append("MenuListPopup"); - case WebAccessibilityRoleMenuListOption: + case WebAXRoleListMarker: + return result.append("ListMarker"); + case WebAXRoleList: + return result.append("List"); + case WebAXRoleLog: + return result.append("Log"); + case WebAXRoleMain: + return result.append("Main"); + case WebAXRoleMarquee: + return result.append("Marquee"); + case WebAXRoleMathElement: + return result.append("MathElement"); + case WebAXRoleMath: + return result.append("Math"); + case WebAXRoleMatte: + return result.append("Matte"); + case WebAXRoleMenuBar: + return result.append("MenuBar"); + case WebAXRoleMenuButton: + return result.append("MenuButton"); + case WebAXRoleMenuItem: + return result.append("MenuItem"); + case WebAXRoleMenuListOption: return result.append("MenuListOption"); - case WebAccessibilityRolePresentational: + case WebAXRoleMenuListPopup: + return result.append("MenuListPopup"); + case WebAXRoleMenu: + return result.append("Menu"); + case WebAXRoleNavigation: + return result.append("Navigation"); + case WebAXRoleNote: + return result.append("Note"); + case WebAXRoleOutline: + return result.append("Outline"); + case WebAXRoleParagraph: + return result.append("Paragraph"); + case WebAXRolePopUpButton: + return result.append("PopUpButton"); + case WebAXRolePresentational: return result.append("Presentational"); - case WebAccessibilityRoleSpinButton: - return result.append("SpinButton"); - case WebAccessibilityRoleSpinButtonPart: + case WebAXRoleProgressIndicator: + return result.append("ProgressIndicator"); + case WebAXRoleRadioButton: + return result.append("RadioButton"); + case WebAXRoleRadioGroup: + return result.append("RadioGroup"); + case WebAXRoleRegion: + return result.append("Region"); + case WebAXRoleRootWebArea: + return result.append("RootWebArea"); + case WebAXRoleRowHeader: + return result.append("RowHeader"); + case WebAXRoleRow: + return result.append("Row"); + case WebAXRoleRulerMarker: + return result.append("RulerMarker"); + case WebAXRoleRuler: + return result.append("Ruler"); + case WebAXRoleSVGRoot: + return result.append("SVGRoot"); + case WebAXRoleScrollArea: + return result.append("ScrollArea"); + case WebAXRoleScrollBar: + return result.append("ScrollBar"); + case WebAXRoleSeamlessWebArea: + return result.append("SeamlessWebArea"); + case WebAXRoleSearch: + return result.append("Search"); + case WebAXRoleSheet: + return result.append("Sheet"); + case WebAXRoleSlider: + return result.append("Slider"); + case WebAXRoleSliderThumb: + return result.append("SliderThumb"); + case WebAXRoleSpinButtonPart: return result.append("SpinButtonPart"); - case WebAccessibilityRoleTabList: + case WebAXRoleSpinButton: + return result.append("SpinButton"); + case WebAXRoleSplitGroup: + return result.append("SplitGroup"); + case WebAXRoleSplitter: + return result.append("Splitter"); + case WebAXRoleStaticText: + return result.append("StaticText"); + case WebAXRoleStatus: + return result.append("Status"); + case WebAXRoleSystemWide: + return result.append("SystemWide"); + case WebAXRoleTabGroup: + return result.append("TabGroup"); + case WebAXRoleTabList: return result.append("TabList"); - case WebAccessibilityRoleTabPanel: + case WebAXRoleTabPanel: return result.append("TabPanel"); - case WebAccessibilityRoleTab: + case WebAXRoleTab: return result.append("Tab"); - case WebAccessibilityRoleTreeRole: - return result.append("Tree"); - case WebAccessibilityRoleTreeGrid: + case WebAXRoleTableHeaderContainer: + return result.append("TableHeaderContainer"); + case WebAXRoleTable: + return result.append("Table"); + case WebAXRoleTextArea: + return result.append("TextArea"); + case WebAXRoleTextField: + return result.append("TextField"); + case WebAXRoleTimer: + return result.append("Timer"); + case WebAXRoleToggleButton: + return result.append("ToggleButton"); + case WebAXRoleToolbar: + return result.append("Toolbar"); + case WebAXRoleTreeGrid: return result.append("TreeGrid"); - case WebAccessibilityRoleTreeItemRole: + case WebAXRoleTreeItem: return result.append("TreeItem"); - case WebAccessibilityRoleUnknown: + case WebAXRoleTree: + return result.append("Tree"); + case WebAXRoleUnknown: + return result.append("Unknown"); + case WebAXRoleUserInterfaceTooltip: + return result.append("UserInterfaceTooltip"); + case WebAXRoleValueIndicator: + return result.append("ValueIndicator"); + case WebAXRoleWebArea: + return result.append("WebArea"); + case WebAXRoleWindow: + return result.append("Window"); default: return result.append("Unknown"); } @@ -299,7 +303,7 @@ string getStringValue(const WebAccessibilityObject& object) string getRole(const WebAccessibilityObject& object) { - string roleString = roleToString(object.roleValue()); + string roleString = roleToString(object.role()); // Special-case canvas with fallback content because Chromium wants to // treat this as essentially a separate role that it can map differently depending diff --git a/third_party/WebKit/Source/testing/runner/WebTestProxy.cpp b/third_party/WebKit/Source/testing/runner/WebTestProxy.cpp index 525a118..665d48a 100644 --- a/third_party/WebKit/Source/testing/runner/WebTestProxy.cpp +++ b/third_party/WebKit/Source/testing/runner/WebTestProxy.cpp @@ -49,7 +49,7 @@ #include "public/testing/WebTestDelegate.h" #include "public/testing/WebTestInterfaces.h" #include "public/testing/WebTestRunner.h" -#include "public/web/WebAccessibilityNotification.h" +#include "public/web/WebAXEnums.h" #include "public/web/WebAccessibilityObject.h" #include "public/web/WebCachedURLRequest.h" #include "public/web/WebConsoleMessage.h" @@ -828,83 +828,101 @@ void WebTestProxyBase::didAutoResize(const WebSize&) invalidateAll(); } -void WebTestProxyBase::postAccessibilityNotification(const WebKit::WebAccessibilityObject& obj, WebKit::WebAccessibilityNotification notification) +void WebTestProxyBase::postAccessibilityEvent(const WebKit::WebAccessibilityObject& obj, WebKit::WebAXEvent event) { - if (notification == WebKit::WebAccessibilityNotificationFocusedUIElementChanged) + if (event == WebKit::WebAXEventFocus) m_testInterfaces->accessibilityController()->setFocusedElement(obj); - const char* notificationName; - switch (notification) { - case WebKit::WebAccessibilityNotificationActiveDescendantChanged: - notificationName = "ActiveDescendantChanged"; + const char* eventName; + switch (event) { + case WebKit::WebAXEventActiveDescendantChanged: + eventName = "ActiveDescendantChanged"; break; - case WebKit::WebAccessibilityNotificationAutocorrectionOccured: - notificationName = "AutocorrectionOccured"; + case WebKit::WebAXEventAlert: + eventName = "Alert"; break; - case WebKit::WebAccessibilityNotificationCheckedStateChanged: - notificationName = "CheckedStateChanged"; + case WebKit::WebAXEventAriaAttributeChanged: + eventName = "AriaAttributeChanged"; break; - case WebKit::WebAccessibilityNotificationChildrenChanged: - notificationName = "ChildrenChanged"; + case WebKit::WebAXEventAutocorrectionOccured: + eventName = "AutocorrectionOccured"; break; - case WebKit::WebAccessibilityNotificationFocusedUIElementChanged: - notificationName = "FocusedUIElementChanged"; + case WebKit::WebAXEventBlur: + eventName = "Blur"; break; - case WebKit::WebAccessibilityNotificationLayoutComplete: - notificationName = "LayoutComplete"; + case WebKit::WebAXEventCheckedStateChanged: + eventName = "CheckedStateChanged"; break; - case WebKit::WebAccessibilityNotificationLoadComplete: - notificationName = "LoadComplete"; + case WebKit::WebAXEventChildrenChanged: + eventName = "ChildrenChanged"; break; - case WebKit::WebAccessibilityNotificationSelectedChildrenChanged: - notificationName = "SelectedChildrenChanged"; + case WebKit::WebAXEventFocus: + eventName = "Focus"; break; - case WebKit::WebAccessibilityNotificationSelectedTextChanged: - notificationName = "SelectedTextChanged"; + case WebKit::WebAXEventHide: + eventName = "Hide"; break; - case WebKit::WebAccessibilityNotificationValueChanged: - notificationName = "ValueChanged"; + case WebKit::WebAXEventInvalidStatusChanged: + eventName = "InvalidStatusChanged"; break; - case WebKit::WebAccessibilityNotificationScrolledToAnchor: - notificationName = "ScrolledToAnchor"; + case WebKit::WebAXEventLayoutComplete: + eventName = "LayoutComplete"; break; - case WebKit::WebAccessibilityNotificationLiveRegionChanged: - notificationName = "LiveRegionChanged"; + case WebKit::WebAXEventLiveRegionChanged: + eventName = "LiveRegionChanged"; break; - case WebKit::WebAccessibilityNotificationMenuListItemSelected: - notificationName = "MenuListItemSelected"; + case WebKit::WebAXEventLoadComplete: + eventName = "LoadComplete"; break; - case WebKit::WebAccessibilityNotificationMenuListValueChanged: - notificationName = "MenuListValueChanged"; + case WebKit::WebAXEventLocationChanged: + eventName = "LocationChanged"; break; - case WebKit::WebAccessibilityNotificationRowCountChanged: - notificationName = "RowCountChanged"; + case WebKit::WebAXEventMenuListItemSelected: + eventName = "MenuListItemSelected"; break; - case WebKit::WebAccessibilityNotificationRowCollapsed: - notificationName = "RowCollapsed"; + case WebKit::WebAXEventMenuListValueChanged: + eventName = "MenuListValueChanged"; break; - case WebKit::WebAccessibilityNotificationRowExpanded: - notificationName = "RowExpanded"; + case WebKit::WebAXEventRowCollapsed: + eventName = "RowCollapsed"; break; - case WebKit::WebAccessibilityNotificationInvalidStatusChanged: - notificationName = "InvalidStatusChanged"; + case WebKit::WebAXEventRowCountChanged: + eventName = "RowCountChanged"; break; - case WebKit::WebAccessibilityNotificationTextChanged: - notificationName = "TextChanged"; + case WebKit::WebAXEventRowExpanded: + eventName = "RowExpanded"; break; - case WebKit::WebAccessibilityNotificationAriaAttributeChanged: - notificationName = "AriaAttributeChanged"; + case WebKit::WebAXEventScrolledToAnchor: + eventName = "ScrolledToAnchor"; break; - default: - notificationName = "UnknownNotification"; + case WebKit::WebAXEventSelectedChildrenChanged: + eventName = "SelectedChildrenChanged"; + break; + case WebKit::WebAXEventSelectedTextChanged: + eventName = "SelectedTextChanged"; + break; + case WebKit::WebAXEventShow: + eventName = "Show"; + break; + case WebKit::WebAXEventTextChanged: + eventName = "TextChanged"; + break; + case WebKit::WebAXEventTextInserted: + eventName = "TextInserted"; + break; + case WebKit::WebAXEventTextRemoved: + eventName = "TextRemoved"; + break; + case WebKit::WebAXEventValueChanged: + eventName = "ValueChanged"; break; } - m_testInterfaces->accessibilityController()->notificationReceived(obj, notificationName); + m_testInterfaces->accessibilityController()->notificationReceived(obj, eventName); if (m_testInterfaces->accessibilityController()->shouldLogAccessibilityEvents()) { string message("AccessibilityNotification - "); - message += notificationName; + message += eventName; WebKit::WebNode node = obj.node(); if (!node.isNull() && node.isElementNode()) { diff --git a/third_party/WebKit/Source/web/AssertMatchingEnums.cpp b/third_party/WebKit/Source/web/AssertMatchingEnums.cpp index 8baed04..4fbf12b 100644 --- a/third_party/WebKit/Source/web/AssertMatchingEnums.cpp +++ b/third_party/WebKit/Source/web/AssertMatchingEnums.cpp @@ -33,29 +33,7 @@ #include "config.h" -#include "public/platform/WebClipboard.h" -#include "public/platform/WebCompositingReasons.h" -#include "public/platform/WebFileError.h" -#include "public/platform/WebFileInfo.h" -#include "public/platform/WebFileSystem.h" -#include "public/platform/WebIDBCursor.h" -#include "public/platform/WebIDBDatabase.h" -#include "public/platform/WebIDBDatabaseException.h" -#include "public/platform/WebIDBFactory.h" -#include "public/platform/WebIDBKey.h" -#include "public/platform/WebIDBKeyPath.h" -#include "public/platform/WebIDBMetadata.h" -#include "public/platform/WebMediaSource.h" -#include "public/platform/WebMediaStreamSource.h" -#include "public/platform/WebReferrerPolicy.h" -#include "public/platform/WebRTCDataChannelHandlerClient.h" -#include "public/platform/WebRTCPeerConnectionHandlerClient.h" -#include "public/platform/WebScrollbar.h" -#include "public/platform/WebURLRequest.h" -#include "public/platform/WebURLResponse.h" -#include "public/web/WebNavigationPolicy.h" -#include "wtf/Assertions.h" -#include "wtf/text/StringImpl.h" +#include "WebAXEnums.h" #include "WebAccessibilityNotification.h" #include "WebAccessibilityObject.h" #include "WebApplicationCacheHost.h" @@ -128,7 +106,30 @@ #include "modules/notifications/NotificationClient.h" #include "modules/quota/StorageQuota.h" #include "modules/speech/SpeechRecognitionError.h" +#include "public/platform/WebClipboard.h" +#include "public/platform/WebCompositingReasons.h" +#include "public/platform/WebFileError.h" +#include "public/platform/WebFileInfo.h" +#include "public/platform/WebFileSystem.h" +#include "public/platform/WebIDBCursor.h" +#include "public/platform/WebIDBDatabase.h" +#include "public/platform/WebIDBDatabaseException.h" +#include "public/platform/WebIDBFactory.h" +#include "public/platform/WebIDBKey.h" +#include "public/platform/WebIDBKeyPath.h" +#include "public/platform/WebIDBMetadata.h" +#include "public/platform/WebMediaSource.h" +#include "public/platform/WebMediaStreamSource.h" +#include "public/platform/WebRTCDataChannelHandlerClient.h" +#include "public/platform/WebRTCPeerConnectionHandlerClient.h" +#include "public/platform/WebReferrerPolicy.h" +#include "public/platform/WebScrollbar.h" +#include "public/platform/WebURLRequest.h" +#include "public/platform/WebURLResponse.h" +#include "public/web/WebNavigationPolicy.h" #include "weborigin/ReferrerPolicy.h" +#include "wtf/Assertions.h" +#include "wtf/text/StringImpl.h" #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \ COMPILE_ASSERT(int(WebKit::webkit_name) == int(WebCore::webcore_name), mismatching_enums) @@ -142,6 +143,168 @@ namespace WebCore { using WTF::TextCaseInsensitive; }; +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventActiveDescendantChanged, AXObjectCache::AXActiveDescendantChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventAlert, AXObjectCache::AXAlert); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventAriaAttributeChanged, AXObjectCache::AXAriaAttributeChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventAutocorrectionOccured, AXObjectCache::AXAutocorrectionOccured); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventBlur, AXObjectCache::AXBlur); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventCheckedStateChanged, AXObjectCache::AXCheckedStateChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventChildrenChanged, AXObjectCache::AXChildrenChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventFocus, AXObjectCache::AXFocusedUIElementChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventHide, AXObjectCache::AXHide); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventInvalidStatusChanged, AXObjectCache::AXInvalidStatusChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventLayoutComplete, AXObjectCache::AXLayoutComplete); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventLiveRegionChanged, AXObjectCache::AXLiveRegionChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventLoadComplete, AXObjectCache::AXLoadComplete); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventLocationChanged, AXObjectCache::AXLocationChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventMenuListItemSelected, AXObjectCache::AXMenuListItemSelected); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventMenuListValueChanged, AXObjectCache::AXMenuListValueChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventRowCollapsed, AXObjectCache::AXRowCollapsed); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventRowCountChanged, AXObjectCache::AXRowCountChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventRowExpanded, AXObjectCache::AXRowExpanded); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventScrolledToAnchor, AXObjectCache::AXScrolledToAnchor); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventSelectedChildrenChanged, AXObjectCache::AXSelectedChildrenChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventSelectedTextChanged, AXObjectCache::AXSelectedTextChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventShow, AXObjectCache::AXShow); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventTextChanged, AXObjectCache::AXTextChanged); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventTextInserted, AXObjectCache::AXTextInserted); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventTextRemoved, AXObjectCache::AXTextRemoved); +COMPILE_ASSERT_MATCHING_ENUM(WebAXEventValueChanged, AXObjectCache::AXValueChanged); + +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleAlertDialog, AlertDialogRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleAlert, AlertRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleAnnotation, AnnotationRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleApplication, ApplicationRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleArticle, ArticleRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleBanner, BannerRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleBrowser, BrowserRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleBusyIndicator, BusyIndicatorRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleButton, ButtonRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleCanvas, CanvasRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleCell, CellRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleCheckBox, CheckBoxRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleColorWell, ColorWellRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleColumnHeader, ColumnHeaderRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleColumn, ColumnRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleComboBox, ComboBoxRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleComplementary, ComplementaryRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleContentInfo, ContentInfoRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleDefinition, DefinitionRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleDescriptionListDetail, DescriptionListDetailRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleDescriptionListTerm, DescriptionListTermRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleDialog, DialogRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleDirectory, DirectoryRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleDisclosureTriangle, DisclosureTriangleRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleDiv, DivRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleDocument, DocumentRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleDrawer, DrawerRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleEditableText, EditableTextRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleFooter, FooterRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleForm, FormRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleGrid, GridRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleGroup, GroupRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleGrowArea, GrowAreaRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleHeading, HeadingRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleHelpTag, HelpTagRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleIgnored, IgnoredRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleImageMapLink, ImageMapLinkRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleImageMap, ImageMapRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleImage, ImageRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleIncrementor, IncrementorRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleLabel, LabelRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleLegend, LegendRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleLink, LinkRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleListBoxOption, ListBoxOptionRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleListBox, ListBoxRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleListItem, ListItemRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleListMarker, ListMarkerRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleList, ListRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleLog, LogRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMain, MainRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMarquee, MarqueeRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMathElement, MathElementRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMath, MathRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMatte, MatteRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMenuBar, MenuBarRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMenuButton, MenuButtonRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMenuItem, MenuItemRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMenuListOption, MenuListOptionRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMenuListPopup, MenuListPopupRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleMenu, MenuRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleNavigation, NavigationRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleNote, NoteRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleOutline, OutlineRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleParagraph, ParagraphRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRolePopUpButton, PopUpButtonRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRolePresentational, PresentationalRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleProgressIndicator, ProgressIndicatorRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleRadioButton, RadioButtonRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleRadioGroup, RadioGroupRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleRegion, RegionRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleRootWebArea, RootWebAreaRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleRowHeader, RowHeaderRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleRow, RowRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleRulerMarker, RulerMarkerRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleRuler, RulerRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSVGRoot, SVGRootRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleScrollArea, ScrollAreaRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleScrollBar, ScrollBarRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSeamlessWebArea, SeamlessWebAreaRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSearch, SearchRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSheet, SheetRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSlider, SliderRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSliderThumb, SliderThumbRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSpinButtonPart, SpinButtonPartRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSpinButton, SpinButtonRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSplitGroup, SplitGroupRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSplitter, SplitterRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleStaticText, StaticTextRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleStatus, StatusRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleSystemWide, SystemWideRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTabGroup, TabGroupRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTabList, TabListRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTabPanel, TabPanelRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTab, TabRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTableHeaderContainer, TableHeaderContainerRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTable, TableRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTextArea, TextAreaRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTextField, TextFieldRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTimer, TimerRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleToggleButton, ToggleButtonRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleToolbar, ToolbarRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTreeGrid, TreeGridRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTreeItem, TreeItemRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleTree, TreeRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleUnknown, UnknownRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleUserInterfaceTooltip, UserInterfaceTooltipRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleValueIndicator, ValueIndicatorRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleWebArea, WebAreaRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAXRoleWindow, WindowRole); + +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateBusy, AXBusyState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateChecked, AXCheckedState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateCollapsed, AXCollapsedState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateEnabled, AXEnabledState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateExpanded, AXExpandedState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateFocusable, AXFocusableState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateFocused, AXFocusedState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateHaspopup, AXHaspopupState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateHovered, AXHoveredState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateIndeterminate, AXIndeterminateState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateInvisible, AXInvisibleState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateLinked, AXLinkedState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateMultiselectable, AXMultiselectableState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateOffscreen, AXOffscreenState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStatePressed, AXPressedState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateProtected, AXProtectedState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateReadonly, AXReadonlyState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateRequired, AXRequiredState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateSelectable, AXSelectableState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateSelected, AXSelectedState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateVertical, AXVerticalState); +COMPILE_ASSERT_MATCHING_ENUM(WebAXStateVisited, AXVisitedState); + +// DEPRECATED (http://crbug.com/269034). COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityNotificationActiveDescendantChanged, AXObjectCache::AXActiveDescendantChanged); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityNotificationAutocorrectionOccured, AXObjectCache::AXAutocorrectionOccured); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityNotificationCheckedStateChanged, AXObjectCache::AXCheckedStateChanged); @@ -163,6 +326,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityNotificationInvalidStatusChanged, A COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityNotificationTextChanged, AXObjectCache::AXTextChanged); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityNotificationAriaAttributeChanged, AXObjectCache::AXAriaAttributeChanged); +// DEPRECATED (http://crbug.com/269034). COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleUnknown, UnknownRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleButton, ButtonRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleRadioButton, RadioButtonRole); @@ -176,7 +340,6 @@ COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleScrollArea, ScrollAreaRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRolePopUpButton, PopUpButtonRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleMenuButton, MenuButtonRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTable, TableRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplication, ApplicationRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleGroup, GroupRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleRadioGroup, RadioGroupRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleList, ListRole); @@ -213,7 +376,6 @@ COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleGrid, GridRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleCell, CellRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleColumnHeader, ColumnHeaderRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleRowHeader, RowHeaderRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleWebCoreLink, WebCoreLinkRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleImageMapLink, ImageMapLinkRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleImageMap, ImageMapRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleListMarker, ListMarkerRole); @@ -249,25 +411,25 @@ COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleParagraph, ParagraphRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLabel, LabelRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDiv, DivRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleForm, FormRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkApplication, LandmarkApplicationRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkBanner, LandmarkBannerRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkComplementary, LandmarkComplementaryRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkContentInfo, LandmarkContentInfoRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkMain, LandmarkMainRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkNavigation, LandmarkNavigationRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkSearch, LandmarkSearchRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationAlert, ApplicationAlertRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationAlertDialog, ApplicationAlertDialogRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationDialog, ApplicationDialogRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationLog, ApplicationLogRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationMarquee, ApplicationMarqueeRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationStatus, ApplicationStatusRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationTimer, ApplicationTimerRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkApplication, ApplicationRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkBanner, BannerRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkComplementary, ComplementaryRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkContentInfo, ContentInfoRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkMain, MainRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkNavigation, NavigationRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkSearch, SearchRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationAlert, AlertRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationAlertDialog, AlertDialogRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationDialog, DialogRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationLog, LogRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationMarquee, MarqueeRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationStatus, StatusRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleApplicationTimer, TimerRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocument, DocumentRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocumentArticle, DocumentArticleRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocumentMath, DocumentMathRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocumentNote, DocumentNoteRole); -COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocumentRegion, DocumentRegionRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocumentArticle, ArticleRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocumentMath, MathRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocumentNote, NoteRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDocumentRegion, RegionRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleUserInterfaceTooltip, UserInterfaceTooltipRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleToggleButton, ToggleButtonRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleCanvas, CanvasRole); diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp index 36d2ce8..999d3b3 100644 --- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp +++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp @@ -128,6 +128,13 @@ static WebAccessibilityNotification toWebAccessibilityNotification(AXObjectCache return static_cast<WebAccessibilityNotification>(notification); } +// Converts a WebCore::AXObjectCache::AXNotification to a WebKit::WebAXEvent +static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification) +{ + // These enums have the same values; enforced in AssertMatchingEnums.cpp. + return static_cast<WebAXEvent>(notification); +} + ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) : m_webView(webView) , m_toolbarsVisible(true) @@ -801,8 +808,12 @@ void ChromeClientImpl::getPopupMenuInfo(PopupContainer* popupContainer, void ChromeClientImpl::postAccessibilityNotification(AccessibilityObject* obj, AXObjectCache::AXNotification notification) { // Alert assistive technology about the accessibility object notification. - if (obj) - m_webView->client()->postAccessibilityNotification(WebAccessibilityObject(obj), toWebAccessibilityNotification(notification)); + if (!obj) + return; + + // FIXME: Remove this first call once Chromium has switched over to using the second. (http://crbug.com/269034) + m_webView->client()->postAccessibilityNotification(WebAccessibilityObject(obj), toWebAccessibilityNotification(notification)); + m_webView->client()->postAccessibilityEvent(WebAccessibilityObject(obj), toWebAXEvent(notification)); } String ChromeClientImpl::acceptLanguages() diff --git a/third_party/WebKit/Source/web/WebAccessibilityObject.cpp b/third_party/WebKit/Source/web/WebAccessibilityObject.cpp index e81f18a..de04600 100644 --- a/third_party/WebKit/Source/web/WebAccessibilityObject.cpp +++ b/third_party/WebKit/Source/web/WebAccessibilityObject.cpp @@ -599,6 +599,7 @@ bool WebAccessibilityObject::press() const return m_private->press(); } +// Deprecated in favor of role(). WebAccessibilityRole WebAccessibilityObject::roleValue() const { if (isDetached()) @@ -607,6 +608,14 @@ WebAccessibilityRole WebAccessibilityObject::roleValue() const return static_cast<WebAccessibilityRole>(m_private->roleValue()); } +WebAXRole WebAccessibilityObject::role() const +{ + if (isDetached()) + return WebKit::WebAXRoleUnknown; + + return static_cast<WebAXRole>(m_private->roleValue()); +} + unsigned WebAccessibilityObject::selectionEnd() const { if (isDetached()) diff --git a/third_party/WebKit/public/testing/WebTestProxy.h b/third_party/WebKit/public/testing/WebTestProxy.h index 9c93690..c2ce8f7 100644 --- a/third_party/WebKit/public/testing/WebTestProxy.h +++ b/third_party/WebKit/public/testing/WebTestProxy.h @@ -36,6 +36,7 @@ #include "public/platform/WebRect.h" #include "public/platform/WebURLError.h" #include "public/platform/WebURLRequest.h" +#include "public/web/WebAXEnums.h" #include "public/web/WebAccessibilityNotification.h" #include "public/web/WebDOMMessageEvent.h" #include "public/web/WebDataSource.h" @@ -158,7 +159,7 @@ protected: void setWindowRect(const WebKit::WebRect&); void show(WebKit::WebNavigationPolicy); void didAutoResize(const WebKit::WebSize&); - void postAccessibilityNotification(const WebKit::WebAccessibilityObject&, WebKit::WebAccessibilityNotification); + void postAccessibilityEvent(const WebKit::WebAccessibilityObject&, WebKit::WebAXEvent); void startDragging(WebKit::WebFrame*, const WebKit::WebDragData&, WebKit::WebDragOperationsMask, const WebKit::WebImage&, const WebKit::WebPoint&); bool shouldBeginEditing(const WebKit::WebRange&); bool shouldEndEditing(const WebKit::WebRange&); @@ -308,10 +309,10 @@ public: WebTestProxyBase::didAutoResize(newSize); Base::didAutoResize(newSize); } - virtual void postAccessibilityNotification(const WebKit::WebAccessibilityObject& object, WebKit::WebAccessibilityNotification notification) + virtual void postAccessibilityEvent(const WebKit::WebAccessibilityObject& object, WebKit::WebAXEvent event) { - WebTestProxyBase::postAccessibilityNotification(object, notification); - Base::postAccessibilityNotification(object, notification); + WebTestProxyBase::postAccessibilityEvent(object, event); + Base::postAccessibilityEvent(object, event); } virtual void startDragging(WebKit::WebFrame* frame, const WebKit::WebDragData& data, WebKit::WebDragOperationsMask mask, const WebKit::WebImage& image, const WebKit::WebPoint& point) { diff --git a/third_party/WebKit/public/web/WebAXEnums.h b/third_party/WebKit/public/web/WebAXEnums.h new file mode 100644 index 0000000..fbe0806 --- /dev/null +++ b/third_party/WebKit/public/web/WebAXEnums.h @@ -0,0 +1,213 @@ +/* + * Copyright (C) 2013 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebAXEnums_h +#define WebAXEnums_h + +namespace WebKit { + +// Accessibility events sent from Blink to the embedder. +// These values must match WebCore::AXObjectCache::AXNotification values. +// Enforced in AssertMatchingEnums.cpp. +enum WebAXEvent { + WebAXEventActiveDescendantChanged, + WebAXEventAlert, + WebAXEventAriaAttributeChanged, + WebAXEventAutocorrectionOccured, + WebAXEventBlur, + WebAXEventCheckedStateChanged, + WebAXEventChildrenChanged, + WebAXEventFocus, + WebAXEventHide, + WebAXEventInvalidStatusChanged, + WebAXEventLayoutComplete, + WebAXEventLiveRegionChanged, + WebAXEventLoadComplete, + WebAXEventLocationChanged, + WebAXEventMenuListItemSelected, + WebAXEventMenuListValueChanged, + WebAXEventRowCollapsed, + WebAXEventRowCountChanged, + WebAXEventRowExpanded, + WebAXEventScrolledToAnchor, + WebAXEventSelectedChildrenChanged, + WebAXEventSelectedTextChanged, + WebAXEventShow, + WebAXEventTextChanged, + WebAXEventTextInserted, + WebAXEventTextRemoved, + WebAXEventValueChanged +}; + +// Accessibility roles. +// These values must match WebCore::AccessibilityRole values. +// Enforced in AssertMatchingEnums.cpp. +enum WebAXRole { + WebAXRoleAlertDialog = 1, + WebAXRoleAlert, + WebAXRoleAnnotation, + WebAXRoleApplication, + WebAXRoleArticle, + WebAXRoleBanner, + WebAXRoleBrowser, + WebAXRoleBusyIndicator, + WebAXRoleButton, + WebAXRoleCanvas, + WebAXRoleCell, + WebAXRoleCheckBox, + WebAXRoleColorWell, + WebAXRoleColumnHeader, + WebAXRoleColumn, + WebAXRoleComboBox, + WebAXRoleComplementary, + WebAXRoleContentInfo, + WebAXRoleDefinition, + WebAXRoleDescriptionListDetail, + WebAXRoleDescriptionListTerm, + WebAXRoleDialog, + WebAXRoleDirectory, + WebAXRoleDisclosureTriangle, + WebAXRoleDiv, + WebAXRoleDocument, + WebAXRoleDrawer, + WebAXRoleEditableText, + WebAXRoleFooter, + WebAXRoleForm, + WebAXRoleGrid, + WebAXRoleGroup, + WebAXRoleGrowArea, + WebAXRoleHeading, + WebAXRoleHelpTag, + WebAXRoleHorizontalRule, + WebAXRoleIgnored, + WebAXRoleImageMapLink, + WebAXRoleImageMap, + WebAXRoleImage, + WebAXRoleIncrementor, + WebAXRoleLabel, + WebAXRoleLegend, + WebAXRoleLink, + WebAXRoleListBoxOption, + WebAXRoleListBox, + WebAXRoleListItem, + WebAXRoleListMarker, + WebAXRoleList, + WebAXRoleLog, + WebAXRoleMain, + WebAXRoleMarquee, + WebAXRoleMathElement, + WebAXRoleMath, + WebAXRoleMatte, + WebAXRoleMenuBar, + WebAXRoleMenuButton, + WebAXRoleMenuItem, + WebAXRoleMenuListOption, + WebAXRoleMenuListPopup, + WebAXRoleMenu, + WebAXRoleNavigation, + WebAXRoleNote, + WebAXRoleOutline, + WebAXRoleParagraph, + WebAXRolePopUpButton, + WebAXRolePresentational, + WebAXRoleProgressIndicator, + WebAXRoleRadioButton, + WebAXRoleRadioGroup, + WebAXRoleRegion, + WebAXRoleRootWebArea, + WebAXRoleRowHeader, + WebAXRoleRow, + WebAXRoleRulerMarker, + WebAXRoleRuler, + WebAXRoleSVGRoot, + WebAXRoleScrollArea, + WebAXRoleScrollBar, + WebAXRoleSeamlessWebArea, + WebAXRoleSearch, + WebAXRoleSheet, + WebAXRoleSlider, + WebAXRoleSliderThumb, + WebAXRoleSpinButtonPart, + WebAXRoleSpinButton, + WebAXRoleSplitGroup, + WebAXRoleSplitter, + WebAXRoleStaticText, + WebAXRoleStatus, + WebAXRoleSystemWide, + WebAXRoleTabGroup, + WebAXRoleTabList, + WebAXRoleTabPanel, + WebAXRoleTab, + WebAXRoleTableHeaderContainer, + WebAXRoleTable, + WebAXRoleTextArea, + WebAXRoleTextField, + WebAXRoleTimer, + WebAXRoleToggleButton, + WebAXRoleToolbar, + WebAXRoleTreeGrid, + WebAXRoleTreeItem, + WebAXRoleTree, + WebAXRoleUnknown, + WebAXRoleUserInterfaceTooltip, + WebAXRoleValueIndicator, + WebAXRoleWebArea, + WebAXRoleWindow, +}; + +// Accessibility states, used as a bitmask. +enum WebAXState { + WebAXStateBusy, + WebAXStateChecked, + WebAXStateCollapsed, + WebAXStateEnabled, + WebAXStateExpanded, + WebAXStateFocusable, + WebAXStateFocused, + WebAXStateHaspopup, + WebAXStateHovered, + WebAXStateIndeterminate, + WebAXStateInvisible, + WebAXStateLinked, + WebAXStateMultiselectable, + WebAXStateOffscreen, + WebAXStatePressed, + WebAXStateProtected, + WebAXStateReadonly, + WebAXStateRequired, + WebAXStateSelectable, + WebAXStateSelected, + WebAXStateVertical, + WebAXStateVisited, +}; + +} // namespace WebKit + +#endif diff --git a/third_party/WebKit/public/web/WebAXObject.h b/third_party/WebKit/public/web/WebAXObject.h new file mode 100644 index 0000000..c693bea --- /dev/null +++ b/third_party/WebKit/public/web/WebAXObject.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2013 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebAXObject_h +#define WebAXObject_h + +#include "WebAccessibilityObject.h" + +namespace WebKit { + +// FIXME: rename WebAccessibilityObject to WebAXObject and get rid of this temporary typedef (http://crbug.com/269034). +typedef WebAccessibilityObject WebAXObject; + +} // namespace WebKit + +#endif diff --git a/third_party/WebKit/public/web/WebAccessibilityNotification.h b/third_party/WebKit/public/web/WebAccessibilityNotification.h index 629d988..efaff5f 100644 --- a/third_party/WebKit/public/web/WebAccessibilityNotification.h +++ b/third_party/WebKit/public/web/WebAccessibilityNotification.h @@ -34,28 +34,36 @@ namespace WebKit { // These values must match WebCore::AXObjectCache::AXNotification values. -// Enforced in AssertMatchingEnums.cpp. +// DEPRECATED: these will be replaced with the enums defined in +// WebAXEnums.h (http://crbug.com/269034). enum WebAccessibilityNotification { WebAccessibilityNotificationActiveDescendantChanged, + WebAccessibilityNotificationAlert, + WebAccessibilityNotificationAriaAttributeChanged, WebAccessibilityNotificationAutocorrectionOccured, + WebAccessibilityNotificationBlur, WebAccessibilityNotificationCheckedStateChanged, WebAccessibilityNotificationChildrenChanged, WebAccessibilityNotificationFocusedUIElementChanged, + WebAccessibilityNotificationHide, + WebAccessibilityNotificationInvalidStatusChanged, WebAccessibilityNotificationLayoutComplete, - WebAccessibilityNotificationLoadComplete, - WebAccessibilityNotificationSelectedChildrenChanged, - WebAccessibilityNotificationSelectedTextChanged, - WebAccessibilityNotificationValueChanged, - WebAccessibilityNotificationScrolledToAnchor, WebAccessibilityNotificationLiveRegionChanged, + WebAccessibilityNotificationLoadComplete, + WebAccessibilityNotificationLocationChanged, WebAccessibilityNotificationMenuListItemSelected, WebAccessibilityNotificationMenuListValueChanged, - WebAccessibilityNotificationRowCountChanged, WebAccessibilityNotificationRowCollapsed, + WebAccessibilityNotificationRowCountChanged, WebAccessibilityNotificationRowExpanded, - WebAccessibilityNotificationInvalidStatusChanged, + WebAccessibilityNotificationScrolledToAnchor, + WebAccessibilityNotificationSelectedChildrenChanged, + WebAccessibilityNotificationSelectedTextChanged, + WebAccessibilityNotificationShow, WebAccessibilityNotificationTextChanged, - WebAccessibilityNotificationAriaAttributeChanged + WebAccessibilityNotificationTextInserted, + WebAccessibilityNotificationTextRemoved, + WebAccessibilityNotificationValueChanged }; } // namespace WebKit diff --git a/third_party/WebKit/public/web/WebAccessibilityObject.h b/third_party/WebKit/public/web/WebAccessibilityObject.h index b2b6e55..ac0bb1e 100644 --- a/third_party/WebKit/public/web/WebAccessibilityObject.h +++ b/third_party/WebKit/public/web/WebAccessibilityObject.h @@ -34,6 +34,7 @@ #include "../platform/WebCommon.h" #include "../platform/WebPrivatePtr.h" #include "../platform/WebVector.h" +#include "WebAXEnums.h" #include "WebAccessibilityRole.h" #if WEBKIT_IMPLEMENTATION @@ -52,6 +53,7 @@ struct WebPoint; struct WebRect; // A container for passing around a reference to AccessibilityObject. +// FIXME: rename this to WebAXObject (http://crbug.com/269034). class WebAccessibilityObject { public: ~WebAccessibilityObject() { reset(); } @@ -135,7 +137,8 @@ public: WEBKIT_EXPORT int hierarchicalLevel() const; WEBKIT_EXPORT WebAccessibilityObject hitTest(const WebPoint&) const; WEBKIT_EXPORT WebString keyboardShortcut() const; - WEBKIT_EXPORT WebAccessibilityRole roleValue() const; + WEBKIT_EXPORT WebAccessibilityRole roleValue() const; // Deprecated, use role(). + WEBKIT_EXPORT WebAXRole role() const; WEBKIT_EXPORT unsigned selectionEnd() const; WEBKIT_EXPORT unsigned selectionEndLineNumber() const; WEBKIT_EXPORT unsigned selectionStart() const; diff --git a/third_party/WebKit/public/web/WebAccessibilityRole.h b/third_party/WebKit/public/web/WebAccessibilityRole.h index c2c0598..b8d4d0a 100644 --- a/third_party/WebKit/public/web/WebAccessibilityRole.h +++ b/third_party/WebKit/public/web/WebAccessibilityRole.h @@ -36,16 +36,15 @@ namespace WebKit { // These values must match WebCore::AccessibilityRole values +// DEPRECATED: these will be replaced with the enums defined in +// WebAXEnums.h (http://crbug.com/269034). enum WebAccessibilityRole { - WebAccessibilityRoleAnnotation = 1, - WebAccessibilityRoleApplication, + WebAccessibilityRoleApplicationAlertDialog = 1, WebAccessibilityRoleApplicationAlert, - WebAccessibilityRoleApplicationAlertDialog, - WebAccessibilityRoleApplicationDialog, - WebAccessibilityRoleApplicationLog, - WebAccessibilityRoleApplicationMarquee, - WebAccessibilityRoleApplicationStatus, - WebAccessibilityRoleApplicationTimer, + WebAccessibilityRoleAnnotation, + WebAccessibilityRoleLandmarkApplication, + WebAccessibilityRoleDocumentArticle, + WebAccessibilityRoleLandmarkBanner, WebAccessibilityRoleBrowser, WebAccessibilityRoleBusyIndicator, WebAccessibilityRoleButton, @@ -53,20 +52,19 @@ enum WebAccessibilityRole { WebAccessibilityRoleCell, WebAccessibilityRoleCheckBox, WebAccessibilityRoleColorWell, - WebAccessibilityRoleColumn, WebAccessibilityRoleColumnHeader, + WebAccessibilityRoleColumn, WebAccessibilityRoleComboBox, + WebAccessibilityRoleLandmarkComplementary, + WebAccessibilityRoleLandmarkContentInfo, WebAccessibilityRoleDefinition, - WebAccessibilityRoleDescriptionListTerm, WebAccessibilityRoleDescriptionListDetail, + WebAccessibilityRoleDescriptionListTerm, + WebAccessibilityRoleApplicationDialog, WebAccessibilityRoleDirectory, WebAccessibilityRoleDisclosureTriangle, WebAccessibilityRoleDiv, WebAccessibilityRoleDocument, - WebAccessibilityRoleDocumentArticle, - WebAccessibilityRoleDocumentMath, - WebAccessibilityRoleDocumentNote, - WebAccessibilityRoleDocumentRegion, WebAccessibilityRoleDrawer, WebAccessibilityRoleEditableText, WebAccessibilityRoleFooter, @@ -78,33 +76,32 @@ enum WebAccessibilityRole { WebAccessibilityRoleHelpTag, WebAccessibilityRoleHorizontalRule, WebAccessibilityRoleIgnored, - WebAccessibilityRoleImage, - WebAccessibilityRoleImageMap, WebAccessibilityRoleImageMapLink, + WebAccessibilityRoleImageMap, + WebAccessibilityRoleImage, WebAccessibilityRoleIncrementor, WebAccessibilityRoleLabel, - WebAccessibilityRoleLandmarkApplication, - WebAccessibilityRoleLandmarkBanner, - WebAccessibilityRoleLandmarkComplementary, - WebAccessibilityRoleLandmarkContentInfo, - WebAccessibilityRoleLandmarkMain, - WebAccessibilityRoleLandmarkNavigation, - WebAccessibilityRoleLandmarkSearch, WebAccessibilityRoleLegend, WebAccessibilityRoleLink, - WebAccessibilityRoleList, - WebAccessibilityRoleListBox, WebAccessibilityRoleListBoxOption, + WebAccessibilityRoleListBox, WebAccessibilityRoleListItem, WebAccessibilityRoleListMarker, + WebAccessibilityRoleList, + WebAccessibilityRoleApplicationLog, + WebAccessibilityRoleLandmarkMain, + WebAccessibilityRoleApplicationMarquee, WebAccessibilityRoleMathElement, + WebAccessibilityRoleDocumentMath, WebAccessibilityRoleMatte, - WebAccessibilityRoleMenu, WebAccessibilityRoleMenuBar, WebAccessibilityRoleMenuButton, WebAccessibilityRoleMenuItem, - WebAccessibilityRoleMenuListPopup, WebAccessibilityRoleMenuListOption, + WebAccessibilityRoleMenuListPopup, + WebAccessibilityRoleMenu, + WebAccessibilityRoleLandmarkNavigation, + WebAccessibilityRoleDocumentNote, WebAccessibilityRoleOutline, WebAccessibilityRoleParagraph, WebAccessibilityRolePopUpButton, @@ -112,42 +109,50 @@ enum WebAccessibilityRole { WebAccessibilityRoleProgressIndicator, WebAccessibilityRoleRadioButton, WebAccessibilityRoleRadioGroup, + WebAccessibilityRoleDocumentRegion, + WebAccessibilityRoleRootWebArea, WebAccessibilityRoleRowHeader, WebAccessibilityRoleRow, - WebAccessibilityRoleRuler, WebAccessibilityRoleRulerMarker, + WebAccessibilityRoleRuler, + WebAccessibilityRoleSVGRoot, WebAccessibilityRoleScrollArea, WebAccessibilityRoleScrollBar, WebAccessibilityRoleSeamlessWebArea, + WebAccessibilityRoleLandmarkSearch, WebAccessibilityRoleSheet, WebAccessibilityRoleSlider, WebAccessibilityRoleSliderThumb, - WebAccessibilityRoleSpinButton, WebAccessibilityRoleSpinButtonPart, + WebAccessibilityRoleSpinButton, WebAccessibilityRoleSplitGroup, WebAccessibilityRoleSplitter, WebAccessibilityRoleStaticText, + WebAccessibilityRoleApplicationStatus, WebAccessibilityRoleSystemWide, - WebAccessibilityRoleSVGRoot, WebAccessibilityRoleTabGroup, WebAccessibilityRoleTabList, WebAccessibilityRoleTabPanel, WebAccessibilityRoleTab, - WebAccessibilityRoleTable, WebAccessibilityRoleTableHeaderContainer, + WebAccessibilityRoleTable, WebAccessibilityRoleTextArea, - WebAccessibilityRoleTreeRole, - WebAccessibilityRoleTreeGrid, - WebAccessibilityRoleTreeItemRole, WebAccessibilityRoleTextField, + WebAccessibilityRoleApplicationTimer, WebAccessibilityRoleToggleButton, WebAccessibilityRoleToolbar, + WebAccessibilityRoleTreeGrid, + WebAccessibilityRoleTreeItemRole, + WebAccessibilityRoleTreeRole, WebAccessibilityRoleUnknown, WebAccessibilityRoleUserInterfaceTooltip, WebAccessibilityRoleValueIndicator, WebAccessibilityRoleWebArea, - WebAccessibilityRoleWebCoreLink, WebAccessibilityRoleWindow, + + // Deprecated. + WebAccessibilityRoleApplication, + WebAccessibilityRoleWebCoreLink }; } // namespace WebKit diff --git a/third_party/WebKit/public/web/WebViewClient.h b/third_party/WebKit/public/web/WebViewClient.h index 96ae35f..7d41624 100644 --- a/third_party/WebKit/public/web/WebViewClient.h +++ b/third_party/WebKit/public/web/WebViewClient.h @@ -34,6 +34,7 @@ #include "../platform/WebColor.h" #include "../platform/WebGraphicsContext3D.h" #include "../platform/WebString.h" +#include "WebAXEnums.h" #include "WebAccessibilityNotification.h" #include "WebContentDetectionResult.h" #include "WebDragOperation.h" @@ -311,9 +312,11 @@ public: // Accessibility ------------------------------------------------------- - // Notifies embedder about an accessibility notification. - virtual void postAccessibilityNotification(const WebAccessibilityObject&, WebAccessibilityNotification) { } + // Notifies embedder about an accessibility event. + virtual void postAccessibilityEvent(const WebAccessibilityObject&, WebAXEvent) { } + // Deprecated. + virtual void postAccessibilityNotification(const WebAccessibilityObject&, WebAccessibilityNotification) { } // Developer tools ----------------------------------------------------- |