Changeset 155022 in webkit


Ignore:
Timestamp:
Sep 3, 2013 11:13:39 PM (11 years ago)
Author:
Chris Fleizach
Message:

AX: REGRESSION: @title is exposed as AXDescription when label label from contents already exists.
https://bugs.webkit.org/show_bug.cgi?id=120550

Reviewed by Mario Sanchez Prada.

Source/WebCore:

Resolve a FIXME from the accessible name computation refactoring so that alternative text for links do not
show up in the title field and do not duplicate naming when a title tag is used.

Effectively, this means that links no longer use AXTitle for alternative text. They use AXDescription
like all other elements.

Test: platform/mac/accessibility/link-with-title.html

  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(-[WebAccessibilityObjectWrapper accessibilityTitle]):
(-[WebAccessibilityObjectWrapper accessibilityDescription]):

LayoutTests:

  • accessibility/image-map1.html:
  • platform/mac/accessibility/document-links-expected.txt:
  • platform/mac/accessibility/image-map1-expected.txt:
  • platform/mac/accessibility/link-with-title-expected.txt: Added.
  • platform/mac/accessibility/link-with-title.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r155014 r155022  
     12013-09-03  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: REGRESSION: @title is exposed as AXDescription when label label from contents already exists.
     4        https://bugs.webkit.org/show_bug.cgi?id=120550
     5
     6        Reviewed by Mario Sanchez Prada.
     7
     8        * accessibility/image-map1.html:
     9        * platform/mac/accessibility/document-links-expected.txt:
     10        * platform/mac/accessibility/image-map1-expected.txt:
     11        * platform/mac/accessibility/link-with-title-expected.txt: Added.
     12        * platform/mac/accessibility/link-with-title.html: Added.
     13
    1142013-09-03  Enrica Casucci  <enrica@apple.com>
    215
  • trunk/LayoutTests/accessibility/image-map1.html

    r120111 r155022  
    2222<div id="console"></div>
    2323     
    24     <script>
     24<script>
    2525        description("This tests that you can reach the links within an image map.");
    2626
     
    2929
    3030            var body = accessibilityController.focusedElement;
    31             shouldBe("body.childAtIndex(0).role", "'AXRole: AXLink'");
    32             shouldBe("body.childAtIndex(0).title", "'AXTitle: Link1'");
    33 
    34             shouldBe("body.childAtIndex(1).role", "'AXRole: AXLink'");
    35             shouldBe("body.childAtIndex(1).title", "'AXTitle: Link2'");
    36 
    37             shouldBe("body.childAtIndex(2).role", "'AXRole: AXLink'");
    38             shouldBe("body.childAtIndex(2).title", "'AXTitle: Link3'");
    39         }
     31            for (var k = 0; k < 3; k++) {
     32                var link = body.childAtIndex(k);
     33                debug("Link" + (k + 1) + " role: " + link.role);
     34                debug("Link" + (k + 1) + " title: " + link.title);
     35                debug("Link" + (k + 1) + " description: " + link.description + "\n");
     36            }
     37         }
    4038</script>
    4139
  • trunk/LayoutTests/platform/mac/accessibility/document-links-expected.txt

    r154283 r155022  
    66AXChildren: <array of size 0>
    77AXHelp:
    8 AXParent: <AXLink: 'Link1'>
     8AXParent: <AXLink>
    99AXSize: NSSize: {123, 62}
    10 AXTitle: Link1
    11 AXDescription:
     10AXTitle:
     11AXDescription: Link1
    1212AXValue:
    1313AXFocused: 0
    1414AXEnabled: 1
    15 AXWindow: <AXLink: 'Link1'>
     15AXWindow: <AXLink>
    1616AXSelectedTextMarkerRange: (null)
    1717AXStartTextMarker: (null)
     
    2121AXSelected: 0
    2222AXBlockQuoteLevel: 0
    23 AXTopLevelUIElement: <AXLink: 'Link1'>
     23AXTopLevelUIElement: <AXLink>
    2424AXLanguage:
    2525AXURL: http://www.apple.com/
    2626AXAccessKey: (null)
    2727AXARIABusy: 0
    28 AXPath: <AXLink: 'Link1'>
     28AXPath: <AXLink>
    2929
    3030------------
     
    3434AXChildren: <array of size 0>
    3535AXHelp:
    36 AXParent: <AXLink: 'Link2'>
     36AXParent: <AXLink>
    3737AXSize: NSSize: {113, 22}
    38 AXTitle: Link2
    39 AXDescription:
     38AXTitle:
     39AXDescription: Link2
    4040AXValue:
    4141AXFocused: 0
    4242AXEnabled: 1
    43 AXWindow: <AXLink: 'Link2'>
     43AXWindow: <AXLink>
    4444AXSelectedTextMarkerRange: (null)
    4545AXStartTextMarker: (null)
     
    4949AXSelected: 0
    5050AXBlockQuoteLevel: 0
    51 AXTopLevelUIElement: <AXLink: 'Link2'>
     51AXTopLevelUIElement: <AXLink>
    5252AXLanguage:
    5353AXURL: http://www.apple.com/
    5454AXAccessKey: (null)
    5555AXARIABusy: 0
    56 AXPath: <AXLink: 'Link2'>
     56AXPath: <AXLink>
    5757
    5858------------
  • trunk/LayoutTests/platform/mac/accessibility/image-map1-expected.txt

    r58794 r155022  
    55
    66
    7 PASS body.childAtIndex(0).role is 'AXRole: AXLink'
    8 PASS body.childAtIndex(0).title is 'AXTitle: Link1'
    9 PASS body.childAtIndex(1).role is 'AXRole: AXLink'
    10 PASS body.childAtIndex(1).title is 'AXTitle: Link2'
    11 PASS body.childAtIndex(2).role is 'AXRole: AXLink'
    12 PASS body.childAtIndex(2).title is 'AXTitle: Link3'
     7Link1 role: AXRole: AXLink
     8Link1 title: AXTitle:
     9Link1 description: AXDescription: Link1
     10
     11Link2 role: AXRole: AXLink
     12Link2 title: AXTitle:
     13Link2 description: AXDescription: Link2
     14
     15Link3 role: AXRole: AXLink
     16Link3 title: AXTitle:
     17Link3 description: AXDescription: Link3
     18
    1319PASS successfullyParsed is true
    1420
  • trunk/Source/WebCore/ChangeLog

    r155019 r155022  
     12013-09-03  Chris Fleizach  <cfleizach@apple.com>
     2
     3        AX: REGRESSION: @title is exposed as AXDescription when label label from contents already exists.
     4        https://bugs.webkit.org/show_bug.cgi?id=120550
     5
     6        Reviewed by Mario Sanchez Prada.
     7
     8        Resolve a FIXME from the accessible name computation refactoring so that alternative text for links do not
     9        show up in the title field and do not duplicate naming when a title tag is used.
     10
     11        Effectively, this means that links no longer use AXTitle for alternative text. They use AXDescription
     12        like all other elements.
     13
     14        Test: platform/mac/accessibility/link-with-title.html
     15
     16        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     17        (-[WebAccessibilityObjectWrapper accessibilityTitle]):
     18        (-[WebAccessibilityObjectWrapper accessibilityDescription]):
     19
    1202013-09-03  Darin Adler  <darin@apple.com>
    221
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r154963 r155022  
    19721972}
    19731973
    1974 // FIXME: Different kinds of elements are putting the title tag to use in different
    1975 // AX fields. This should be rectified, but in the initial patch I want to achieve
    1976 // parity with existing behavior.
    1977 - (BOOL)titleTagShouldBeUsedInDescriptionField
    1978 {
    1979     return (m_object->isLink() && !m_object->isImageMapLink()) || m_object->isImage();
    1980 }
    1981 
    19821974// This should be the "visible" text that's actually on the screen if possible.
    19831975// If there's alternative text, that can override the title.
     
    20132005        if (text.textSource == LabelByElementText && !m_object->exposesTitleUIElement())
    20142006            return text.text;
    2015        
    2016         // FIXME: The title tag is used in certain cases for the title. This usage should
    2017         // probably be in the description field since it's not "visible".
    2018         if (text.textSource == TitleTagText && ![self titleTagShouldBeUsedInDescriptionField])
    2019             return text.text;
    20202007    }
    20212008   
     
    20342021   
    20352022    unsigned length = textOrder.size();
     2023    bool visibleTextAvailable = false;
    20362024    for (unsigned k = 0; k < length; k++) {
    20372025        const AccessibilityText& text = textOrder[k];
     
    20402028            return text.text;
    20412029       
    2042         if (text.textSource == TitleTagText && [self titleTagShouldBeUsedInDescriptionField])
     2030        switch (text.textSource) {
     2031        case VisibleText:
     2032        case ChildrenText:
     2033        case LabelByElementText:
     2034            visibleTextAvailable = true;
     2035        default:
     2036            break;
     2037        }
     2038       
     2039        if (text.textSource == TitleTagText && !visibleTextAvailable)
    20432040            return text.text;
    20442041    }
Note: See TracChangeset for help on using the changeset viewer.