Skip to content
Permalink
Browse files
AX: AOM: Implement AccessibleNode class and support label and role at…
…tributes

https://bugs.webkit.org/show_bug.cgi?id=179494

Reviewed by Ryosuke Niwa.

Source/WebCore:

Accessibility Object Model
Explainer: https://wicg.github.io/aom/explainer.html
Spec: https://wicg.github.io/aom/spec/

This change adds an accessibleNode getter on Element, and implements
the role and label properties of AccessibleNode.

In existing accessibility code, places where we previously retrieve an
ARIA attribute are replaced with a new function that first checks the
AOM property and then checks the equivalent ARIA attribute.

Test: accessibility/accessibility-object-model.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::nodeHasRole):
(WebCore::AXObjectCache::handleLiveRegionCreated):
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::roleValue const):
(WebCore::AccessibilityImageMapLink::accessibilityDescription const):
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::stringValue const):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::ariaAccessibilityDescription const):
(WebCore::siblingWithAriaRole):
(WebCore::AccessibilityNodeObject::textForLabelElement const):
(WebCore::AccessibilityNodeObject::alternativeText const):
(WebCore::AccessibilityNodeObject::alternativeTextForWebArea const):
(WebCore::AccessibilityNodeObject::stringValue const):
(WebCore::accessibleNameForNode):
(WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::hasProperty const):
(WebCore::AccessibilityObject::stringValueForProperty const):
(WebCore::AccessibilityObject::supportsARIAAttributes const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue const):
(WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/AccessibleNode.cpp: Added.
(WebCore::ariaAttributeMap):
(WebCore::isPropertyValueString):
(WebCore::AccessibleNode::hasProperty):
(WebCore::AccessibleNode::valueForProperty):
(WebCore::AccessibleNode::effectiveStringValueForElement):
(WebCore::AccessibleNode::stringValueForProperty):
(WebCore::AccessibleNode::setStringProperty):
(WebCore::AccessibleNode::role const):
(WebCore::AccessibleNode::setRole):
(WebCore::AccessibleNode::label const):
(WebCore::AccessibleNode::setLabel):
* accessibility/AccessibleNode.h: Added.
(WebCore::AXPropertyHashTraits::emptyValue):
(WebCore::AXPropertyHashTraits::constructDeletedValue):
(WebCore::AXPropertyHashTraits::isDeletedValue):
(WebCore::AccessibleNode::AccessibleNode):
(WebCore::AccessibleNode::ref):
(WebCore::AccessibleNode::deref):
* accessibility/AccessibleNode.idl: Added.
* bindings/js/WebCoreBuiltinNames.h:
* dom/Element.cpp:
(WebCore::Element::canContainRangeEndPoint const):
(WebCore::Element::accessibleNode):
(WebCore::Element::existingAccessibleNode const):
* dom/Element.h:
* dom/Element.idl:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::accessibleNode const):
(WebCore::ElementRareData::setAccessibleNode):
* editing/TextIterator.cpp:
(WebCore::isRendererReplacedElement):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setAccessibilityObjectModelEnabled):
(WebCore::RuntimeEnabledFeatures::accessibilityObjectModelEnabled const):
* rendering/RenderMenuList.cpp:
(RenderMenuList::itemAccessibilityText const):

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetAccessibilityObjectModelEnabled):
(WKPreferencesGetAccessibilityObjectModelEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences accessibilityObjectModelEnabled]):
(-[WebPreferences setAccessibilityObjectModelEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

* accessibility/accessibility-object-model-expected.txt: Added.
* accessibility/accessibility-object-model.html: Added.
* js/dom/dom-static-property-for-in-iteration-expected.txt:


Canonical link: https://commits.webkit.org/195752@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224871 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Nan Wang committed Nov 15, 2017
1 parent bc78641 commit 625015ddd1b0885fd3a071f5a65820011e026777
Showing with 721 additions and 23 deletions.
  1. +11 −0 LayoutTests/ChangeLog
  2. +42 −0 LayoutTests/accessibility/accessibility-object-model-expected.txt
  3. +121 −0 LayoutTests/accessibility/accessibility-object-model.html
  4. +1 −0 LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt
  5. +2 −0 Source/WebCore/CMakeLists.txt
  6. +91 −0 Source/WebCore/ChangeLog
  7. +1 −0 Source/WebCore/DerivedSources.cpp
  8. +3 −0 Source/WebCore/DerivedSources.make
  9. +2 −0 Source/WebCore/Sources.txt
  10. +6 −0 Source/WebCore/WebCore.xcodeproj/project.pbxproj
  11. +3 −2 Source/WebCore/accessibility/AXObjectCache.cpp
  12. +1 −0 Source/WebCore/accessibility/AccessibilityAllInOne.cpp
  13. +3 −2 Source/WebCore/accessibility/AccessibilityImageMapLink.cpp
  14. +2 −1 Source/WebCore/accessibility/AccessibilityListBoxOption.cpp
  15. +10 −9 Source/WebCore/accessibility/AccessibilityNodeObject.cpp
  16. +17 −2 Source/WebCore/accessibility/AccessibilityObject.cpp
  17. +5 −0 Source/WebCore/accessibility/AccessibilityObject.h
  18. +3 −3 Source/WebCore/accessibility/AccessibilityRenderObject.cpp
  19. +146 −0 Source/WebCore/accessibility/AccessibleNode.cpp
  20. +91 −0 Source/WebCore/accessibility/AccessibleNode.h
  21. +32 −0 Source/WebCore/accessibility/AccessibleNode.idl
  22. +1 −0 Source/WebCore/bindings/js/WebCoreBuiltinNames.h
  23. +24 −1 Source/WebCore/dom/Element.cpp
  24. +4 −0 Source/WebCore/dom/Element.h
  25. +2 −0 Source/WebCore/dom/Element.idl
  26. +1 −1 Source/WebCore/dom/ElementRareData.cpp
  27. +6 −0 Source/WebCore/dom/ElementRareData.h
  28. +2 −1 Source/WebCore/editing/TextIterator.cpp
  29. +5 −0 Source/WebCore/page/RuntimeEnabledFeatures.h
  30. +2 −1 Source/WebCore/rendering/RenderMenuList.cpp
  31. +13 −0 Source/WebKit/ChangeLog
  32. +8 −0 Source/WebKit/Shared/WebPreferences.yaml
  33. +10 −0 Source/WebKit/UIProcess/API/C/WKPreferences.cpp
  34. +4 −0 Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
  35. +16 −0 Source/WebKitLegacy/mac/ChangeLog
  36. +1 −0 Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
  37. +12 −0 Source/WebKitLegacy/mac/WebView/WebPreferences.mm
  38. +1 −0 Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
  39. +1 −0 Source/WebKitLegacy/mac/WebView/WebView.mm
  40. +12 −0 Tools/ChangeLog
  41. +1 −0 Tools/DumpRenderTree/mac/DumpRenderTree.mm
  42. +2 −0 Tools/WebKitTestRunner/TestController.cpp
@@ -1,3 +1,14 @@
2017-11-14 Nan Wang <n_wang@apple.com>

AX: AOM: Implement AccessibleNode class and support label and role attributes
https://bugs.webkit.org/show_bug.cgi?id=179494

Reviewed by Ryosuke Niwa.

* accessibility/accessibility-object-model-expected.txt: Added.
* accessibility/accessibility-object-model.html: Added.
* js/dom/dom-static-property-for-in-iteration-expected.txt:

2017-11-14 Antti Koivisto <antti@apple.com>

Media query with :host inside a custom elements doesn't get updated on window resize
@@ -0,0 +1,42 @@
Click Me
This tests getting and setting Accessibility Object Model properties.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS button.accessibleNode == null is false

Supported properties on an AccessibleNode are all null by default
PASS button.accessibleNode.role is null
PASS button.accessibleNode.label is null
PASS button.accessibleNode.foo is undefined

ARIA attributes should not be reflected into AOM properties.
PASS axButton.role is 'AXRole: AXCheckBox'
PASS axButton.description is 'AXDescription: label'
PASS button.accessibleNode.role is null
PASS button.accessibleNode.label is null

Test setting AOM properties. And make sure AOM takes precedence.
PASS button.accessibleNode.role is 'slider'
PASS button.accessibleNode.label is 'AOM Label'
PASS axButton.role is 'AXRole: AXSlider'
PASS axButton.description is 'AXDescription: AOM Label'

Setting some of the AOM properties should be able to make an element accessible.
PASS axParagraph == null || axParagraph == undefined is true
PASS axParagraph.isIgnored is false

An invalid role should be ignored.
PASS button.accessibleNode.role is null
PASS axButton.role is 'AXRole: AXButton'
PASS button.accessibleNode.role is 'badrole'
PASS axButton.role is 'AXRole: AXButton'

An AccessibleNode keeps its element alive.
PASS aomRemovedButton.role is 'checkbox'
PASS aomRemovedButton.role is 'checkbox'
PASS successfullyParsed is true

TEST COMPLETE

@@ -0,0 +1,121 @@
<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script src="../resources/accessibility-helper.js"></script>
</head>
<body>

<button id="button">Click Me</button>
<div id="container"><button id="button2">Button2</button></div>
<p id="paragraph"></p>

<p id="description"></p>
<div id="console"></div>

<script>
description("This tests getting and setting Accessibility Object Model properties.");
if (window.accessibilityController) {
var button = document.getElementById("button");
var axButton = accessibilityController.accessibleElementById("button");
var aomRemovedButton;
var paragraph = document.getElementById("paragraph");
var axParagraph;

shouldBeFalse("button.accessibleNode == null");

testPropertiesDefault();
testNoReflection();
testSettingProperties();
testBecomeAccessible();
testInvalidRole();
testElementAlive();
}

function testPropertiesDefault() {
debug("\nSupported properties on an AccessibleNode are all null by default");
shouldBeNull("button.accessibleNode.role");
shouldBeNull("button.accessibleNode.label");
// Invalid property value should be undefined
shouldBe("button.accessibleNode.foo", "undefined");
}

function testNoReflection() {
debug("\nARIA attributes should not be reflected into AOM properties.");
button.setAttribute("role", "checkbox");
button.setAttribute("aria-label", "label");
shouldBe("axButton.role", "'AXRole: AXCheckBox'");
shouldBe("axButton.description", "'AXDescription: label'");

// AOM properties should be null even if we have set ARIA attributes.
shouldBeNull("button.accessibleNode.role");
shouldBeNull("button.accessibleNode.label");
}

function testSettingProperties() {
debug("\nTest setting AOM properties. And make sure AOM takes precedence.");

// Set the ARIA attributes on the element first.
button.setAttribute("role", "checkbox");
button.setAttribute("aria-label", "label");

// Then set the corresponding AOM properties to some different values.
button.accessibleNode.role = "slider";
shouldBe("button.accessibleNode.role", "'slider'");
button.accessibleNode.label = "AOM Label";
shouldBe("button.accessibleNode.label", "'AOM Label'");

// The AOM property values should override ARIA attributes.
shouldBe("axButton.role", "'AXRole: AXSlider'");
shouldBe("axButton.description", "'AXDescription: AOM Label'");
}

function testBecomeAccessible() {
debug("\nSetting some of the AOM properties should be able to make an element accessible.");
axParagraph = accessibilityController.accessibleElementById("paragraph");
shouldBeTrue("axParagraph == null || axParagraph == undefined");

// The element should be accessible if it has a label.
paragraph.accessibleNode.label = "test label";
axParagraph = accessibilityController.accessibleElementById("paragraph");
shouldBeFalse("axParagraph.isIgnored");
}

function testInvalidRole() {
debug("\nAn invalid role should be ignored.");

// Clear the ARIA attribute and AOM property value.
button.removeAttribute("role");
button.accessibleNode.role = null;
shouldBe("button.accessibleNode.role", "null");
shouldBe("axButton.role", "'AXRole: AXButton'");

// Accessibility should use the semantic role if an invalid role is provided.
button.accessibleNode.role = "badrole";
shouldBe("button.accessibleNode.role", "'badrole'");
shouldBe("axButton.role", "'AXRole: AXButton'");
}

function testElementAlive() {
debug("\nAn AccessibleNode keeps its element alive.");
// Get the button to be removed and access its accessibleNode.
(function() {
var button2 = document.getElementById("button2");
aomRemovedButton = button2.accessibleNode;
aomRemovedButton.role = "checkbox";
})();
shouldBe("aomRemovedButton.role", "'checkbox'");

// Remove the button make sure we are still able to access the accessibleNode.
(function() {
var button2 = document.getElementById("button2");
button2.parentElement.removeChild(button2);
})();
gc();
shouldBe("aomRemovedButton.role", "'checkbox'");
}

</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>
@@ -134,6 +134,7 @@ PASS a["clientWidth"] is 0
PASS a["clientHeight"] is 0
PASS a["innerHTML"] is nerget
PASS a["outerHTML"] is <a id="foo" href="bar">nerget</a>
PASS a["accessibleNode"] is [object AccessibleNode]
PASS a["oncopy"] is null
PASS a["oncut"] is null
PASS a["onpaste"] is null
@@ -419,6 +419,8 @@ set(WebCore_NON_SVG_IDL_FILES
Modules/webvr/VRPose.idl
Modules/webvr/VRStageParameters.idl

accessibility/AccessibleNode.idl

animation/Animatable.idl
animation/AnimationEffect.idl
animation/AnimationEffectTiming.idl
@@ -1,3 +1,94 @@
2017-11-14 Nan Wang <n_wang@apple.com>

AX: AOM: Implement AccessibleNode class and support label and role attributes
https://bugs.webkit.org/show_bug.cgi?id=179494

Reviewed by Ryosuke Niwa.

Accessibility Object Model
Explainer: https://wicg.github.io/aom/explainer.html
Spec: https://wicg.github.io/aom/spec/

This change adds an accessibleNode getter on Element, and implements
the role and label properties of AccessibleNode.

In existing accessibility code, places where we previously retrieve an
ARIA attribute are replaced with a new function that first checks the
AOM property and then checks the equivalent ARIA attribute.

Test: accessibility/accessibility-object-model.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::nodeHasRole):
(WebCore::AXObjectCache::handleLiveRegionCreated):
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::roleValue const):
(WebCore::AccessibilityImageMapLink::accessibilityDescription const):
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::stringValue const):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::ariaAccessibilityDescription const):
(WebCore::siblingWithAriaRole):
(WebCore::AccessibilityNodeObject::textForLabelElement const):
(WebCore::AccessibilityNodeObject::alternativeText const):
(WebCore::AccessibilityNodeObject::alternativeTextForWebArea const):
(WebCore::AccessibilityNodeObject::stringValue const):
(WebCore::accessibleNameForNode):
(WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::hasProperty const):
(WebCore::AccessibilityObject::stringValueForProperty const):
(WebCore::AccessibilityObject::supportsARIAAttributes const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue const):
(WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/AccessibleNode.cpp: Added.
(WebCore::ariaAttributeMap):
(WebCore::isPropertyValueString):
(WebCore::AccessibleNode::hasProperty):
(WebCore::AccessibleNode::valueForProperty):
(WebCore::AccessibleNode::effectiveStringValueForElement):
(WebCore::AccessibleNode::stringValueForProperty):
(WebCore::AccessibleNode::setStringProperty):
(WebCore::AccessibleNode::role const):
(WebCore::AccessibleNode::setRole):
(WebCore::AccessibleNode::label const):
(WebCore::AccessibleNode::setLabel):
* accessibility/AccessibleNode.h: Added.
(WebCore::AXPropertyHashTraits::emptyValue):
(WebCore::AXPropertyHashTraits::constructDeletedValue):
(WebCore::AXPropertyHashTraits::isDeletedValue):
(WebCore::AccessibleNode::AccessibleNode):
(WebCore::AccessibleNode::ref):
(WebCore::AccessibleNode::deref):
* accessibility/AccessibleNode.idl: Added.
* bindings/js/WebCoreBuiltinNames.h:
* dom/Element.cpp:
(WebCore::Element::canContainRangeEndPoint const):
(WebCore::Element::accessibleNode):
(WebCore::Element::existingAccessibleNode const):
* dom/Element.h:
* dom/Element.idl:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::accessibleNode const):
(WebCore::ElementRareData::setAccessibleNode):
* editing/TextIterator.cpp:
(WebCore::isRendererReplacedElement):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setAccessibilityObjectModelEnabled):
(WebCore::RuntimeEnabledFeatures::accessibilityObjectModelEnabled const):
* rendering/RenderMenuList.cpp:
(RenderMenuList::itemAccessibilityText const):

