WebKit Bugzilla
Attachment 340115 Details for
Bug 185521
: AX: Listbox and Combobox roles embedded in labels should participate in name calculation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185521-20180510145600.patch (text/plain), 8.27 KB, created by
Joanmarie Diggs
on 2018-05-10 11:56:01 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Joanmarie Diggs
Created:
2018-05-10 11:56:01 PDT
Size:
8.27 KB
patch
obsolete
>Subversion Revision: 231637 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cd794e4d4c9ea2e6629d5edc6029c53dfbdcb726..559c0b589d990c47e18a02520613a1230d69e4cf 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-05-10 Joanmarie Diggs <jdiggs@igalia.com> >+ >+ AX: Listbox and Combobox roles embedded in labels should participate in name calculation >+ https://bugs.webkit.org/show_bug.cgi?id=185521 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Take selected children into account when computing the name in >+ accessibleNameForNode. Also add ListBox to the roles for which >+ accessibleNameDerivesFromContent returns false. The latter is >+ needed so that native select elements with size > 1 are treated >+ the same way as ARIA listbox. >+ >+ Test: accessibility/text-alternative-calculation-from-listbox.html >+ >+ * accessibility/AccessibilityNodeObject.cpp: >+ (WebCore::accessibleNameForNode): >+ * accessibility/AccessibilityObject.cpp: >+ (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const): >+ > 2018-05-10 Yacine Bandou <yacine.bandou_ext@softathome.com> > > [EME][GStreamer] Add a handler for GStreamer protection event >diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >index 4ad50050362fb38ddc1e4bf54c258af8bc302697..12dce85fd7e6d69a7be745cd51aa5b03c89f390c 100644 >--- a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >+++ b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >@@ -1952,6 +1952,29 @@ static String accessibleNameForNode(Node* node, Node* labelledbyNode) > String valueDescription = axObject->valueDescription(); > if (!valueDescription.isEmpty()) > return valueDescription; >+ >+ // The Accname specification states that if the name is being calculated for a combobox >+ // or listbox inside a labeling element, return the text alternative of the chosen option. >+ AccessibilityObject::AccessibilityChildrenVector children; >+ if (axObject->isListBox()) >+ axObject->selectedChildren(children); >+ else if (axObject->isComboBox()) { >+ for (const auto& child : axObject->children()) { >+ if (child->isListBox()) { >+ child->selectedChildren(children); >+ break; >+ } >+ } >+ } >+ >+ StringBuilder builder; >+ String childText; >+ for (const auto& child : children) >+ appendNameToStringBuilder(builder, accessibleNameForNode(child->node())); >+ >+ childText = builder.toString(); >+ if (!childText.isEmpty()) >+ return childText; > } > > if (is<HTMLInputElement>(*node)) >diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp >index 990c4c7291af537d4ffb1ff20ada20af514023a3..c6e262531102461530ae559b7aeb42c8211ba437 100644 >--- a/Source/WebCore/accessibility/AccessibilityObject.cpp >+++ b/Source/WebCore/accessibility/AccessibilityObject.cpp >@@ -354,6 +354,7 @@ bool AccessibilityObject::accessibleNameDerivesFromContent() const > // Now check for generically derived elements now that we know the element does not match a specific ARIA role. > switch (roleValue()) { > case AccessibilityRole::Slider: >+ case AccessibilityRole::ListBox: > return false; > default: > break; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1da4521785c36dd2e60117a8de87c2be6f950d02..9b2215b4f5267586513eb9caf44621596052e95f 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-05-10 Joanmarie Diggs <jdiggs@igalia.com> >+ >+ AX: Listbox and Combobox roles embedded in labels should participate in name calculation >+ https://bugs.webkit.org/show_bug.cgi?id=185521 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/text-alternative-calculation-from-listbox-expected.txt: Added. >+ * accessibility/text-alternative-calculation-from-listbox.html: Added. >+ * platform/gtk/accessibility/text-alternative-calculation-from-listbox-expected.txt: Added. >+ > 2018-05-10 Yacine Bandou <yacine.bandou_ext@softathome.com> > > [wpe] update the TestExpectations for encrypted-media after some fixes >diff --git a/LayoutTests/accessibility/text-alternative-calculation-from-listbox-expected.txt b/LayoutTests/accessibility/text-alternative-calculation-from-listbox-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..34a2d92360e49209da7e646530d76d6d71b60ef9 >--- /dev/null >+++ b/LayoutTests/accessibility/text-alternative-calculation-from-listbox-expected.txt >@@ -0,0 +1,13 @@ >+This tests text alternative calculation from label with an embedded listbox. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Test 1 - W3C Name: >+Test 2 - W3C Name: >+Test 3 - W3C Name: >+Test 4 - W3C Name: >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/accessibility/text-alternative-calculation-from-listbox.html b/LayoutTests/accessibility/text-alternative-calculation-from-listbox.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3fe07075b0fd3dd87d161a647a186e19a64821da >--- /dev/null >+++ b/LayoutTests/accessibility/text-alternative-calculation-from-listbox.html >@@ -0,0 +1,73 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../resources/js-test-pre.js"></script> >+<script src="../resources/accessibility-helper.js"></script> >+</head> >+<body> >+<div id="content"> >+ <div> >+ <input type="checkbox" id="test1" /> >+ <label for="test1" id="label">Flash the screen >+ <ul role="listbox" style="list-style-type: none;"> >+ <li role="option" aria-selected="false">1</li> >+ <li role="option" aria-selected="true">2</li> >+ <li role="option">3</li> >+ </ul> >+ times. >+ </label> >+ </div> >+ <div> >+ <input type="checkbox" id="test2" /> >+ <label for="test2">Flash the screen >+ <div role="combobox" id="combobox"> >+ <div role="textbox" id="textbox"></div> >+ <ul role="listbox" id="listbox" style="list-style-type: none;"> >+ <li role="option" id="option1" aria-selected="false">1</li> >+ <li role="option" id="option2" aria-selected="true">2</li> >+ <li role="option" id="option3">3</li> >+ </ul> >+ </div> >+ times. >+ </label> >+ </div> >+ <div> >+ <input type="checkbox" id="test3" /> >+ <label for="test3">Flash the screen >+ <select size="1"> >+ <option>1</option> >+ <option selected>2</option> >+ <option>3</option> >+ </select> >+ times. >+ </label> >+ </div> >+ <div> >+ <input type="checkbox" id="test4" /> >+ <label for="test4">Flash the screen >+ <select size="3"> >+ <option>1</option> >+ <option selected>2</option> >+ <option>3</option> >+ </select> >+ times. >+ </label> >+ </div> >+</div> >+<p id="description"></p> >+<div id="console"></div> >+ >+<script> >+ description("This tests text alternative calculation from label with an embedded listbox."); >+ if (window.accessibilityController) { >+ for (var i = 1; i <= 4; i++) { >+ var axElement = accessibilityController.accessibleElementById("test" + i); >+ debug("Test " + i + " - W3C Name: " + platformValueForW3CName(axElement)); >+ } >+ document.getElementById("content").style.visibility = "hidden"; >+ } >+</script> >+ >+<script src="../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/platform/gtk/accessibility/text-alternative-calculation-from-listbox-expected.txt b/LayoutTests/platform/gtk/accessibility/text-alternative-calculation-from-listbox-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..c5376ccf7f9ee6088ec007901d8f3ccb6d8544f8 >--- /dev/null >+++ b/LayoutTests/platform/gtk/accessibility/text-alternative-calculation-from-listbox-expected.txt >@@ -0,0 +1,13 @@ >+This tests text alternative calculation from label with an embedded listbox. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Test 1 - W3C Name: Flash the screen 2 times. >+Test 2 - W3C Name: Flash the screen 2 times. >+Test 3 - W3C Name: Flash the screen 2 times. >+Test 4 - W3C Name: Flash the screen 2 times. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185521
:
340115
|
340125
|
340192
|
340193
|
340196
|
340211
|
340212
|
340368
|
340380