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

cfleizach at apple.com cfleizach at apple.com
Wed Apr 7 23:44:19 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 60b776da0d12346a5facf6a7175efbc6d214eb2f
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 16 22:41:38 2009 +0000

    AX: aria-labelledby duplicates some of its WAI-ARIA label
    https://bugs.webkit.org/show_bug.cgi?id=31565
    
    Reviewed by Beth Dakin.
    
    WebCore:
    
    Test: accessibility/aria-labelledby-overrides-label.html
    
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::hasTextAlternative):
    (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
    (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
    * accessibility/AccessibilityRenderObject.h:
    
    WebKitTools:
    
    * DumpRenderTree/AccessibilityUIElement.cpp:
    (titleUIElementCallback):
    (getIsValidCallback):
    (AccessibilityUIElement::getJSClass):
    
    LayoutTests:
    
    * accessibility/aria-labelledby-overrides-label-expected.txt: Added.
    * accessibility/aria-labelledby-overrides-label.html: Added.
    * platform/gtk/Skipped:
    * platform/win/Skipped:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51055 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f7cafdd..c7843b2 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2009-11-16  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        AX: aria-labelledby duplicates some of its WAI-ARIA label
+        https://bugs.webkit.org/show_bug.cgi?id=31565
+
+        * accessibility/aria-labelledby-overrides-label-expected.txt: Added.
+        * accessibility/aria-labelledby-overrides-label.html: Added.
+        * platform/gtk/Skipped:
+        * platform/win/Skipped:
+
 2009-11-16  Kenneth Russell  <kbr at google.com>
 
         Reviewed by Oliver Hunt.
diff --git a/LayoutTests/accessibility/aria-labelledby-overrides-label-expected.txt b/LayoutTests/accessibility/aria-labelledby-overrides-label-expected.txt
new file mode 100644
index 0000000..2ff7d34
--- /dev/null
+++ b/LayoutTests/accessibility/aria-labelledby-overrides-label-expected.txt
@@ -0,0 +1,13 @@
+Shut down computer after  minutes
+This tests that if aria-labelledby is used, then label elements are not used
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS text.title is 'AXTitle: Shut down computer after 10 minutes'
+PASS text.titleUIElement().isValid is false
+PASS labelElement.role is 'AXRole: AXStaticText'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/accessibility/aria-labelledby-overrides-label.html b/LayoutTests/accessibility/aria-labelledby-overrides-label.html
new file mode 100644
index 0000000..bc9237f
--- /dev/null
+++ b/LayoutTests/accessibility/aria-labelledby-overrides-label.html
@@ -0,0 +1,47 @@
+<!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">
+
+<span id="labelShutdown"><label for="shutdownTime">Shut down computer after</label></span>
+<input id="shutdownTime" type="text" value="10" aria-labelledby="labelShutdown shutdownTime shutdownUnit" />
+<span id="shutdownUnit">minutes</span>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that if aria-labelledby is used, then label elements are not used");
+
+    if (window.accessibilityController) {
+
+          var text = document.getElementById("shutdownTime");
+          text.focus();
+          text = accessibilityController.focusedElement;
+
+          shouldBe("text.title", "'AXTitle: Shut down computer after 10 minutes'");
+
+          // There should be no title UI element.
+          shouldBe("text.titleUIElement().isValid", "false");
+          
+          // The label element is in a group, in a group, in the web area.
+          var labelElement = accessibilityController.rootElement.childAtIndex(0).childAtIndex(0).childAtIndex(0).childAtIndex(0);
+
+          // This just makes sure that the label element is still visible in the AX hierarchy, even though
+          // it's a label element (sometimes they are ignored).
+          shouldBe("labelElement.role", "'AXRole: AXStaticText'");
+    }
+
+    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 337d721..6dc69da 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -49,6 +49,7 @@ accessibility/aria-combobox.html
 accessibility/aria-disabled.html
 accessibility/aria-hidden.html
 accessibility/aria-label.html
+accessibility/aria-labelledby-overrides-label.html
 accessibility/aria-labelledby-stay-within.html
 accessibility/aria-link-supports-press.html
 accessibility/aria-readonly.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 9ba9cc3..e742046 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -361,6 +361,7 @@ accessibility/aria-describedby-on-input.html
 accessibility/aria-disabled.html
 accessibility/aria-hidden.html
 accessibility/aria-label.html
+accessibility/aria-labelledby-overrides-label.html
 accessibility/aria-labelledby-on-input.html
 accessibility/aria-labelledby-stay-within.html
 accessibility/aria-link-supports-press.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8ac130d..3686843 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-11-16  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        AX: aria-labelledby duplicates some of its WAI-ARIA label
+        https://bugs.webkit.org/show_bug.cgi?id=31565
+
+        Test: accessibility/aria-labelledby-overrides-label.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::hasTextAlternative):
+        (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+        * accessibility/AccessibilityRenderObject.h:
+
 2009-11-16  Nate Chapin  <japhet at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index f01810b..1964814 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -1273,6 +1273,16 @@ void AccessibilityRenderObject::linkedUIElements(AccessibilityChildrenVector& li
         addRadioButtonGroupMembers(linkedUIElements);
 }
 
+bool AccessibilityRenderObject::hasTextAlternative() const
+{
+    // ARIA: section 2A, bullet #3 says if aria-labeledby or aria-label appears, it should
+    // override the "label" element association.
+    if (!ariaLabeledByAttribute().isEmpty() || !getAttribute(aria_labelAttr).string().isEmpty())
+        return true;
+        
+    return false;   
+}
+    
 bool AccessibilityRenderObject::exposesTitleUIElement() const
 {
     if (!isControl())
@@ -1282,6 +1292,9 @@ bool AccessibilityRenderObject::exposesTitleUIElement() const
     if (isCheckboxOrRadio() && getAttribute(titleAttr).isEmpty())
         return false;
     
+    if (hasTextAlternative())
+        return false;
+    
     return true;
 }
     
@@ -1353,7 +1366,7 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
     // find out if this element is inside of a label element.
     // if so, it may be ignored because it's the label for a checkbox or radio button
     AccessibilityObject* controlObject = correspondingControlForLabelElement();
-    if (controlObject && !controlObject->exposesTitleUIElement())
+    if (controlObject && !controlObject->exposesTitleUIElement() && controlObject->isCheckboxOrRadio())
         return true;
         
     AccessibilityRole ariaRole = ariaRoleAttribute();
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index 0407422..ffaa9e8 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -252,6 +252,7 @@ private:
     void ariaListboxSelectedChildren(AccessibilityChildrenVector&);
     void ariaListboxVisibleChildren(AccessibilityChildrenVector&);
     bool ariaIsHidden() const;
+    bool hasTextAlternative() const;
     String positionalDescriptionForMSAA() const;
 
     Element* menuElementForMenuButton() const;
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index f1f8782..d5cb95c 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2009-11-16  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        AX: aria-labelledby duplicates some of its WAI-ARIA label
+        https://bugs.webkit.org/show_bug.cgi?id=31565
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (titleUIElementCallback):
+        (getIsValidCallback):
+        (AccessibilityUIElement::getJSClass):
+
 2009-11-16  Kenneth Rohde Christiansen  <kenneth at webkit.org>
 
         Reviewed by Simon Hausmann.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 24a5429..2573512 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -295,6 +295,17 @@ static JSValueRef showMenuCallback(JSContextRef context, JSObjectRef function, J
 
 // Static Value Getters
 
+static JSValueRef getIsValidCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    AccessibilityUIElement* uiElement = toAXElement(thisObject);
+    if (!uiElement->platformUIElement())
+        return JSValueMakeBoolean(context, false);
+    
+    // There might be other platform logic that one could check here...
+    
+    return JSValueMakeBoolean(context, true);
+}
+
 static JSValueRef getRoleCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
 {
     JSRetainPtr<JSStringRef> role(Adopt, toAXElement(thisObject)->role());
@@ -485,6 +496,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
         { "hierarchicalLevel", hierarchicalLevelCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "documentEncoding", getDocumentEncodingCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "documentURI", getDocumentURICallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "isValid", getIsValidCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { 0, 0, 0, 0 }
     };
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list