2017-11-14 Zan Dobersek <zdobersek@igalia.com>

[Cairo] Add GraphicsContextImplCairo stub
@@ -36,6 +36,7 @@
#include "JSANGLEInstancedArrays.cpp"
#endif
#include "JSAbstractWorker.cpp"
#include "JSAccessibleNode.cpp"
#include "JSAnimationEvent.cpp"
#include "JSAttr.cpp"
#include "JSBarProp.cpp"
@@ -57,6 +57,7 @@ VPATH = \
$(WebCore)/Modules/webdriver \
$(WebCore)/Modules/websockets \
$(WebCore)/Modules/webvr \
$(WebCore)/accessibility \
$(WebCore)/animation \
$(WebCore)/bindings/js \
$(WebCore)/crypto \
@@ -343,6 +344,7 @@ JS_BINDING_IDLS = \
$(WebCore)/Modules/webvr/VRLayerInit.idl \
$(WebCore)/Modules/webvr/VRPose.idl \
$(WebCore)/Modules/webvr/VRStageParameters.idl \
$(WebCore)/accessibility/AccessibleNode.idl \
$(WebCore)/animation/Animatable.idl \
$(WebCore)/animation/AnimationEffect.idl \
$(WebCore)/animation/AnimationEffectTiming.idl \
@@ -1395,6 +1397,7 @@ PREPROCESS_IDLS_SCRIPTS = \

