WebKit Bugzilla
Attachment 339972 Details for
Bug 185478
: AX: Hidden nodes which are not directly referenced should not participate name/description from content
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185478-20180509125001.patch (text/plain), 6.96 KB, created by
Joanmarie Diggs
on 2018-05-09 09:50:01 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Joanmarie Diggs
Created:
2018-05-09 09:50:01 PDT
Size:
6.96 KB
patch
obsolete
>Subversion Revision: 231482 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9978f968a09a6e95f12bfc811c4711f7d5951d57..7e89005d84babba6a59910ec1c9a1d24ddc161c6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-05-09 Joanmarie Diggs <jdiggs@igalia.com> >+ >+ AX: Hidden nodes which are not directly referenced should not participate name/description from content >+ https://bugs.webkit.org/show_bug.cgi?id=185478 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a check to AccessibilityNodeObject::textUnderElement() and return early >+ if the node is hidden, not referenced by aria-labelledby or aria-describedby, >+ not an HTMLLabelElement, and not fallback content for an HTMLCanvasElement. >+ >+ Test: accessibility/text-alternative-calculation-hidden-nodes.html >+ >+ * accessibility/AccessibilityNodeObject.cpp: >+ (WebCore::AccessibilityNodeObject::textUnderElement const): >+ > 2018-05-07 Zalan Bujtas <zalan@apple.com> > > [LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation >diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >index db8575e1033df7e8aced92397d8bc054d666b5ac..709ecc349ef69d976573b5991d28fd149d89a89c 100644 >--- a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >+++ b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >@@ -1733,6 +1733,18 @@ String AccessibilityNodeObject::textUnderElement(AccessibilityTextUnderElementMo > if (is<Text>(node)) > return downcast<Text>(*node).wholeText(); > >+ // The Accname specification states that if the current node is hidden, and not directly >+ // referenced by aria-labelledby or aria-describedby, and is not a host language text >+ // alternative, the empty string should be returned. >+ if (isHidden() && !is<HTMLLabelElement>(node) && !ancestorsOfType<HTMLCanvasElement>(*node).first()) { >+ AccessibilityObject::AccessibilityChildrenVector labelFor; >+ AccessibilityObject::AccessibilityChildrenVector descriptionFor; >+ ariaLabelledByReferencingElements(labelFor); >+ ariaDescribedByReferencingElements(descriptionFor); >+ if (!labelFor.size() && !descriptionFor.size()) >+ return String(); >+ } >+ > StringBuilder builder; > for (AccessibilityObject* child = firstChild(); child; child = child->nextSibling()) { > if (mode.ignoredChildNode && child->node() == mode.ignoredChildNode) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index f5d402b11d985e10e7324f44f523019ac6b3e767..37f703b4f2973ed71591a6694b1b133c265d36db 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-05-09 Joanmarie Diggs <jdiggs@igalia.com> >+ >+ AX: Hidden nodes which are not directly referenced should not participate name/description from content >+ https://bugs.webkit.org/show_bug.cgi?id=185478 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/text-alternative-calculation-hidden-nodes-expected.txt: Added. >+ * accessibility/text-alternative-calculation-hidden-nodes.html: Added. >+ * platform/gtk/accessibility/text-alternative-calculation-hidden-nodes-expected.txt: Added. >+ > 2018-05-07 Chris Dumez <cdumez@apple.com> > > Unreviewed, add frame name in form-iframe-target-before-load-crash.html >diff --git a/LayoutTests/accessibility/text-alternative-calculation-hidden-nodes-expected.txt b/LayoutTests/accessibility/text-alternative-calculation-hidden-nodes-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0de04759c326e55ae8a0129ed928525ad99e56ce >--- /dev/null >+++ b/LayoutTests/accessibility/text-alternative-calculation-hidden-nodes-expected.txt >@@ -0,0 +1,24 @@ >+This tests text alternative calculation with hidden nodes. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Test 1 >+ W3C Name: foo >+ W3C Description: >+Test 2 >+ W3C Name: >+ W3C Description: bar >+Test 3 >+ W3C Name: >+ W3C Description: >+Test 4 >+ W3C Name: cell 1 cell 4 >+ W3C Description: >+Test 5 >+ W3C Name: >+ W3C Description: cell 1 cell 4 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/accessibility/text-alternative-calculation-hidden-nodes.html b/LayoutTests/accessibility/text-alternative-calculation-hidden-nodes.html >new file mode 100644 >index 0000000000000000000000000000000000000000..dd96913ffc7e81f70905c66876ed95efafaa7dce >--- /dev/null >+++ b/LayoutTests/accessibility/text-alternative-calculation-hidden-nodes.html >@@ -0,0 +1,50 @@ >+<!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 id="hidden1" style="visibility:hidden;">foo</div> >+ <div id="hidden2" style="display:none;">bar</div> >+ >+ <input id="test1" aria-labelledby="hidden1"> >+ <input id="test2" aria-describedby="hidden2"> >+ >+ <label for="test3" id="hidden3" style="display:none;">baz</label> >+ <input id="test3"> >+ >+ <table id="table"> >+ <tr> >+ <td>cell 1</td> >+ <td style="visibility:hidden;">cell 2</td> >+ <td><div style="display:none;"><div>cell 3</div></td> >+ <td><div>cell 4</div></td> >+ </tr> >+ </table> >+ <input id="test4" aria-labelledby="table"> >+ <input id="test5" aria-describedby="table"> >+</div> >+ >+<p id="description"></p> >+<div id="console"></div> >+ >+<script> >+ description("This tests text alternative calculation with hidden nodes."); >+ >+ if (window.accessibilityController) { >+ for (var i = 1; i <= 5; i++) { >+ var axElement = accessibilityController.accessibleElementById("test" + i); >+ debug("Test " + i); >+ debug("\tW3C Name: " + platformValueForW3CName(axElement)); >+ debug("\tW3C Description: " + platformValueForW3CDescription(axElement)); >+ } >+ document.getElementById("content").style.visibility = "hidden"; >+ document.getElementById("table").style.visibility = "hidden"; >+ } >+</script> >+ >+<script src="../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/platform/gtk/accessibility/text-alternative-calculation-hidden-nodes-expected.txt b/LayoutTests/platform/gtk/accessibility/text-alternative-calculation-hidden-nodes-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..fd7a09851462242e9b1831240030861dac3e5dbc >--- /dev/null >+++ b/LayoutTests/platform/gtk/accessibility/text-alternative-calculation-hidden-nodes-expected.txt >@@ -0,0 +1,24 @@ >+This tests text alternative calculation with hidden nodes. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Test 1 >+ W3C Name: foo >+ W3C Description: >+Test 2 >+ W3C Name: >+ W3C Description: bar >+Test 3 >+ W3C Name: baz >+ W3C Description: >+Test 4 >+ W3C Name: cell 1 cell 4 >+ W3C Description: >+Test 5 >+ W3C Name: >+ W3C Description: cell 1 cell 4 >+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 185478
: 339972