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


The following commit has been merged in the webkit-1.2 branch:
commit 18b2b7c33979bf88a937e41b1a5b0fc39a0a4c26
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 4 01:00:07 2009 +0000

    Implement WAI-ARIA scrollbar role and related property aria-orientation
    https://bugs.webkit.org/show_bug.cgi?id=32126
    
    Reviewed by Beth Dakin.
    
    WebCore:
    
    Test: accessibility/aria-scrollbar-role.html
    
    * accessibility/AccessibilityObject.cpp:
    (WebCore::createARIARoleMap):
    * accessibility/AccessibilityObject.h:
    (WebCore::AccessibilityObject::isScrollbar):
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::valueForRange):
    (WebCore::AccessibilityRenderObject::orientation):
    (WebCore::AccessibilityRenderObject::canHaveChildren):
    * accessibility/AccessibilityRenderObject.h:
    * accessibility/mac/AccessibilityObjectWrapper.mm:
    (-[AccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
    (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
    * html/HTMLAttributeNames.in:
    
    WebKitTools:
    
    * DumpRenderTree/AccessibilityUIElement.cpp:
    (getOrientationCallback):
    (AccessibilityUIElement::getJSClass):
    * DumpRenderTree/AccessibilityUIElement.h:
    * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
    (AccessibilityUIElement::orientation):
    * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
    (AccessibilityUIElement::orientation):
    * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
    (AccessibilityUIElement::orientation):
    
    LayoutTests:
    
    * accessibility/aria-scrollbar-role-expected.txt: Added.
    * accessibility/aria-scrollbar-role.html: Added.
    * platform/gtk/Skipped:
    * platform/win/Skipped:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51669 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index bb2243d..ea5c8b2 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2009-12-03  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        Implement WAI-ARIA scrollbar role and related property aria-orientation
+        https://bugs.webkit.org/show_bug.cgi?id=32126
+
+        * accessibility/aria-scrollbar-role-expected.txt: Added.
+        * accessibility/aria-scrollbar-role.html: Added.
+        * platform/gtk/Skipped:
+        * platform/win/Skipped:
+
 2009-12-03  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/accessibility/aria-scrollbar-role-expected.txt b/LayoutTests/accessibility/aria-scrollbar-role-expected.txt
new file mode 100644
index 0000000..3217105
--- /dev/null
+++ b/LayoutTests/accessibility/aria-scrollbar-role-expected.txt
@@ -0,0 +1,14 @@
+scrollbar
+This tests that the ARIA scrollbar role works correctly
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS scroller.role is 'AXRole: AXScrollBar'
+PASS scroller.intValue is 55
+PASS scroller.orientation is 'AXOrientation: AXVerticalOrientation'
+PASS scroller.orientation is 'AXOrientation: AXHorizontalOrientation'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/accessibility/aria-scrollbar-role.html b/LayoutTests/accessibility/aria-scrollbar-role.html
new file mode 100644
index 0000000..95953f3
--- /dev/null
+++ b/LayoutTests/accessibility/aria-scrollbar-role.html
@@ -0,0 +1,39 @@
+<!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 tabindex=0 id="scroller" aria-valuenow="55" role="scrollbar" aria-orientation="vertical">scrollbar</div>
+
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that the ARIA scrollbar role works correctly");
+
+    if (window.accessibilityController) {
+
+        document.getElementById("scroller").focus();
+        var scroller = accessibilityController.focusedElement;
+        shouldBe("scroller.role", "'AXRole: AXScrollBar'");
+        shouldBe("scroller.intValue", "55");
+        shouldBe("scroller.orientation", "'AXOrientation: AXVerticalOrientation'");
+
+        document.getElementById("scroller").setAttribute("aria-orientation", "horizontal");
+        shouldBe("scroller.orientation", "'AXOrientation: AXHorizontalOrientation'");
+    }
+
+    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 0a5be11..45b3544 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -53,6 +53,7 @@ accessibility/aria-labelledby-overrides-label.html
 accessibility/aria-labelledby-stay-within.html
 accessibility/aria-link-supports-press.html
 accessibility/aria-readonly.html
+accessibility/aria-scrollbar-role.html
 accessibility/aria-tab-roles.html
 accessibility/aria-text-role.html
 accessibility/aria-used-on-image-maps.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index a17061b..f255c38 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -370,6 +370,7 @@ accessibility/aria-list-and-listitem.html
 accessibility/aria-presentational-role.html
 accessibility/aria-readonly.html
 accessibility/aria-roles.html
+accessibility/aria-scrollbar-role.html
 accessibility/aria-tables.html
 accessibility/aria-tab-roles.html
 accessibility/aria-text-role.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 53b8cdf..217ddaa 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2009-12-03  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        Implement WAI-ARIA scrollbar role and related property aria-orientation
+        https://bugs.webkit.org/show_bug.cgi?id=32126
+
+        Test: accessibility/aria-scrollbar-role.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::createARIARoleMap):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::isScrollbar):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::valueForRange):
+        (WebCore::AccessibilityRenderObject::orientation):
+        (WebCore::AccessibilityRenderObject::canHaveChildren):
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/mac/AccessibilityObjectWrapper.mm:
+        (-[AccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
+        (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
+        * html/HTMLAttributeNames.in:
+
 2009-12-03  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/accessibility/AccessibilityObject.cpp b/WebCore/accessibility/AccessibilityObject.cpp
index a066f50..585e4cb 100644
--- a/WebCore/accessibility/AccessibilityObject.cpp
+++ b/WebCore/accessibility/AccessibilityObject.cpp
@@ -897,6 +897,7 @@ static ARIARoleMap* createARIARoleMap()
         { "region", DocumentRegionRole },
         { "row", RowRole },
         { "range", SliderRole },
+        { "scrollbar", ScrollBarRole },
         { "search", LandmarkSearchRole },
         { "separator", SplitterRole },
         { "slider", SliderRole },
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index 287fe1b..e02982c 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -285,6 +285,7 @@ public:
     bool isComboBox() const { return roleValue() == ComboBoxRole; }
     bool isTree() const { return roleValue() == TreeRole; }
     bool isTreeItem() const { return roleValue() == TreeItemRole; }
+    bool isScrollbar() const { return roleValue() == ScrollBarRole; }
     
     virtual bool isChecked() const { return false; }
     virtual bool isEnabled() const { return false; }
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 8b40772..95a5f9d 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -833,7 +833,7 @@ String AccessibilityRenderObject::valueDescription() const
     
 float AccessibilityRenderObject::valueForRange() const
 {
-    if (!isProgressIndicator() && !isSlider())
+    if (!isProgressIndicator() && !isSlider() && !isScrollbar())
         return 0.0f;
 
     return getAttribute(aria_valuenowAttr).toFloat();
@@ -2651,6 +2651,17 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     return UnknownRole;
 }
 
+AccessibilityOrientation AccessibilityRenderObject::orientation() const
+{
+    const AtomicString& ariaOrientation = getAttribute(aria_orientationAttr).string();
+    if (equalIgnoringCase(ariaOrientation, "horizontal"))
+        return AccessibilityOrientationHorizontal;
+    if (equalIgnoringCase(ariaOrientation, "vertical"))
+        return AccessibilityOrientationVertical;
+    
+    return AccessibilityObject::orientation();
+}
+    
 bool AccessibilityRenderObject::isPresentationalChildOfAriaRole() const
 {
     // Walk the parent chain looking for a parent that has presentational children
@@ -2762,6 +2773,7 @@ bool AccessibilityRenderObject::canHaveChildren() const
     case TabRole:
     case StaticTextRole:
     case ListBoxOptionRole:
+    case ScrollBarRole:
         return false;
     default:
         return true;
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index 5189ea1..d537881 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -201,6 +201,7 @@ public:
     virtual void setSelected(bool);
     virtual void setSelectedRows(AccessibilityChildrenVector&);
     virtual void changeValueByPercent(float percentChange);
+    virtual AccessibilityOrientation orientation() const;
     virtual void increment();
     virtual void decrement();
     
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index 28336c3..27b826a 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -590,6 +590,9 @@ static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(VisiblePositi
     if (m_object->supportsARIAOwns())
         [additional addObject:NSAccessibilityOwnsAttribute];
 
+    if (m_object->isScrollbar())
+        [additional addObject:NSAccessibilityOrientationAttribute];
+    
     if (m_object->supportsARIADragging())
         [additional addObject:NSAccessibilityGrabbedAttribute];
 
@@ -1448,7 +1451,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
             if ([[[self attachmentView] accessibilityAttributeNames] containsObject:NSAccessibilityValueAttribute]) 
                 return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityValueAttribute];
         }
-        if (m_object->isProgressIndicator() || m_object->isSlider())
+        if (m_object->isProgressIndicator() || m_object->isSlider() || m_object->isScrollbar())
             return [NSNumber numberWithFloat:m_object->valueForRange()];
         if (m_object->hasIntValue())
             return [NSNumber numberWithInt:m_object->intValue()];
diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in
index 0e91c88..f91adad 100644
--- a/WebCore/html/HTMLAttributeNames.in
+++ b/WebCore/html/HTMLAttributeNames.in
@@ -27,6 +27,7 @@ aria-labeledby
 aria-labelledby
 aria-level
 aria-multiselectable
+aria-orientation
 aria-owns
 aria-pressed
 aria-readonly
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index a1d9687..7b361af 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,21 @@
+2009-12-03  Chris Fleizach  <cfleizach at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        Implement WAI-ARIA scrollbar role and related property aria-orientation
+        https://bugs.webkit.org/show_bug.cgi?id=32126
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (getOrientationCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (AccessibilityUIElement::orientation):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::orientation):
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::orientation):
+
 2009-12-03  Eric Carlson  <eric.carlson at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 8d1f6d8..0dac0a0 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -371,6 +371,12 @@ static JSValueRef getLanguageCallback(JSContextRef context, JSObjectRef thisObje
     return JSValueMakeString(context, language.get());
 }
 
+static JSValueRef getOrientationCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> orientation(Adopt, toAXElement(thisObject)->orientation());
+    return JSValueMakeString(context, orientation.get());
+}
+
 static JSValueRef getChildrenCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
 {
     return JSValueMakeNumber(context, toAXElement(thisObject)->childrenCount());
@@ -526,6 +532,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
         { "documentEncoding", getDocumentEncodingCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "documentURI", getDocumentURICallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "isValid", getIsValidCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "orientation", getOrientationCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "ariaIsGrabbed", getARIAIsGrabbedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "ariaDropEffects", getARIADropEffectsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { 0, 0, 0, 0 }
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index d478456..ba6a635 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -95,6 +95,7 @@ public:
     JSStringRef language();
     JSStringRef stringValue();
     JSStringRef accessibilityValue() const;
+    JSStringRef orientation() const;
     double x();
     double y();
     double width();
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
index c06ebcc..71d7f19 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
@@ -239,6 +239,10 @@ double AccessibilityUIElement::clickPointY()
     return 0.f;
 }
 
+JSStringRef AccessibilityUIElement::orientation() const
+{
+    return 0;
+}
 
 double AccessibilityUIElement::intValue()
 {
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index 4b46dda..8f6f550 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -386,6 +386,12 @@ JSStringRef AccessibilityUIElement::description()
     return concatenateAttributeAndValue(@"AXDescription", description);
 }
 
+JSStringRef AccessibilityUIElement::orientation() const
+{
+    id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityOrientationAttribute], m_element);
+    return concatenateAttributeAndValue(@"AXOrientation", description);    
+}
+
 JSStringRef AccessibilityUIElement::stringValue()
 {
     id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityValueAttribute], m_element);
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
index 872e2fd..d77929e 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
@@ -277,6 +277,11 @@ bool AccessibilityUIElement::isExpanded() const
     return false;
 }
 
+JSStringRef AccessibilityUIElement::orientation() const
+{
+    return 0;
+}
+
 double AccessibilityUIElement::intValue()
 {
     BSTR valueBSTR;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list