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

jhoneycutt at apple.com jhoneycutt at apple.com
Wed Apr 7 23:16:58 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit c35480722c6b90b38d72d1f90ee71a6dca869fd0
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 30 21:38:15 2009 +0000

    Test for MSAA: Accessibility of links is wrong
    
    https://bugs.webkit.org/show_bug.cgi?id=30928
    
    Reviewed by Darin Adler.
    
    WebKitTools:
    
    * DumpRenderTree/AccessibilityUIElement.cpp:
    (getAccessibilityValueCallback):
    Return the accessibility value.
    (AccessibilityUIElement::getJSClass):
    Added "accessibilityValue" value.
    
    * DumpRenderTree/AccessibilityUIElement.h:
    
    * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
    (AccessibilityUIElement::accessibilityValue):
    Stubbed.
    
    * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
    (AccessibilityUIElement::accessibilityValue):
    Stubbed.
    
    * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
    (AccessibilityUIElement::accessibilityValue):
    Get the object's value, and return it as a JS string.
    
    LayoutTests:
    
    * platform/win/accessibility/linked-elements-expected.txt: Added.
    * platform/win/accessibility/linked-elements.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50355 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ea40c09..3b4dc9e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-29  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        Test for MSAA: Accessibility of links is wrong
+
+        https://bugs.webkit.org/show_bug.cgi?id=30928
+
+        Reviewed by Darin Adler.
+
+        * platform/win/accessibility/linked-elements-expected.txt: Added.
+        * platform/win/accessibility/linked-elements.html: Added.
+
 2009-10-30  Ben Murdoch  <benm at google.com>
 
         Reviewed by David Kilzer.
diff --git a/LayoutTests/platform/win/accessibility/linked-elements-expected.txt b/LayoutTests/platform/win/accessibility/linked-elements-expected.txt
new file mode 100644
index 0000000..4904511
--- /dev/null
+++ b/LayoutTests/platform/win/accessibility/linked-elements-expected.txt
@@ -0,0 +1,15 @@
+ 
+link text 
+ 
+This test verifies that, on Windows, linked text, linked images, and anchor elements return the anchor's href attribute for the 'value' property, and text nodes return their text for their 'title' property. 
+
+Bug 30928 - MSAA: Accessibility of links is wrong
+
+PASS e.accessibilityValue.substr(-8) is "img.html"
+PASS e.accessibilityValue.substr(-8) is "img.html"
+PASS e.accessibilityValue.substr(-9) is "text.html"
+PASS e.accessibilityValue.substr(-9) is "text.html"
+PASS e.title is "link text"
+PASS e.accessibilityValue.substr(-10) is "input.html"
+PASS e.accessibilityValue is "input value"
+
diff --git a/LayoutTests/platform/win/accessibility/linked-elements.html b/LayoutTests/platform/win/accessibility/linked-elements.html
new file mode 100644
index 0000000..c625b1c
--- /dev/null
+++ b/LayoutTests/platform/win/accessibility/linked-elements.html
@@ -0,0 +1,63 @@
+<html>
+    <head>
+        <link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+        <script src="../../../fast/js/resources/js-test-pre.js"></script>
+
+        <script>
+            if (window.layoutTestController)
+                layoutTestController.dumpAsText();
+        </script>
+    </head>
+    <body id="body">
+        <a id="link1" href="img.html" title="title text"><img src="404.png" alt="alt text" title="title text"></a>
+        <br>
+
+        <a id="link2" href="text.html" title="title text">link text</a>
+        <br>
+
+        <a id="link3" href="input.html" title="title text"><input type="text" value="input value"></a>
+        <br>
+
+        <p>
+            This test verifies that, on Windows, linked text, linked images, and
+            anchor elements return the anchor's href attribute for the 'value'
+            property, and text nodes return their text for their 'title'
+            property.
+            <br><br>
+            <a href="https://bugs.webkit.org/show_bug.cgi?id=30928">Bug 30928
+            - MSAA: Accessibility of links is wrong</a>
+        </p>
+
+        <p id="console"></p>
+
+        <script>
+            if (window.accessibilityController) {
+                document.getElementById("link1").focus();
+                var e = accessibilityController.focusedElement;
+                shouldBe('e.accessibilityValue.substr(-8)', '"img.html"');
+
+                // The child img element.
+                e = e.childAtIndex(0);
+                shouldBe('e.accessibilityValue.substr(-8)', '"img.html"');
+
+                document.getElementById("link2").focus();
+                e = accessibilityController.focusedElement;
+                shouldBe('e.accessibilityValue.substr(-9)', '"text.html"');
+
+                // The child text node.
+                e = e.childAtIndex(0);
+                shouldBe('e.accessibilityValue.substr(-9)', '"text.html"');
+                shouldBe('e.title', '"link text"');
+
+                document.getElementById("link3").focus();
+                e = accessibilityController.focusedElement;
+                shouldBe('e.accessibilityValue.substr(-10)', '"input.html"');
+
+                // The child input element. This should not return the URL as
+                // its value.
+                e = e.childAtIndex(0);
+                shouldBe('e.accessibilityValue', '"input value"');
+            }
+        </script>
+    </body>
+</html>
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index b085914..74d18fe 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,31 @@
+2009-10-29  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        Test for MSAA: Accessibility of links is wrong
+
+        https://bugs.webkit.org/show_bug.cgi?id=30928
+
+        Reviewed by Darin Adler.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (getAccessibilityValueCallback):
+        Return the accessibility value.
+        (AccessibilityUIElement::getJSClass):
+        Added "accessibilityValue" value.
+
+        * DumpRenderTree/AccessibilityUIElement.h:
+
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (AccessibilityUIElement::accessibilityValue):
+        Stubbed.
+
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::accessibilityValue):
+        Stubbed.
+
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::accessibilityValue):
+        Get the object's value, and return it as a JS string.
+
 2009-10-30  Kevin Ollivier  <kevino at theolliviers.com>
 
         Fix typo in command name used by wx build system.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 5958ccb..1ed8217 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -364,6 +364,12 @@ static JSValueRef getValueDescriptionCallback(JSContextRef context, JSObjectRef
     return JSValueMakeString(context, valueDescription.get());
 }
 
