[GTK] Expose title and alternative text for links in image maps
authormario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Oct 2013 09:57:48 +0000 (09:57 +0000)
committermario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Oct 2013 09:57:48 +0000 (09:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=84045

Reviewed by Chris Fleizach.

Source/WebCore:

Change the way we decide when the title attribute should be
used for the accessible description, by not relying in the
titleTagShouldBeUsedInDescriptionField() helper function but
in whether we have found a visible text for it or not.

This actually mimics what the Mac port does and so makes possible
to share both the layout test and its expected results.

* accessibility/atk/WebKitAccessibleUtil.cpp:
(accessibilityDescription): Update the method to determine
whether the title attribute should be used for the description.

LayoutTests:

Share test expectations among Mac, GTK and EFL ports and
remove expected failures for GTK and EFL.

* accessibility/image-map1-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/image-map1-expected.txt.
* platform/gtk/accessibility/image-map1-expected.txt: Removed.
* platform/efl/TestExpectations: Removed failure expectations.
* platform/gtk/TestExpectations: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158104 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/accessibility/image-map1-expected.txt [moved from LayoutTests/platform/mac/accessibility/image-map1-expected.txt with 100% similarity]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/gtk/accessibility/image-map1-expected.txt [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp

index e3326cf..5acbae4 100644 (file)
@@ -1,3 +1,18 @@
+2013-10-28  Mario Sanchez Prada  <mario.prada@samsung.com>
+
+        [GTK] Expose title and alternative text for links in image maps
+        https://bugs.webkit.org/show_bug.cgi?id=84045
+
+        Reviewed by Chris Fleizach.
+
+        Share test expectations among Mac, GTK and EFL ports and
+        remove expected failures for GTK and EFL.
+
+        * accessibility/image-map1-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/image-map1-expected.txt.
+        * platform/gtk/accessibility/image-map1-expected.txt: Removed.
+        * platform/efl/TestExpectations: Removed failure expectations.
+        * platform/gtk/TestExpectations: Ditto.
+
 2013-10-26  Simon Fraser  <simon.fraser@apple.com>
 
         Crashy WebGL test is crashy.
index e3e4e0b..eb68efe 100644 (file)
@@ -1413,7 +1413,6 @@ webkit.org/b/114151 accessibility/svg-group-element-with-title.html [ Failure ]
 webkit.org/b/115659 accessibility/meter-element.html [ Missing ]
 
 webkit.org/b/121684 accessibility/aria-describedby-on-input.html [ Failure ]
-webkit.org/b/84045 accessibility/image-map1.html [ Failure ]
 webkit.org/b/121593 accessibility/radio-button-title-label.html [ Failure ]
 
 # Newly added test at r139111 is failing.
index c755320..e818860 100644 (file)
@@ -1403,8 +1403,6 @@ webkit.org/b/120596 css3/masking/mask-repeat-space-border.html [ ImageOnlyFailur
 webkit.org/b/120596 css3/masking/mask-repeat-space-content.html [ ImageOnlyFailure ]
 webkit.org/b/120596 css3/masking/mask-repeat-space-padding.html [ ImageOnlyFailure ]
 
-webkit.org/b/84045 accessibility/image-map1.html [ Failure ]
-
 webkit.org/b/120836 fast/regions/text-region-split-vertical-rl.html [ Failure ]
 
 webkit.org/b/120839 animations/cross-fade-background-image.html [ ImageOnlyFailure ]
diff --git a/LayoutTests/platform/gtk/accessibility/image-map1-expected.txt b/LayoutTests/platform/gtk/accessibility/image-map1-expected.txt
deleted file mode 100644 (file)
index 1383ac9..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-This tests that you can reach the links within an image map.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS body.childAtIndex(0).role is 'AXRole: AXLink'
-FAIL body.childAtIndex(0).title should be AXTitle: Link1. Was AXTitle: .
-PASS body.childAtIndex(1).role is 'AXRole: AXLink'
-FAIL body.childAtIndex(1).title should be AXTitle: Link2. Was AXTitle: .
-PASS body.childAtIndex(2).role is 'AXRole: AXLink'
-FAIL body.childAtIndex(2).title should be AXTitle: Link3. Was AXTitle: .
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
index 82c791e..1285d1e 100644 (file)
@@ -1,3 +1,22 @@
+2013-10-28  Mario Sanchez Prada  <mario.prada@samsung.com>
+
+        [GTK] Expose title and alternative text for links in image maps
+        https://bugs.webkit.org/show_bug.cgi?id=84045
+
+        Reviewed by Chris Fleizach.
+
+        Change the way we decide when the title attribute should be
+        used for the accessible description, by not relying in the
+        titleTagShouldBeUsedInDescriptionField() helper function but
+        in whether we have found a visible text for it or not.
+
+        This actually mimics what the Mac port does and so makes possible
+        to share both the layout test and its expected results.
+
+        * accessibility/atk/WebKitAccessibleUtil.cpp:
+        (accessibilityDescription): Update the method to determine
+        whether the title attribute should be used for the description.
+
 2013-10-28  Bastien Nocera <hadess@hadess.net>
 
         Replace 0 timeouts g_timeout_add() by g_idle_add()
index 34a71f1..ab50d49 100644 (file)
@@ -125,13 +125,23 @@ String accessibilityDescription(AccessibilityObject* coreObject)
     coreObject->accessibilityText(textOrder);
 
     unsigned length = textOrder.size();
+    bool visibleTextAvailable = false;
     for (unsigned k = 0; k < length; k++) {
         const AccessibilityText& text = textOrder[k];
 
         if (text.textSource == AlternativeText)
             return text.text;
 
-        if (text.textSource == TitleTagText && titleTagShouldBeUsedInDescriptionField(coreObject))
+        switch (text.textSource) {
+        case VisibleText:
+        case ChildrenText:
+        case LabelByElementText:
+            visibleTextAvailable = true;
+        default:
+            break;
+        }
+
+        if (text.textSource == TitleTagText && !visibleTextAvailable)
             return text.text;
     }