Title: [231295] trunk/Source/WebKit
Revision
231295
Author
n_w...@apple.com
Date
2018-05-02 23:05:57 -0700 (Wed, 02 May 2018)

Log Message

AX: Missing kAXSWebAccessibilityEventsEnabledNotification causes a crash
https://bugs.webkit.org/show_bug.cgi?id=185237

Reviewed by Dan Bernstein.

When libAccessibility.dylib is missing, the compiler would optimize out the global
notification and lead to a crash. Fixed it by using the isNullFunction check instead,
since we are sure the global notification would be there when the corresponding function
is available.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (231294 => 231295)


--- trunk/Source/WebKit/ChangeLog	2018-05-03 03:40:29 UTC (rev 231294)
+++ trunk/Source/WebKit/ChangeLog	2018-05-03 06:05:57 UTC (rev 231295)
@@ -1,3 +1,18 @@
+2018-05-02  Nan Wang  <n_w...@apple.com>
+
+        AX: Missing kAXSWebAccessibilityEventsEnabledNotification causes a crash
+        https://bugs.webkit.org/show_bug.cgi?id=185237
+
+        Reviewed by Dan Bernstein.
+
+        When libAccessibility.dylib is missing, the compiler would optimize out the global
+        notification and lead to a crash. Fixed it by using the isNullFunction check instead,
+        since we are sure the global notification would be there when the corresponding function 
+        is available.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]):
+
 2018-05-02  Keith Rollin  <krol...@apple.com>
 
         Add facility for tracking times and results of page and resource loading

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (231294 => 231295)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2018-05-03 03:40:29 UTC (rev 231294)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2018-05-03 06:05:57 UTC (rev 231295)
@@ -694,8 +694,9 @@
 #endif
 
 #if ENABLE(ACCESSIBILITY_EVENTS)
-    const auto* notificationPtr = &kAXSWebAccessibilityEventsEnabledNotification;
-    if (notificationPtr)
+    // Check _AXSWebAccessibilityEventsEnabled here to avoid compiler optimizing
+    // out the null check of kAXSWebAccessibilityEventsEnabledNotification.
+    if (!isNullFunctionPointer(_AXSWebAccessibilityEventsEnabled))
         CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), accessibilityEventsEnabledChangedCallback, kAXSWebAccessibilityEventsEnabledNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately);
     [self _updateAccessibilityEventsEnabled];
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to