[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:59 UTC 2010


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

    Test for MSAA: Accessibility of headings is not correct
    
    https://bugs.webkit.org/show_bug.cgi?id=30937
    
    Reviewed by Adam Roben.
    
    WebKitTools:
    
    * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
    (AccessibilityUIElement::role):
    Allow the role returned to be a BSTR.
    (AccessibilityUIElement::description):
    Fix a copy/paste error.
    
    LayoutTests:
    
    * platform/win/accessibility/heading-elements-expected.txt: Added.
    * platform/win/accessibility/heading-elements.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50356 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3b4dc9e..73c67be 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,16 @@
 2009-10-29  Jon Honeycutt  <jhoneycutt at apple.com>
 
+        Test for MSAA: Accessibility of headings is not correct
+
+        https://bugs.webkit.org/show_bug.cgi?id=30937
+
+        Reviewed by Adam Roben.
+
+        * platform/win/accessibility/heading-elements-expected.txt: Added.
+        * platform/win/accessibility/heading-elements.html: Added.
+
+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
diff --git a/LayoutTests/platform/win/accessibility/heading-elements-expected.txt b/LayoutTests/platform/win/accessibility/heading-elements-expected.txt
new file mode 100644
index 0000000..3431852
--- /dev/null
+++ b/LayoutTests/platform/win/accessibility/heading-elements-expected.txt
@@ -0,0 +1,29 @@
+h1
+
+h2
+
+h3
+
+h4
+
+h5
+
+h6
+
+This test verifies that, on Windows, heading elements return their tag name for their 'role' property and a positional description of "L#", where # is the heading level, for their description. 
+
+Bug 30937 - MSAA: Accessibility of headings is not correct
+
+PASS e.role is "H1"
+PASS e.description is "L1"
+PASS e.role is "H2"
+PASS e.description is "L2"
+PASS e.role is "H3"
+PASS e.description is "L3"
+PASS e.role is "H4"
+PASS e.description is "L4"
+PASS e.role is "H5"
+PASS e.description is "L5"
+PASS e.role is "H6"
+PASS e.description is "L6"
+
diff --git a/LayoutTests/platform/win/accessibility/heading-elements.html b/LayoutTests/platform/win/accessibility/heading-elements.html
new file mode 100644
index 0000000..3e5aaf3
--- /dev/null
+++ b/LayoutTests/platform/win/accessibility/heading-elements.html
@@ -0,0 +1,60 @@
+<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">
+        <h1>h1</h1>
+        <h2>h2</h2>
+        <h3>h3</h3>
+        <h4>h4</h4>
+        <h5>h5</h5>
+        <h6>h6</h6>
+
+        <p>
+            This test verifies that, on Windows, heading elements return their
+            tag name for their 'role' property and a positional description of
+            "L#", where # is the heading level, for their description.
+            <br><br>
+            <a href="https://bugs.webkit.org/show_bug.cgi?id=30937">Bug 30937
+            - MSAA: Accessibility of headings is not correct</a>
+        </p>
+
+        <p id="console"></p>
+
+        <script>
+            if (window.accessibilityController) {
+                document.getElementById("body").focus();
+
+                var e = accessibilityController.focusedElement.childAtIndex(0);
+                shouldBe('e.role', '"H1"');
+                shouldBe('e.description', '"L1"');
+
+                e = accessibilityController.focusedElement.childAtIndex(1);
+                shouldBe('e.role', '"H2"');
+                shouldBe('e.description', '"L2"');
+
+                e = accessibilityController.focusedElement.childAtIndex(2);
+                shouldBe('e.role', '"H3"');
+                shouldBe('e.description', '"L3"');
+
+                e = accessibilityController.focusedElement.childAtIndex(3);
+                shouldBe('e.role', '"H4"');
+                shouldBe('e.description', '"L4"');
+
+                e = accessibilityController.focusedElement.childAtIndex(4);
+                shouldBe('e.role', '"H5"');
+                shouldBe('e.description', '"L5"');
+
+                e = accessibilityController.focusedElement.childAtIndex(5);
+                shouldBe('e.role', '"H6"');
+                shouldBe('e.description', '"L6"');
+            }
+        </script>
+    </body>
+</html>
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 74d18fe..4a09803 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,19 @@
 2009-10-29  Jon Honeycutt  <jhoneycutt at apple.com>
 
+        Test for MSAA: Accessibility of headings is not correct
+
+        https://bugs.webkit.org/show_bug.cgi?id=30937
+
+        Reviewed by Adam Roben.
+
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::role):
+        Allow the role returned to be a BSTR.
+        (AccessibilityUIElement::description):
+        Fix a copy/paste error.
+
+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
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
index c1f57ef..e89796c 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
@@ -151,10 +151,20 @@ JSStringRef AccessibilityUIElement::role()
     VARIANT vRole;
     if (FAILED(m_element->get_accRole(self(), &vRole)))
         return JSStringCreateWithCharacters(0, 0);
-    ASSERT(V_VT(&vRole) == VT_I4);
-    TCHAR roleText[64] = {0};
-    ::GetRoleText(V_I4(&vRole), roleText, ARRAYSIZE(roleText));
-    return JSStringCreateWithCharacters(roleText, _tcslen(roleText));
+
+    ASSERT(V_VT(&vRole) == VT_I4 || V_VT(&vRole) == VT_BSTR);
+
+    wstring result;
+    if (V_VT(&vRole) == VT_I4) {
+        TCHAR roleText[64] = {0};
+        ::GetRoleText(V_I4(&vRole), roleText, ARRAYSIZE(roleText));
+        result = roleText;
+    } else if (V_VT(&vRole) == VT_BSTR)
+        result = wstring(V_BSTR(&vRole), ::SysStringLen(V_BSTR(&vRole)));
+
+    ::VariantClear(&vRole);
+
+    return JSStringCreateWithCharacters(result.data(), result.length());
 }
 
 JSStringRef AccessibilityUIElement::subrole()
@@ -175,7 +185,7 @@ JSStringRef AccessibilityUIElement::title()
 JSStringRef AccessibilityUIElement::description()
 {
     BSTR descriptionBSTR;
-    if (FAILED(m_element->get_accName(self(), &descriptionBSTR)) || !descriptionBSTR)
+    if (FAILED(m_element->get_accDescription(self(), &descriptionBSTR)) || !descriptionBSTR)
         return JSStringCreateWithCharacters(0, 0);
     wstring description(descriptionBSTR, SysStringLen(descriptionBSTR));
     ::SysFreeString(descriptionBSTR);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list