WebKit Bugzilla
Attachment 349085 Details for
Bug 189379
: AX: The title of an input contained in a label should participate in the accessible name calculation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189379-20180906184537.patch (text/plain), 6.05 KB, created by
Joanmarie Diggs
on 2018-09-06 15:45:38 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Joanmarie Diggs
Created:
2018-09-06 15:45:38 PDT
Size:
6.05 KB
patch
obsolete
>Subversion Revision: 235737 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8ebfd969209773286cee0f85efbe970b23e299d8..529a9f5835e114ec78d8488691d01dd0217788b7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-09-06 Joanmarie Diggs <jdiggs@igalia.com> >+ >+ AX: The title of an input contained in a label should participate in the accessible name calculation >+ https://bugs.webkit.org/show_bug.cgi?id=189379 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When getting the text under element for a label, if that label contains >+ an input which lacks displayed text, fall back on the title attribute of >+ that input. >+ >+ Test: accessibility/label-with-input-with-title.html >+ >+ * accessibility/AccessibilityNodeObject.cpp: >+ (WebCore::AccessibilityNodeObject::textUnderElement const): >+ > 2018-09-06 Ali Juma <ajuma@chromium.org> > > IntersectionObserver leaks documents >diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >index c2a7ace9066751f9ebdd2e4190d5a157ca188ea4..6ca97d9ebaa89ec67e42b23ce7071e6b11211aad 100644 >--- a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >+++ b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >@@ -1785,6 +1785,9 @@ String AccessibilityNodeObject::textUnderElement(AccessibilityTextUnderElementMo > } > > String childText = child->textUnderElement(mode); >+ if (childText.isEmpty() && is<HTMLInputElement>(child->node())) >+ childText = child->getAttribute(titleAttr); >+ > if (childText.length()) > appendNameToStringBuilder(builder, childText); > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 2afba80b37f47df48e5293115175694c356b6348..314d5e43808491a9805516eff0c19c39567ffc65 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-09-06 Joanmarie Diggs <jdiggs@igalia.com> >+ >+ AX: The title of an input contained in a label should participate in the accessible name calculation >+ https://bugs.webkit.org/show_bug.cgi?id=189379 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/label-with-input-with-title.html: Added. >+ * platform/gtk/accessibility/label-with-input-with-title-expected.txt: Added. >+ * platform/mac/accessibility/label-with-input-with-title-expected.txt: Added. >+ > 2018-09-06 Miguel Gomez <magomez@igalia.com> > > Unreviewed GTK+ gardening after r235732. >diff --git a/LayoutTests/accessibility/label-with-input-with-title.html b/LayoutTests/accessibility/label-with-input-with-title.html >new file mode 100644 >index 0000000000000000000000000000000000000000..962670363cb2ed41af01657f8a64e98839e41b13 >--- /dev/null >+++ b/LayoutTests/accessibility/label-with-input-with-title.html >@@ -0,0 +1,34 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../resources/js-test-pre.js"></script> >+<script src="../resources/accessibility-helper.js"></script> >+<style> >+ .pseudo:before { content:"foo "; } >+ .pseudo:after { content:" baz"; } >+</style> >+</head> >+<body id="body"> >+<div id="content"> >+ <label for="test1">foo <input id="test1" type="button" name="test1" title="bar"> baz</label> >+ <label for="test2">foo <input id="test2" type="checkbox" name="test2" title="bar"> baz</label> >+ <label for="test3" class="pseudo"><input id="test3" type="button" name="test3" title=" bar "></label> >+ <label for="test4" class="pseudo"><input id="test4" type="checkbox" name="test4" title=" bar "></label> >+</div> >+<p id="description"></p> >+<div id="console"></div> >+<script> >+ description("This tests the accessible text alternatives results for labels with inputs with a title."); >+ if (window.accessibilityController) { >+ for (var i = 1; i <= 4; i++) { >+ var element = document.getElementById("test" + i); >+ var axElement = accessibilityController.accessibleElementById("test" + i); >+ debug(platformTextAlternatives(axElement, true) + "\n"); >+ } >+ document.getElementById("content").style.visibility = "hidden"; >+ } >+</script> >+<script src="../resources/js-test-post.js"></script> >+</body> >+</html> >+ >diff --git a/LayoutTests/platform/gtk/accessibility/label-with-input-with-title-expected.txt b/LayoutTests/platform/gtk/accessibility/label-with-input-with-title-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..41821af5aaff6c08b6c372a5d1abbbe035f4bea6 >--- /dev/null >+++ b/LayoutTests/platform/gtk/accessibility/label-with-input-with-title-expected.txt >@@ -0,0 +1,25 @@ >+This tests the accessible text alternatives results for labels with inputs with a title. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+ AXTitle: foo bar baz >+ AXDescription: bar >+ AXTitleUIElement: non-null >+ >+ AXTitle: foo bar baz >+ AXDescription: bar >+ AXTitleUIElement: non-null >+ >+ AXTitle: foo bar baz >+ AXDescription: bar >+ AXTitleUIElement: non-null >+ >+ AXTitle: foo bar baz >+ AXDescription: bar >+ AXTitleUIElement: non-null >+ >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/platform/mac/accessibility/label-with-input-with-title-expected.txt b/LayoutTests/platform/mac/accessibility/label-with-input-with-title-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d900c4d2cfefc096237c80a0099acc5b121492bc >--- /dev/null >+++ b/LayoutTests/platform/mac/accessibility/label-with-input-with-title-expected.txt >@@ -0,0 +1,29 @@ >+This tests the accessible text alternatives results for labels with inputs with a title. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+ AXTitle: >+ AXDescription: >+ AXHelp: bar >+ AXTitleUIElement: non-null >+ >+ AXTitle: >+ AXDescription: >+ AXHelp: bar >+ AXTitleUIElement: non-null >+ >+ AXTitle: >+ AXDescription: >+ AXHelp: bar >+ AXTitleUIElement: non-null >+ >+ AXTitle: >+ AXDescription: >+ AXHelp: bar >+ AXTitleUIElement: non-null >+ >+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 189379
:
349085
|
349096
|
349098
|
349106
|
349108
|
349164
|
349181
|
349192