Title: [157859] trunk
Revision
157859
Author
ma...@webkit.org
Date
2013-10-23 09:23:30 -0700 (Wed, 23 Oct 2013)

Log 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.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (157858 => 157859)


--- trunk/LayoutTests/ChangeLog	2013-10-23 16:16:06 UTC (rev 157858)
+++ trunk/LayoutTests/ChangeLog	2013-10-23 16:23:30 UTC (rev 157859)
@@ -1,3 +1,20 @@
+2013-10-23  Mario Sanchez Prada  <mario.pr...@samsung.com>
+
+        [GTK] Expose image links properly
+        https://bugs.webkit.org/show_bug.cgi?id=84044
+
+        Reviewed by Chris Fleizach.
+
+        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.
+
 2013-10-23  Krzysztof Wolanski  <k.wolan...@samsung.com>
 
         [GTK] accessibility/self-referencing-aria-labelledby.html is failing

Modified: trunk/LayoutTests/platform/efl-wk1/accessibility/image-link-expected.txt (157858 => 157859)


--- trunk/LayoutTests/platform/efl-wk1/accessibility/image-link-expected.txt	2013-10-23 16:16:06 UTC (rev 157858)
+++ trunk/LayoutTests/platform/efl-wk1/accessibility/image-link-expected.txt	2013-10-23 16:23:30 UTC (rev 157859)
@@ -20,6 +20,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: http://www.wowhead.com/?item=33924
 AXPlatformAttributes: html-id:test, toolkit:WebKitEfl
 
 Child 0:
@@ -39,6 +40,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: LayoutTests/accessibility/resources/cake.png
 AXPlatformAttributes: toolkit:WebKitEfl
 
 

Modified: trunk/LayoutTests/platform/efl-wk1/accessibility/image-map2-expected.txt (157858 => 157859)


--- trunk/LayoutTests/platform/efl-wk1/accessibility/image-map2-expected.txt	2013-10-23 16:16:06 UTC (rev 157858)
+++ trunk/LayoutTests/platform/efl-wk1/accessibility/image-map2-expected.txt	2013-10-23 16:23:30 UTC (rev 157859)
@@ -35,6 +35,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: http://www.apple.com/
 AXPlatformAttributes: toolkit:WebKitEfl
 ------------
 AXRole: AXLink
@@ -53,6 +54,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: http://www.apple.com/
 AXPlatformAttributes: toolkit:WebKitEfl
 ------------
 

Modified: trunk/LayoutTests/platform/efl-wk2/accessibility/image-link-expected.txt (157858 => 157859)


--- trunk/LayoutTests/platform/efl-wk2/accessibility/image-link-expected.txt	2013-10-23 16:16:06 UTC (rev 157858)
+++ trunk/LayoutTests/platform/efl-wk2/accessibility/image-link-expected.txt	2013-10-23 16:23:30 UTC (rev 157859)
@@ -20,6 +20,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: http://www.wowhead.com/?item=33924
 AXPlatformAttributes: html-id:test, toolkit:WebKitEfl
 
 Child 0:
@@ -39,6 +40,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: LayoutTests/accessibility/resources/cake.png
 AXPlatformAttributes: toolkit:WebKitEfl
 
 

Modified: trunk/LayoutTests/platform/efl-wk2/accessibility/image-map2-expected.txt (157858 => 157859)


--- trunk/LayoutTests/platform/efl-wk2/accessibility/image-map2-expected.txt	2013-10-23 16:16:06 UTC (rev 157858)
+++ trunk/LayoutTests/platform/efl-wk2/accessibility/image-map2-expected.txt	2013-10-23 16:23:30 UTC (rev 157859)
@@ -35,6 +35,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: http://www.apple.com/
 AXPlatformAttributes: toolkit:WebKitEfl
 ------------
 AXRole: AXLink
@@ -53,6 +54,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: http://www.apple.com/
 AXPlatformAttributes: toolkit:WebKitEfl
 ------------
 

Modified: trunk/LayoutTests/platform/gtk/accessibility/image-link-expected.txt (157858 => 157859)


--- trunk/LayoutTests/platform/gtk/accessibility/image-link-expected.txt	2013-10-23 16:16:06 UTC (rev 157858)
+++ trunk/LayoutTests/platform/gtk/accessibility/image-link-expected.txt	2013-10-23 16:23:30 UTC (rev 157859)
@@ -20,6 +20,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: http://www.wowhead.com/?item=33924
 AXPlatformAttributes: html-id:test, toolkit:WebKitGtk
 
 Child 0:
@@ -39,6 +40,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: LayoutTests/accessibility/resources/cake.png
 AXPlatformAttributes: toolkit:WebKitGtk
 
 

