Changeset 201216 in webkit


Ignore:
Timestamp:
May 20, 2016 11:34:14 AM (8 years ago)
Author:
jdiggs@igalia.com
Message:

AX: Layout tests related to text alternative computation need to be done differently
https://bugs.webkit.org/show_bug.cgi?id=157187

Create several utility methods to facilitate retrieval of platform-independent
attribute values from platform-specific attributes:

  • platformValueForW3CName() and platformValueForW3CDescription() to retrieve a specific piece of text alternative information, stripping off the platform attribute name by default. These methods should make it possible to share tests and expectations files because the text alternative calculation defined by the W3C accessibility specifications should be the same for all platforms. (The differences are the result of the unique platform mappings.)
  • platformTextAlternatives() to dump out all the text alternative attributes and values, preserving the platform-specific attribute name. This, along with the use of the platformValue* methods with attribute name enabled, should make it possible to have shared tests with platform-specific expectations without the need to check the platform in the test itself.
  • platformRoleForComboBox() and platformRoleForStaticText() to eliminate the need for platform-specific expectations files simply because such an element happens to be included in the test file and verifying that element's role is desired.

Begin using these methods in the tests related to text alternative computation
which had platform-specific checks, update the expectations files when needed,
and remove now-obsolete platform-specific expectations files.

Reviewed by Chris Fleizach.

  • accessibility/alt-tag-on-image-with-nonimage-role-expected.txt: Updated.
  • accessibility/alt-tag-on-image-with-nonimage-role.html: Updated.
  • accessibility/aria-help-expected.txt: Added.
  • accessibility/aria-help.html: Updated.
  • accessibility/aria-label-expected.txt: Updated.
  • accessibility/aria-label.html: Updated.
  • accessibility/aria-labeled-with-hidden-node-expected.txt: Updated.
  • accessibility/aria-labeled-with-hidden-node.html: Updated.
  • accessibility/aria-labelledby-on-input-expected.txt: Updated.
  • accessibility/aria-labelledby-on-input.html: Updated.
  • accessibility/aria-labelledby-overrides-aria-labeledby-expected.txt: Updated.
  • accessibility/aria-labelledby-overrides-aria-labeledby.html: Updated.
  • accessibility/aria-labelledby-overrides-label-expected.txt: Updated.
  • accessibility/aria-labelledby-overrides-label.html: Updated.
  • accessibility/aria-labelledby-stay-within-expected.txt: Updated.
  • accessibility/aria-labelledby-stay-within.html: Updated.
  • accessibility/aria-labelledby-with-descendants-expected.txt: Updated.
  • accessibility/aria-labelledby-with-descendants.html: Updated.
  • accessibility/aria-namefrom-author-expected.txt: Updated.
  • accessibility/aria-namefrom-author.html: Updated.
  • accessibility/aria-text-role-expected.txt: Updated.
  • accessibility/aria-text-role.html: Updated.
  • accessibility/canvas-description-and-role-expected.txt: Updated.
  • accessibility/canvas-description-and-role.html: Updated.
  • accessibility/canvas-fallback-content.html: Updated.
  • accessibility/empty-image-with-title-expected.txt: Updated.
  • accessibility/empty-image-with-title.html: Updated.
  • accessibility/fieldset-element-expected.txt: Updated.
  • accessibility/fieldset-element.html: Updated.
  • accessibility/focusable-div-expected.txt: Updated.
  • accessibility/focusable-div.html: Updated.
  • accessibility/help-text.html: Updated.
  • accessibility/img-alt-tag-only-whitespace-expected.txt: Updated.
  • accessibility/img-alt-tag-only-whitespace.html: Updated.
  • accessibility/img-aria-button-alt-tag-expected.txt: Updated.
  • accessibility/img-aria-button-alt-tag.html: Updated.
  • accessibility/img-fallsback-to-title.html: Updated.
  • accessibility/input-image-alt-expected.txt: Updated.
  • accessibility/input-image-alt.html: Updated.
  • accessibility/loading-iframe-sends-notification.html: Updated.
  • accessibility/self-referencing-aria-labelledby-expected.txt: Updated.
  • accessibility/self-referencing-aria-labelledby.html: Updated.
  • accessibility/svg-bounds.html: Updated.
  • accessibility/svg-group-element-with-title-expected.txt: Updated.
  • accessibility/svg-group-element-with-title.html: Updated.
  • accessibility/svg-image-expected.txt: Updated.
  • accessibility/svg-image.html: Updated.
  • accessibility/svg-labelledby-expected.txt: Updated.
  • accessibility/svg-labelledby.html: Updated.
  • accessibility/svg-remote-element.html: Updated.
  • accessibility/w3c-svg-description-calculation.html: Updated.
  • accessibility/w3c-svg-name-calculation.html: Updated.
  • platform/gtk/accessibility/alt-tag-on-image-with-nonimage-role-expected.txt: Removed.
  • platform/gtk/accessibility/aria-labeled-with-hidden-node-expected.txt: Removed.
  • platform/gtk/accessibility/aria-labelledby-on-input-expected.txt: Removed.
  • platform/gtk/accessibility/aria-labelledby-overrides-aria-labeledby-expected.txt: Removed.
  • platform/gtk/accessibility/aria-labelledby-overrides-label-expected.txt: Updated.
  • platform/gtk/accessibility/aria-labelledby-with-descendants-expected.txt: Removed.
  • platform/gtk/accessibility/aria-namefrom-author-expected.txt: Removed.
  • platform/gtk/accessibility/aria-text-role-expected.txt: Removed.
  • platform/gtk/accessibility/canvas-description-and-role-expected.txt: Updated.
  • platform/gtk/accessibility/empty-image-with-title-expected.txt: Updated.
  • platform/gtk/accessibility/fieldset-element-expected.txt: Removed.
  • platform/gtk/accessibility/focusable-div-expected.txt: Removed.
  • platform/gtk/accessibility/img-alt-tag-only-whitespace-expected.txt: Removed.
  • platform/gtk/accessibility/img-aria-button-alt-tag-expected.txt: Removed.
  • platform/gtk/accessibility/img-fallsback-to-title-expected.txt: Updated.
  • platform/gtk/accessibility/input-image-alt-expected.txt: Removed.
  • platform/gtk/accessibility/self-referencing-aria-labelledby-expected.txt: Removed.
  • platform/gtk/accessibility/svg-group-element-with-title-expected.txt: Removed.
  • platform/gtk/accessibility/svg-image-expected.txt: Removed.
  • platform/gtk/accessibility/svg-labelledby-expected.txt: Removed.
  • platform/mac/accessibility/aria-help-expected.txt: Removed.
  • platform/mac/accessibility/aria-labelledby-overrides-label-expected.txt: Removed.
  • platform/mac/accessibility/canvas-description-and-role-expected.txt: Updated.
  • platform/mac/accessibility/fieldset-element-expected.txt: Removed.
  • platform/mac/accessibility/img-fallsback-to-title-expected.txt: Updated.
  • platform/win/accessibility/canvas-description-and-role-expected.txt: Updated.
  • resources/accessibility-helper.js:

(platformValueForW3CName): Added.
(platformValueForW3CDescription): Added.
(platformTextAlternatives): Added.
(platformRoleForComboBox): Added.
(platformRoleForStaticText): Added.

