Skip to content
Permalink
Browse files
AX: REGRESSION (r202063): ARIA role attribute is being ignored for la…
…bel element

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

Reviewed by Chris Fleizach.

Source/WebCore:

createFromRenderer() was creating an AccessibilityLabel for any HTMLLabelElement which
lacked an explicitly-handled ARIA role. We should instead create an AccessibilityLabel
when there is no ARIA role.

Test: accessibility/aria-role-on-label.html

* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):

LayoutTests:

This regression was caught by a GTK-specific layout test. Adding a cross-platform
test for additional coverage.

* accessibility/aria-role-on-label.html: Added.
* platform/gtk/accessibility/aria-role-on-label-expected.txt: Added.
* platform/mac/accessibility/aria-role-on-label-expected.txt: Added.


Canonical link: https://commits.webkit.org/177267@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
joanmarie committed Jun 27, 2016
1 parent 6a7685e commit b3be45056bdf8356c036080c31f18922b0f29c0d
@@ -1,3 +1,17 @@
2016-06-27 Joanmarie Diggs <jdiggs@igalia.com>

AX: REGRESSION (r202063): ARIA role attribute is being ignored for label element
https://bugs.webkit.org/show_bug.cgi?id=159162

Reviewed by Chris Fleizach.

This regression was caught by a GTK-specific layout test. Adding a cross-platform
test for additional coverage.

* accessibility/aria-role-on-label.html: Added.
* platform/gtk/accessibility/aria-role-on-label-expected.txt: Added.
* platform/mac/accessibility/aria-role-on-label-expected.txt: Added.

2016-06-27 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r202505.
@@ -0,0 +1,27 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<label id="label1">text</label>
<label id="label2" role="heading">text</label>
<p id="description"></p>
<div id="console"></div>
<script>

description("This verifies that an ARIA role applied to a label element is not ignored.");

if (window.accessibilityController) {
var label = accessibilityController.accessibleElementById("label1");
debug("label without role: " + label.role);

label = accessibilityController.accessibleElementById("label2");
debug("label with role: " + label.role);
}

</script>

<script src="../resources/js-test-post.js"></script>
</body>
</html>
@@ -0,0 +1,12 @@
text text
This verifies that an ARIA role applied to a label element is not ignored.

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


label without role: AXRole: AXLabel
label with role: AXRole: AXHeading
PASS successfullyParsed is true

TEST COMPLETE

@@ -0,0 +1,12 @@
text text
This verifies that an ARIA role applied to a label element is not ignored.

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


label without role: AXRole: AXStaticText
label with role: AXRole: AXHeading
PASS successfullyParsed is true

TEST COMPLETE

@@ -1,3 +1,19 @@
2016-06-27 Joanmarie Diggs <jdiggs@igalia.com>

AX: REGRESSION (r202063): ARIA role attribute is being ignored for label element
https://bugs.webkit.org/show_bug.cgi?id=159162

Reviewed by Chris Fleizach.

createFromRenderer() was creating an AccessibilityLabel for any HTMLLabelElement which
lacked an explicitly-handled ARIA role. We should instead create an AccessibilityLabel
when there is no ARIA role.

Test: accessibility/aria-role-on-label.html

* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):

2016-06-27 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r202505.
@@ -429,7 +429,7 @@ static Ref<AccessibilityObject> createFromRenderer(RenderObject* renderer)
if (nodeHasRole(node, "treeitem"))
return AccessibilityTreeItem::create(renderer);

if (node && is<HTMLLabelElement>(node))
if (node && is<HTMLLabelElement>(node) && nodeHasRole(node, nullAtom))
return AccessibilityLabel::create(renderer);

#if ENABLE(VIDEO)

0 comments on commit b3be450

Please sign in to comment.