Changeset 176505 in webkit


Ignore:
Timestamp:
Nov 22, 2014 10:18:11 AM (9 years ago)
Author:
jdiggs@igalia.com
Message:

AX: [ATK] Accessible names missing for imagemap images and links
https://bugs.webkit.org/show_bug.cgi?id=127288

Source/WebCore:

Reviewed by Chris Fleizach.

Return the alt text, if present, for the accessible name for image maps
and image map links for ATK. Also expose the accessible element with
ATK_ROLE_IMAGE_MAP instead of ATK_ROLE_IMAGE.

Test: accessibility/image-with-alt-and-map.html

  • accessibility/AccessibilityObject.h:

(WebCore::AccessibilityObject::isImageMap):

  • accessibility/atk/WebKitAccessibleWrapperAtk.cpp:

(webkitAccessibleGetName):
(atkRole):

LayoutTests:

New and updated tests to reflect the expected role, accessible hierarchy,
and exposure of the alternative text for each platform.

Reviewed by Chris Fleizach.

  • accessibility/image-with-alt-and-map.html: Added.
  • accessibility/roles-exposed.html: Added some more elements to the test.
  • platform/efl/accessibility/image-map1-expected.txt: Added.
  • platform/efl/accessibility/image-map2-expected.txt: Updated to reflect fix.
  • platform/efl/accessibility/image-with-alt-and-map-expected.txt: Added.
  • platform/efl/accessibility/roles-exposed-expected.txt: Updated for added elements.
  • platform/gtk/accessibility/image-map1-expected.txt: Added.
  • platform/gtk/accessibility/image-map2-expected.txt: Updated to reflect fix.
  • platform/gtk/accessibility/image-with-alt-and-map-expected.txt: Added.
  • platform/gtk/accessibility/roles-exposed-expected.txt: Updated for added elements.
  • platform/mac/accessibility/image-with-alt-and-map-expected.txt: Added.
  • platform/mac/accessibility/roles-exposed-expected.txt: Updated for added elements.
  • platform/mac-mavericks/accessibility/roles-exposed-expected.txt: Updated for added elements.
  • platform/mac-mountainlion/accessibility/roles-exposed-expected.txt: Updated for added elements.
