AX: com.apple.WebKit.WebContent at WebKit: -[WKAccessibilityWebPageObjectBase axObje...
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2019 02:53:16 +0000 (02:53 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2019 02:53:16 +0000 (02:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194306
<rdar://problem/47764549>

Reviewed by Zalan Bujtas.

Check the page reference is still valid.
Modernize code in this area.

* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:

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

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

index 6824748..5ea0a45 100644 (file)
@@ -1,3 +1,16 @@
+2019-02-06  chris fleizach  <cfleizach@apple.com>
+
+        AX:  com.apple.WebKit.WebContent at WebKit: -[WKAccessibilityWebPageObjectBase axObjectCache]
+        https://bugs.webkit.org/show_bug.cgi?id=194306
+        <rdar://problem/47764549>
+
+        Reviewed by Zalan Bujtas.
+
+        Check the page reference is still valid.
+        Modernize code in this area.
+
+        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
+
 2019-02-06  Daniel Bates  <dabates@apple.com>
 
         Move toNSEventModifierFlags() and toNSButtonNumber() to WebEventFactory.mm
index 994cbaa..60f7f1d 100644 (file)
@@ -50,12 +50,16 @@ using namespace WebKit;
 
 - (WebCore::AXObjectCache*)axObjectCache
 {
-    WebCore::Page* page = m_page->corePage();
+    if (!m_page)
+        return nullptr;
+
+    auto page = m_page->corePage();
     if (!page)
-        return nil;
-    WebCore::Frame& core = page->mainFrame();
+        return nullptr;
+
+    auto& core = page->mainFrame();
     if (!core.document())
-        return nil;
+        return nullptr;
 
     return core.document()->axObjectCache();
 }