WebKitTools:
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jun 2008 21:02:38 +0000 (21:02 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jun 2008 21:02:38 +0000 (21:02 +0000)
2008-06-24  Sam Weinig and Beth Dakin  <bdakin@apple.com and sam@webkit.org>

        Reviewed by Darin.

        Fix for <rdar://problem/5884881> Make DumpRenderTree support
        accessibility tests

        This patch adds some basic support for accessibility layout tests
        on the Mac.

        * DumpRenderTree/AccessibilityController.cpp: Added.
        (AccessibilityController::AccessibilityController):
        (AccessibilityController::~AccessibilityController):
        (dumpCurrentAttributesCallback):
        (AccessibilityController::makeWindowObject):
        (AccessibilityController::getJSClass):
        (AccessibilityController::staticFunctions):
        * DumpRenderTree/AccessibilityController.h: Added.
        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
        * DumpRenderTree/mac/AccessibilityControllerMac.mm: Added.
        (descriptionOfValue):
        (AccessibilityController::dumpCurrentAttributes):
        * DumpRenderTree/mac/DumpRenderTree.mm:
        * DumpRenderTree/mac/FrameLoadDelegate.h:
        * DumpRenderTree/mac/FrameLoadDelegate.mm:
        (-[FrameLoadDelegate init]):
        (-[FrameLoadDelegate webView:didClearWindowObject:forFrame:]):

LayoutTests:

2008-06-24  Sam Weinig and Beth Dakin  <bdakin@apple.com and sam@webkit.org>

        Reviewed by Darin.

        First test for <rdar://problem/5884881> Make DumpRenderTree support
        accessibility tests

        * accessibility: Added.
        * accessibility/document-attributes-expected.txt: Added.
        * accessibility/document-attributes.html: Added.
        * platform/gtk/Skipped:
        * platform/qt/Skipped:
        * platform/win/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34776 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/document-attributes-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/document-attributes.html [new file with mode: 0644]
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/AccessibilityController.cpp [new file with mode: 0644]
WebKitTools/DumpRenderTree/AccessibilityController.h [new file with mode: 0644]
WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm [new file with mode: 0644]
WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.h
WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm

index cb8ff17fb37c78ecfbc93f7b6c7c7e00239c4ec8..f1f4247a4b6bf1c41fee6920df65fe6fecb65dcd 100644 (file)
@@ -1,3 +1,17 @@
+2008-06-24  Sam Weinig and Beth Dakin  <bdakin@apple.com and sam@webkit.org>
+
+        Reviewed by Darin.
+        
+        First test for <rdar://problem/5884881> Make DumpRenderTree support 
+        accessibility tests
+
+        * accessibility: Added.
+        * accessibility/document-attributes-expected.txt: Added.
+        * accessibility/document-attributes.html: Added.
+        * platform/gtk/Skipped:
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+
 2008-06-24  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Anders Carlsson.
diff --git a/LayoutTests/accessibility/document-attributes-expected.txt b/LayoutTests/accessibility/document-attributes-expected.txt
new file mode 100644 (file)
index 0000000..2efe0ce
--- /dev/null
@@ -0,0 +1,27 @@
+AXRole: AXWebArea
+AXSubrole: 
+AXRoleDescription: HTML content
+AXChildren: <array of size 0>
+AXHelp: 
+AXParent: <AXWebArea>
+AXPosition: NSPoint: {-10000, 10900}
+AXSize: NSSize: {0, 0}
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocused: 0
+AXEnabled: 1
+AXWindow: <AXWebArea>
+AXSelectedTextMarkerRange: 
+AXStartTextMarker: <AXWebArea>
+AXEndTextMarker: <AXWebArea>
+AXVisited: 0
+AXLinkedUIElements: 
+AXSelected: 0
+AXBlockQuoteLevel: 0
+AXLinkUIElements: <array of size 0>
+AXLoaded: 1
+AXLayoutCount: 2
+AXURL: LayoutTests/accessibility/document-attributes.html
+
+
diff --git a/LayoutTests/accessibility/document-attributes.html b/LayoutTests/accessibility/document-attributes.html
new file mode 100644 (file)
index 0000000..b0bcc4f
--- /dev/null
@@ -0,0 +1,24 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var log = function(msg)
+    {
+        document.getElementById("console").appendChild(document.createTextNode(msg + "\n"));
+    }
+
+    onload = function()
+    {
+        if (window.accessibilityController)
+            log(accessibilityController.dumpCurrentAttributes());
+        else
+            log("This test requires DumpRenderTree to run.")
+    }
+</script>
+</head>
+<body>
+<pre id="console"></pre>
+</body>
+</html>
index 0bf1dfb5d1d1f7dc5dc968519fb042cb176283ac..fbeca10e0980d936d6d7d14b055a51195aa1b8a7 100644 (file)
@@ -4,4 +4,6 @@ editing/execCommand/print.html
 storage/quota-tracking.html
 storage/success-callback.html
 # Application cache
-http/tests/appcache
\ No newline at end of file
+http/tests/appcache
+# Missing AccessibilityController implementation
+accessibility
index dcdf8919997a43215d95d4a0d7069e116cf5bc77..ac526c89e1293bc93cb2fdda63917260f8d8ad90 100644 (file)
@@ -1,4 +1,5 @@
 # ------- missing features in DRT
+accessibility
 editing/selection/4975120.html
 editing/selection/5109817.html
 editing/selection/5354455-1.html
index 1beb985517072aac18789370f4dbc7a581f242dc..4a3a03fba7ac202f3cce5b172070d1c75fc31b0a 100644 (file)
@@ -407,3 +407,6 @@ http/tests/appcache
 # <rdar://problem/5961006> LayoutTests that send an OPTIONS request don't work on Windows due to Apache 1.3
 http/tests/xmlhttprequest/access-control-basic-not-get-allow-async.html
 http/tests/xmlhttprequest/access-control-basic-not-get-allow.html
+
+# Still need to implement AccessibilityController for DumpRenderTree on Windows
+accessibility
index e1f2fe21005326ea27e92523fdba22c3169f3668..82f222254d49b4e5f2fd23cd08b66cbe808c6048 100644 (file)
@@ -1,3 +1,31 @@
+2008-06-24  Sam Weinig and Beth Dakin  <bdakin@apple.com and sam@webkit.org>
+
+        Reviewed by Darin.
+
+        Fix for <rdar://problem/5884881> Make DumpRenderTree support 
+        accessibility tests
+
+        This patch adds some basic support for accessibility layout tests 
+        on the Mac.
+
+        * DumpRenderTree/AccessibilityController.cpp: Added.
+        (AccessibilityController::AccessibilityController):
+        (AccessibilityController::~AccessibilityController):
+        (dumpCurrentAttributesCallback):
+        (AccessibilityController::makeWindowObject):
+        (AccessibilityController::getJSClass):
+        (AccessibilityController::staticFunctions):
+        * DumpRenderTree/AccessibilityController.h: Added.
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+        * DumpRenderTree/mac/AccessibilityControllerMac.mm: Added.
+        (descriptionOfValue):
+        (AccessibilityController::dumpCurrentAttributes):
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        * DumpRenderTree/mac/FrameLoadDelegate.h:
+        * DumpRenderTree/mac/FrameLoadDelegate.mm:
+        (-[FrameLoadDelegate init]):
+        (-[FrameLoadDelegate webView:didClearWindowObject:forFrame:]):
+
 2008-06-24  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Dan Bernstein
diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.cpp b/WebKitTools/DumpRenderTree/AccessibilityController.cpp
new file mode 100644 (file)
index 0000000..be0b2cb
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "AccessibilityController.h"
+
+#import <JavaScriptCore/JSRetainPtr.h>
+
+AccessibilityController::AccessibilityController()
+{
+}
+
+AccessibilityController::~AccessibilityController()
+{
+}
+
+static JSValueRef dumpCurrentAttributesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    AccessibilityController* controller = reinterpret_cast<AccessibilityController*>(JSObjectGetPrivate(thisObject));
+    JSRetainPtr<JSStringRef> attributes(Adopt, controller->dumpCurrentAttributes());
+    return JSValueMakeString(context, attributes.get());
+}
+
+// Object Creation
+
+void AccessibilityController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> accessibilityControllerStr(Adopt, JSStringCreateWithUTF8CString("accessibilityController"));
+    JSValueRef accessibilityControllerObject = JSObjectMake(context, getJSClass(), this);
+    JSObjectSetProperty(context, windowObject, accessibilityControllerStr.get(), accessibilityControllerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
+}
+
+JSClassRef AccessibilityController::getJSClass()
+{
+    static JSClassRef accessibilityControllerClass;
+
+    if (!accessibilityControllerClass) {
+        JSStaticFunction* staticFunctions = AccessibilityController::staticFunctions();
+        JSClassDefinition classDefinition = {
+            0, kJSClassAttributeNone, "AccessibilityController", 0, 0, staticFunctions,
+            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+        };
+
+        accessibilityControllerClass = JSClassCreate(&classDefinition);
+    }
+
+    return accessibilityControllerClass;
+}
+
+JSStaticFunction* AccessibilityController::staticFunctions()
+{
+    static JSStaticFunction staticFunctions[] = {
+        { "dumpCurrentAttributes", dumpCurrentAttributesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { 0, 0, 0 }
+    };
+
+    return staticFunctions;
+}
diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.h b/WebKitTools/DumpRenderTree/AccessibilityController.h
new file mode 100644 (file)
index 0000000..920f27e
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef AccessibilityController_h
+#define AccessibilityController_h
+
+#include <JavaScriptCore/JSObjectRef.h>
+
+class AccessibilityController {
+public:
+    AccessibilityController();
+    ~AccessibilityController();
+
+    void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception);
+
+    // Controller Methods - platfrom independant implementations
+    JSStringRef dumpCurrentAttributes();
+
+private:
+    static JSClassRef getJSClass();
+    static JSStaticFunction* staticFunctions();
+};
+
+#endif // AccessibilityController_h
index 936c6ad8c8da09050f129e19bcd1d3212a300704..7233d74c3c07410d23825572c5e31d17279c3211 100644 (file)
@@ -90,6 +90,8 @@
                BCB284D00CFA83CC007E533E /* PixelDumpSupportCG.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB284890CFA8202007E533E /* PixelDumpSupportCG.h */; };
                BCB284D60CFA83D1007E533E /* PixelDumpSupportMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCB2848C0CFA8221007E533E /* PixelDumpSupportMac.mm */; };
                BCB284F60CFA84F8007E533E /* ImageDiffCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB284F30CFA84F2007E533E /* ImageDiffCG.cpp */; };
