2012-09-21 21:27:22 +00:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<body>
|
2017-05-19 23:37:59 +00:00
|
|
|
<script src="../resources/js-test.js"></script>
|
2016-05-20 18:34:14 +00:00
|
|
|
<script src="../resources/accessibility-helper.js"></script>
|
2012-09-21 21:27:22 +00:00
|
|
|
|
2012-12-20 17:29:34 +00:00
|
|
|
<div id="container" style="position: relative; top: 100px; left: 600px; width:400px; height: 400px;" role="group" tabindex="0">
|
2012-09-21 21:27:22 +00:00
|
|
|
|
2012-12-20 17:29:34 +00:00
|
|
|
<svg role="group" id="svgroot">
|
2012-09-21 21:27:22 +00:00
|
|
|
|
|
|
|
<circle role="button" aria-label="face" id="face" r="200" cx="200" cy="200" stroke="red" stroke-width="1" fill="yellow" />
|
|
|
|
<ellipse role="button" aria-label="left-eye" id="left-eye" cx="120" cy="180" rx="18" ry="33" fill="black"/>
|
|
|
|
<ellipse role="button" aria-label="right-eye" id="right-eye" cx="280" cy="120" rx="18" ry="33" fill="black"/>
|
|
|
|
<ellipse role="button" aria-label="nose" id="nose" cx="200" cy="220" rx="8" ry="15" fill="black"/>
|
|
|
|
<path role="button" aria-label="smile" id="smile" stroke-width="10" stroke="black" fill="none" stroke-linecap="round" d="M120,280 Q200,330 290,280"/>
|
2012-12-20 17:29:34 +00:00
|
|
|
<text x="150" y="130" fill="red">Test</text>
|
|
|
|
<image x="20" y="20" width="300" height="80" aria-label="Test Image" xlink:href="resources/cake.png" />
|
2012-09-21 21:27:22 +00:00
|
|
|
|
|
|
|
</svg>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="console"></div>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
description("This test ensures the accessibility bounds of embedded SVG objects are correct.")
|
|
|
|
|
|
|
|
// Return the page's relative coordinates. If we rely on the x() or y() of the accessibility object, then
|
|
|
|
// accessibility transforms are applied that fail because there is no window available
|
|
|
|
function pageX(element) {
|
|
|
|
return element.clickPointX - element.width/2;
|
|
|
|
}
|
|
|
|
|
|
|
|
function pageY(element) {
|
|
|
|
return element.clickPointY - element.height/2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (window.testRunner && window.accessibilityController) {
|
2012-12-20 17:29:34 +00:00
|
|
|
var container = accessibilityController.accessibleElementById("svgroot");
|
2012-09-21 21:27:22 +00:00
|
|
|
|
|
|
|
var x = pageX(container) - 1;
|
|
|
|
var y = pageY(container) - 1;
|
|
|
|
|
|
|
|
debug("container location: (" + x + ", " + y + ")");
|
|
|
|
|
|
|
|
var face = container.childAtIndex(0);
|
|
|
|
debug('Face role: ' + face.role);
|
2016-05-20 18:34:14 +00:00
|
|
|
debug('Face label: ' + platformValueForW3CName(face, true));
|
2012-09-21 21:27:22 +00:00
|
|
|
debug('FaceX: ' + (pageX(face) - x));
|
|
|
|
debug('FaceY: ' + Math.abs(pageY(face) - y));
|
|
|
|
debug('<br>');
|
|
|
|
|
|
|
|
var eye = container.childAtIndex(1);
|
|
|
|
debug('Eye role: ' + eye.role);
|
2016-05-20 18:34:14 +00:00
|
|
|
debug('Eye label: ' + platformValueForW3CName(eye, true));
|
2012-09-21 21:27:22 +00:00
|
|
|
debug('EyeX: ' + (pageX(eye) - x));
|
|
|
|
debug('EyeY: ' + Math.abs(pageY(eye) - y));
|
|
|
|
debug('<br>');
|
|
|
|
|
|
|
|
var nose = container.childAtIndex(3);
|
|
|
|
debug('Nose role: ' + nose.role);
|
2016-05-20 18:34:14 +00:00
|
|
|
debug('Nose label: ' + platformValueForW3CName(nose, true));
|
2012-09-21 21:27:22 +00:00
|
|
|
debug('NoseX: ' + (pageX(nose) - x));
|
|
|
|
debug('NoseY: ' + Math.abs(pageY(nose) - y));
|
|
|
|
debug('<br>');
|
|
|
|
|
|
|
|
var mouth = container.childAtIndex(4);
|
|
|
|
debug('Mouth role: ' + mouth.role);
|
2016-05-20 18:34:14 +00:00
|
|
|
debug('Mouth label: ' + platformValueForW3CName(mouth, true));
|
2012-09-21 21:27:22 +00:00
|
|
|
debug('MouthX: ' + (pageX(mouth) - x));
|
2012-12-20 17:29:34 +00:00
|
|
|
debug('MouthY: ' + Math.floor(Math.abs(pageY(mouth) - y)));
|
2012-09-21 21:27:22 +00:00
|
|
|
debug('<br>');
|
|
|
|
|
2012-12-20 17:29:34 +00:00
|
|
|
// Text varies by about 1 - 2 pixels depending on the platform,
|
|
|
|
// so just print the text coordinates divided by 10.
|
AX: [ATK] Use WebCore Accessibility's AccessibilityText for AtkObject name and description
https://bugs.webkit.org/show_bug.cgi?id=157822
Reviewed by Chris Fleizach.
Source/WebCore:
Remove the old code which was overriding WebCore Accessibility and always use
AccessibilityText.
If the AccessibilityText's textSource is HelpText or SummaryText, it should be exposed
as the AtkObject description. If the textSource is TitleTagText and there is no other
text alternative, the value should also be exposed in this fashion. Note that AtkObject's
description property is equivalent to AXAPI's AXHelp property.
If the AccessibilityText's textSource is anything other than the above, the first
non-empty value should be exposed as the AtkObject name. Depending on the source of
the name content, AtkObject's name property can be the equivalent of AXAPI's AXTitle.
However, most of the time, AtkObject's name property is equivalent to AXAPI's
AXDescription property.
By making these changes, what WebKit exposes for ATK is now extremely similar to what
WebKit exposes on the Mac (modulo the property names) and also with what is defined in
the HTML Accessibility and Accessible Name and Description Computation API mappings specs.
Now that the exposure is correct, the Layout Tests needed to be adjusted accordingly because
asking for the "AXDescription" gives you the AXDescription on the Mac and the AtkObject
description in GNU/Linux. But as indicated above, what ATK calls a "description" is what
the Mac calls "help."
Ultimately our Layout Tests and/or our platform TestRunner API should be modified to deal
with these differences more gracefully. (Bug https://bugs.webkit.org/show_bug.cgi?id=157187
has been opened for that task.) In the meantime, the existing tests have been given platform
checks to ask for the right property on each platform. This was done in such a way as to not
require other (non-ATK) platforms change their current expectations files.
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetName):
(webkitAccessibleGetDescription):
Tools:
Fix AccessibilityUIElement::helpText() so that it returns an empty string rather than
nullptr upon failure.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::helpText):
LayoutTests:
Now that the exposure is correct, the Layout Tests needed to be adjusted accordingly because asking
for the "AXDescription" gives you the AXDescription on the Mac and the AtkObject description in
GNU/Linux. But what the Mac calls a "description" is what ATK calls a "name." What ATK calls a
"description" is what the Mac calls "help."
Ultimately our Layout Tests and/or our platform TestRunner API should be modified to deal with
with these differences more gracefully. (Bug https://bugs.webkit.org/show_bug.cgi?id=157187 has
been opened for that task.) In the meantime, the existing tests have been given platform checks
to ask for the right property on each platform. This was done in such a way as to not require
other (non-ATK) platforms change their current expectations files.
In addition to the above, three previously-failing tests were corrected and are now passing.
* accessibility/alt-tag-on-image-with-nonimage-role.html:
* accessibility/aria-help.html:
* accessibility/aria-label.html:
* accessibility/aria-labeled-with-hidden-node.html:
* accessibility/aria-labelledby-on-input.html:
* accessibility/aria-labelledby-overrides-aria-labeledby.html:
* accessibility/aria-labelledby-overrides-label.html:
* accessibility/aria-labelledby-stay-within.html:
* accessibility/aria-labelledby-with-descendants.html:
* accessibility/aria-namefrom-author.html:
* accessibility/aria-option-role.html:
* accessibility/canvas-description-and-role.html:
* accessibility/empty-image-with-title.html:
* accessibility/fieldset-element.html:
* accessibility/focusable-div.html:
* accessibility/gtk/no-notification-for-unrendered-iframe-children-expected.txt:
* accessibility/gtk/no-notification-for-unrendered-iframe-children.html:
* accessibility/gtk/title-and-alt-expected.txt:
* accessibility/gtk/title-and-alt.html:
* accessibility/help-text.html:
* accessibility/img-alt-tag-only-whitespace-expected.txt:
* accessibility/img-alt-tag-only-whitespace.html:
* accessibility/img-aria-button-alt-tag.html:
* accessibility/img-fallsback-to-title.html:
* accessibility/input-image-alt.html:
* accessibility/loading-iframe-sends-notification.html:
* accessibility/media-element.html:
* accessibility/radio-button-title-label.html:
* accessibility/self-referencing-aria-labelledby.html:
* accessibility/svg-bounds.html:
* platform/gtk/TestExpectations:
* platform/gtk/accessibility/alt-tag-on-image-with-nonimage-role-expected.txt: Added.
* platform/gtk/accessibility/aria-help-expected.txt:
* platform/gtk/accessibility/aria-hidden-negates-no-visibility-expected.txt: Added.
* platform/gtk/accessibility/aria-labeled-with-hidden-node-expected.txt: Added.
* platform/gtk/accessibility/aria-labelledby-on-input-expected.txt: Added.
* platform/gtk/accessibility/aria-labelledby-overrides-aria-label-expected.txt: Added.
* platform/gtk/accessibility/aria-labelledby-overrides-aria-labeledby-expected.txt: Added.
* platform/gtk/accessibility/aria-labelledby-overrides-label-expected.txt: Added.
* platform/gtk/accessibility/aria-labelledby-with-descendants-expected.txt: Added.
* platform/gtk/accessibility/aria-namefrom-author-expected.txt: Added.
* platform/gtk/accessibility/aria-option-role-expected.txt: Added.
* platform/gtk/accessibility/aria-switch-text-expected.txt:
* platform/gtk/accessibility/canvas-description-and-role-expected.txt: Added.
* platform/gtk/accessibility/empty-image-with-title-expected.txt: Added.
* platform/gtk/accessibility/fieldset-element-expected.txt: Added.
* platform/gtk/accessibility/focusable-div-expected.txt: Added.
* platform/gtk/accessibility/help-text-expected.txt: Added.
* platform/gtk/accessibility/image-link-expected.txt:
* platform/gtk/accessibility/image-map1-expected.txt:
* platform/gtk/accessibility/image-map2-expected.txt:
* platform/gtk/accessibility/image-with-alt-and-map-expected.txt:
* platform/gtk/accessibility/img-alt-tag-only-whitespace-expected.txt: Added.
* platform/gtk/accessibility/img-aria-button-alt-tag-expected.txt: Added.
* platform/gtk/accessibility/img-fallsback-to-title-expected.txt:
* platform/gtk/accessibility/input-image-alt-expected.txt: Added.
* platform/gtk/accessibility/media-element-expected.txt:
* platform/gtk/accessibility/radio-button-title-label-expected.txt:
* platform/gtk/accessibility/self-referencing-aria-labelledby-expected.txt: Added.
* platform/gtk/accessibility/svg-bounds-expected.txt: Added.
Canonical link: https://commits.webkit.org/175953@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-18 07:12:09 +00:00
|
|
|
var text = container.childAtIndex(5);
|
|
|
|
if (accessibilityController.platformName != "atk")
|
|
|
|
text = text.childAtIndex(0);
|
2012-09-21 21:27:22 +00:00
|
|
|
debug('Text role: ' + text.role);
|
2012-12-20 17:29:34 +00:00
|
|
|
debug('TextX/10: ' + Math.floor((pageX(text) - x) / 10));
|
|
|
|
debug('TextY/10: ' + Math.floor(Math.abs(pageY(text) - y) / 10));
|
2012-09-21 21:27:22 +00:00
|
|
|
debug('<br>');
|
|
|
|
|
|
|
|
var image = container.childAtIndex(6);
|
|
|
|
debug('Image role: ' + image.role);
|
2016-05-20 18:34:14 +00:00
|
|
|
debug('Image label: ' + platformValueForW3CName(image, true));
|
2012-09-21 21:27:22 +00:00
|
|
|
debug('ImageX: ' + (pageX(image) - x));
|
|
|
|
debug('ImageY: ' + Math.abs(pageY(image) - y));
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|