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


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

    MSAA: Accessibility of headings is not correct
    
    https://bugs.webkit.org/show_bug.cgi?id=30937
    
    Reviewed by Alice Liu.
    
    WebCore:
    
    * accessibility/AccessibilityObject.h:
    (WebCore::AccessibilityObject::stringRoleForMSAA):
    (WebCore::AccessibilityObject::descriptionForMSAA):
    
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::shouldReturnTagNameAsRoleForMSAA):
    If the element's tag name is one of h1, h2, h3, h4, h5, h6, return
    true.
    (WebCore::AccessibilityRenderObject::stringRoleForMSAA):
    If the element should return its tag name as the role, return the tag
    name.
    (WebCore::AccessibilityRenderObject::positionalDescriptionForMSAA):
    If the object is a heading, return the string "L" followed by the
    heading level.
    (WebCore::AccessibilityRenderObject::descriptionForMSAA):
    If the object has a positional description, return it. Otherwise, get
    the accessibility description, and prefix it with "Description" so that
    MSAA clients know that it's not a positional description.
    
    * accessibility/AccessibilityRenderObject.h:
    
    WebKit/win:
    
    * AccessibleBase.cpp:
    (AccessibleBase::get_accDescription):
    Call the object's descriptionForMSAA(). Moved the comment to the
    WebCore file.
    (AccessibleBase::get_accRole):
    If the object has a string role, return that. Otherwise, return the
    integer role.
    
    * AccessibleBase.h:
    Removed description(), as this was moved to WebCore.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50354 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5de4cde..06c8386 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,34 @@
 2009-10-29  Jon Honeycutt  <jhoneycutt at apple.com>
 
+        MSAA: Accessibility of headings is not correct
+
+        https://bugs.webkit.org/show_bug.cgi?id=30937
+
+        Reviewed by Alice Liu.
+
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::stringRoleForMSAA):
+        (WebCore::AccessibilityObject::descriptionForMSAA):
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::shouldReturnTagNameAsRoleForMSAA):
+        If the element's tag name is one of h1, h2, h3, h4, h5, h6, return
+        true.
+        (WebCore::AccessibilityRenderObject::stringRoleForMSAA):
+        If the element should return its tag name as the role, return the tag
+        name.
+        (WebCore::AccessibilityRenderObject::positionalDescriptionForMSAA):
+        If the object is a heading, return the string "L" followed by the
+        heading level.
+        (WebCore::AccessibilityRenderObject::descriptionForMSAA):
+        If the object has a positional description, return it. Otherwise, get
+        the accessibility description, and prefix it with "Description" so that
+        MSAA clients know that it's not a positional description.
+
+        * accessibility/AccessibilityRenderObject.h:
+
+2009-10-29  Jon Honeycutt  <jhoneycutt at apple.com>
+
         MSAA: Accessibility of links is wrong
 
         https://bugs.webkit.org/show_bug.cgi?id=30928
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index 68c6cb8..cf5d676 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -448,7 +448,9 @@ public:
     unsigned doAXLineForIndex(unsigned);
 
     virtual String stringValueForMSAA() const { return String(); }
+    virtual String stringRoleForMSAA() const { return String(); }
     virtual String nameForMSAA() const { return String(); }
+    virtual String descriptionForMSAA() const { return String(); }
 
 #if HAVE(ACCESSIBILITY)
 #if PLATFORM(GTK)
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 013757f..c293dcd 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -2752,4 +2752,60 @@ String AccessibilityRenderObject::nameForMSAA() const
     return title();
 }
 
+static bool shouldReturnTagNameAsRoleForMSAA(const Element& element)
+{
+    // See "document structure",
+    // https://wiki.mozilla.org/Accessibility/AT-Windows-API
+    // FIXME: Add the other tag names that should be returned as the role.
+    return element.hasTagName(h1Tag) || element.hasTagName(h2Tag) ||
+        element.hasTagName(h3Tag) || element.hasTagName(h4Tag) ||
+        element.hasTagName(h5Tag) || element.hasTagName(h6Tag);
+}
+
+String AccessibilityRenderObject::stringRoleForMSAA() const
+{
+    if (!m_renderer)
+        return String();
+
+    Node* node = m_renderer->node();
+    if (!node || !node->isElementNode())
+        return String();
+
+    Element* element = static_cast<Element*>(node);
+    if (!shouldReturnTagNameAsRoleForMSAA(*element))
+        return String();
+
+    return element->tagName();
+}
+
+String AccessibilityRenderObject::positionalDescriptionForMSAA() const
+{
+    // See "positional descriptions",
+    // https://wiki.mozilla.org/Accessibility/AT-Windows-API
+    if (isHeading())
+        return "L" + String::number(headingLevel());
+
+    // FIXME: Add positional descriptions for other elements.
+    return String();
+}
+
+String AccessibilityRenderObject::descriptionForMSAA() const
+{
+    String description = positionalDescriptionForMSAA();
+    if (!description.isEmpty())
+        return description;
+
+    description = accessibilityDescription();
+    if (!description.isEmpty()) {
+        // From the Mozilla MSAA implementation:
+        // "Signal to screen readers that this description is speakable and is not
+        // a formatted positional information description. Don't localize the
+        // 'Description: ' part of this string, it will be parsed out by assistive
+        // technologies."
+        return "Description: " + description;
+    }
+
+    return String();
+}
+
 } // namespace WebCore
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index 693a23a..14b7e34 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -227,7 +227,9 @@ public:
     virtual void updateBackingStore();
 
     virtual String stringValueForMSAA() const;
