Changeset 157859 in webkit


Ignore:
Timestamp:
Oct 23, 2013 9:23:30 AM (11 years ago)
Author:
mario@webkit.org
Message:

[GTK] Expose image links properly
https://bugs.webkit.org/show_bug.cgi?id=84044

Reviewed by Chris Fleizach.

Tools:

Expose the accessible URL if present, as yet another attribute
for the AccessibilityUIElement wrapper. For coherence with what
the Mac port does (and what you would expect as the output of
the layout test), we strip the absolute URL path for relative
references, if it's the case, leaving the base of the URL path
out of the exposed string.

  • DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:

(attributesOfElement): Print the AXURL, if available.
(AccessibilityUIElement::url): Expose the URL if present. That
is, if the wrapped AtkObject implements AtkHyperlinkImpl.

  • WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:

(attributesOfElement): Print the AXURL, if available.
(WTR::AccessibilityUIElement::url): Expose the URL if present.
That is, if the wrapped AtkObject implements AtkHyperlinkImpl.

LayoutTests:

Rebaseline some tests that would now be printing the new
AXURL string for implementations of AtkHyperlinkImpl.

  • platform/efl-wk1/accessibility/image-link-expected.txt: Updated.
  • platform/efl-wk1/accessibility/image-map2-expected.txt: Ditto.
  • platform/efl-wk2/accessibility/image-link-expected.txt: Ditto.
  • platform/efl-wk2/accessibility/image-map2-expected.txt: Ditto.
  • platform/gtk/accessibility/image-link-expected.txt: Ditto.
  • platform/gtk/accessibility/image-map2-expected.txt: Ditto.
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r157857 r157859  
     12013-10-23  Mario Sanchez Prada  <mario.prada@samsung.com>
     2
     3        [GTK] Expose image links properly
     4        https://bugs.webkit.org/show_bug.cgi?id=84044
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Rebaseline some tests that would now be printing the new
     9        AXURL string for implementations of AtkHyperlinkImpl.
     10
     11        * platform/efl-wk1/accessibility/image-link-expected.txt: Updated.
     12        * platform/efl-wk1/accessibility/image-map2-expected.txt: Ditto.
     13        * platform/efl-wk2/accessibility/image-link-expected.txt: Ditto.
     14        * platform/efl-wk2/accessibility/image-map2-expected.txt: Ditto.
     15        * platform/gtk/accessibility/image-link-expected.txt: Ditto.
     16        * platform/gtk/accessibility/image-map2-expected.txt: Ditto.
     17
    1182013-10-23  Krzysztof Wolanski  <k.wolanski@samsung.com>
    219
  • trunk/LayoutTests/platform/efl-wk1/accessibility/image-link-expected.txt

    r154680 r157859  
    2121AXRequired: 0
    2222AXChecked: 0
     23AXURL: http://www.wowhead.com/?item=33924
    2324AXPlatformAttributes: html-id:test, toolkit:WebKitEfl
    2425
     
    4041AXRequired: 0
    4142AXChecked: 0
     43AXURL: LayoutTests/accessibility/resources/cake.png
    4244AXPlatformAttributes: toolkit:WebKitEfl
    4345
  • trunk/LayoutTests/platform/efl-wk1/accessibility/image-map2-expected.txt

    r154680 r157859  
    3636AXRequired: 0
    3737AXChecked: 0
     38AXURL: http://www.apple.com/
    3839AXPlatformAttributes: toolkit:WebKitEfl
    3940------------
     
    5455AXRequired: 0
    5556AXChecked: 0
     57AXURL: http://www.apple.com/
    5658AXPlatformAttributes: toolkit:WebKitEfl
    5759------------
  • trunk/LayoutTests/platform/efl-wk2/accessibility/image-link-expected.txt

    r156033 r157859  
    2121AXRequired: 0
    2222AXChecked: 0
     23AXURL: http://www.wowhead.com/?item=33924
    2324AXPlatformAttributes: html-id:test, toolkit:WebKitEfl
    2425
     
    4041AXRequired: 0
    4142AXChecked: 0
     43AXURL: LayoutTests/accessibility/resources/cake.png
    4244AXPlatformAttributes: toolkit:WebKitEfl
    4345
  • trunk/LayoutTests/platform/efl-wk2/accessibility/image-map2-expected.txt

    r156033 r157859  
    3636AXRequired: 0
    3737AXChecked: 0
     38AXURL: http://www.apple.com/
    3839AXPlatformAttributes: toolkit:WebKitEfl
    3940------------
     
    5455AXRequired: 0
    5556AXChecked: 0
     57AXURL: http://www.apple.com/
    5658AXPlatformAttributes: toolkit:WebKitEfl
    5759------------
  • trunk/LayoutTests/platform/gtk/accessibility/image-link-expected.txt

    r156033 r157859  
    2121AXRequired: 0
    2222AXChecked: 0
     23AXURL: http://www.wowhead.com/?item=33924
    2324AXPlatformAttributes: html-id:test, toolkit:WebKitGtk
    2425
     
    4041AXRequired: 0
    4142AXChecked: 0
     43AXURL: LayoutTests/accessibility/resources/cake.png
    4244AXPlatformAttributes: toolkit:WebKitGtk
    4345
  • trunk/LayoutTests/platform/gtk/accessibility/image-map2-expected.txt

    r156033 r157859  
    3636AXRequired: 0
    3737AXChecked: 0
     38AXURL: http://www.apple.com/
    3839AXPlatformAttributes: toolkit:WebKitGtk
    3940------------
     
    5455AXRequired: 0
    5556AXChecked: 0
     57AXURL: http://www.apple.com/
    5658AXPlatformAttributes: toolkit:WebKitGtk
    5759------------
  • trunk/Tools/ChangeLog

    r157858 r157859  
     12013-10-23  Mario Sanchez Prada  <mario.prada@samsung.com>
     2
     3        [GTK] Expose image links properly
     4        https://bugs.webkit.org/show_bug.cgi?id=84044
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Expose the accessible URL if present, as yet another attribute
     9        for the AccessibilityUIElement wrapper. For coherence with what
     10        the Mac port does (and what you would expect as the output of
     11        the layout test), we strip the absolute URL path for relative
     12        references, if it's the case, leaving the base of the URL path
     13        out of the exposed string.
     14
     15        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
     16        (attributesOfElement): Print the AXURL, if available.
     17        (AccessibilityUIElement::url): Expose the URL if present. That
     18        is, if the wrapped AtkObject implements AtkHyperlinkImpl.
     19        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
     20        (attributesOfElement): Print the AXURL, if available.
     21        (WTR::AccessibilityUIElement::url): Expose the URL if present.
     22        That is, if the wrapped AtkObject implements AtkHyperlinkImpl.
     23
    1242013-10-23  Simon Fraser  <simon.fraser@apple.com>
    225
  • trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp

    r157096 r157859  
    357357    builder.append(String::format("AXChecked: %d\n", element->isChecked()));
    358358
     359    String url = element->url()->string();
     360    if (!url.isEmpty())
     361        builder.append(String::format("%s\n", url.utf8().data()));
     362
    359363    // We append the ATK specific attributes as a single line at the end.
    360364    builder.append("AXPlatformAttributes: ");
     
    11771181JSStringRef AccessibilityUIElement::url()
    11781182{
    1179     // FIXME: implement
    1180     return JSStringCreateWithCharacters(0, 0);
     1183    if (!ATK_IS_HYPERLINK_IMPL(m_element))
     1184        return JSStringCreateWithCharacters(0, 0);
     1185
     1186    AtkHyperlink* hyperlink = atk_hyperlink_impl_get_hyperlink(ATK_HYPERLINK_IMPL(m_element));
     1187    GOwnPtr<char> hyperlinkURI(atk_hyperlink_get_uri(hyperlink, 0));
     1188
     1189    // Build the result string, stripping the absolute URL paths if present.
     1190    char* localURI = g_strstr_len(hyperlinkURI.get(), -1, "LayoutTests");
     1191    String axURL = String::format("AXURL: %s", localURI ? localURI : hyperlinkURI.get());
     1192    return JSStringCreateWithUTF8CString(axURL.utf8().data());
    11811193}
    11821194
  • trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp

    r157821 r157859  
    422422    builder.append(String::format("AXChecked: %d\n", element->isChecked()));
    423423
     424    String url = element->url()->string();
     425    if (!url.isEmpty())
     426        builder.append(String::format("%s\n", url.utf8().data()));
     427
    424428    // We append the ATK specific attributes as a single line at the end.
    425429    builder.append("AXPlatformAttributes: ");
     
    12261230JSRetainPtr<JSStringRef> AccessibilityUIElement::url()
    12271231{
    1228     // FIXME: implement
    1229     return JSStringCreateWithCharacters(0, 0);
     1232    if (!ATK_IS_HYPERLINK_IMPL(m_element.get()))
     1233        return JSStringCreateWithCharacters(0, 0);
     1234
     1235    AtkHyperlink* hyperlink = atk_hyperlink_impl_get_hyperlink(ATK_HYPERLINK_IMPL(m_element.get()));
     1236    GOwnPtr<char> hyperlinkURI(atk_hyperlink_get_uri(hyperlink, 0));
     1237
     1238    // Build the result string, stripping the absolute URL paths if present.
     1239    char* localURI = g_strstr_len(hyperlinkURI.get(), -1, "LayoutTests");
     1240    String axURL = String::format("AXURL: %s", localURI ? localURI : hyperlinkURI.get());
     1241    return JSStringCreateWithUTF8CString(axURL.utf8().data());
    12301242}
    12311243
Note: See TracChangeset for help on using the changeset viewer.