AX: com.apple.WebKit.WebContent at com.apple.WebKit: -[WKAccessibilityWebPageObject...
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jul 2019 14:38:42 +0000 (14:38 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jul 2019 14:38:42 +0000 (14:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200277
<rdar://problem/49475009>

Reviewed by Per Arne Vollan.

Verify Page is available before calling into it.

* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):

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

Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm

index 29ee6e7..5ca4e28 100644 (file)
@@ -1,3 +1,16 @@
+2019-07-31  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: com.apple.WebKit.WebContent at com.apple.WebKit: -[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]
+        https://bugs.webkit.org/show_bug.cgi?id=200277
+        <rdar://problem/49475009>
+
+        Reviewed by Per Arne Vollan.
+
+        Verify Page is available before calling into it.
+
+        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+        (-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
+
 2019-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Datalist element support for TextFieldInputType
index bb7fbcf..8732797 100644 (file)
@@ -96,9 +96,13 @@ ALLOW_DEPRECATED_IMPLEMENTATIONS_END
 {
     return retrieveAccessibilityValueFromMainThread<id>([&self] () -> id {
         NSMutableArray *names = [NSMutableArray array];
-        auto result = m_page->corePage()->pageOverlayController().copyAccessibilityAttributesNames(true);
-        for (auto& name : result)
-            [names addObject:(NSString *)name];
+        if (!m_page)
+            return names;
+        
+        if (auto corePage = m_page->corePage()) {
+            for (auto& name : corePage->pageOverlayController().copyAccessibilityAttributesNames(true))
+                [names addObject:(NSString *)name];
+        }
         return names;
     });
 }