+static JSValueRef getAccessibilityValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> accessibilityValue(Adopt, toAXElement(thisObject)->accessibilityValue());
+    return JSValueMakeString(context, accessibilityValue.get());
+}
+
 // Destruction
 
 static void finalize(JSObjectRef thisObject)
@@ -381,6 +387,7 @@ JSObjectRef AccessibilityUIElement::makeJSAccessibilityUIElement(JSContextRef co
 JSClassRef AccessibilityUIElement::getJSClass()
 {
     static JSStaticValue staticValues[] = {
+        { "accessibilityValue", getAccessibilityValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "role", getRoleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "subrole", getSubroleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "title", getTitleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index fffdad8..ea45a27 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -90,6 +90,7 @@ public:
     JSStringRef title();
     JSStringRef description();
     JSStringRef language();
+    JSStringRef accessibilityValue() const;
     double x();
     double y();
     double width();
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
index 9aa31a8..e5f26d2 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
@@ -426,3 +426,9 @@ void AccessibilityUIElement::decrement()
 {
     // FIXME: implement
 }
+
+JSStringRef AccessibilityUIElement::accessibilityValue() const
+{
+    // FIXME: implement
+    return JSStringCreateWithCharacters(0, 0);
+}
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index 375dbad..ef0f9da 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -571,3 +571,9 @@ void AccessibilityUIElement::decrement()
 {
     [m_element accessibilityPerformAction:NSAccessibilityDecrementAction];
 }
+
+JSStringRef AccessibilityUIElement::accessibilityValue() const
+{
+    // FIXME: implement
+    return JSStringCreateWithCharacters(0, 0);
+}
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
index de3d9ff..c1f57ef 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
@@ -366,3 +366,15 @@ void AccessibilityUIElement::increment()
 void AccessibilityUIElement::decrement()
 {
 }
+
+JSStringRef AccessibilityUIElement::accessibilityValue() const
+{
+    BSTR valueBSTR;
+    if (FAILED(m_element->get_accValue(self(), &valueBSTR)) || !valueBSTR)
+        return JSStringCreateWithCharacters(0, 0);
+
+    wstring value(valueBSTR, SysStringLen(valueBSTR));
+    ::SysFreeString(valueBSTR);
+
+    return JSStringCreateWithCharacters(value.data(), value.length());
+}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list