Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r221918 - AX: On generic container elements, WebKit should dist…
…inguish between tooltip (e.g. @title) and label (e.g. @aria-label) attributes https://bugs.webkit.org/show_bug.cgi?id=170475 <rdar://problem/31439222> Reviewed by Joanmarie Diggs. Source/WebCore: Test: accessibility/title-tag-on-unimportant-elements-is-help-text.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::helpText): (WebCore::AccessibilityNodeObject::accessibilityDescription): (WebCore::AccessibilityNodeObject::roleIgnoresTitle): * accessibility/AccessibilityNodeObject.h: LayoutTests: * accessibility/title-tag-on-unimportant-elements-is-help-text-expected.txt: Added. * accessibility/title-tag-on-unimportant-elements-is-help-text.html: Added.
- Loading branch information
1 parent
872fe8e
commit 2dcc37b
Showing
6 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
LayoutTests/accessibility/title-tag-on-unimportant-elements-is-help-text-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
a | ||
a | ||
|
||
This tests that if a semantically unimportant element has title text, that text is exposed as help text rather than descriptive text. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS platformValueForW3CDescription(accessibilityController.accessibleElementById('div1')) is 'test1' | ||
PASS platformValueForW3CName(accessibilityController.accessibleElementById('div1')) is '' | ||
PASS platformValueForW3CDescription(accessibilityController.accessibleElementById('div2')) is '' | ||
PASS platformValueForW3CName(accessibilityController.accessibleElementById('div2')) is 'test2' | ||
PASS platformValueForW3CDescription(accessibilityController.accessibleElementById('button1')) is '' | ||
PASS platformValueForW3CName(accessibilityController.accessibleElementById('button1')) is 'test5' | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
40 changes: 40 additions & 0 deletions
40
LayoutTests/accessibility/title-tag-on-unimportant-elements-is-help-text.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/js-test-pre.js"></script> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
</head> | ||
<body id="body"> | ||
|
||
<div id="div1" title="test1">a</div> | ||
<div id="div2" role="group" title="test2">a</div> | ||
|
||
<button id="button1" title="test5"></button> | ||
|
||
<p id="description"></p> | ||
<div id="console"></div> | ||
|
||
<script> | ||
|
||
description("This tests that if a semantically unimportant element has title text, that text is exposed as help text rather than descriptive text."); | ||
|
||
if (window.accessibilityController) { | ||
|
||
// div1 is unimportant, so description should be blank. | ||
shouldBe("platformValueForW3CDescription(accessibilityController.accessibleElementById('div1'))", "'test1'"); | ||
shouldBe("platformValueForW3CName(accessibilityController.accessibleElementById('div1'))", "''"); | ||
|
||
// div2 has an author applied role, so title tag should be used for description. | ||
shouldBe("platformValueForW3CDescription(accessibilityController.accessibleElementById('div2'))", "''"); | ||
shouldBe("platformValueForW3CName(accessibilityController.accessibleElementById('div2'))", "'test2'"); | ||
|
||
// button is a meaningful element, so it should have a description. | ||
shouldBe("platformValueForW3CDescription(accessibilityController.accessibleElementById('button1'))", "''"); | ||
shouldBe("platformValueForW3CName(accessibilityController.accessibleElementById('button1'))", "'test5'"); | ||
} | ||
|
||
</script> | ||
|
||
<script src="../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters