[Webkit-unassigned] [Bug 126685] AX: Merge layout test from Mac and GTK checking accessibility roles

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 9 03:55:22 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=126685





--- Comment #2 from Mario Sanchez Prada <mario at webkit.org>  2014-01-09 03:53:05 PST ---
Created an attachment (id=220711)
 --> (https://bugs.webkit.org/attachment.cgi?id=220711&action=review)
Patch proposal

This patch merges the two tests in one, following the idea (or my interpretation of it) suggested by Chris in bug 125525 (see https://bugs.webkit.org/show_bug.cgi?id=125525#c4).

Compared to the original test from the Mac, the differences now are:

* A new data attribute is added to specify which platforms should care about a given element, or ignore it ('data-platform'), specifying a comma-separated list of platforms as returned by accessibilityController.platformName ("atk", "mac" or "win". See bug 126689). If the current "accessibility platform" is not listed for an element, it will be ignored and nothing will be checked about it. See some examples:

<a data-platform="atk,mac" data-role="AXLink" data-subrole="" data-roledescription="link" href="#" data-note="[href]" class="ex">X</a>
<input data-platform="mac" type="color" value="X" data-role="AXColorWell" data-subrole="" data-roledescription="color well" class="ex" data-note="[type='color']">


* To handle the case where the expected role would NOT be the same for all the platforms, a new 'data-role-<platform>' attribute can be added to an element. See some examples:

<dl data-platform="atk,mac" data-role-atk="AXDescriptionList" data-role-mac="AXList" data-subrole="AXDescriptionList" data-alternatesubrole="AXDefinitionList" data-roledescription="description list" class="ex">
    <dt data-platform="atk,mac" data-role-atk="AXDescriptionTerm" data-role-mac="AXGroup" data-subrole="AXTerm" data-roledescription="term" class="ex">X</dt>
    <dd data-platform="atk,mac" data-role-atk="AXDescriptionValue" data-role-mac="AXGroup" data-subrole="AXDescription" data-roledescription="description" class="ex">X</dd>
</dl>


* To handle the case where the expected role would be the same for more than one platform, the 'data-role' attribute can still be used (see the first examples above), as the role checking code will fallback to it in case it could not find a 'data-role-<platform>'one:

        expectedRole = "";
        if (el.hasAttribute('data-role-' + currentPlatform)) {
            expectedRole = el.getAttribute('data-role-' + currentPlatform);
        } else if (el.hasAttribute('data-role')) {
            expectedRole = el.getAttribute('data-role');
        }


* This test depends on bug 126689 because it expects accessibilityController.platformName instead of testRunner.platformName, and also because it expects "atk" for both the GTK and EFL ports, so it can compare it against the values included in the new 'data-platform' attribute:

    var currentPlatform = accessibilityController.platformName;
    [...]
    for (var i = 0, c = examples.length; i < c; i++) {
        el = examples[i];

        supportedPlatforms = el.getAttribute('data-platform');
        if (!supportedPlatforms || supportedPlatforms.indexOf(currentPlatform) == -1)
            continue;

        [...]
    }


I have carefully changed the code using the Mac test as a base and only changing bits that should not have altered the logic (and the output) in the mac port, but I can't be 100% sure that I did not break anything there, so I'd rather set the r? flag once bug 126689 has been fixed and the EWS for this test have been run. It "should work fine", though :)

In the meanwhile, any feedback is welcome of course!

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list