IDL_INCLUDES = \
$(WebCore)/Modules \
$(WebCore)/accessibility \
$(WebCore)/animation \
$(WebCore)/css \
$(WebCore)/crypto \
@@ -308,6 +308,7 @@ accessibility/AccessibilityTableHeaderContainer.cpp
accessibility/AccessibilityTableRow.cpp
accessibility/AccessibilityTree.cpp
accessibility/AccessibilityTreeItem.cpp
accessibility/AccessibleNode.cpp

animation/AnimationEffect.cpp
animation/AnimationEffectTiming.cpp
@@ -2258,6 +2259,7 @@ JSHTMLElementWrapperFactory.cpp
JSAbortController.cpp
JSAbortSignal.cpp
JSAbstractWorker.cpp
JSAccessibleNode.cpp
JSAesCbcCfbParams.cpp
JSAesCtrParams.cpp
JSAesGcmParams.cpp
@@ -11238,6 +11238,9 @@
A91C9FBD1B6586DE00AFFD54 /* AccessibilityTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTree.h; sourceTree = "<group>"; };
A91C9FC01B659A6700AFFD54 /* AccessibilityTreeItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTreeItem.cpp; sourceTree = "<group>"; };
A91C9FC11B659A6700AFFD54 /* AccessibilityTreeItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTreeItem.h; sourceTree = "<group>"; };
A941AE6B1FB62BE5000F6F71 /* AccessibleNode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibleNode.cpp; sourceTree = "<group>"; };
A941AE6D1FB62BE7000F6F71 /* AccessibleNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccessibleNode.h; sourceTree = "<group>"; };
A941AE6E1FB62BEC000F6F71 /* AccessibleNode.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AccessibleNode.idl; sourceTree = "<group>"; };
A9787CB21F5F599200C551C6 /* AccessibilityMediaObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccessibilityMediaObject.h; sourceTree = "<group>"; };
A9787CB31F5F5C6500C551C6 /* AccessibilityMediaObject.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMediaObject.cpp; sourceTree = "<group>"; };
A9C6E4E10D745E05006442E9 /* DOMMimeType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DOMMimeType.cpp; sourceTree = "<group>"; };
@@ -15842,6 +15845,9 @@
2981CAAF131822EC00D12F2A /* AXObjectCache.cpp */,
29A8121A0FBB9C1D00510293 /* AXObjectCache.h */,
91C9F2F81AE3BE240095B61C /* AXTextStateChangeIntent.h */,
A941AE6B1FB62BE5000F6F71 /* AccessibleNode.cpp */,
A941AE6D1FB62BE7000F6F71 /* AccessibleNode.h */,
A941AE6E1FB62BEC000F6F71 /* AccessibleNode.idl */,
);
path = accessibility;
sourceTree = "<group>";
@@ -62,6 +62,7 @@
#include "AccessibilityTableRow.h"
#include "AccessibilityTree.h"
#include "AccessibilityTreeItem.h"
#include "AccessibleNode.h"
#include "Document.h"
#include "Editing.h"
#include "Editor.h"
@@ -408,7 +409,7 @@ bool nodeHasRole(Node* node, const String& role)
if (!node || !is<Element>(node))
return false;