+    virtual String stringRoleForMSAA() const;
     virtual String nameForMSAA() const;
+    virtual String descriptionForMSAA() const;
 
 protected:
     RenderObject* m_renderer;
@@ -242,6 +244,7 @@ private:
     void ariaListboxSelectedChildren(AccessibilityChildrenVector&);
     void ariaListboxVisibleChildren(AccessibilityChildrenVector&);
     bool ariaIsHidden() const;
+    String positionalDescriptionForMSAA() const;
 
     Element* menuElementForMenuButton() const;
     Element* menuItemElementForMenu() const;
diff --git a/WebKit/win/AccessibleBase.cpp b/WebKit/win/AccessibleBase.cpp
index 4e4e6da..47b8369 100644
--- a/WebKit/win/AccessibleBase.cpp
+++ b/WebKit/win/AccessibleBase.cpp
@@ -190,11 +190,9 @@ HRESULT STDMETHODCALLTYPE AccessibleBase::get_accDescription(VARIANT vChild, BST
     if (FAILED(hr))
         return hr;
 
-    // TODO: Description, for SELECT subitems, should be a string describing
-    // the position of the item in its group and of the group in the list (see
-    // Firefox).
-    if (*description = BString(wrapper(childObj)->description()).release())
+    if (*description = BString(childObj->descriptionForMSAA()).release())
         return S_OK;
+
     return S_FALSE;
 }
 
@@ -211,6 +209,13 @@ HRESULT STDMETHODCALLTYPE AccessibleBase::get_accRole(VARIANT vChild, VARIANT* p
     if (FAILED(hr))
         return hr;
 
+    String roleString = childObj->stringRoleForMSAA();
+    if (!roleString.isEmpty()) {
+        V_VT(pvRole) = VT_BSTR;
+        V_BSTR(pvRole) = BString(roleString).release();
+        return S_OK;
+    }
+
     pvRole->vt = VT_I4;
     pvRole->lVal = wrapper(childObj)->role();
     return S_OK;
@@ -522,20 +527,6 @@ String AccessibleBase::value() const
     return m_object->stringValueForMSAA();
 }
 
-String AccessibleBase::description() const
-{
-    String desc = m_object->accessibilityDescription();
-    if (desc.isNull())
-        return desc;
-
-    // From the Mozilla MSAA implementation:
-    // "Signal to screen readers that this description is speakable and is not
-    // a formatted positional information description. Don't localize the
-    // 'Description: ' part of this string, it will be parsed out by assistive
-    // technologies."
-    return "Description: " + desc;
-}
-
 static long MSAARole(AccessibilityRole role)
 {
     switch (role) {
diff --git a/WebKit/win/AccessibleBase.h b/WebKit/win/AccessibleBase.h
index c69c57d..3b6bce8 100644
--- a/WebKit/win/AccessibleBase.h
+++ b/WebKit/win/AccessibleBase.h
@@ -95,7 +95,6 @@ protected:
 
     virtual WebCore::String name() const;
     virtual WebCore::String value() const;
-    virtual WebCore::String description() const;
     virtual long role() const;
 
     HRESULT getAccessibilityObjectForChild(VARIANT vChild, WebCore::AccessibilityObject*&) const;
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 2412de0..2b8a0a2 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,5 +1,24 @@
 2009-10-29  Jon Honeycutt  <jhoneycutt at apple.com>
 
+        MSAA: Accessibility of headings is not correct
+
+        https://bugs.webkit.org/show_bug.cgi?id=30937
+
+        Reviewed by Alice Liu.
+
+        * AccessibleBase.cpp:
+        (AccessibleBase::get_accDescription):
+        Call the object's descriptionForMSAA(). Moved the comment to the
+        WebCore file.
+        (AccessibleBase::get_accRole):
+        If the object has a string role, return that. Otherwise, return the
+        integer role.
+
+        * AccessibleBase.h:
+        Removed description(), as this was moved to WebCore.
+
+2009-10-29  Jon Honeycutt  <jhoneycutt at apple.com>
+
         MSAA: Accessibility of links is wrong
 
         https://bugs.webkit.org/show_bug.cgi?id=30928

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list