Location:
trunk
Files:
6 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r176496 r176505  
     12014-11-22  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        AX: [ATK] Accessible names missing for imagemap images and links
     4        https://bugs.webkit.org/show_bug.cgi?id=127288
     5
     6        New and updated tests to reflect the expected role, accessible hierarchy,
     7        and exposure of the alternative text for each platform.
     8
     9        Reviewed by Chris Fleizach.
     10
     11        * accessibility/image-with-alt-and-map.html: Added.
     12        * accessibility/roles-exposed.html: Added some more elements to the test.
     13        * platform/efl/accessibility/image-map1-expected.txt: Added.
     14        * platform/efl/accessibility/image-map2-expected.txt: Updated to reflect fix.
     15        * platform/efl/accessibility/image-with-alt-and-map-expected.txt: Added.
     16        * platform/efl/accessibility/roles-exposed-expected.txt: Updated for added elements.
     17        * platform/gtk/accessibility/image-map1-expected.txt: Added.
     18        * platform/gtk/accessibility/image-map2-expected.txt: Updated to reflect fix.
     19        * platform/gtk/accessibility/image-with-alt-and-map-expected.txt: Added.
     20        * platform/gtk/accessibility/roles-exposed-expected.txt: Updated for added elements.
     21        * platform/mac/accessibility/image-with-alt-and-map-expected.txt: Added.
     22        * platform/mac/accessibility/roles-exposed-expected.txt: Updated for added elements.
     23        * platform/mac-mavericks/accessibility/roles-exposed-expected.txt: Updated for added elements.
     24        * platform/mac-mountainlion/accessibility/roles-exposed-expected.txt: Updated for added elements.
     25
    1262014-11-21  Chris Dumez  <cdumez@apple.com>
    227
  • trunk/LayoutTests/accessibility/roles-exposed.html

    r176158 r176505  
    5959<!-- [ATK] Object not exposed (webkit.org/b/125491) --><img data-platform="mac" class="ex" src="foo.png" data-note="[src]:not([alt])">
    6060<img data-platform="atk,mac" class="ex" alt="X" data-note="[alt='X']">
     61<img data-platform="atk,mac" class="ex" alt="X" usemap="imagemap" data-note="[usemap][alt='X']">
     62<img data-platform="atk,mac" class="ex" usemap="imagemap" data-note="[usemap]:not([alt])">
    6163<input data-platform="atk,mac" type="button" value="X" class="ex" data-note="[type='button']">
    6264<!-- skipped <menu><input type="button"></menu> -->
     
    8890<!-- [ATK] Skipped: not focusable --><ins data-platform="mac" class="ex">X</ins>
    8991<!-- skipped <link> -->
    90 <!-- skipped <map> -->
     92<map data-platform="atk,mac" class="ex" name="imagemap">
     93  <area data-platform="atk,mac" class="ex" shape="rect" coords="0,0,10,10" href="#" title="x" />
     94</map>
    9195<!-- [ATK] Skipped: not focusable --><!-- http://webkit.org/b/109018 --><mark data-platform="mac" class="ex">X</mark>
    9296<math data-platform="atk,mac" class="ex">X</math>
  • trunk/LayoutTests/platform/efl/accessibility/image-map2-expected.txt

    r171140 r176505  
    2525AXPosition: { 0.000000, 0.000000 }
    2626AXSize: { 123.000000, 62.000000 }
    27 AXTitle:
     27AXTitle: Link1
    2828AXDescription: Link1
    2929AXValue:
     
    4545AXPosition: { 0.000000, 0.000000 }
    4646AXSize: { 122.000000, 14.000000 }
    47 AXTitle:
     47AXTitle: Link2
    4848AXDescription: Link2
    4949AXValue:
  • trunk/LayoutTests/platform/efl/accessibility/roles-exposed-expected.txt

    r176162 r176505  
    7777      AXRole: AXImage
    7878     
     79img[usemap][alt='X']
     80      AXRole: AXImageMap
     81     
     82img[usemap]:not([alt])
     83      AXRole:
     84     
    7985input[type='button']
    8086      AXRole: AXButton
     
    139145input[type='week']
    140146      AXRole: AXTextField
     147     
     148map
     149      AXRole:
     150     
     151area
     152      AXRole:
    141153     
    142154math
  • trunk/LayoutTests/platform/gtk/accessibility/image-map2-expected.txt

    r170145 r176505  
    2525AXPosition: { 18.000000, 53.000000 }
    2626AXSize: { 123.000000, 62.000000 }
    27 AXTitle:
     27AXTitle: Link1
    2828AXDescription: Link1
    2929AXValue:
     
    4545AXPosition: { 20.000000, 117.000000 }
    4646AXSize: { 122.000000, 14.000000 }
    47 AXTitle:
     47AXTitle: Link2
    4848AXDescription: Link2
    4949AXValue:
  • trunk/LayoutTests/platform/gtk/accessibility/roles-exposed-expected.txt

    r176162 r176505  
    7777      AXRole: AXImage
    7878     
     79img[usemap][alt='X']
     80      AXRole: AXImageMap
     81     
     82img[usemap]:not([alt])
     83      AXRole:
     84     
    7985input[type='button']
    8086      AXRole: AXButton
     
    139145input[type='week']
    140146      AXRole: AXTextField
     147     
     148map
     149      AXRole:
     150     
     151area
     152      AXRole:
    141153     
    142154math
  • trunk/LayoutTests/platform/mac-mavericks/accessibility/roles-exposed-expected.txt

    r174585 r176505  
    200200      AXRoleDescription: image
    201201     
     202img[usemap][alt='X']
     203      AXRole: AXImageMap
     204      AXSubrole:
     205      AXRoleDescription: image map
     206     
     207img[usemap]:not([alt])
     208      AXRole:
     209      AXSubrole:
     210      AXRoleDescription:
     211     
    202212input[type='button']
    203213      AXRole: AXButton
     
    320330      AXRoleDescription:
    321331     
     332map
     333      AXRole:
     334      AXSubrole:
     335      AXRoleDescription:
     336     
     337area
     338      AXRole:
     339      AXSubrole:
     340      AXRoleDescription:
     341     
    322342mark
    323343      AXRole:
  • trunk/LayoutTests/platform/mac-mountainlion/accessibility/roles-exposed-expected.txt

    r170412 r176505  
    200200      AXRoleDescription: image
    201201     
     202img[usemap][alt='X']
     203      AXRole: AXImageMap
     204      AXSubrole:
     205      AXRoleDescription: image map
     206     
     207img[usemap]:not([alt])
     208      AXRole:
     209      AXSubrole:
     210      AXRoleDescription:
     211     
    202212input[type='button']
    203213      AXRole: AXButton
     
    320330      AXRoleDescription:
    321331     
     332map
     333      AXRole:
     334      AXSubrole:
     335      AXRoleDescription:
     336     
     337area
     338      AXRole:
     339      AXSubrole:
     340      AXRoleDescription:
     341     
    322342mark
    323343      AXRole:
  • trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt

    r174585 r176505  
    200200      AXRoleDescription: image
    201201     
     202img[usemap][alt='X']
     203      AXRole: AXImageMap
     204      AXSubrole:
     205      AXRoleDescription: image map
     206     
     207img[usemap]:not([alt])
     208      AXRole:
     209      AXSubrole:
     210      AXRoleDescription:
     211     
    202212input[type='button']
    203213      AXRole: AXButton
     
    320330      AXRoleDescription:
    321331     
     332map
     333      AXRole:
     334      AXSubrole:
     335      AXRoleDescription:
     336     
     337area
     338      AXRole:
     339      AXSubrole:
     340      AXRoleDescription:
     341     
    322342mark
    323343      AXRole:
  • trunk/Source/WebCore/ChangeLog

    r176504 r176505  
     12014-11-22  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        AX: [ATK] Accessible names missing for imagemap images and links
     4        https://bugs.webkit.org/show_bug.cgi?id=127288
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Return the alt text, if present, for the accessible name for image maps
     9        and image map links for ATK. Also expose the accessible element with
     10        ATK_ROLE_IMAGE_MAP instead of ATK_ROLE_IMAGE.
     11
     12        Test: accessibility/image-with-alt-and-map.html
     13
     14        * accessibility/AccessibilityObject.h:
     15        (WebCore::AccessibilityObject::isImageMap):
     16        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
     17        (webkitAccessibleGetName):
     18        (atkRole):
     19
    1202014-11-22  Andreas Kling  <akling@apple.com>
    221
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r176481 r176505  
    451451    virtual bool isLink() const { return false; }
    452452    virtual bool isImage() const { return false; }
     453    virtual bool isImageMap() const { return roleValue() == ImageMapRole; }
    453454    virtual bool isNativeImage() const { return false; }
    454455    virtual bool isImageButton() const { return false; }
  • trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp

    r176162 r176505  
    110110
    111111    AccessibilityObject* coreObject = core(object);
    112 
    113     if (!coreObject->isAccessibilityRenderObject())
    114         return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, coreObject->stringValue());
    115 
    116112    if (coreObject->isFieldset()) {
    117113        AccessibilityObject* label = coreObject->titleUIElement();
     
    137133    }
    138134
    139     if (coreObject->isImage() || coreObject->isInputImage()) {
     135    if (coreObject->isImage() || coreObject->isInputImage() || coreObject->isImageMap() || coreObject->isImageMapLink()) {
    140136        Node* node = coreObject->node();
    141137        if (is<HTMLElement>(node)) {
     
    681677        return ATK_ROLE_LINK;
    682678    case ImageMapRole:
     679        return ATK_ROLE_IMAGE_MAP;
    683680    case ImageRole:
    684681        return ATK_ROLE_IMAGE;
Note: See TracChangeset for help on using the changeset viewer.