auto& roleValue = downcast<Element>(*node).attributeWithoutSynchronization(roleAttr);
const auto& roleValue = AccessibleNode::effectiveStringValueForElement(downcast<Element>(*node), AXPropertyName::Role);
if (role.isNull())
return roleValue.isEmpty();
if (roleValue.isEmpty())
@@ -848,7 +849,7 @@ void AXObjectCache::handleLiveRegionCreated(Node* node)
Element* element = downcast<Element>(node);
String liveRegionStatus = element->attributeWithoutSynchronization(aria_liveAttr);
if (liveRegionStatus.isEmpty()) {
const AtomicString& ariaRole = element->attributeWithoutSynchronization(roleAttr);
const AtomicString& ariaRole = AccessibleNode::effectiveStringValueForElement(*element, AXPropertyName::Role);
if (!ariaRole.isEmpty())
liveRegionStatus = AccessibilityObject::defaultLiveRegionStatusForRole(AccessibilityObject::ariaRoleToWebCoreRole(ariaRole));
}
@@ -58,3 +58,4 @@
#include "AccessibilityTableRow.cpp"
#include "AccessibilityTree.cpp"
#include "AccessibilityTreeItem.cpp"
#include "AccessibleNode.cpp"

0 comments on commit 625015d

Please sign in to comment.