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

cfleizach at apple.com cfleizach at apple.com
Thu Apr 8 00:10:20 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit bd43f07d7333f400d5ddfeb0df2d0eb57840f7ac
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 2 02:04:50 2009 +0000

    ARIA: support a way to create a static text object
    https://bugs.webkit.org/show_bug.cgi?id=32030
    
    Reviewed by David Kilzer.
    
    WebCore:
    
    Test: accessibility/aria-text-role.html
    
    * accessibility/AccessibilityObject.cpp:
    (WebCore::createARIARoleMap):
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::stringValue):
    (WebCore::AccessibilityRenderObject::isDescendantOfBarrenParent):
    (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
    (WebCore::AccessibilityRenderObject::text):
    * accessibility/AccessibilityRenderObject.h:
    
    LayoutTests:
    
    * accessibility/aria-text-role-expected.txt: Added.
    * accessibility/aria-text-role.html: Added.
    * platform/gtk/Skipped:
    * platform/win/Skipped:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51576 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 18d8bd9..4257e91 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2009-12-01  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by David Kilzer.
+
+        ARIA: support a way to create a static text object
+        https://bugs.webkit.org/show_bug.cgi?id=32030
+
+        * accessibility/aria-text-role-expected.txt: Added.
+        * accessibility/aria-text-role.html: Added.
+        * platform/gtk/Skipped:
+        * platform/win/Skipped:
+
 2009-12-01  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Reviewed by Simon Fraser.
diff --git a/LayoutTests/accessibility/aria-text-role-expected.txt b/LayoutTests/accessibility/aria-text-role-expected.txt
new file mode 100644
index 0000000..1144a84
--- /dev/null
+++ b/LayoutTests/accessibility/aria-text-role-expected.txt
@@ -0,0 +1,13 @@
+hello world this is a test more test
+This tests that you can set an ARIA text role and that it will not have children through hit testing
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS textrole.role is 'AXRole: AXStaticText'
+PASS textrole.stringValue is 'AXValue: all at once'
+PASS textrole.elementAtPoint(x, y).isEqual(textrole) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/accessibility/aria-text-role.html b/LayoutTests/accessibility/aria-text-role.html
new file mode 100644
index 0000000..61906d3
--- /dev/null
+++ b/LayoutTests/accessibility/aria-text-role.html
@@ -0,0 +1,43 @@
+<!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">
+
+<div id="textrole" tabindex=0 role="text" aria-label="all at once">
+<b>hello world</b>
+<i>this is a test</i>
+<a href="#">more test</a>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that you can set an ARIA text role and that it will not have children through hit testing");
+
+    if (window.accessibilityController) {
+
+        document.getElementById("textrole").focus();
+        var textrole = accessibilityController.focusedElement;
+        shouldBe("textrole.role", "'AXRole: AXStaticText'");
+        shouldBe("textrole.stringValue", "'AXValue: all at once'");
+
+        // now check the hit-testing
+        var x = textrole.clickPointX;
+        var y = textrole.clickPointY;
+        shouldBe("textrole.elementAtPoint(x, y).isEqual(textrole)", "true");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 949f26f..b5f0ad3 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -54,6 +54,7 @@ accessibility/aria-labelledby-stay-within.html
 accessibility/aria-link-supports-press.html
 accessibility/aria-readonly.html
 accessibility/aria-tab-roles.html
+accessibility/aria-text-role.html
 accessibility/aria-used-on-image-maps.html
 accessibility/button-press-action.html
 accessibility/canvas.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 3d485a1..0360a52 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -372,6 +372,7 @@ accessibility/aria-readonly.html
 accessibility/aria-roles.html
 accessibility/aria-tables.html
 accessibility/aria-tab-roles.html
+accessibility/aria-text-role.html
 accessibility/aria-used-on-image-maps.html
 accessibility/button-press-action.html
 accessibility/canvas.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 857483c..bf01a2a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2009-12-01  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by David Kilzer.
+
+        ARIA: support a way to create a static text object
+        https://bugs.webkit.org/show_bug.cgi?id=32030
+
+        Test: accessibility/aria-text-role.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::createARIARoleMap):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::stringValue):
+        (WebCore::AccessibilityRenderObject::isDescendantOfBarrenParent):
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+        (WebCore::AccessibilityRenderObject::text):
+        * accessibility/AccessibilityRenderObject.h:
+
 2009-12-01  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebCore/accessibility/AccessibilityObject.cpp b/WebCore/accessibility/AccessibilityObject.cpp
index a4f3400..a066f50 100644
--- a/WebCore/accessibility/AccessibilityObject.cpp
+++ b/WebCore/accessibility/AccessibilityObject.cpp
@@ -905,6 +905,7 @@ static ARIARoleMap* createARIARoleMap()
         { "tab", TabRole },
         { "tablist", TabListRole },
         { "tabpanel", TabPanelRole },
+        { "text", StaticTextRole },
         { "textbox", TextAreaRole },
         { "timer", ApplicationTimerRole },
         { "toolbar", ToolbarRole },
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 41f155f..cc58e38 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -860,6 +860,9 @@ String AccessibilityRenderObject::stringValue() const
     if (!m_renderer || isPasswordField())
         return String();
     
+    if (ariaRoleAttribute() == StaticTextRole)
+        return text();
+        
     if (m_renderer->isText())
         return textUnderElement();
     
@@ -1357,6 +1360,16 @@ bool AccessibilityRenderObject::ariaIsHidden() const
     return false;
 }
 
+bool AccessibilityRenderObject::isDescendantOfBarrenParent() const
+{
+    for (AccessibilityObject* object = parentObject(); object; object = object->parentObject()) {
+        if (!object->canHaveChildren())
+            return true;
+    }
+    
+    return false;
+}
+    
 bool AccessibilityRenderObject::accessibilityIsIgnored() const
 {
     // Is the platform interested in this object?
@@ -1377,6 +1390,10 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
     if (isPresentationalChildOfAriaRole())
         return true;
         
+    // If this element is within a parent that cannot have children, it should not be exposed.
+    if (isDescendantOfBarrenParent())
+        return true;    
+    
     if (roleValue() == IgnoredRole)
         return true;
     
@@ -1489,6 +1506,10 @@ int AccessibilityRenderObject::layoutCount() const
 
 String AccessibilityRenderObject::text() const
 {
+    // If this is a user defined static text, use the accessible name computation.
+    if (ariaRoleAttribute() == StaticTextRole)
+        return accessibilityDescription();
+    
     if (!isTextControl() || isPasswordField())
         return String();
     
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index 859aee1..27cd49e 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -256,6 +256,7 @@ private:
     void ariaListboxSelectedChildren(AccessibilityChildrenVector&);
     void ariaListboxVisibleChildren(AccessibilityChildrenVector&);
     bool ariaIsHidden() const;
+    bool isDescendantOfBarrenParent() const;
     bool hasTextAlternative() const;
     String positionalDescriptionForMSAA() const;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list