Changeset 201072 in webkit
- Timestamp:
- May 18, 2016 12:12:09 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 19 added
- 45 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201069 r201072 1 2016-05-18 Joanmarie Diggs <jdiggs@igalia.com> 2 3 AX: [ATK] Use WebCore Accessibility's AccessibilityText for AtkObject name and description 4 https://bugs.webkit.org/show_bug.cgi?id=157822 5 6 Reviewed by Chris Fleizach. 7 8 Now that the exposure is correct, the Layout Tests needed to be adjusted accordingly because asking 9 for the "AXDescription" gives you the AXDescription on the Mac and the AtkObject description in 10 GNU/Linux. But what the Mac calls a "description" is what ATK calls a "name." What ATK calls a 11 "description" is what the Mac calls "help." 12 13 Ultimately our Layout Tests and/or our platform TestRunner API should be modified to deal with 14 with these differences more gracefully. (Bug https://bugs.webkit.org/show_bug.cgi?id=157187 has 15 been opened for that task.) In the meantime, the existing tests have been given platform checks 16 to ask for the right property on each platform. This was done in such a way as to not require 17 other (non-ATK) platforms change their current expectations files. 18 19 In addition to the above, three previously-failing tests were corrected and are now passing. 20 21 * accessibility/alt-tag-on-image-with-nonimage-role.html: 22 * accessibility/aria-help.html: 23 * accessibility/aria-label.html: 24 * accessibility/aria-labeled-with-hidden-node.html: 25 * accessibility/aria-labelledby-on-input.html: 26 * accessibility/aria-labelledby-overrides-aria-labeledby.html: 27 * accessibility/aria-labelledby-overrides-label.html: 28 * accessibility/aria-labelledby-stay-within.html: 29 * accessibility/aria-labelledby-with-descendants.html: 30 * accessibility/aria-namefrom-author.html: 31 * accessibility/aria-option-role.html: 32 * accessibility/canvas-description-and-role.html: 33 * accessibility/empty-image-with-title.html: 34 * accessibility/fieldset-element.html: 35 * accessibility/focusable-div.html: 36 * accessibility/gtk/no-notification-for-unrendered-iframe-children-expected.txt: 37 * accessibility/gtk/no-notification-for-unrendered-iframe-children.html: 38 * accessibility/gtk/title-and-alt-expected.txt: 39 * accessibility/gtk/title-and-alt.html: 40 * accessibility/help-text.html: 41 * accessibility/img-alt-tag-only-whitespace-expected.txt: 42 * accessibility/img-alt-tag-only-whitespace.html: 43 * accessibility/img-aria-button-alt-tag.html: 44 * accessibility/img-fallsback-to-title.html: 45 * accessibility/input-image-alt.html: 46 * accessibility/loading-iframe-sends-notification.html: 47 * accessibility/media-element.html: 48 * accessibility/radio-button-title-label.html: 49 * accessibility/self-referencing-aria-labelledby.html: 50 * accessibility/svg-bounds.html: 51 * platform/gtk/TestExpectations: 52 * platform/gtk/accessibility/alt-tag-on-image-with-nonimage-role-expected.txt: Added. 53 * platform/gtk/accessibility/aria-help-expected.txt: 54 * platform/gtk/accessibility/aria-hidden-negates-no-visibility-expected.txt: Added. 55 * platform/gtk/accessibility/aria-labeled-with-hidden-node-expected.txt: Added. 56 * platform/gtk/accessibility/aria-labelledby-on-input-expected.txt: Added. 57 * platform/gtk/accessibility/aria-labelledby-overrides-aria-label-expected.txt: Added. 58 * platform/gtk/accessibility/aria-labelledby-overrides-aria-labeledby-expected.txt: Added. 59 * platform/gtk/accessibility/aria-labelledby-overrides-label-expected.txt: Added. 60 * platform/gtk/accessibility/aria-labelledby-with-descendants-expected.txt: Added. 61 * platform/gtk/accessibility/aria-namefrom-author-expected.txt: Added. 62 * platform/gtk/accessibility/aria-option-role-expected.txt: Added. 63 * platform/gtk/accessibility/aria-switch-text-expected.txt: 64 * platform/gtk/accessibility/canvas-description-and-role-expected.txt: Added. 65 * platform/gtk/accessibility/empty-image-with-title-expected.txt: Added. 66 * platform/gtk/accessibility/fieldset-element-expected.txt: Added. 67 * platform/gtk/accessibility/focusable-div-expected.txt: Added. 68 * platform/gtk/accessibility/help-text-expected.txt: Added. 69 * platform/gtk/accessibility/image-link-expected.txt: 70 * platform/gtk/accessibility/image-map1-expected.txt: 71 * platform/gtk/accessibility/image-map2-expected.txt: 72 * platform/gtk/accessibility/image-with-alt-and-map-expected.txt: 73 * platform/gtk/accessibility/img-alt-tag-only-whitespace-expected.txt: Added. 74 * platform/gtk/accessibility/img-aria-button-alt-tag-expected.txt: Added. 75 * platform/gtk/accessibility/img-fallsback-to-title-expected.txt: 76 * platform/gtk/accessibility/input-image-alt-expected.txt: Added. 77 * platform/gtk/accessibility/media-element-expected.txt: 78 * platform/gtk/accessibility/radio-button-title-label-expected.txt: 79 * platform/gtk/accessibility/self-referencing-aria-labelledby-expected.txt: Added. 80 * platform/gtk/accessibility/svg-bounds-expected.txt: Added. 81 1 82 2016-05-17 Saam barati <sbarati@apple.com> 2 83 -
trunk/LayoutTests/accessibility/alt-tag-on-image-with-nonimage-role.html
r160311 r201072 25 25 26 26 var group = accessibilityController.accessibleElementById("group"); 27 shouldBe("group.description", "'AXDescription: TEST2'");27 var button = accessibilityController.accessibleElementById("button"); 28 28 29 var button = accessibilityController.accessibleElementById("button"); 30 shouldBe("button.description", "'AXDescription: TEST3'"); 29 if (accessibilityController.platformName == "atk") { 30 shouldBe("group.title", "'AXTitle: TEST2'"); 31 shouldBe("button.title", "'AXTitle: TEST3'"); 32 } else { 33 shouldBe("group.description", "'AXDescription: TEST2'"); 34 shouldBe("button.description", "'AXDescription: TEST3'"); 35 } 31 36 } 32 37 -
trunk/LayoutTests/accessibility/aria-help.html
r159128 r201072 21 21 document.getElementById("button").focus(); 22 22 var button = accessibilityController.focusedElement; 23 shouldBe("button.helpText", "'AXHelp: click here'"); 23 if (accessibilityController.platformName == "atk") 24 shouldBe("button.description", "'AXDescription: click here'"); 25 else 26 shouldBe("button.helpText", "'AXHelp: click here'"); 24 27 } 25 28 -
trunk/LayoutTests/accessibility/aria-label.html
r155274 r201072 19 19 body.focus(); 20 20 var obj = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(0); 21 var succeeded = obj.description == "AXDescription: aria label"; 21 var succeeded; 22 if (accessibilityController.platformName == "atk") 23 succeeded = obj.title == "AXTitle: aria label"; 24 else 25 succeeded = obj.description == "AXDescription: aria label"; 22 26 shouldBe("succeeded", "true"); 23 27 24 28 obj = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(1); 25 succeeded = obj.description == "AXDescription: aria link"; 29 if (accessibilityController.platformName == "atk") 30 succeeded = obj.title == "AXTitle: aria link"; 31 else 32 succeeded = obj.description == "AXDescription: aria link"; 26 33 shouldBe("succeeded", "true"); 27 34 } -
trunk/LayoutTests/accessibility/aria-labeled-with-hidden-node.html
r157221 r201072 18 18 if (window.accessibilityController) { 19 19 var button = accessibilityController.accessibleElementById("button"); 20 shouldBe("button.description", "'AXDescription: TITLE'"); 20 if (accessibilityController.platformName == "atk") 21 shouldBe("button.title", "'AXTitle: TITLE'"); 22 else 23 shouldBe("button.description", "'AXDescription: TITLE'"); 21 24 } 22 25 </script> -
trunk/LayoutTests/accessibility/aria-labelledby-on-input.html
r120111 r201072 15 15 labeledItem.focus(); 16 16 var result = document.getElementById("result"); 17 result.innerText = "\nThe accessibility description is \"" + accessibilityController.focusedElement.description + "\""; 17 if (accessibilityController.platformName == "atk") 18 result.innerText = "\nThe accessibility title is \"" + accessibilityController.focusedElement.title + "\""; 19 else 20 result.innerText = "\nThe accessibility description is \"" + accessibilityController.focusedElement.description + "\""; 18 21 } 19 22 </script> -
trunk/LayoutTests/accessibility/aria-labelledby-overrides-aria-labeledby.html
r159482 r201072 24 24 25 25 if (window.accessibilityController) { 26 var linkDescription = accessibilityController.accessibleElementById("link").description; 27 28 shouldBe("linkDescription", "'AXDescription: Y Z'"); 29 26 if (accessibilityController.platformName == "atk") { 27 var linkTitle = accessibilityController.accessibleElementById("link").title; 28 shouldBe("linkTitle", "'AXTitle: Y Z'"); 29 } else { 30 var linkDescription = accessibilityController.accessibleElementById("link").description; 31 shouldBe("linkDescription", "'AXDescription: Y Z'"); 32 } 30 33 // Hide superfluous text. 31 34 document.getElementById("test").style.display = "none"; -
trunk/LayoutTests/accessibility/aria-labelledby-overrides-label.html
r155274 r201072 23 23 text = accessibilityController.focusedElement; 24 24 25 debug("text.description is " + text.description); 25 if (accessibilityController.platformName == "atk") 26 debug("text.title is " + text.title); 27 else 28 debug("text.description is " + text.description); 26 29 27 30 // There should be no title UI element. -
trunk/LayoutTests/accessibility/aria-labelledby-stay-within.html
r120111 r201072 33 33 labeledItem.focus(); 34 34 var result = document.getElementById("result"); 35 if ( accessibilityController.focusedElement.description == "AXDescription: Reply Item Five" ) { 35 var resultValue; 36 if (accessibilityController.platformName == "atk") 37 resultValue = accessibilityController.focusedElement.title; 38 else 39 resultValue = accessibilityController.focusedElement.description; 40 if (resultValue.endsWith("Reply Item Five")) { 36 41 result.innerText = "Passed"; 37 42 } 38 43 else { 39 result.innerText = "Failed. Result ==" + accessibilityController.focusedElement.description+ "==";44 result.innerText = "Failed. Result ==" + resultValue + "=="; 40 45 } 41 46 } -
trunk/LayoutTests/accessibility/aria-labelledby-with-descendants.html
r174074 r201072 50 50 for (var k = 1; k < 8; k++) { 51 51 var test = accessibilityController.accessibleElementById("test" + k); 52 debug("test " + k + ": aria-labelledby description: " + test.description); 52 if (accessibilityController.platformName == "atk") 53 debug("test " + k + ": aria-labelledby description: " + test.title); 54 else 55 debug("test " + k + ": aria-labelledby description: " + test.description); 53 56 debug("test " + k + ": expected description: " + document.getElementById("test" + k).getAttribute("data-label") + "\n"); 54 57 } -
trunk/LayoutTests/accessibility/aria-namefrom-author.html
r174074 r201072 68 68 69 69 if (window.accessibilityController) { 70 debug("Button description: " + accessibilityController.accessibleElementById("button").description); 70 if (accessibilityController.platformName == "atk") 71 debug("Button title: " + accessibilityController.accessibleElementById("button").title); 72 else 73 debug("Button description: " + accessibilityController.accessibleElementById("button").description); 71 74 document.getElementById("content").style.visibility = "hidden"; 72 75 } -
trunk/LayoutTests/accessibility/aria-option-role.html
r155274 r201072 30 30 31 31 debug("secondChild.role is " + secondChild.role); 32 debug("secondChild.description is " + secondChild.description); 32 if (accessibilityController.platformName == "atk") 33 debug("secondChild.title is " + secondChild.title); 34 else 35 debug("secondChild.description is " + secondChild.description); 33 36 34 37 shouldBe("firstChild.childrenCount", "0"); -
trunk/LayoutTests/accessibility/canvas-description-and-role.html
r155274 r201072 22 22 23 23 var axCanvas1 = axContainer.childAtIndex(0); 24 debug('Canvas 1 description: ' + axCanvas1.description); 24 if (accessibilityController.platformName == "atk") 25 debug('Canvas 1 title: ' + axCanvas1.title); 26 else 27 debug('Canvas 1 description: ' + axCanvas1.description); 25 28 debug('Canvas 1 role: ' + axCanvas1.role); 26 29 27 30 var axCanvas2 = axContainer.childAtIndex(1); 28 debug('Canvas 2 description: ' + axCanvas2.description); 31 if (accessibilityController.platformName == "atk") 32 debug('Canvas 2 title: ' + axCanvas2.title); 33 else 34 debug('Canvas 2 description: ' + axCanvas2.description); 29 35 debug('Canvas 2 role: ' + axCanvas2.role); 30 36 } -
trunk/LayoutTests/accessibility/empty-image-with-title.html
r155274 r201072 18 18 var image1 = accessibilityController.accessibleElementById("image1"); 19 19 debug("image1.role is " + image1.role); 20 debug("image1.description is " + image1.description); 20 if (accessibilityController.platformName == "atk") 21 debug("image1.title is " + image1.title); 22 else 23 debug("image1.description is " + image1.description); 21 24 } 22 25 -
trunk/LayoutTests/accessibility/fieldset-element.html
r157434 r201072 79 79 fieldsetTestCount = document.getElementsByClassName("fieldsetTest").length; 80 80 for (var i = 0; i < fieldsetTestCount; ++i) { 81 fieldsetDescription = accessibilityController.accessibleElementById("f" + i).description; 81 if (accessibilityController.platformName == "atk") 82 fieldsetDescription = accessibilityController.accessibleElementById("f" + i).title; 83 else 84 fieldsetDescription = accessibilityController.accessibleElementById("f" + i).description; 82 85 debug(fieldsetDescription); 83 86 } -
trunk/LayoutTests/accessibility/focusable-div.html
r162576 r201072 51 51 shouldBe("document.activeElement == div3", "true"); 52 52 window.axDiv3 = accessibilityController.focusedElement; 53 shouldBe("lastChar(axDiv3.description)", "\"D\""); 53 if (accessibilityController.platformName == "atk") 54 shouldBe("lastChar(axDiv3.title)", "\"D\""); 55 else 56 shouldBe("lastChar(axDiv3.description)", "\"D\""); 54 57 55 58 var div4 = document.getElementById('div4'); -
trunk/LayoutTests/accessibility/gtk/no-notification-for-unrendered-iframe-children-expected.txt
r187777 r201072 5 5 6 6 7 AXChildrenAdded on AX Description: inner body8 AXChildrenAdded on AX Description: inner body7 AXChildrenAdded on AXTitle: inner body 8 AXChildrenAdded on AXTitle: inner body 9 9 PASS successfullyParsed is true 10 10 -
trunk/LayoutTests/accessibility/gtk/no-notification-for-unrendered-iframe-children.html
r187804 r201072 22 22 accessibilityController.addNotificationListener(function(element, notification) { 23 23 if (notification == "AXChildrenAdded" && element.role == "AXRole: AXGroup") 24 debug(notification + " on " + element. description);24 debug(notification + " on " + element.title); 25 25 }); 26 26 } -
trunk/LayoutTests/accessibility/gtk/title-and-alt-expected.txt
r200942 r201072 1 1 2 Functional label: 2 Functional label: 3 3 This tests the exposure of alt and title information. 4 4 … … 8 8 PASS image.title is 'AXTitle: Image alt attr' 9 9 PASS image.description is 'AXDescription: Image title attr' 10 PASS link.title is 'AXTitle: '10 PASS link.title is 'AXTitle: Functional label' 11 11 PASS link.description is 'AXDescription: Link title attr' 12 PASS entry.title is 'AXTitle: '13 PASS entry.description is 'AXDescription: Entry title attr'12 PASS entry.title is 'AXTitle: Entry title attr' 13 PASS entry.description is 'AXDescription: ' 14 14 PASS button.title is 'AXTitle: Submit' 15 15 PASS button.description is 'AXDescription: Submit button title attr' -
trunk/LayoutTests/accessibility/gtk/title-and-alt.html
r200260 r201072 24 24 25 25 var link = accessibilityController.accessibleElementById("link"); 26 shouldBe("link.title", "'AXTitle: Functional label .'");26 shouldBe("link.title", "'AXTitle: Functional label'"); 27 27 shouldBe("link.description", "'AXDescription: Link title attr'"); 28 28 29 29 var entry = accessibilityController.accessibleElementById("entry"); 30 shouldBe("entry.title", "'AXTitle: '");31 shouldBe("entry.description", "'AXDescription: Entry title attr'");30 shouldBe("entry.title", "'AXTitle: Entry title attr'"); 31 shouldBe("entry.description", "'AXDescription: '"); 32 32 33 33 var button = accessibilityController.accessibleElementById("button"); -
trunk/LayoutTests/accessibility/help-text.html
r167054 r201072 66 66 if (!ax) 67 67 continue; 68 var output = ax.helpText.replace("AXHelp: ", ""); 68 var output; 69 if (accessibilityController.platformName == "atk") 70 output = ax.description.replace("AXDescription: ", ""); 71 else 72 output = ax.helpText.replace("AXHelp: ", ""); 69 73 var result = document.getElementById("console"); 70 74 if (expectation === output) -
trunk/LayoutTests/accessibility/img-alt-tag-only-whitespace-expected.txt
r158810 r201072 1 CONSOLE MESSAGE: line 2 6: Image description: AXDescription: Image1 CONSOLE MESSAGE: line 27: Image description: AXDescription: Image 2 2 3 3 -
trunk/LayoutTests/accessibility/img-alt-tag-only-whitespace.html
r155274 r201072 24 24 var imagesGroup = accessibilityController.focusedElement; 25 25 shouldBe("imagesGroup.childrenCount", "1"); 26 console.log("Image description: " + imagesGroup.childAtIndex(0).description); 26 if (accessibilityController.platformName != "atk") 27 console.log("Image description: " + imagesGroup.childAtIndex(0).description); 28 else 29 console.log("Image title: " + imagesGroup.childAtIndex(0).title); 27 30 } 28 31 -
trunk/LayoutTests/accessibility/img-aria-button-alt-tag.html
r155274 r201072 22 22 var body = document.getElementById("body").focus(); 23 23 var imgUIElement = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(0); 24 debug("imgUIElement.description is " + imgUIElement.description); 24 if (accessibilityController.platformName == "atk") 25 debug("imgUIElement.title is " + imgUIElement.title); 26 else 27 debug("imgUIElement.description is " + imgUIElement.description); 25 28 } 26 29 </script> -
trunk/LayoutTests/accessibility/img-fallsback-to-title.html
r155274 r201072 29 29 // The title should NOT be in the help text. 30 30 var image1 = imagesGroup.childAtIndex(0).childAtIndex(0); 31 debug("Image1 description: " + image1.description); 32 debug("Image1 help: " + image1.helpText + "<br>"); 31 if (accessibilityController.platformName == "atk") { 32 debug("Image1 title: " + image1.title); 33 debug("Image1 description: " + image1.description + "<br>"); 34 } else { 35 debug("Image1 description: " + image1.description); 36 debug("Image1 help: " + image1.helpText + "<br>"); 37 } 33 38 34 39 // Second image should use the description from the alt tag instead of the title. 35 40 // The help text should reflect what's in the title. 36 41 var image2 = imagesGroup.childAtIndex(0).childAtIndex(1); 37 debug("Image2 description: " + image2.description); 38 debug("Image2 help: " + image2.helpText + "<br>"); 42 if (accessibilityController.platformName == "atk") { 43 debug("Image2 title: " + image2.title); 44 debug("Image2 description: " + image2.description + "<br>"); 45 } else { 46 debug("Image2 description: " + image2.description); 47 debug("Image2 help: " + image2.helpText + "<br>"); 48 } 39 49 40 50 // Now do the same checks for ARIA type images. 41 51 var image3 = imagesGroup.childAtIndex(1); 42 debug("Image3 description: " + image3.description); 43 debug("Image3 help: " + image3.helpText + "<br>"); 52 if (accessibilityController.platformName == "atk") { 53 debug("Image3 title: " + image3.title); 54 debug("Image3 description: " + image3.description + "<br>"); 55 } else { 56 debug("Image3 description: " + image3.description); 57 debug("Image3 help: " + image3.helpText + "<br>"); 58 } 44 59 45 60 // Now do the same checks for ARIA type images. 46 61 var image4 = imagesGroup.childAtIndex(2); 47 debug("Image4 description: " + image4.description); 48 debug("Image4 help: " + image4.helpText + "<br>"); 62 if (accessibilityController.platformName == "atk") { 63 debug("Image4 title: " + image4.title); 64 debug("Image4 description: " + image4.description + "<br>"); 65 } else { 66 debug("Image4 description: " + image4.description); 67 debug("Image4 help: " + image4.helpText + "<br>"); 68 } 49 69 50 70 // Verify that the first image (with an empty alt tag) is ignored -
trunk/LayoutTests/accessibility/input-image-alt.html
r155274 r201072 18 18 var img = accessibilityController.focusedElement; 19 19 20 debug("img.description is " + img.description); 20 if (accessibilityController.platformName == "atk") 21 debug("img.title is " + img.title); 22 else 23 debug("img.description is " + img.description); 21 24 } 22 25 </script> -
trunk/LayoutTests/accessibility/loading-iframe-sends-notification.html
r160903 r201072 55 55 window.accessibilityController.addNotificationListener(function (target, notification) { 56 56 // Ignore this notification if it's not on the iframe or not about the iframe being loaded. 57 if (target.description.indexOf("InnerFrame") == -1 57 58 var targetString; 59 if (accessibilityController.platformName == "atk") 60 targetString = target.title; 61 else 62 targetString = target.description; 63 64 if (targetString.indexOf("InnerFrame") == -1 58 65 || (notification != "AXLoadComplete" && notification != "AXLayoutComplete")) 59 66 return; -
trunk/LayoutTests/accessibility/media-element.html
r155274 r201072 19 19 function dumpObject(axObject) 20 20 { 21 debug(indent(indentLevel) + "description: " + axObject.description); 21 if (accessibilityController.platformName == "atk") 22 debug(indent(indentLevel) + "title: " + axObject.title); 23 else 24 debug(indent(indentLevel) + "description: " + axObject.description); 22 25 debug(indent(indentLevel) + "role: " + axObject.role); 23 26 if (axObject.subrole && axObject.subrole != 'AXSubrole: ') debug(indent(indentLevel) + "subrole: " + axObject.subrole); -
trunk/LayoutTests/accessibility/radio-button-title-label.html
r178255 r201072 40 40 var radio2 = accessibilityController.accessibleElementById("r2"); 41 41 titleUIElement = radio2.titleUIElement(); 42 shouldBe("radio2.description", "'AXDescription: LABEL2a'"); 43 shouldBe("radio2.title", "'AXTitle: '"); 42 if (accessibilityController.platformName == "atk") { 43 shouldBe("radio2.title", "'AXTitle: LABEL2a'"); 44 shouldBe("radio2.description", "'AXDescription: '"); 45 } else { 46 shouldBe("radio2.description", "'AXDescription: LABEL2a'"); 47 shouldBe("radio2.title", "'AXTitle: '"); 48 } 44 49 shouldBeTrue("!titleUIElement || titleUIElement.title == 'AXTitle: '"); 45 50 … … 47 52 var radio3 = accessibilityController.accessibleElementById("r3"); 48 53 titleUIElement = radio3.titleUIElement(); 49 shouldBe("radio3.description", "'AXDescription: radio3'"); 50 shouldBe("radio3.title", "'AXTitle: '"); 54 if (accessibilityController.platformName == "atk") { 55 shouldBe("radio3.title", "'AXTitle: radio3'"); 56 shouldBe("radio2.description", "'AXDescription: '"); 57 } else { 58 shouldBe("radio3.description", "'AXDescription: radio3'"); 59 shouldBe("radio3.title", "'AXTitle: '"); 60 } 51 61 shouldBeTrue("!titleUIElement || titleUIElement.title == 'AXTitle: '"); 52 62 -
trunk/LayoutTests/accessibility/self-referencing-aria-labelledby.html
r155601 r201072 41 41 for (var i = 0; i < testCount; ++i) { 42 42 var test = accessibilityController.accessibleElementById("t" + i); 43 shouldBe("test.description", "'AXDescription: X Y Z'"); 43 if (accessibilityController.platformName == "atk") 44 shouldBe("test.title", "'AXTitle: X Y Z'"); 45 else 46 shouldBe("test.description", "'AXDescription: X Y Z'"); 44 47 } 45 48 } -
trunk/LayoutTests/accessibility/svg-bounds.html
r155274 r201072 35 35 } 36 36 37 function label(element) { 38 return accessibilityController.platformName == "atk" ? element.title: element.description; 39 } 40 37 41 if (window.testRunner && window.accessibilityController) { 38 42 window.testRunner.dumpAsText(); … … 47 51 var face = container.childAtIndex(0); 48 52 debug('Face role: ' + face.role); 49 debug('Face label: ' + face.description);53 debug('Face label: ' + label(face)); 50 54 debug('FaceX: ' + (pageX(face) - x)); 51 55 debug('FaceY: ' + Math.abs(pageY(face) - y)); … … 54 58 var eye = container.childAtIndex(1); 55 59 debug('Eye role: ' + eye.role); 56 debug('Eye label: ' + eye.description);60 debug('Eye label: ' + label(eye)); 57 61 debug('EyeX: ' + (pageX(eye) - x)); 58 62 debug('EyeY: ' + Math.abs(pageY(eye) - y)); … … 61 65 var nose = container.childAtIndex(3); 62 66 debug('Nose role: ' + nose.role); 63 debug('Nose label: ' + nose.description);67 debug('Nose label: ' + label(nose)); 64 68 debug('NoseX: ' + (pageX(nose) - x)); 65 69 debug('NoseY: ' + Math.abs(pageY(nose) - y)); … … 68 72 var mouth = container.childAtIndex(4); 69 73 debug('Mouth role: ' + mouth.role); 70 debug('Mouth label: ' + mouth.description);74 debug('Mouth label: ' + label(mouth)); 71 75 debug('MouthX: ' + (pageX(mouth) - x)); 72 76 debug('MouthY: ' + Math.floor(Math.abs(pageY(mouth) - y))); … … 75 79 // Text varies by about 1 - 2 pixels depending on the platform, 76 80 // so just print the text coordinates divided by 10. 77 var text = container.childAtIndex(5).childAtIndex(0); 81 var text = container.childAtIndex(5); 82 if (accessibilityController.platformName != "atk") 83 text = text.childAtIndex(0); 78 84 debug('Text role: ' + text.role); 79 85 debug('TextX/10: ' + Math.floor((pageX(text) - x) / 10)); … … 83 89 var image = container.childAtIndex(6); 84 90 debug('Image role: ' + image.role); 85 debug('Image label: ' + image.description);91 debug('Image label: ' + label(image)); 86 92 debug('ImageX: ' + (pageX(image) - x)); 87 93 debug('ImageY: ' + Math.abs(pageY(image) - y)); -
trunk/LayoutTests/platform/gtk/TestExpectations
r200973 r201072 1741 1741 webkit.org/b/42194 http/tests/security/drag-drop-same-unique-origin.html [ Failure ] 1742 1742 1743 webkit.org/b/106340 accessibility/img-fallsback-to-title.html [ Failure ]1744 1745 1743 # svg/ failures 1746 1744 webkit.org/b/42457 svg/custom/embedded-svg-allowed-in-dashboard.xml [ Failure ] … … 1960 1958 Bug(GTK) sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.3/S15.9.3.1_A5_T6.html [ Failure ] 1961 1959 1962 webkit.org/b/157187 accessibility/gtk/title-and-alt.html [ Failure ]1963 1964 1960 # Expose title direction in WebKit API 1965 1961 webkit.org/b/58845 fast/dom/title-directionality.html [ Failure ] … … 2234 2230 # Test globally skipped, passing on GTK port 2235 2231 webkit.org/b/124349 fast/hidpi/image-srcset-relative-svg-canvas.html [ Pass ] 2236 2237 webkit.org/b/131496 accessibility/help-text.html [ Failure ]2238 2232 2239 2233 webkit.org/b/131498 fast/css/cascade/box-shadow-and-webkit-box-shadow-cascade-order.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/gtk/accessibility/aria-help-expected.txt
r189467 r201072 5 5 6 6 7 FAIL button.helpText should be AXHelp: click here (of type string). Was null (of type object). 7 PASS button.description is 'AXDescription: click here' 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/platform/gtk/accessibility/aria-switch-text-expected.txt
r189467 r201072 13 13 widget.description is AXDescription: 14 14 widget.childrenCount is 0 15 widget.title is AXTitle: Three16 widget.description is AXDescription: foo15 widget.title is AXTitle: foo 16 widget.description is AXDescription: 17 17 widget.childrenCount is 0 18 18 PASS successfullyParsed is true -
trunk/LayoutTests/platform/gtk/accessibility/image-link-expected.txt
r197448 r201072 31 31 AXSize: { 280.000000, 210.000000 } 32 32 AXTitle: Delicious cake 33 AXDescription: Delicious cake33 AXDescription: 34 34 AXFocusable: 0 35 35 AXFocused: 0 -
trunk/LayoutTests/platform/gtk/accessibility/image-map1-expected.txt
r189467 r201072 7 7 Link1 role: AXRole: AXLink 8 8 Link1 title: AXTitle: Link1 9 Link1 description: AXDescription: Link19 Link1 description: AXDescription: 10 10 11 11 Link2 role: AXRole: AXLink 12 12 Link2 title: AXTitle: Link2 13 Link2 description: AXDescription: Link213 Link2 description: AXDescription: 14 14 15 15 Link3 role: AXRole: AXLink 16 16 Link3 title: AXTitle: Link3 17 Link3 description: AXDescription: Link317 Link3 description: AXDescription: 18 18 19 19 PASS successfullyParsed is true -
trunk/LayoutTests/platform/gtk/accessibility/image-map2-expected.txt
r189467 r201072 26 26 AXSize: { 123.000000, 62.000000 } 27 27 AXTitle: Link1 28 AXDescription: Link128 AXDescription: 29 29 AXValue: 30 30 AXFocusable: 0 … … 46 46 AXSize: { 122.000000, 14.000000 } 47 47 AXTitle: Link2 48 AXDescription: Link248 AXDescription: 49 49 AXValue: 50 50 AXFocusable: 0 -
trunk/LayoutTests/platform/gtk/accessibility/image-with-alt-and-map-expected.txt
r193841 r201072 8 8 AXRole: AXWebArea AXTitle: AXDescription: 9 9 AXRole: AXSection AXTitle: AXDescription: 10 AXRole: AXImageMap AXTitle: foo bar baz AXDescription: foo bar baz11 AXRole: AXLink AXTitle: foo AXDescription: foo12 AXRole: AXLink AXTitle: bar AXDescription: bar13 AXRole: AXLink AXTitle: baz AXDescription: baz10 AXRole: AXImageMap AXTitle: foo bar baz AXDescription: 11 AXRole: AXLink AXTitle: foo AXDescription: 12 AXRole: AXLink AXTitle: bar AXDescription: 13 AXRole: AXLink AXTitle: baz AXDescription: 14 14 PASS successfullyParsed is true 15 15 -
trunk/LayoutTests/platform/gtk/accessibility/img-alt-tag-only-whitespace-expected.txt
r201071 r201072 1 CONSOLE MESSAGE: line 2 6: Image description: AXDescription: Image1 CONSOLE MESSAGE: line 29: Image title: AXTitle: Image 2 2 3 3 -
trunk/LayoutTests/platform/gtk/accessibility/img-fallsback-to-title-expected.txt
r189467 r201072 1 2 test 1 test 3 2 test 4 3 This tests that images will fallback to using the title attribute if no other descriptive text is present. … … 7 6 8 7 9 Image1 description: AXDescription: test110 Image1 help: AXHelp:8 Image1 title: AXTitle: test1 9 Image1 description: AXDescription: 11 10 11 Image2 title: AXTitle: alt 12 12 Image2 description: AXDescription: test2 13 Image2 help: AXHelp: test214 13 15 Image3 description: AXDescription: test316 Image3 help: AXHelp:14 Image3 title: AXTitle: test3 15 Image3 description: AXDescription: 17 16 18 Image4 description: AXDescription: alt19 Image4 help: AXHelp: test417 Image4 title: AXTitle: alt 18 Image4 description: AXDescription: test4 20 19 21 20 PASS imagesGroup.childAtIndex(0).childrenCount is 2 -
trunk/LayoutTests/platform/gtk/accessibility/media-element-expected.txt
r189467 r201072 6 6 State at 'canplaythrough' event: 7 7 8 description: AXDescription:8 title: AXTitle: 9 9 role: AXRole: AXVideo 10 10 11 11 12 description: AXDescription: Video Playback12 title: AXTitle: Video Playback 13 13 role: AXRole: AXToolbar 14 14 15 15 16 description: AXDescription: Play16 title: AXTitle: Play 17 17 role: AXRole: AXButton 18 18 19 19 20 description: AXDescription: Duration20 title: AXTitle: Duration 21 21 role: AXRole: AXSlider 22 22 23 23 24 description: AXDescription: Remaining24 title: AXTitle: Remaining 25 25 role: AXRole: AXTimer 26 26 27 27 28 description: AXDescription: Display Full Screen28 title: AXTitle: Display Full Screen 29 29 role: AXRole: AXButton 30 30 31 31 32 description: AXDescription: Mute32 title: AXTitle: Mute 33 33 role: AXRole: AXButton 34 34 35 35 36 description: AXDescription: Volume36 title: AXTitle: Volume 37 37 role: AXRole: AXSlider 38 38 -
trunk/LayoutTests/platform/gtk/accessibility/radio-button-title-label-expected.txt
r189467 r201072 6 6 PASS radio1.title is 'AXTitle: LABEL' 7 7 PASS titleUIElement.isEqual(accessibilityController.accessibleElementById('label1')) is true 8 PASS radio2. description is 'AXDescription: LABEL2a'9 PASS radio2. title is 'AXTitle: '8 PASS radio2.title is 'AXTitle: LABEL2a' 9 PASS radio2.description is 'AXDescription: ' 10 10 PASS !titleUIElement || titleUIElement.title == 'AXTitle: ' is true 11 PASS radio3. description is 'AXDescription: radio3'12 PASS radio 3.title is 'AXTitle: '11 PASS radio3.title is 'AXTitle: radio3' 12 PASS radio2.description is 'AXDescription: ' 13 13 PASS !titleUIElement || titleUIElement.title == 'AXTitle: ' is true 14 14 PASS successfullyParsed is true -
trunk/Source/WebCore/ChangeLog
r201071 r201072 1 2016-05-18 Joanmarie Diggs <jdiggs@igalia.com> 2 3 AX: [ATK] Use WebCore Accessibility's AccessibilityText for AtkObject name and description 4 https://bugs.webkit.org/show_bug.cgi?id=157822 5 6 Reviewed by Chris Fleizach. 7 8 Remove the old code which was overriding WebCore Accessibility and always use 9 AccessibilityText. 10 11 If the AccessibilityText's textSource is HelpText or SummaryText, it should be exposed 12 as the AtkObject description. If the textSource is TitleTagText and there is no other 13 text alternative, the value should also be exposed in this fashion. Note that AtkObject's 14 description property is equivalent to AXAPI's AXHelp property. 15 16 If the AccessibilityText's textSource is anything other than the above, the first 17 non-empty value should be exposed as the AtkObject name. Depending on the source of 18 the name content, AtkObject's name property can be the equivalent of AXAPI's AXTitle. 19 However, most of the time, AtkObject's name property is equivalent to AXAPI's 20 AXDescription property. 21 22 By making these changes, what WebKit exposes for ATK is now extremely similar to what 23 WebKit exposes on the Mac (modulo the property names) and also with what is defined in 24 the HTML Accessibility and Accessible Name and Description Computation API mappings specs. 25 26 Now that the exposure is correct, the Layout Tests needed to be adjusted accordingly because 27 asking for the "AXDescription" gives you the AXDescription on the Mac and the AtkObject 28 description in GNU/Linux. But as indicated above, what ATK calls a "description" is what 29 the Mac calls "help." 30 31 Ultimately our Layout Tests and/or our platform TestRunner API should be modified to deal 32 with these differences more gracefully. (Bug https://bugs.webkit.org/show_bug.cgi?id=157187 33 has been opened for that task.) In the meantime, the existing tests have been given platform 34 checks to ask for the right property on each platform. This was done in such a way as to not 35 require other (non-ATK) platforms change their current expectations files. 36 37 * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: 38 (webkitAccessibleGetName): 39 (webkitAccessibleGetDescription): 40 1 41 2016-05-17 Zalan Bujtas <zalan@apple.com> 2 42 -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
r200677 r201072 112 112 returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(object), 0); 113 113 114 AccessibilityObject* coreObject = core(object); 115 if (coreObject->isFieldset()) { 116 AccessibilityObject* label = coreObject->titleUIElement(); 117 if (label) { 118 AtkObject* atkObject = label->wrapper(); 119 if (ATK_IS_TEXT(atkObject)) 120 return atk_text_get_text(ATK_TEXT(atkObject), 0, -1); 121 } 122 } 123 124 if (coreObject->isControl()) { 125 AccessibilityObject* label = coreObject->correspondingLabelForControlElement(); 126 if (label) { 127 AtkObject* atkObject = label->wrapper(); 128 if (ATK_IS_TEXT(atkObject)) 129 return atk_text_get_text(ATK_TEXT(atkObject), 0, -1); 130 } 131 132 // Try text under the node. 133 String textUnder = coreObject->textUnderElement(); 134 if (textUnder.length()) 135 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, textUnder); 136 } 137 138 if (is<SVGElement>(coreObject->element())) { 139 Vector<AccessibilityText> textOrder; 140 coreObject->accessibilityText(textOrder); 141 142 for (const auto& text : textOrder) { 143 if (text.textSource != HelpText && text.textSource != SummaryText) 144 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, text.text); 145 } 146 // FIXME: This is to keep the next blocks from returning duplicate text. 147 // This behavior should be extended to all elements; not just SVG. 148 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, ""); 149 } 150 151 if (coreObject->isImage() || coreObject->isInputImage() || coreObject->isImageMap() || coreObject->isImageMapLink()) { 152 Node* node = coreObject->node(); 153 if (is<HTMLElement>(node)) { 154 // Get the attribute rather than altText String so as not to fall back on title. 155 const AtomicString& alt = downcast<HTMLElement>(*node).getAttribute(HTMLNames::altAttr); 156 if (!alt.isEmpty()) 157 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, alt); 158 } 159 } 160 161 // Fallback for the webArea object: just return the document's title. 162 if (coreObject->isWebArea()) { 163 Document* document = coreObject->document(); 164 if (document) 165 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, document->title()); 166 } 167 168 // Nothing worked so far, try with the AccessibilityObject's 169 // title() before going ahead with stringValue(). 170 String axTitle = accessibilityTitle(coreObject); 171 if (!axTitle.isEmpty()) 172 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, axTitle); 173 174 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, coreObject->stringValue()); 114 Vector<AccessibilityText> textOrder; 115 core(object)->accessibilityText(textOrder); 116 117 for (const auto& text : textOrder) { 118 // FIXME: This check is here because AccessibilityNodeObject::titleElementText() 119 // appends an empty String for the LabelByElementText source when there is a 120 // titleUIElement(). Removing this check makes some fieldsets lose their name. 121 if (text.text.isEmpty()) 122 continue; 123 124 // WebCore Accessibility should provide us with the text alternative computation 125 // in the order defined by that spec. So take the first thing that our platform 126 // does not expose via the AtkObject description. 127 if (text.textSource != HelpText && text.textSource != SummaryText) 128 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, text.text); 129 } 130 131 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, ""); 175 132 } 176 133 … … 180 137 returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(object), 0); 181 138 182 AccessibilityObject* coreObject = core(object); 183 Node* node = nullptr; 184 if (coreObject->isAccessibilityRenderObject()) 185 node = coreObject->node(); 186 187 if (is<SVGElement>(node)) { 188 Vector<AccessibilityText> textOrder; 189 coreObject->accessibilityText(textOrder); 190 191 for (const auto& text : textOrder) { 192 if (text.textSource == HelpText || text.textSource == SummaryText || text.textSource == TitleTagText) 193 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, text.text); 194 } 195 // FIXME: This is to keep the next blocks from returning duplicate text. 196 // This behavior should be extended to all elements; not just SVG. 197 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, ""); 198 } 199 200 if (!is<HTMLElement>(node) || coreObject->ariaRoleAttribute() != UnknownRole || coreObject->isImage()) 201 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, accessibilityDescription(coreObject)); 202 203 // atk_table_get_summary returns an AtkObject. We have no summary object, so expose summary here. 204 if (coreObject->roleValue() == TableRole) { 205 const AtomicString& summary = downcast<HTMLTableElement>(*node).summary(); 206 if (!summary.isEmpty()) 207 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, summary); 208 } 209 210 // The title attribute should be reliably available as the object's descripton. 211 // We do not want to fall back on other attributes in its absence. See bug 25524. 212 String title = downcast<HTMLElement>(*node).title(); 213 if (!title.isEmpty()) 214 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, title); 215 216 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, accessibilityDescription(coreObject)); 139 Vector<AccessibilityText> textOrder; 140 core(object)->accessibilityText(textOrder); 141 142 bool nameTextAvailable = false; 143 for (const auto& text : textOrder) { 144 // WebCore Accessibility should provide us with the text alternative computation 145 // in the order defined by that spec. So take the first thing that our platform 146 // does not expose via the AtkObject name. 147 if (text.textSource == HelpText || text.textSource == SummaryText) 148 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, text.text); 149 150 // If there is no other text alternative, the title tag contents will have been 151 // used for the AtkObject name. We don't want to duplicate it here. 152 if (text.textSource == TitleTagText && nameTextAvailable) 153 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, text.text); 154 155 nameTextAvailable = true; 156 } 157 158 return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, ""); 217 159 } 218 160 -
trunk/Tools/ChangeLog
r201056 r201072 1 2016-05-18 Joanmarie Diggs <jdiggs@igalia.com> 2 3 AX: [ATK] Use WebCore Accessibility's AccessibilityText for AtkObject name and description 4 https://bugs.webkit.org/show_bug.cgi?id=157822 5 6 Reviewed by Chris Fleizach. 7 8 Fix AccessibilityUIElement::helpText() so that it returns an empty string rather than 9 nullptr upon failure. 10 11 * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: 12 (WTR::AccessibilityUIElement::helpText): 13 1 14 2016-05-17 Beth Dakin <bdakin@apple.com> 2 15 -
trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
r200677 r201072 1223 1223 AtkRelationSet* relationSet = atk_object_ref_relation_set(ATK_OBJECT(m_element.get())); 1224 1224 if (!relationSet) 1225 return nullptr;1225 return JSStringCreateWithCharacters(0, 0); 1226 1226 1227 1227 AtkRelation* relation = atk_relation_set_get_relation_by_type(relationSet, ATK_RELATION_DESCRIBED_BY); 1228 1228 if (!relation) 1229 return nullptr;1229 return JSStringCreateWithCharacters(0, 0); 1230 1230 1231 1231 GPtrArray* targetList = atk_relation_get_target(relation); 1232 1232 if (!targetList || !targetList->len) 1233 return nullptr;1233 return JSStringCreateWithCharacters(0, 0); 1234 1234 1235 1235 StringBuilder builder;
Note: See TracChangeset
for help on using the changeset viewer.