[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:23:12 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 5a5bba5699c7ed659a02b6449e8c309005aa8a4b
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 7 14:27:44 2009 +0000

    2009-12-07  Joanmarie Diggs  <joanmarie.diggs at gmail.com>
    
            Reviewed by Xan Lopez.
    
            https://bugs.webkit.org/show_bug.cgi?id=25524
            [Gtk] Expose the title attribute to assistive technologies
    
            * platform/gtk/accessibility/title-and-alt.html: Added.
            * platform/gtk/accessibility/title-and-alt-expected.txt: Added.
    2009-12-07  Joanmarie Diggs  <joanmarie.diggs at gmail.com>
    
            Reviewed by Xan Lopez.
    
            https://bugs.webkit.org/show_bug.cgi?id=25524
            [Gtk] Expose the title attribute to assistive technologies
    
            Expose 'alt' attribute from images as accessible name.
            Expose the 'title' core HTML attribute as accessible description.
            This is a modified version of the original fix submitted by Mario Sanchez Prada,
            adjusted so that it doesn't impact other platforms.
    
            * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
            (webkit_accessible_get_name):
            (webkit_accessible_get_description):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51762 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 57d8413..5459b42 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2009-12-07  Joanmarie Diggs  <joanmarie.diggs at gmail.com>
+
+        Reviewed by Xan Lopez.
+
+        https://bugs.webkit.org/show_bug.cgi?id=25524
+        [Gtk] Expose the title attribute to assistive technologies
+
+        * platform/gtk/accessibility/title-and-alt.html: Added.
+        * platform/gtk/accessibility/title-and-alt-expected.txt: Added.
+
 2009-12-07  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Maciej Stachowiak.
diff --git a/LayoutTests/platform/gtk/accessibility/title-and-alt-expected.txt b/LayoutTests/platform/gtk/accessibility/title-and-alt-expected.txt
new file mode 100644
index 0000000..2c54ac1
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/title-and-alt-expected.txt
@@ -0,0 +1,19 @@
+
+Functional label:
+This tests the exposure of alt and title information.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS image.title is 'Image alt attr'
+PASS image.description is 'Image title attr'
+PASS link.title is ''
+PASS link.description is 'Link title attr'
+PASS entry.title is ''
+PASS entry.description is 'Entry title attr'
+PASS button.title is 'Submit'
+PASS button.description is 'Submit button title attr'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/accessibility/title-and-alt.html b/LayoutTests/platform/gtk/accessibility/title-and-alt.html
new file mode 100644
index 0000000..aa91e7a
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/title-and-alt.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+<img src="image.jpg" alt="Image alt attr" title="Image title attr">
+<form>
+<a href="" title="Link title attr">Functional label</a>:<input title="Entry title attr" type="text" /><input value="Clear" type="reset" /><input value="Submit" title="Submit button title attr" type="submit" />
+</form>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+    description("This tests the exposure of alt and title information.");
+    if (window.accessibilityController) {
+        layoutTestController.dumpAsText();
+        document.getElementById("body").focus();
+        var webArea = accessibilityController.focusedElement;
+
+        var image = webArea.childAtIndex(0);
+        shouldBe("image.title", "'Image alt attr'");
+        shouldBe("image.description", "'Image title attr'");
+
+        var link = webArea.childAtIndex(1);
+        shouldBe("link.title", "''");
+        shouldBe("link.description", "'Link title attr'");
+
+        var entry = webArea.childAtIndex(2);
+        shouldBe("entry.title", "''");
+        shouldBe("entry.description", "'Entry title attr'");
+
+        var button = webArea.childAtIndex(4);
+        shouldBe("button.title", "'Submit'");
+        shouldBe("button.description", "'Submit button title attr'");
+        }
+    successfullyParsed = true;
+</script>
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8f380a8..3446641 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2009-12-07  Joanmarie Diggs  <joanmarie.diggs at gmail.com>
+
+        Reviewed by Xan Lopez.
+
+        https://bugs.webkit.org/show_bug.cgi?id=25524
+        [Gtk] Expose the title attribute to assistive technologies
+
+        Expose 'alt' attribute from images as accessible name.
+        Expose the 'title' core HTML attribute as accessible description.
+        This is a modified version of the original fix submitted by Mario Sanchez Prada,
+        adjusted so that it doesn't impact other platforms.
+
+        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+        (webkit_accessible_get_name):
+        (webkit_accessible_get_description):
+
 2009-12-07  Tor Arne Vestbø  <tor.arne.vestbo at nokia.com>
 
         Reviewed by Simon Hausmann.
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index 308007c..466ccfd 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -159,29 +159,51 @@ static const gchar* nameFromChildren(AccessibilityObject* object)
 static const gchar* webkit_accessible_get_name(AtkObject* object)
 {
     AccessibilityObject* coreObject = core(object);
+    if (!coreObject->isAccessibilityRenderObject())
+        return returnString(coreObject->stringValue());
+
+    AccessibilityRenderObject* renderObject = static_cast<AccessibilityRenderObject*>(coreObject);
     if (coreObject->isControl()) {
-        AccessibilityRenderObject* renderObject = static_cast<AccessibilityRenderObject*>(coreObject);
         AccessibilityObject* label = renderObject->correspondingLabelForControlElement();
         if (label)
             return returnString(nameFromChildren(label));
     }
+
+    if (renderObject->isImage() || renderObject->isInputImage()) {
+        Node* node = renderObject->renderer()->node();
+        if (node && node->isHTMLElement()) {
+            // Get the attribute rather than altText String so as not to fall back on title.
+            String alt = static_cast<HTMLElement*>(node)->getAttribute(HTMLNames::altAttr);
+            if (!alt.isEmpty())
+                return returnString(alt);
+        }
+    }
+
     return returnString(coreObject->stringValue());
 }
 
 static const gchar* webkit_accessible_get_description(AtkObject* object)
 {
     AccessibilityObject* coreObject = core(object);
+    Node* node = 0;
+    if (coreObject->isAccessibilityRenderObject())
+        node = static_cast<AccessibilityRenderObject*>(coreObject)->renderer()->node();
+    if (!node || !node->isHTMLElement() || coreObject->ariaRoleAttribute() != UnknownRole)
+        return returnString(coreObject->accessibilityDescription());
 
     // atk_table_get_summary returns an AtkObject. We have no summary object, so expose summary here.
-    if (coreObject->roleValue() == TableRole && coreObject->ariaRoleAttribute() == UnknownRole) {
-        Node* node = static_cast<AccessibilityRenderObject*>(coreObject)->renderer()->node();
-        if (node && node->isHTMLElement()) {
-            String summary = static_cast<HTMLTableElement*>(node)->summary();
-            if (!summary.isEmpty())
-                return returnString(summary);
-        }
+    if (coreObject->roleValue() == TableRole) {
+        String summary = static_cast<HTMLTableElement*>(node)->summary();
+        if (!summary.isEmpty())
+            return returnString(summary);
     }
 
+    // The title attribute should be reliably available as the object's descripton.
+    // We do not want to fall back on other attributes in its absence. See bug 25524.
+    String title = static_cast<HTMLElement*>(node)->title();
+    if (!title.isEmpty())
+        return returnString(title);
+
     return returnString(coreObject->accessibilityDescription());
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list