Modified: trunk/LayoutTests/platform/gtk/accessibility/image-map2-expected.txt (157858 => 157859)


--- trunk/LayoutTests/platform/gtk/accessibility/image-map2-expected.txt	2013-10-23 16:16:06 UTC (rev 157858)
+++ trunk/LayoutTests/platform/gtk/accessibility/image-map2-expected.txt	2013-10-23 16:23:30 UTC (rev 157859)
@@ -35,6 +35,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: http://www.apple.com/
 AXPlatformAttributes: toolkit:WebKitGtk
 ------------
 AXRole: AXLink
@@ -53,6 +54,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
+AXURL: http://www.apple.com/
 AXPlatformAttributes: toolkit:WebKitGtk
 ------------
 

Modified: trunk/Tools/ChangeLog (157858 => 157859)


--- trunk/Tools/ChangeLog	2013-10-23 16:16:06 UTC (rev 157858)
+++ trunk/Tools/ChangeLog	2013-10-23 16:23:30 UTC (rev 157859)
@@ -1,3 +1,26 @@
+2013-10-23  Mario Sanchez Prada  <mario.pr...@samsung.com>
+
+        [GTK] Expose image links properly
+        https://bugs.webkit.org/show_bug.cgi?id=84044
+
+        Reviewed by Chris Fleizach.
+
+        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.
+
 2013-10-23  Simon Fraser  <simon.fra...@apple.com>
 
         Remove Lion bots.

Modified: trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp (157858 => 157859)


--- trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp	2013-10-23 16:16:06 UTC (rev 157858)
+++ trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp	2013-10-23 16:23:30 UTC (rev 157859)
@@ -356,6 +356,10 @@
     builder.append(String::format("AXRequired: %d\n", element->isRequired()));
     builder.append(String::format("AXChecked: %d\n", element->isChecked()));
 
+    String url = ""
+    if (!url.isEmpty())
+        builder.append(String::format("%s\n", url.utf8().data()));
+
     // We append the ATK specific attributes as a single line at the end.
     builder.append("AXPlatformAttributes: ");
     builder.append(getAtkAttributeSetAsString(element->platformUIElement(), ObjectAttributeType));
@@ -1176,8 +1180,16 @@
 
 JSStringRef AccessibilityUIElement::url()
 {
-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
+    if (!ATK_IS_HYPERLINK_IMPL(m_element))
+        return JSStringCreateWithCharacters(0, 0);
+
+    AtkHyperlink* hyperlink = atk_hyperlink_impl_get_hyperlink(ATK_HYPERLINK_IMPL(m_element));
+    GOwnPtr<char> hyperlinkURI(atk_hyperlink_get_uri(hyperlink, 0));
+
+    // Build the result string, stripping the absolute URL paths if present.
+    char* localURI = g_strstr_len(hyperlinkURI.get(), -1, "LayoutTests");
+    String axURL = String::format("AXURL: %s", localURI ? localURI : hyperlinkURI.get());
+    return JSStringCreateWithUTF8CString(axURL.utf8().data());
 }
 
 bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallback)

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (157858 => 157859)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp	2013-10-23 16:16:06 UTC (rev 157858)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp	2013-10-23 16:23:30 UTC (rev 157859)
@@ -421,6 +421,10 @@
     builder.append(String::format("AXRequired: %d\n", element->isRequired()));
     builder.append(String::format("AXChecked: %d\n", element->isChecked()));
 
+    String url = ""
+    if (!url.isEmpty())
+        builder.append(String::format("%s\n", url.utf8().data()));
+
     // We append the ATK specific attributes as a single line at the end.
     builder.append("AXPlatformAttributes: ");
     builder.append(getAtkAttributeSetAsString(element->platformUIElement().get(), ObjectAttributeType));
@@ -1225,8 +1229,16 @@
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::url()
 {
-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
+    if (!ATK_IS_HYPERLINK_IMPL(m_element.get()))
+        return JSStringCreateWithCharacters(0, 0);
+
+    AtkHyperlink* hyperlink = atk_hyperlink_impl_get_hyperlink(ATK_HYPERLINK_IMPL(m_element.get()));
+    GOwnPtr<char> hyperlinkURI(atk_hyperlink_get_uri(hyperlink, 0));
+
+    // Build the result string, stripping the absolute URL paths if present.
+    char* localURI = g_strstr_len(hyperlinkURI.get(), -1, "LayoutTests");
+    String axURL = String::format("AXURL: %s", localURI ? localURI : hyperlinkURI.get());
+    return JSStringCreateWithUTF8CString(axURL.utf8().data());
 }
 
 bool AccessibilityUIElement::addNotificationListener(JSValueRef functionCallback)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to