+               BCD08B3A0E1057EF00A7D0C1 /* AccessibilityController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */; };
+               BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */; };
                BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF6C64F0C98E9C000AC063E /* GCController.cpp */; };
 /* End PBXBuildFile section */
 
                BCB2848C0CFA8221007E533E /* PixelDumpSupportMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = PixelDumpSupportMac.mm; path = mac/PixelDumpSupportMac.mm; sourceTree = "<group>"; };
                BCB284B20CFA82CB007E533E /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
                BCB284F30CFA84F2007E533E /* ImageDiffCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ImageDiffCG.cpp; path = cg/ImageDiffCG.cpp; sourceTree = "<group>"; };
+               BCD08A580E10496B00A7D0C1 /* AccessibilityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityController.h; sourceTree = "<group>"; };
+               BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityController.cpp; sourceTree = "<group>"; };
+               BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityControllerMac.mm; path = mac/AccessibilityControllerMac.mm; sourceTree = "<group>"; };
                BCF6C64F0C98E9C000AC063E /* GCController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = GCController.cpp; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
                1422A2690AF6F45200E1A883 /* Controllers */ = {
                        isa = PBXGroup;
                        children = (
+                               BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */,
+                               BCD08A580E10496B00A7D0C1 /* AccessibilityController.h */,
+                               BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */,
                                BCA18B360C9B021900114369 /* AppleScriptController.h */,
                                BCA18B370C9B021900114369 /* AppleScriptController.m */,
                                BCA18B6B0C9B08DB00114369 /* EventSendingController.h */,
                                BCB284CD0CFA83C8007E533E /* PixelDumpSupportCG.cpp in Sources */,
                                BCB284D60CFA83D1007E533E /* PixelDumpSupportMac.mm in Sources */,
                                BC4741410D038A570072B006 /* JavaScriptThreadingPthreads.cpp in Sources */,
+                               BCD08B3A0E1057EF00A7D0C1 /* AccessibilityController.cpp in Sources */,
+                               BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm
new file mode 100644 (file)
index 0000000..c219a46
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import "DumpRenderTree.h"
+#import "AccessibilityController.h"
+
+#import <Foundation/Foundation.h>
+#import <JavaScriptCore/JSStringRef.h>
+#import <WebKit/WebFrame.h>
+#import <WebKit/WebHTMLView.h>
+#import <wtf/Vector.h>
+#import <wtf/RetainPtr.h>
+
+static NSString* descriptionOfValue(id valueObject, id focusedAccessibilityObject)
+{
+    if (!valueObject)
+        return NULL;
+
+    if ([valueObject isKindOfClass:[NSArray class]])
+        return [NSString stringWithFormat:@"<array of size %d>", [(NSArray*)valueObject count]];
+
+    // Strip absolute URL paths
+    NSString* description = [valueObject description];
+    NSRange range = [description rangeOfString:@"LayoutTests"];
+    if (range.length)
+        return [description substringFromIndex:range.location];
+
+    // Strip pointer locations
+    if ([description rangeOfString:@": 0x"].length) {
+        NSString* role = [focusedAccessibilityObject accessibilityAttributeValue:@"AXRole"];
+        NSString* title = [focusedAccessibilityObject accessibilityAttributeValue:@"AXTitle"];
+        if ([title length])
+            return [NSString stringWithFormat:@"<%@: '%@'>", role, title];
+        return [NSString stringWithFormat:@"<%@>", role];
+    }
+    
+    return [valueObject description];
+}
+
+JSStringRef AccessibilityController::dumpCurrentAttributes()
+{
+    WebHTMLView* view = [[mainFrame frameView] documentView];
+    id accessibilityObject = [view accessibilityFocusedUIElement];
+    NSArray* supportedAttributes = [accessibilityObject accessibilityAttributeNames];
+
+    Vector<UniChar> buffer;
+    for (NSUInteger i = 0; i < [supportedAttributes count]; ++i) {
+        NSString* attribute = [supportedAttributes objectAtIndex:i];
+        id valueObject = [accessibilityObject accessibilityAttributeValue:attribute];
+        NSString* value = descriptionOfValue(valueObject, accessibilityObject);
+
+        Vector<UniChar> attributeBuffer([attribute length]);
+        [attribute getCharacters:attributeBuffer.data()];
+        buffer.append(attributeBuffer);
+        buffer.append(':');
+        buffer.append(' ');
+
+        Vector<UniChar> valueBuffer([value length]);
+        [value getCharacters:valueBuffer.data()];
+        buffer.append(valueBuffer);
+        buffer.append('\n');
+    }
+
+    return JSStringCreateWithCharacters(buffer.data(), buffer.size());
+}
index 16aadc918fd7ba91925833d35f81293c438f894f..8413e1c2c5da91c891c628f4aed4a327915df75d 100644 (file)
@@ -29,6 +29,7 @@
  
 #import "DumpRenderTree.h"
 
+#import "AccessibilityController.h"
 #import "CheckedMalloc.h"
 #import "DumpRenderTreePasteboard.h"
 #import "DumpRenderTreeWindow.h"
index 3b86fdf0d8b055a90ed99cf221d680193f2fc8a4..6c3cbdb4ff1b0a7acbf641aa837803211e2dbc02 100644 (file)
 
 #import <Foundation/Foundation.h>
 
+class AccessibilityController;
 class GCController;
 
 @interface FrameLoadDelegate : NSObject
 {
+    AccessibilityController* accessibilityController;
     GCController* gcController;
 }
 @end
index 0c68d496994a5f215b639653050d5a5fbb476f55..bc54b114743896013611921596df2ed488695ee0 100644 (file)
@@ -29,6 +29,7 @@
 #import "DumpRenderTree.h"
 #import "FrameLoadDelegate.h"
 
+#import "AccessibilityController.h"
 #import "AppleScriptController.h"
 #import "EventSendingController.h"
 #import "GCController.h"
 
 - (id)init
 {
-    if ((self = [super init]))
+    if ((self = [super init])) {
         gcController = new GCController;
+        accessibilityController = new AccessibilityController;
+    }
     return self;
 }
 
     gcController->makeWindowObject(context, globalObject, &exception);
     ASSERT(!exception);
 
+    accessibilityController->makeWindowObject(context, globalObject, &exception);
+    ASSERT(!exception);
+
     // Make Old-Style controllers
     EventSendingController *esc = [[EventSendingController alloc] init];
     [obj setValue:esc forKey:@"eventSender"];