[Mac] accessibility/document-attributes.html fails
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Aug 2015 19:14:55 +0000 (19:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Aug 2015 19:14:55 +0000 (19:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116636

Patch by Nan Wang <n_wang@apple.com> on 2015-08-25
Reviewed by Chris Fleizach.

Source/WebCore:

Re-enabled accessibility/document-attributes.html test.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

Tools:

Implemented documentURI() and documentEncoding().

* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::documentEncoding):
(AccessibilityUIElement::documentURI):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::documentEncoding):
(WTR::AccessibilityUIElement::documentURI):

LayoutTests:

* platform/mac/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm

index 9915640..7365db2 100644 (file)
@@ -1,3 +1,12 @@
+2015-08-25  Nan Wang  <n_wang@apple.com>
+
+        [Mac] accessibility/document-attributes.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=116636
+
+        Reviewed by Chris Fleizach.
+
+        * platform/mac/TestExpectations:
+
 2015-08-25  Skachkov Oleksandr  <gskachkov@gmail.com>
 
         Function.prototype.toString is incorrect for ArrowFunction
index 920479b..f8270a7 100644 (file)
@@ -36,8 +36,6 @@ fast/notifications
 fast/dom/Window/slow-unload-handler.html
 fast/dom/Window/slow-unload-handler-only-frame-is-stopped.html
 
-webkit.org/b/116636 accessibility/document-attributes.html [ Failure ]
-
 # Accessibility tests for notifications that don't exist or aren't needed on Mac OS X.
 accessibility/aria-checkbox-sends-notification.html
 accessibility/aria-switch-sends-notification.html
index b955cdb..7b70b3f 100644 (file)
@@ -1,3 +1,15 @@
+2015-08-25  Nan Wang  <n_wang@apple.com>
+
+        [Mac] accessibility/document-attributes.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=116636
+
+        Reviewed by Chris Fleizach.
+
+        Re-enabled accessibility/document-attributes.html test.
+
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+
 2015-08-25  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Fix the !ENABLE(VIDEO) build after r188693
index 7beee09..f915881 100644 (file)
@@ -233,6 +233,14 @@ using namespace HTMLNames;
 #define NSAccessibilityIsMultiSelectableAttribute @"AXIsMultiSelectable"
 #endif
 
+#ifndef NSAccessibilityDocumentURIAttribute
+#define NSAccessibilityDocumentURIAttribute @"AXDocumentURI"
+#endif
+
+#ifndef NSAccessibilityDocumentEncodingAttribute
+#define NSAccessibilityDocumentEncodingAttribute @"AXDocumentEncoding"
+#endif
+
 #define NSAccessibilityDOMIdentifierAttribute @"AXDOMIdentifier"
 #define NSAccessibilityDOMClassListAttribute @"AXDOMClassList"
 
@@ -3047,6 +3055,19 @@ static NSString* roleValueToNSString(AccessibilityRole value)
     if ([attributeName isEqualToString:NSAccessibilityIsMultiSelectableAttribute])
         return [NSNumber numberWithBool:m_object->isMultiSelectable()];
     
+    // Document attributes
+    if ([attributeName isEqualToString:NSAccessibilityDocumentURIAttribute]) {
+        if (Document* document = m_object->document())
+            return document->documentURI();
+        return nil;
+    }
+    
+    if ([attributeName isEqualToString:NSAccessibilityDocumentEncodingAttribute]) {
+        if (Document* document = m_object->document())
+            return document->encoding();
+        return nil;
+    }
+    
     return nil;
 }
 
index 4ddd2e0..464743b 100644 (file)
@@ -1,3 +1,19 @@
+2015-08-25  Nan Wang  <n_wang@apple.com>
+
+        [Mac] accessibility/document-attributes.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=116636
+
+        Reviewed by Chris Fleizach.
+
+        Implemented documentURI() and documentEncoding().
+
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::documentEncoding):
+        (AccessibilityUIElement::documentURI):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::AccessibilityUIElement::documentEncoding):
+        (WTR::AccessibilityUIElement::documentURI):
+
 2015-08-24  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Unreviewed test gardening.
index f1370ba..a3b16fd 100644 (file)
@@ -1407,11 +1407,23 @@ JSStringRef AccessibilityUIElement::accessibilityValue() const
 
 JSStringRef AccessibilityUIElement::documentEncoding()
 {
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:@"AXDocumentEncoding"];
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
     return JSStringCreateWithCharacters(0, 0);
 }
 
 JSStringRef AccessibilityUIElement::documentURI()
 {
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:@"AXDocumentURI"];
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
     return JSStringCreateWithCharacters(0, 0);
 }
 
index 7fba3c1..b74f18f 100644 (file)
@@ -1446,11 +1446,23 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding()
 {
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:@"AXDocumentEncoding"];
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
     return JSStringCreateWithCharacters(0, 0);
 }
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI()
 {
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:@"AXDocumentURI"];
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
     return JSStringCreateWithCharacters(0, 0);
 }