Location:
trunk/LayoutTests
Files:
19 deleted
60 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201204 r201216  
     12016-05-20  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        AX: Layout tests related to text alternative computation need to be done differently
     4        https://bugs.webkit.org/show_bug.cgi?id=157187
     5
     6        Create several utility methods to facilitate retrieval of platform-independent
     7        attribute values from platform-specific attributes:
     8
     9        - platformValueForW3CName() and platformValueForW3CDescription() to retrieve a
     10          specific piece of text alternative information, stripping off the platform
     11          attribute name by default. These methods should make it possible to share tests
     12          and expectations files because the text alternative calculation defined by the
     13          W3C accessibility specifications should be the same for all platforms. (The
     14          differences are the result of the unique platform mappings.)
     15
     16        - platformTextAlternatives() to dump out all the text alternative attributes and
     17          values, preserving the platform-specific attribute name. This, along with the
     18          use of the platformValue* methods with attribute name enabled, should make it
     19          possible to have shared tests with platform-specific expectations without the
     20          need to check the platform in the test itself.
     21
     22        - platformRoleForComboBox() and platformRoleForStaticText() to eliminate the
     23          need for platform-specific expectations files simply because such an element
     24          happens to be included in the test file and verifying that element's role is
     25          desired.
     26
     27        Begin using these methods in the tests related to text alternative computation
     28        which had platform-specific checks, update the expectations files when needed,
     29        and remove now-obsolete platform-specific expectations files.
     30
     31        Reviewed by Chris Fleizach.
     32
     33        * accessibility/alt-tag-on-image-with-nonimage-role-expected.txt: Updated.
     34        * accessibility/alt-tag-on-image-with-nonimage-role.html: Updated.
     35        * accessibility/aria-help-expected.txt: Added.
     36        * accessibility/aria-help.html: Updated.
     37        * accessibility/aria-label-expected.txt: Updated.
     38        * accessibility/aria-label.html: Updated.
     39        * accessibility/aria-labeled-with-hidden-node-expected.txt: Updated.
     40        * accessibility/aria-labeled-with-hidden-node.html: Updated.
     41        * accessibility/aria-labelledby-on-input-expected.txt: Updated.
     42        * accessibility/aria-labelledby-on-input.html: Updated.
     43        * accessibility/aria-labelledby-overrides-aria-labeledby-expected.txt: Updated.
     44        * accessibility/aria-labelledby-overrides-aria-labeledby.html: Updated.
     45        * accessibility/aria-labelledby-overrides-label-expected.txt: Updated.
     46        * accessibility/aria-labelledby-overrides-label.html: Updated.
     47        * accessibility/aria-labelledby-stay-within-expected.txt: Updated.
     48        * accessibility/aria-labelledby-stay-within.html: Updated.
     49        * accessibility/aria-labelledby-with-descendants-expected.txt: Updated.
     50        * accessibility/aria-labelledby-with-descendants.html: Updated.
     51        * accessibility/aria-namefrom-author-expected.txt: Updated.
     52        * accessibility/aria-namefrom-author.html: Updated.
     53        * accessibility/aria-text-role-expected.txt: Updated.
     54        * accessibility/aria-text-role.html: Updated.
     55        * accessibility/canvas-description-and-role-expected.txt: Updated.
     56        * accessibility/canvas-description-and-role.html: Updated.
     57        * accessibility/canvas-fallback-content.html: Updated.
     58        * accessibility/empty-image-with-title-expected.txt: Updated.
     59        * accessibility/empty-image-with-title.html: Updated.
     60        * accessibility/fieldset-element-expected.txt: Updated.
     61        * accessibility/fieldset-element.html: Updated.
     62        * accessibility/focusable-div-expected.txt: Updated.
     63        * accessibility/focusable-div.html: Updated.
     64        * accessibility/help-text.html: Updated.
     65        * accessibility/img-alt-tag-only-whitespace-expected.txt: Updated.
     66        * accessibility/img-alt-tag-only-whitespace.html: Updated.
     67        * accessibility/img-aria-button-alt-tag-expected.txt: Updated.
     68        * accessibility/img-aria-button-alt-tag.html: Updated.
     69        * accessibility/img-fallsback-to-title.html: Updated.
     70        * accessibility/input-image-alt-expected.txt: Updated.
     71        * accessibility/input-image-alt.html: Updated.
     72        * accessibility/loading-iframe-sends-notification.html: Updated.
     73        * accessibility/self-referencing-aria-labelledby-expected.txt: Updated.
     74        * accessibility/self-referencing-aria-labelledby.html: Updated.
     75        * accessibility/svg-bounds.html: Updated.
     76        * accessibility/svg-group-element-with-title-expected.txt: Updated.
     77        * accessibility/svg-group-element-with-title.html: Updated.
     78        * accessibility/svg-image-expected.txt: Updated.
     79        * accessibility/svg-image.html: Updated.
     80        * accessibility/svg-labelledby-expected.txt: Updated.
     81        * accessibility/svg-labelledby.html: Updated.
     82        * accessibility/svg-remote-element.html: Updated.
     83        * accessibility/w3c-svg-description-calculation.html: Updated.
     84        * accessibility/w3c-svg-name-calculation.html: Updated.
     85        * platform/gtk/accessibility/alt-tag-on-image-with-nonimage-role-expected.txt: Removed.
     86        * platform/gtk/accessibility/aria-labeled-with-hidden-node-expected.txt: Removed.
     87        * platform/gtk/accessibility/aria-labelledby-on-input-expected.txt: Removed.
     88        * platform/gtk/accessibility/aria-labelledby-overrides-aria-labeledby-expected.txt: Removed.
     89        * platform/gtk/accessibility/aria-labelledby-overrides-label-expected.txt: Updated.
     90        * platform/gtk/accessibility/aria-labelledby-with-descendants-expected.txt: Removed.
     91        * platform/gtk/accessibility/aria-namefrom-author-expected.txt: Removed.
     92        * platform/gtk/accessibility/aria-text-role-expected.txt: Removed.
     93        * platform/gtk/accessibility/canvas-description-and-role-expected.txt: Updated.
     94        * platform/gtk/accessibility/empty-image-with-title-expected.txt: Updated.
     95        * platform/gtk/accessibility/fieldset-element-expected.txt: Removed.
     96        * platform/gtk/accessibility/focusable-div-expected.txt: Removed.
     97        * platform/gtk/accessibility/img-alt-tag-only-whitespace-expected.txt: Removed.
     98        * platform/gtk/accessibility/img-aria-button-alt-tag-expected.txt: Removed.
     99        * platform/gtk/accessibility/img-fallsback-to-title-expected.txt: Updated.
     100        * platform/gtk/accessibility/input-image-alt-expected.txt: Removed.
     101        * platform/gtk/accessibility/self-referencing-aria-labelledby-expected.txt: Removed.
     102        * platform/gtk/accessibility/svg-group-element-with-title-expected.txt: Removed.
     103        * platform/gtk/accessibility/svg-image-expected.txt: Removed.
     104        * platform/gtk/accessibility/svg-labelledby-expected.txt: Removed.
     105        * platform/mac/accessibility/aria-help-expected.txt: Removed.
     106        * platform/mac/accessibility/aria-labelledby-overrides-label-expected.txt: Removed.
     107        * platform/mac/accessibility/canvas-description-and-role-expected.txt: Updated.
     108        * platform/mac/accessibility/fieldset-element-expected.txt: Removed.
     109        * platform/mac/accessibility/img-fallsback-to-title-expected.txt: Updated.
     110        * platform/win/accessibility/canvas-description-and-role-expected.txt: Updated.
     111        * resources/accessibility-helper.js:
     112        (platformValueForW3CName): Added.
     113        (platformValueForW3CDescription): Added.
     114        (platformTextAlternatives): Added.
     115        (platformRoleForComboBox): Added.
     116        (platformRoleForStaticText): Added.
     117
    11182016-05-19  Myles C. Maxfield  <mmaxfield@apple.com>
    2119
  • trunk/LayoutTests/accessibility/alt-tag-on-image-with-nonimage-role-expected.txt

    r160311 r201216  
    11   
    2 This tests that setting a role on an img still allows the alt attribute to be used for the description..
     2This tests the alternative text calculation when setting a role on an img with an alt attribute.
    33
    44On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     
    66
    77PASS text.stringValue is 'AXValue: TEST1'
    8 PASS group.description is 'AXDescription: TEST2'
    9 PASS button.description is 'AXDescription: TEST3'
     8PASS platformValueForW3CName(group) is "TEST2"
     9PASS platformValueForW3CName(button) is "TEST3"
    1010PASS successfullyParsed is true
    1111
  • trunk/LayoutTests/accessibility/alt-tag-on-image-with-nonimage-role.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    1718<script>
    1819
    19     description("This tests that setting a role on an img still allows the alt attribute to be used for the description..");
     20    description("This tests the alternative text calculation when setting a role on an img with an alt attribute.");
    2021
    2122    if (window.accessibilityController) {
     
    2728        var button = accessibilityController.accessibleElementById("button");
    2829
    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         }
     30        shouldBeEqualToString("platformValueForW3CName(group)", "TEST2");
     31        shouldBeEqualToString("platformValueForW3CName(button)", "TEST3");
    3632    }
    3733
  • trunk/LayoutTests/accessibility/aria-help-expected.txt

    r201215 r201216  
    1 button
    21This tests that aria-help attribute works as expected.
    32
     
    54
    65
    7 PASS button.description is 'AXDescription: click here'
     6PASS platformValueForW3CName(axButton) is "title"
     7PASS platformValueForW3CDescription(axButton) is "click here"
    88PASS successfullyParsed is true
    99
  • trunk/LayoutTests/accessibility/aria-help.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
    7 
     8<div id="content">
    89<div id="button" tabindex=0 role="button" aria-label="title" aria-help="click here">
    910button
    1011</div>
    11 
     12</div>
    1213<p id="description"></p>
    1314<div id="console"></div>
     
    1819
    1920    if (window.accessibilityController) {
     21        document.getElementById("button").focus();
     22        var axButton = accessibilityController.focusedElement;
     23        shouldBeEqualToString("platformValueForW3CName(axButton)", "title");
     24        shouldBeEqualToString("platformValueForW3CDescription(axButton)", "click here");
    2025
    21         document.getElementById("button").focus();
    22         var button = accessibilityController.focusedElement;
    23         if (accessibilityController.platformName == "atk")
    24             shouldBe("button.description", "'AXDescription: click here'");
    25         else
    26             shouldBe("button.helpText", "'AXHelp: click here'");
     26        document.getElementById("content").style.visibility = "hidden";
    2727    }
    28 
    2928</script>
    3029
  • trunk/LayoutTests/accessibility/aria-label-expected.txt

    r45456 r201216  
    1  test
    2 This tests that the aria-label attribute works. The input and the A tag should return the appropriate description.
     1This tests that the aria-label attribute works on both an input and an anchor.
    32
    43On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    54
    65
    7 PASS succeeded is true
    8 PASS succeeded is true
     6PASS platformValueForW3CName(axInput) is "aria label"
     7PASS platformValueForW3CName(axLink) is "aria link"
    98PASS successfullyParsed is true
    109
  • trunk/LayoutTests/accessibility/aria-label.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     8<div id="content">
    79<input aria-label="aria label" type="text" size=20>
    810<a href="#" aria-label="aria link">test</a>
     11</div>
    912<p id="description"></p>
    1013<div id="console"></div>
     
    1215<script>
    1316
    14     description("This tests that the aria-label attribute works. The input and the A tag should return the appropriate description.");
     17    description("This tests that the aria-label attribute works on both an input and an anchor.");
    1518
    1619    if (window.accessibilityController) {
     
    1821          var body = document.getElementById("body");
    1922          body.focus();
    20           var obj = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(0);
    21           var succeeded;
    22           if (accessibilityController.platformName == "atk")
    23               succeeded = obj.title == "AXTitle: aria label";
    24           else
    25               succeeded = obj.description == "AXDescription: aria label";
    26           shouldBe("succeeded", "true");
    2723
    28           obj = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(1);
    29           if (accessibilityController.platformName == "atk")
    30               succeeded = obj.title == "AXTitle: aria link";
    31           else
    32               succeeded = obj.description == "AXDescription: aria link";
    33           shouldBe("succeeded", "true");
     24          var axInput = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(0);
     25          shouldBeEqualToString("platformValueForW3CName(axInput)", "aria label");
     26
     27          var axLink = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(1);
     28          shouldBeEqualToString("platformValueForW3CName(axLink)", "aria link");
     29
     30          document.getElementById("content").style.visibility = "hidden";
    3431    }
    35 
    3632</script>
    3733
  • trunk/LayoutTests/accessibility/aria-labeled-with-hidden-node-expected.txt

    r157221 r201216  
    1 Go
    21This tests that if try to use a non-rendered node as your labelledby element, it won't crash and it will work.
    32
     
    54
    65
    7 PASS button.description is 'AXDescription: TITLE'
     6PASS platformValueForW3CName(button) is "TITLE"
    87PASS successfullyParsed is true
    98
  • trunk/LayoutTests/accessibility/aria-labeled-with-hidden-node.html

    r201072 r201216  
    44<head>
    55<script src="../resources/js-test-pre.js"></script>
     6<script src="../resources/accessibility-helper.js"></script>
    67</head>
    78<body>
    8 
     9<div id="content">
    910<button id="button" aria-labelledby="title">Go</button>
    10 
     11</div>
    1112
    1213<p id="description"></p>
     
    1819    if (window.accessibilityController) {
    1920       var button = accessibilityController.accessibleElementById("button");
    20        if (accessibilityController.platformName == "atk")
    21            shouldBe("button.title", "'AXTitle: TITLE'");
    22        else
    23            shouldBe("button.description", "'AXDescription: TITLE'");
     21       shouldBeEqualToString("platformValueForW3CName(button)", "TITLE");
     22
     23       document.getElementById("content").style.visibility = "hidden";
    2424    }
    2525</script>
  • trunk/LayoutTests/accessibility/aria-labelledby-on-input-expected.txt

    r114362 r201216  
    1 This computer will self-destruct in   minutes.
     1This verifies the accessible name of an input with multiple aria-labelledby elements.
    22
    3 The accessibility description is "AXDescription: This computer will self-destruct in 10 minutes."
     3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     4
     5
     6PASS platformValueForW3CName(axInput) is "This computer will self-destruct in 10 minutes."
     7PASS successfullyParsed is true
     8
     9TEST COMPLETE
     10
  • trunk/LayoutTests/accessibility/aria-labelledby-on-input.html

    r201072 r201216  
     1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
    12<html>
    2 <script>
    3     if (window.testRunner)
    4         testRunner.dumpAsText();
    5 </script>
     3<head>
     4<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
     6</head>
    67<body>
     8<div id="content">
    79    <span id="message">This computer will self-destruct in</span>
    810    <input id="time" type="text" value="10" aria-labelledby="message time unit"/>
    911    <span id="unit"> minutes.</span>
    10     <div id="result"></div>
    11    
    12     <script>
    13         if (window.accessibilityController) {
    14             var labeledItem = document.getElementById("time");
    15             labeledItem.focus();
    16             var result = document.getElementById("result");
    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 + "\"";
    21         }
    22     </script>
     12</div>
     13<div id="console"></div>
     14<script>
     15    description("This verifies the accessible name of an input with multiple aria-labelledby elements.");
     16    if (window.accessibilityController) {
     17        var labeledItem = document.getElementById("time").focus();
     18        var axInput = accessibilityController.focusedElement;
     19        shouldBeEqualToString("platformValueForW3CName(axInput)", "This computer will self-destruct in 10 minutes.");
     20
     21        document.getElementById("content").style.visibility = "hidden";
     22    }
     23</script>
     24<script src="../resources/js-test-post.js"></script>
    2325</body>
    2426</html>
  • trunk/LayoutTests/accessibility/aria-labelledby-overrides-aria-labeledby-expected.txt

    r159482 r201216  
    44
    55
    6 PASS linkDescription is 'AXDescription: Y Z'
     6PASS platformValueForW3CName(axLink) is "Y Z"
    77PASS successfullyParsed is true
    88
  • trunk/LayoutTests/accessibility/aria-labelledby-overrides-aria-labeledby.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56<title>aria-labelledby Overrides aria-labeledby</title>
    67</head>
     
    2425   
    2526    if (window.accessibilityController) {
    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         }
     27        var axLink = accessibilityController.accessibleElementById("link");
     28        shouldBeEqualToString("platformValueForW3CName(axLink)", "Y Z");
     29
    3330        // Hide superfluous text.
    3431        document.getElementById("test").style.display = "none";
  • trunk/LayoutTests/accessibility/aria-labelledby-overrides-label-expected.txt

    r151924 r201216  
    1 Shut down computer after  minutes
    21This tests that if aria-labelledby is used, then label elements are not used
    32
     
    54
    65
    7 text.description is AXDescription: Shut down computer after 10 minutes
     6PASS platformValueForW3CName(text) is "Shut down computer after 10 minutes"
    87PASS text.titleUIElement() != null && text.titleUIElement().isValid is false
    9 Label element role is: AXRole: AXLabel
     8Label element role is: AXRole: AXGroup
    109PASS successfullyParsed is true
    1110
  • trunk/LayoutTests/accessibility/aria-labelledby-overrides-label.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
    7 
     8<div id="content">
    89<span id="labelShutdown"><label id="labelElement" for="shutdownTime">Shut down computer after</label></span>
    910<input id="shutdownTime" type="text" value="10" aria-labelledby="labelShutdown shutdownTime shutdownUnit" />
    1011<span id="shutdownUnit">minutes</span>
    11 
     12</div>
    1213<p id="description"></p>
    1314<div id="console"></div>
     
    2223          text.focus();
    2324          text = accessibilityController.focusedElement;
    24 
    25           if (accessibilityController.platformName == "atk")
    26               debug("text.title is " + text.title);
    27           else
    28               debug("text.description is " + text.description);
     25          shouldBeEqualToString("platformValueForW3CName(text)", "Shut down computer after 10 minutes");
    2926
    3027          // There should be no title UI element.
     
    3532          // it's a label element (sometimes they are ignored).
    3633          debug("Label element role is: " + labelElement.role);
     34
     35          document.getElementById("content").style.visibility = "hidden";
    3736    }
    3837
  • trunk/LayoutTests/accessibility/aria-labelledby-stay-within-expected.txt

    r114362 r201216  
    1 Some focusable content before the application widgets.
     1This tests that aria-labelledby does not append all sibling to an ARIA name
    22
    3 Get New Mail
    4 Compose New Message
    5 Reply
    6 Reply All
    7 Forward
    8 Delete
    9 Item Four
    10 Item Five
    11 Item Six
    12 Item Seven
    13 Passed
     3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     4
     5
     6PASS platformValueForW3CName(axButton) is "Reply Item Five"
     7PASS successfullyParsed is true
     8
     9TEST COMPLETE
     10
  • trunk/LayoutTests/accessibility/aria-labelledby-stay-within.html

    r201072 r201216  
     1<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
    12<html>
    2 <script>
    3     if (window.testRunner)
    4         testRunner.dumpAsText();
    5 </script>
     3<head>
     4<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
     6</head>
    67<body>
    7 
    8     <!-- this test makes sure that the labeled by aria attributes does not start climbing out of itself and
    9          appending on other elements as its own description -->
    10 
     8<div id="content">
    119    <p>Some <a href="#">focusable content</a> before the application widgets.</p>
    1210    <ul role="toolbar">
     
    2624</ul>
    2725
    28     <div id="result"></div>
    29    
    30     <script>
     26</div>
     27<p id="description"></p>
     28<div id="console"></div>
     29<script>
     30        description("This tests that aria-labelledby does not append all sibling to an ARIA name");
     31
    3132        if (window.accessibilityController) {
    32             var labeledItem = document.getElementById("rep");
    33             labeledItem.focus();
    34             var result = document.getElementById("result");
    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")) {
    41                result.innerText = "Passed";
    42             }
    43             else {
    44                result.innerText = "Failed. Result ==" + resultValue + "==";
    45             }
     33            var labeledItem = document.getElementById("rep").focus();
     34            var axButton = accessibilityController.focusedElement;
     35            shouldBeEqualToString("platformValueForW3CName(axButton)", "Reply Item Five");
     36
     37            document.getElementById("content").style.visibility = "hidden";
    4638        }
    47     </script>
     39</script>
     40<script src="../resources/js-test-post.js"></script>
    4841</body>
    4942</html>
  • trunk/LayoutTests/accessibility/aria-labelledby-with-descendants-expected.txt

    r174080 r201216  
    66
    77
    8 test 1: aria-labelledby description: AXDescription: hello link use world test1 test2 test3
     8test 1: aria-labelledby description: hello link use world test1 test2 test3
    99test 1: expected description: hello link use world test1 test2 test3
    1010
    11 test 2: aria-labelledby description: AXDescription: foo bar
     11test 2: aria-labelledby description: foo bar
    1212test 2: expected description: foo bar
    1313
    14 test 3: aria-labelledby description: AXDescription: foo bar
     14test 3: aria-labelledby description: foo bar
    1515test 3: expected description: foo bar
    1616
    17 test 4: aria-labelledby description: AXDescription: foo
     17test 4: aria-labelledby description: foo
    1818test 4: expected description: foo
    1919
    20 test 5: aria-labelledby description: AXDescription: Delete
     20test 5: aria-labelledby description: Delete
    2121test 5: expected description: Delete
    2222
    23 test 6: aria-labelledby description: AXDescription: Delete product name
     23test 6: aria-labelledby description: Delete product name
    2424test 6: expected description: Delete product name
    2525
    26 test 7: aria-labelledby description: AXDescription: foo bar baz bop bap boom
     26test 7: aria-labelledby description: foo bar baz bop bap boom
    2727test 7: expected description: foo bar baz bop bap boom
    2828
  • trunk/LayoutTests/accessibility/aria-labelledby-with-descendants.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    5051          for (var k = 1; k < 8; k++) {
    5152              var test = accessibilityController.accessibleElementById("test" + k);
    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              debug("test " + k + ": aria-labelledby description: " + platformValueForW3CName(test));
    5654              debug("test " + k + ": expected description: " + document.getElementById("test" + k).getAttribute("data-label") + "\n");
    5755          }
  • trunk/LayoutTests/accessibility/aria-namefrom-author-expected.txt

    r174074 r201216  
    1 This tests all the cases where nameFrom: author is used instead of nameFrom: contents. This means that if these elements are used in aria-labelledby they should not return their inner text. The button should retain its aria-label as the description.
     1This tests all the cases where nameFrom: author is used instead of nameFrom: contents. This means that if these elements are used in aria-labelledby they should not return their inner text. The button should retain its aria-label.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    44
    55
    6 Button description: AXDescription: text
     6PASS buttonAccName == button.getAttribute('aria-label') is true
     7PASS buttonAccName != button.innerText is true
    78PASS successfullyParsed is true
    89
  • trunk/LayoutTests/accessibility/aria-namefrom-author.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    5960<script>
    6061
    61     description("This tests all the cases where nameFrom: author is used instead of nameFrom: contents. This means that if these elements are used in aria-labelledby they should not return their inner text. The button should retain its aria-label as the description.");
     62    description("This tests all the cases where nameFrom: author is used instead of nameFrom: contents. This means that if these elements are used in aria-labelledby they should not return their inner text. The button should retain its aria-label.");
    6263
    6364    var labelledby = "";
     
    6869
    6970    if (window.accessibilityController) {
    70         if (accessibilityController.platformName == "atk")
    71             debug("Button title: " + accessibilityController.accessibleElementById("button").title);
    72         else
    73             debug("Button description: " + accessibilityController.accessibleElementById("button").description);
     71        var buttonAccName = platformValueForW3CName(accessibilityController.accessibleElementById("button"));
     72        var button = document.getElementById("button");
     73        shouldBeTrue("buttonAccName == button.getAttribute('aria-label')");
     74        shouldBeTrue("buttonAccName != button.innerText");
     75
    7476        document.getElementById("content").style.visibility = "hidden";
    7577    }
  • trunk/LayoutTests/accessibility/aria-text-role-expected.txt

    r51576 r201216  
    55
    66
    7 PASS textrole.role is 'AXRole: AXStaticText'
     7PASS textrole.role is platformRoleForStaticText(textrole)
    88PASS textrole.stringValue is 'AXValue: all at once'
    99PASS textrole.elementAtPoint(x, y).isEqual(textrole) is true
  • trunk/LayoutTests/accessibility/aria-text-role.html

    r200240 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    2324        document.getElementById("textrole").focus();
    2425        var textrole = accessibilityController.focusedElement;
    25         if (accessibilityController.platformName == "atk")
    26             shouldBe("textrole.role", "'AXRole: AXStatic'");
    27         else
    28             shouldBe("textrole.role", "'AXRole: AXStaticText'");
     26        shouldBe("textrole.role", "platformRoleForStaticText(textrole)");
    2927        shouldBe("textrole.stringValue", "'AXValue: all at once'");
    3028
  • trunk/LayoutTests/accessibility/canvas-description-and-role-expected.txt

    r158810 r201216  
    55
    66PASS axContainer.childrenCount is 2
    7 Canvas 1 description: AXDescription: Canvas label
     7PASS platformValueForW3CName(axCanvas1) is "Canvas label"
    88Canvas 1 role: AXRole: AXCanvas
    9 Canvas 2 description: AXDescription:
     9PASS platformValueForW3CName(axCanvas2) is ""
    1010Canvas 2 role: AXRole: AXCanvas
    1111PASS successfullyParsed is true
  • trunk/LayoutTests/accessibility/canvas-description-and-role.html

    r201072 r201216  
    33<body>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56
    67<style>canvas { display: inline; border: 1px solid #000; }</style>
     
    2223
    2324    var axCanvas1 = axContainer.childAtIndex(0);
    24     if (accessibilityController.platformName == "atk")
    25         debug('Canvas 1 title: ' + axCanvas1.title);
    26     else
    27         debug('Canvas 1 description: ' + axCanvas1.description);
     25    shouldBeEqualToString("platformValueForW3CName(axCanvas1)", "Canvas label");
    2826    debug('Canvas 1 role: ' + axCanvas1.role);
    2927
    3028    var axCanvas2 = axContainer.childAtIndex(1);
    31     if (accessibilityController.platformName == "atk")
    32         debug('Canvas 2 title: ' + axCanvas2.title);
    33     else
    34         debug('Canvas 2 description: ' + axCanvas2.description);
     29    shouldBeEqualToString("platformValueForW3CName(axCanvas2)", "");
    3530    debug('Canvas 2 role: ' + axCanvas2.role);
    3631}
  • trunk/LayoutTests/accessibility/canvas-fallback-content.html

    r161666 r201216  
    33<body>
    44<script src="../resources/js-test-pre.js"></script>
    5 
     5<script src="../resources/accessibility-helper.js"></script>
    66<style>
    77myelement {
     
    5353    }
    5454
    55     var comboBoxRole = accessibilityController.platformName == "atk" ? "AXRole: AXComboBox" : "AXRole: AXPopUpButton";
     55    var comboBoxRole = platformRoleForComboBox(accessibilityController.platformName);
    5656
    5757    // Check rendered controls.
  • trunk/LayoutTests/accessibility/empty-image-with-title-expected.txt

    r151924 r201216  
    66
    77image1.role is AXRole: AXImage
    8 image1.description is AXDescription: baz
     8image1's accessible name with source is AXDescription: baz
    99PASS successfullyParsed is true
    1010
  • trunk/LayoutTests/accessibility/empty-image-with-title.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
    78
    89<img id="image1" src="foo.gif" title="baz" width="100" height="100">
    9 
    1010<div id="console"></div>
    1111
     
    1818          var image1 = accessibilityController.accessibleElementById("image1");
    1919          debug("image1.role is " + image1.role);
    20           if (accessibilityController.platformName == "atk")
    21               debug("image1.title is " + image1.title);
    22           else
    23               debug("image1.description is " + image1.description);
     20
     21          var accNameWithSource = platformValueForW3CName(image1, true);
     22          debug("image1's accessible name with source is " + accNameWithSource);
    2423    }
    2524
  • trunk/LayoutTests/accessibility/fieldset-element-expected.txt

    r178471 r201216  
    1 Name:
    2 High Score:
    3 Name:
    4 High Score:
    5 Name:
    6 High Score:
    7 Name:
    8 High Score:
    9 Name:
    10 High Score: Name:
    11 Name:
    12 Other:
    131This tests that fieldset and legend elements are exposed correctly.
    142
     
    164
    175
    18 AXDescription: High Score:
    19 AXDescription: High Score:
    20 AXDescription: New High Score:
    21 AXDescription: New High Score:
    22 AXDescription:
    23 AXDescription: High Score:
    24 AXDescription:
    25 
     6element id 'f0': High Score:
     7element id 'f1': High Score:
     8element id 'f2': New High Score:
     9element id 'f3': New High Score:
     10element id 'f4':
     11element id 'f5': High Score:
     12element id 'f6':
     13element id 'l0': AXValue: Other:
    2614PASS successfullyParsed is true
    2715
  • trunk/LayoutTests/accessibility/fieldset-element.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56<title>Fieldset Element</title>
    67</head>
    78<body>
    8 
     9<div id="content">
    910<form>
    1011<!-- fieldset with aria-label. -->
     
    6465<!-- legend outside fieldset. -->
    6566<legend id="l0">Other:</legend>
    66 
     67</div>
    6768<p id="description"></p>
    6869<div id="console"></div>
     
    7980        fieldsetTestCount = document.getElementsByClassName("fieldsetTest").length;
    8081        for (var i = 0; i < fieldsetTestCount; ++i) {
    81             if (accessibilityController.platformName == "atk")
    82                 fieldsetDescription = accessibilityController.accessibleElementById("f" + i).title;
    83             else
    84                 fieldsetDescription = accessibilityController.accessibleElementById("f" + i).description;
    85             debug(fieldsetDescription);
     82            var accName = platformValueForW3CName(accessibilityController.accessibleElementById("f" + i));
     83            debug("element id 'f" + i + "': " +  accName);
    8684        }
    87        
     85
    8886        // legend tests.
    89         legendValue = accessibilityController.accessibleElementById("l0").childAtIndex(0).stringValue;
    90         debug(legendValue);
     87        var legend = accessibilityController.accessibleElementById("l0");
     88        if (legend.childrenCount)
     89            legend = legend.childAtIndex(0);
     90        debug("element id 'l0': " + legend.stringValue);
     91
     92        document.getElementById("content").style.visibility = "hidden";
    9193    }
    9294</script>
  • trunk/LayoutTests/accessibility/focusable-div-expected.txt

    r162576 r201216  
    1 A
    2 B
    3 C
    4 Link
    5 Initial text before linkLink
    6 List item
    7 Initial text before list
    8 List item
    91This test makes sure that a generic focusable div can get accessibility focus. It should not get accessible text from its children automatically though.
    102
     
    1911PASS lastChar(axDiv2.title) is ' '
    2012PASS document.activeElement == div3 is true
    21 PASS lastChar(axDiv3.description) is "D"
     13PASS lastChar(accNameForDiv3) is "D"
    2214PASS document.activeElement == div4 is true
    2315PASS axDiv4.title.indexOf('Link') is -1
  • trunk/LayoutTests/accessibility/focusable-div.html

    r201072 r201216  
    33<body>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
     6
     7<div id="content">
    58
    69<!-- A link always gets its accessible text from contents. -->
     
    1720<div id="div6" tabindex="0"><ul><li>List item</li></ul></div>
    1821<div id="div7" tabindex="0">Initial text before list<ul><li>List item</li></ul></div>
    19 
     22</div>
    2023<div id="console"></div>
    2124<script>
     
    5154    shouldBe("document.activeElement == div3", "true");
    5255    window.axDiv3 = accessibilityController.focusedElement;
    53     if (accessibilityController.platformName == "atk")
    54         shouldBe("lastChar(axDiv3.title)", "\"D\"");
    55     else
    56         shouldBe("lastChar(axDiv3.description)", "\"D\"");
     56    var accNameForDiv3 = platformValueForW3CName(axDiv3);
     57    shouldBe("lastChar(accNameForDiv3)", "\"D\"");
    5758
    5859    var div4 = document.getElementById('div4');
     
    8182    shouldBe("axDiv7.title.indexOf('List item')", "-1");
    8283    shouldBe("axDiv7.title.indexOf('Initial text before list') >= 0", "false");
     84
     85    document.getElementById("content").style.visibility = "hidden";
    8386}
    8487
  • trunk/LayoutTests/accessibility/help-text.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    6667            if (!ax)
    6768                continue;
    68             var output;
    69             if (accessibilityController.platformName == "atk")
    70                 output = ax.description.replace("AXDescription: ", "");
    71             else
    72                 output = ax.helpText.replace("AXHelp: ", "");
     69            var output = platformValueForW3CDescription(ax);
    7370            var result = document.getElementById("console");
    7471            if (expectation === output)
  • trunk/LayoutTests/accessibility/img-alt-tag-only-whitespace-expected.txt

    r201072 r201216  
    1 CONSOLE MESSAGE: line 27: Image description: AXDescription:    Image
    21
    32
     
    98
    109PASS imagesGroup.childrenCount is 1
     10PASS platformValueForW3CName(imagesGroup.childAtIndex(0)) is "   Image "
    1111PASS successfullyParsed is true
    1212
  • trunk/LayoutTests/accessibility/img-alt-tag-only-whitespace.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    2425        var imagesGroup = accessibilityController.focusedElement;
    2526        shouldBe("imagesGroup.childrenCount", "1");
    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        shouldBeEqualToString("platformValueForW3CName(imagesGroup.childAtIndex(0))", "   Image ");
    3028    }
    3129
  • trunk/LayoutTests/accessibility/img-aria-button-alt-tag-expected.txt

    r151924 r201216  
    11
    2 This test makes sure that a img acting as an aria button still returns its alt tag as the description
     2This test makes sure that a img acting as an aria button still returns its alt tag as the accessible name
    33
    44On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    55
    66
    7 imgUIElement.description is AXDescription: alternate
     7PASS platformValueForW3CName(imgUIElement) is "alternate"
    88PASS successfullyParsed is true
    99
  • trunk/LayoutTests/accessibility/img-aria-button-alt-tag.html

    r201072 r201216  
    22<head>
    33<script src="../resources/js-test-pre.js"></script>
     4<script src="../resources/accessibility-helper.js"></script>
    45</head>
    56<script>
     
    1516     
    1617    <script>
    17         description("This test makes sure that a img acting as an aria button still returns its alt tag as the description");
     18        description("This test makes sure that a img acting as an aria button still returns its alt tag as the accessible name");
    1819 
    1920        if (window.accessibilityController) {
     
    2223            var body = document.getElementById("body").focus();
    2324            var imgUIElement = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(0);
    24             if (accessibilityController.platformName == "atk")
    25                 debug("imgUIElement.title is " + imgUIElement.title);
    26             else
    27                 debug("imgUIElement.description is " + imgUIElement.description);
     25            shouldBeEqualToString("platformValueForW3CName(imgUIElement)", "alternate");
    2826        }
    2927    </script>
  • trunk/LayoutTests/accessibility/img-fallsback-to-title.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    2930        // The title should NOT be in the help text.
    3031        var image1 = imagesGroup.childAtIndex(0).childAtIndex(0);
    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         }
     32        debug("Image1:");
     33        debug(platformTextAlternatives(image1));
    3834
    3935        // Second image should use the description from the alt tag instead of the title.
    4036        // The help text should reflect what's in the title.
    4137        var image2 = imagesGroup.childAtIndex(0).childAtIndex(1);
    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         }
     38        debug("Image2:");
     39        debug(platformTextAlternatives(image2));
    4940
    5041        // Now do the same checks for ARIA type images.
    5142        var image3 = imagesGroup.childAtIndex(1);
    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         }
     43        debug("Image3:");
     44        debug(platformTextAlternatives(image3));
    5945
    6046        // Now do the same checks for ARIA type images.
    6147        var image4 = imagesGroup.childAtIndex(2);
    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         }
     48        debug("Image4:");
     49        debug(platformTextAlternatives(image4));
    6950
    7051        // Verify that the first image (with an empty alt tag) is ignored
  • trunk/LayoutTests/accessibility/input-image-alt-expected.txt

    r151924 r201216  
    11
    2 This test makes sure that an input image returns its alt tag as the description
     2This test makes sure that an input image returns its alt tag as the accessible name
    33
    44On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    55
    66
    7 img.description is AXDescription: Submit
     7PASS platformValueForW3CName(img) is "Submit"
    88PASS successfullyParsed is true
    99
  • trunk/LayoutTests/accessibility/input-image-alt.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    1314    <script>
    1415        if (window.accessibilityController) {
    15             description("This test makes sure that an input image returns its alt tag as the description");
     16            description("This test makes sure that an input image returns its alt tag as the accessible name");
    1617
    1718            var image1 = document.getElementById("image1").focus();
    1819            var img = accessibilityController.focusedElement;
    19 
    20             if (accessibilityController.platformName == "atk")
    21                 debug("img.title is " + img.title);
    22             else
    23                 debug("img.description is " + img.description);
     20            shouldBeEqualToString("platformValueForW3CName(img)", "Submit");
    2421        }
    2522    </script>
  • trunk/LayoutTests/accessibility/loading-iframe-sends-notification.html

    r201072 r201216  
    22<head>
    33<script src="../resources/js-test-pre.js"></script>
     4<script src="../resources/accessibility-helper.js"></script>
    45</head>
    56<body>
     
    5657                // Ignore this notification if it's not on the iframe or not about the iframe being loaded.
    5758
    58                 var targetString;
    59                 if (accessibilityController.platformName == "atk")
    60                     targetString = target.title;
    61                 else
    62                     targetString = target.description;
    63 
     59                var targetString = platformValueForW3CName(target);
    6460                if (targetString.indexOf("InnerFrame") == -1
    6561                    || (notification != "AXLoadComplete" && notification != "AXLayoutComplete"))
  • trunk/LayoutTests/accessibility/self-referencing-aria-labelledby-expected.txt

    r155601 r201216  
    1 X ?          Y Z
    21This tests that self-referencing aria-labelledby is exposed correctly.
    32
     
    54
    65
    7 PASS test.description is 'AXDescription: X Y Z'
    8 PASS test.description is 'AXDescription: X Y Z'
    9 PASS test.description is 'AXDescription: X Y Z'
    10 PASS test.description is 'AXDescription: X Y Z'
    11 PASS test.description is 'AXDescription: X Y Z'
    12 PASS test.description is 'AXDescription: X Y Z'
    13 PASS test.description is 'AXDescription: X Y Z'
     6PASS platformValueForW3CName(test) is "X Y Z"
     7PASS platformValueForW3CName(test) is "X Y Z"
     8PASS platformValueForW3CName(test) is "X Y Z"
     9PASS platformValueForW3CName(test) is "X Y Z"
     10PASS platformValueForW3CName(test) is "X Y Z"
     11PASS platformValueForW3CName(test) is "X Y Z"
     12PASS platformValueForW3CName(test) is "X Y Z"
    1413PASS successfullyParsed is true
    1514
  • trunk/LayoutTests/accessibility/self-referencing-aria-labelledby.html

    r201072 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56<title>Self-Referencing aria-labelledby</title>
    67</head>
    78<body>
    8 
     9<div id="content">
    910<!-- Self-referencing label should be the content text. -->
    1011<a aria-labelledby="t0 s0 s1" class="test" href="#" id="t0">X</a>
     
    3031<span id="s0">Y</span>
    3132<span id="s1">Z</span>
    32 
     33</div>
    3334<p id="description"></p>
    3435<div id="console"></div>
     
    4142        for (var i = 0; i < testCount; ++i) {
    4243            var test = accessibilityController.accessibleElementById("t" + i);
    43             if (accessibilityController.platformName == "atk")
    44                 shouldBe("test.title", "'AXTitle: X Y Z'");
    45             else
    46                 shouldBe("test.description", "'AXDescription: X Y Z'");
     44            shouldBeEqualToString("platformValueForW3CName(test)", "X Y Z");
    4745        }
     46
     47        document.getElementById("content").style.visibility = "hidden";
    4848    }
    4949</script>
  • trunk/LayoutTests/accessibility/svg-bounds.html

    r201072 r201216  
    33<body>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56
    67<div id="container" style="position: relative; top: 100px; left: 600px; width:400px; height: 400px;" role="group" tabindex="0">
     
    3536}
    3637
    37 function label(element) {
    38     return accessibilityController.platformName == "atk" ? element.title: element.description;
    39 }
    40 
    4138if (window.testRunner && window.accessibilityController) {
    4239    window.testRunner.dumpAsText();
     
    5148    var face = container.childAtIndex(0);
    5249    debug('Face role: ' + face.role);
    53     debug('Face label: ' + label(face));
     50    debug('Face label: ' + platformValueForW3CName(face, true));
    5451    debug('FaceX: ' + (pageX(face) - x));
    5552    debug('FaceY: ' + Math.abs(pageY(face) - y));
     
    5855    var eye = container.childAtIndex(1);
    5956    debug('Eye role: ' + eye.role);
    60     debug('Eye label: ' + label(eye));
     57    debug('Eye label: ' + platformValueForW3CName(eye, true));
    6158    debug('EyeX: ' + (pageX(eye) - x));
    6259    debug('EyeY: ' + Math.abs(pageY(eye) - y));
     
    6562    var nose = container.childAtIndex(3);
    6663    debug('Nose role: ' + nose.role);
    67     debug('Nose label: ' + label(nose));
     64    debug('Nose label: ' + platformValueForW3CName(nose, true));
    6865    debug('NoseX: ' + (pageX(nose) - x));
    6966    debug('NoseY: ' + Math.abs(pageY(nose) - y));
     
    7269    var mouth = container.childAtIndex(4);
    7370    debug('Mouth role: ' + mouth.role);
    74     debug('Mouth label: ' + label(mouth));
     71    debug('Mouth label: ' + platformValueForW3CName(mouth, true));
    7572    debug('MouthX: ' + (pageX(mouth) - x));
    7673    debug('MouthY: ' + Math.floor(Math.abs(pageY(mouth) - y)));
     
    8986    var image = container.childAtIndex(6);
    9087    debug('Image role: ' + image.role);
    91     debug('Image label: ' + label(image));
     88    debug('Image label: ' + platformValueForW3CName(image, true));
    9289    debug('ImageX: ' + (pageX(image) - x));
    9390    debug('ImageY: ' + Math.abs(pageY(image) - y));
  • trunk/LayoutTests/accessibility/svg-group-element-with-title-expected.txt

    r147802 r201216  
    66Verify that the SVG group is returned as an accessible element.
    77PASS group1.role is 'AXRole: AXGroup'
    8 PASS group1.description is 'AXDescription: SVG TITLE 1'
     8PASS platformValueForW3CName(group1) is "SVG TITLE 1"
    99
    1010Verify that you can hit-test to the SVG group.
  • trunk/LayoutTests/accessibility/svg-group-element-with-title.html

    r197616 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    2526          var group1 = accessibilityController.accessibleElementById("group1");
    2627          shouldBe("group1.role", "'AXRole: AXGroup'");
    27           if (accessibilityController.platformName == "atk")
    28               shouldBe("group1.title", "'AXTitle: SVG TITLE 1'");
    29           else
    30               shouldBe("group1.description", "'AXDescription: SVG TITLE 1'");
     28          shouldBeEqualToString("platformValueForW3CName(group1)", "SVG TITLE 1");
    3129
    3230          debug("\nVerify that you can hit-test to the SVG group.");
  • trunk/LayoutTests/accessibility/svg-image-expected.txt

    r168350 r201216  
    66
    77PASS svgImage.role is realImage.role
    8 PASS svgImage.description is realImage.description
     8PASS platformValueForW3CName(svgImage) is platformValueForW3CName(realImage)
     9PASS platformValueForW3CDescription(svgImage) is platformValueForW3CDescription(realImage)
    910SVG Image Role: AXRole: AXImage
    10 SVG Image Description: AXDescription: TestImage
     11SVG Image Accessible Name: TestImage
     12SVG Image Accessible Description:
    1113PASS successfullyParsed is true
    1214
  • trunk/LayoutTests/accessibility/svg-image.html

    r197616 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    2829        var svgImage = accessibilityController.focusedElement;
    2930        shouldBe("svgImage.role", "realImage.role");
    30         if (accessibilityController.platformName == "atk")
    31             shouldBe("svgImage.title", "realImage.title");
    32         else
    33             shouldBe("svgImage.description", "realImage.description");
    34        
     31        shouldBe("platformValueForW3CName(svgImage)", "platformValueForW3CName(realImage)");
     32        shouldBe("platformValueForW3CDescription(svgImage)", "platformValueForW3CDescription(realImage)");
     33
    3534        debug("SVG Image Role: " + svgImage.role);
    36         if (accessibilityController.platformName == "atk")
    37             debug("SVG Image Title: " + svgImage.title);
    38         else
    39             debug("SVG Image Description: " + svgImage.description);
     35        debug("SVG Image Accessible Name: " + platformValueForW3CName(svgImage));
     36        debug("SVG Image Accessible Description: " + platformValueForW3CDescription(svgImage));
    4037    }
    4138
  • trunk/LayoutTests/accessibility/svg-labelledby-expected.txt

    r166917 r201216  
    55
    66
    7 SVG Element: AXDescription: Sudan
     7PASS platformValueForW3CName(image) is "Sudan"
    88PASS successfullyParsed is true
    99
  • trunk/LayoutTests/accessibility/svg-labelledby.html

    r197616 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body>
     
    2930    if (window.accessibilityController) {
    3031        var image = accessibilityController.accessibleElementById("Sudan");
    31         if (accessibilityController.platformName == "atk")
    32             debug("SVG Element: " + image.title);
    33         else
    34             debug("SVG Element: " + image.description);
     32        shouldBeEqualToString("platformValueForW3CName(image)", "Sudan");
    3533    }
    3634
  • trunk/LayoutTests/accessibility/svg-remote-element.html

    r197616 r201216  
    33<body>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56
    67<img tabindex="0" id="svg-image" alt="interactive SVG" >
     
    2223}
    2324
    24 function label(axElement) {
    25     return accessibilityController.platformName == "atk" ? axElement.title : axElement.description;
    26 }
    27 
    2825function runAXTest() {   
    2926    var container = accessibilityController.accessibleElementById("svg-image");
     
    3633    var face = container.childAtIndex(0);
    3734    debug('Face role: ' + face.role);
    38     debug('Face label: ' + label(face));
     35    debug('Face label: ' + platformValueForW3CName(face, true));
    3936    debug('FaceX: ' + (pageX(face) - x));
    4037    debug('FaceY: ' + Math.abs(pageY(face) - y));
     
    4340    var eye = container.childAtIndex(1);
    4441    debug('Eye role: ' + eye.role);
    45     debug('Eye label: ' + label(eye));
     42    debug('Eye label: ' + platformValueForW3CName(eye, true));
    4643    debug('EyeX: ' + (pageX(eye) - x));
    4744    debug('EyeY: ' + Math.abs(pageY(eye) - y));
     
    5047    var nose = container.childAtIndex(3);
    5148    debug('Nose role: ' + nose.role);
    52     debug('Nose label: ' + label(nose));
     49    debug('Nose label: ' + platformValueForW3CName(nose, true));
    5350    debug('NoseX: ' + (pageX(nose) - x));
    5451    debug('NoseY: ' + Math.abs(pageY(nose) - y));
     
    5754    var mouth = container.childAtIndex(4);
    5855    debug('Mouth role: ' + mouth.role);
    59     debug('Mouth label: ' + label(mouth));
     56    debug('Mouth label: ' + platformValueForW3CName(mouth, true));
    6057    debug('MouthX: ' + (pageX(mouth) - x));
    6158    debug('MouthY: ' + Math.floor(Math.abs(pageY(mouth) - y)));
  • trunk/LayoutTests/accessibility/w3c-svg-description-calculation.html

    r197616 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    279280<div id="console"></div>
    280281<script>
    281     function textAlternatives(axElement) {
    282         if (!axElement)
    283             return "Element not exposed";
    284 
    285        result = axElement.title + "\n\t" + axElement.description;
    286        if (accessibilityController.platformName == "mac")
    287            result += "\n\t" + axElement.helpText;
    288        return result;
    289     }
    290 
    291282    description("This tests the accessible text alternatives results for SVG.");
    292283    if (window.accessibilityController) {
     
    294285            var element = document.getElementById("test" + i);
    295286            var axElement = accessibilityController.accessibleElementById("test" + i);
    296             var result = textAlternatives(axElement);
    297             debug("test" + i + ":\n\tExpected " + element.getAttribute("data-expected") + "\n\t" + result);
     287            var result = platformTextAlternatives(axElement);
     288            debug("test" + i + ":\n\tExpected " + element.getAttribute("data-expected") + "\n" + result);
    298289        }
    299290        document.getElementById("content").style.visibility = "hidden";
  • trunk/LayoutTests/accessibility/w3c-svg-name-calculation.html

    r198254 r201216  
    33<head>
    44<script src="../resources/js-test-pre.js"></script>
     5<script src="../resources/accessibility-helper.js"></script>
    56</head>
    67<body id="body">
     
    310311<div id="console"></div>
    311312<script>
    312     function textAlternatives(axElement) {
    313         if (!axElement)
    314             return "Element not exposed";
    315 
    316        result = axElement.title + "\n\t" + axElement.description;
    317        if (accessibilityController.platformName == "mac")
    318            result += "\n\t" + axElement.helpText;
    319        result += "\n\tAXTitleUIElement: " + (axElement.titleUIElement() ? "non-null" : "null");
    320        return result;
    321     }
    322 
    323313    description("This tests the accessible text alternatives results for SVG.");
    324314    if (window.accessibilityController) {
     
    326316            var element = document.getElementById("test" + i);
    327317            var axElement = accessibilityController.accessibleElementById("test" + i);
    328             var result = textAlternatives(axElement);
    329             debug("test" + i + ":\n\tExpected " + element.getAttribute("data-expected") + "\n\t" + result);
     318            var result = platformTextAlternatives(axElement, true);
     319            debug("test" + i + ":\n\tExpected " + element.getAttribute("data-expected") + "\n" + result);
    330320        }
    331321        document.getElementById("content").style.visibility = "hidden";
  • trunk/LayoutTests/platform/gtk/accessibility/aria-labelledby-overrides-label-expected.txt

    r201072 r201216  
    1 Shut down computer after  minutes
    21This tests that if aria-labelledby is used, then label elements are not used
    32
     
    54
    65
    7 text.title is AXTitle: Shut down computer after 10 minutes
     6PASS platformValueForW3CName(text) is "Shut down computer after 10 minutes"
    87PASS text.titleUIElement() != null && text.titleUIElement().isValid is false
    98Label element role is: AXRole: AXLabel
  • trunk/LayoutTests/platform/gtk/accessibility/canvas-description-and-role-expected.txt

    r201072 r201216  
    55
    66PASS axContainer.childrenCount is 2
    7 Canvas 1 title: AXTitle: Canvas label
     7PASS platformValueForW3CName(axCanvas1) is "Canvas label"
    88Canvas 1 role: AXRole: AXCanvas
    9 Canvas 2 title: AXTitle:
     9PASS platformValueForW3CName(axCanvas2) is ""
    1010Canvas 2 role: AXRole: AXCanvas
    1111PASS successfullyParsed is true
  • trunk/LayoutTests/platform/gtk/accessibility/empty-image-with-title-expected.txt

    r201072 r201216  
    66
    77image1.role is AXRole: AXImage
    8 image1.title is AXTitle: baz
     8image1's accessible name with source is AXTitle: baz
    99PASS successfullyParsed is true
    1010
  • trunk/LayoutTests/platform/gtk/accessibility/img-fallsback-to-title-expected.txt

    r201072 r201216  
    66
    77
    8 Image1 title: AXTitle: test1
    9 Image1 description: AXDescription:
    10 
    11 Image2 title: AXTitle: alt
    12 Image2 description: AXDescription: test2
    13 
    14 Image3 title: AXTitle: test3
    15 Image3 description: AXDescription:
    16 
    17 Image4 title: AXTitle: alt
    18 Image4 description: AXDescription: test4
    19 
     8Image1:
     9        AXTitle: test1
     10        AXDescription:
     11Image2:
     12        AXTitle: alt
     13        AXDescription: test2
     14Image3:
     15        AXTitle: test3
     16        AXDescription:
     17Image4:
     18        AXTitle: alt
     19        AXDescription: test4
    2020PASS imagesGroup.childAtIndex(0).childrenCount is 2
    2121PASS successfullyParsed is true
  • trunk/LayoutTests/platform/mac/accessibility/canvas-description-and-role-expected.txt

    r127084 r201216  
    55
    66PASS axContainer.childrenCount is 2
    7 Canvas 1 description: AXDescription: Canvas label
     7PASS platformValueForW3CName(axCanvas1) is "Canvas label"
    88Canvas 1 role: AXRole: AXImage
    9 Canvas 2 description: AXDescription:
     9PASS platformValueForW3CName(axCanvas2) is ""
    1010Canvas 2 role: AXRole: AXGroup
    1111PASS successfullyParsed is true
  • trunk/LayoutTests/platform/mac/accessibility/img-fallsback-to-title-expected.txt

    r152388 r201216  
    66
    77
    8 Image1 description: AXDescription: test1
    9 Image1 help: AXHelp:
    10 
    11 Image2 description: AXDescription: alt
    12 Image2 help: AXHelp: test2
    13 
    14 Image3 description: AXDescription: test3
    15 Image3 help: AXHelp:
    16 
    17 Image4 description: AXDescription: alt
    18 Image4 help: AXHelp: test4
    19 
     8Image1:
     9        AXTitle:
     10        AXDescription: test1
     11        AXHelp:
     12Image2:
     13        AXTitle:
     14        AXDescription: alt
     15        AXHelp: test2
     16Image3:
     17        AXTitle:
     18        AXDescription: test3
     19        AXHelp:
     20Image4:
     21        AXTitle:
     22        AXDescription: alt
     23        AXHelp: test4
    2024PASS imagesGroup.childAtIndex(0).childrenCount is 2
    2125PASS successfullyParsed is true
  • trunk/LayoutTests/platform/win/accessibility/canvas-description-and-role-expected.txt

    r179026 r201216  
    55
    66PASS axContainer.childrenCount is 2
    7 Canvas 1 description: AXDescription: Canvas label
     7PASS platformValueForW3CName(axCanvas1) is "Canvas label"
    88Canvas 1 role: AXRole: AXImage
    9 Canvas 2 description: AXDescription:
     9PASS platformValueForW3CName(axCanvas2) is ""
    1010Canvas 2 role: AXRole: AXImage
    1111PASS successfullyParsed is true
  • trunk/LayoutTests/resources/accessibility-helper.js

    r184213 r201216  
    3333    return true;
    3434}
     35
     36function platformValueForW3CName(accessibilityObject, includeSource=false) {
     37    var result;
     38    if (accessibilityController.platformName == "atk")
     39        result = accessibilityObject.title
     40    else
     41        result = accessibilityObject.description
     42
     43    if (!includeSource) {
     44        var splitResult = result.split(": ");
     45        return splitResult[1];
     46    }
     47
     48    return result;
     49}
     50
     51function platformValueForW3CDescription(accessibilityObject, includeSource=false) {
     52    var result;
     53    if (accessibilityController.platformName == "atk")
     54        result = accessibilityObject.description
     55    else
     56        result = accessibilityObject.helpText;
     57
     58    if (!includeSource) {
     59        var splitResult = result.split(": ");
     60        return splitResult[1];
     61    }
     62
     63    return result;
     64}
     65
     66function platformTextAlternatives(accessibilityObject, includeTitleUIElement=false) {
     67    if (!accessibilityObject)
     68        return "Element not exposed";
     69
     70    result = "\t" + accessibilityObject.title + "\n\t" + accessibilityObject.description;
     71    if (accessibilityController.platformName == "mac")
     72       result += "\n\t" + accessibilityObject.helpText;
     73    if (includeTitleUIElement)
     74        result += "\n\tAXTitleUIElement: " + (accessibilityObject.titleUIElement() ? "non-null" : "null");
     75    return result;
     76}
     77
     78function platformRoleForComboBox() {
     79    return accessibilityController.platformName == "atk" ? "AXRole: AXComboBox" : "AXRole: AXPopUpButton";
     80}
     81
     82function platformRoleForStaticText() {
     83    return accessibilityController.platformName == "atk" ? "AXRole: AXStatic" : "AXRole: AXStaticText";
     84}
Note: See TracChangeset for help on using the changeset viewer.