<rdar://problem/4918397> Exception raise inspecting note contents in the background
authorpyeh <pyeh@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2007 23:24:05 +0000 (23:24 +0000)
committerpyeh <pyeh@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2007 23:24:05 +0000 (23:24 +0000)
        * bridge/mac/WebCoreAXObject.mm:
        (-[WebCoreAXObject subrole]):
        (-[WebCoreAXObject title]):
Check that attachment supports the attribute before requesting it.

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

WebCore/ChangeLog
WebCore/bridge/mac/WebCoreAXObject.mm

index dd6e3f36c084dd866f477927d6a30aaf14c3ebbb..992c3056be5c243617421315b864665042eb33eb 100644 (file)
@@ -1,3 +1,14 @@
+2007-03-29  Patti Hoa  <patti@apple.com>
+
+        Reviewed by harrison.
+
+        <rdar://problem/4918397> Exception raise inspecting note contents in the background
+        * WebCore.xcodeproj/project.pbxproj:
+        * bridge/mac/WebCoreAXObject.mm:
+        (-[WebCoreAXObject subrole]):
+        (-[WebCoreAXObject title]):
+        Check that attachment supports the attribute before requesting it.
+
 2007-03-29  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by john
index 5ed4cc72489e0ce559749d1a9702d51d96500997..9f9138ae954fe5b4492930ae441aed75938e5ba8 100644 (file)
@@ -442,9 +442,13 @@ static int headingLevel(RenderObject* renderer)
 {
     if ([self isPasswordField])
         return NSAccessibilitySecureTextFieldSubrole;
-
-    if ([self isAttachment])
-        return [[self attachmentView] accessibilityAttributeValue:NSAccessibilitySubroleAttribute];
+    
+    if ([self isAttachment]) {
+        NSView* attachmentView = [self attachmentView];
+        if ([[attachmentView accessibilityAttributeNames] containsObject:NSAccessibilitySubroleAttribute]) {
+            return [attachmentView accessibilityAttributeValue:NSAccessibilitySubroleAttribute];
+        }
+    }
 
     return nil;
 }
@@ -643,8 +647,12 @@ static HTMLLabelElement* labelForElement(Element* element)
     if (m_renderer->element()->isLink())
         return [self textUnderElement];
         
-    if ([self isAttachment])
-        return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityTitleAttribute];
+    if ([self isAttachment]) {
+        NSView* attachmentView = [self attachmentView];
+        if ([[attachmentView accessibilityAttributeNames] containsObject:NSAccessibilityTitleAttribute]) {
+            return [attachmentView accessibilityAttributeValue:NSAccessibilityTitleAttribute];
+        }
+    }
     
     return nil;
 }