REGRESSION (257739) [ Mac wk2 Release ] multiple tests crashing in WebCore::postUserI...
authorandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2020 04:57:34 +0000 (04:57 +0000)
committerandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2020 04:57:34 +0000 (04:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=208488
<rdar://problem/59975669>

Reviewed by Chris Fleizach.

Ensure that we have a root web area before de-referencing it.

* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postTextReplacementPlatformNotification):
(WebCore::AXObjectCache::postTextReplacementPlatformNotificationForTextControl):

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

Source/WebCore/ChangeLog
Source/WebCore/accessibility/mac/AXObjectCacheMac.mm

index 6077480..ee391e6 100644 (file)
@@ -1,5 +1,19 @@
 2020-03-02  Andres Gonzalez  <andresg_22@apple.com>
 
 2020-03-02  Andres Gonzalez  <andresg_22@apple.com>
 
+        REGRESSION (257739) [ Mac wk2 Release ] multiple tests crashing in WebCore::postUserInfoForChanges
+        https://bugs.webkit.org/show_bug.cgi?id=208488
+        <rdar://problem/59975669>
+
+        Reviewed by Chris Fleizach.
+
+        Ensure that we have a root web area before de-referencing it.
+
+        * accessibility/mac/AXObjectCacheMac.mm:
+        (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
+        (WebCore::AXObjectCache::postTextReplacementPlatformNotificationForTextControl):
+
+2020-03-02  Andres Gonzalez  <andresg_22@apple.com>
+
         Fix for LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html in IsolatedTree mode.
         https://bugs.webkit.org/show_bug.cgi?id=208462
 
         Fix for LayoutTests/accessibility/mac/value-change/value-change-user-info-contenteditable.html in IsolatedTree mode.
         https://bugs.webkit.org/show_bug.cgi?id=208462
 
index c51b185..6e9082c 100644 (file)
@@ -490,7 +490,9 @@ void AXObjectCache::postTextReplacementPlatformNotification(AXCoreObject* object
         [changes addObject:change];
     if (NSDictionary *change = textReplacementChangeDictionary(*object, insertionType, insertedText, position))
         [changes addObject:change];
         [changes addObject:change];
     if (NSDictionary *change = textReplacementChangeDictionary(*object, insertionType, insertedText, position))
         [changes addObject:change];
-    postUserInfoForChanges(*rootWebArea(), *object, changes);
+
+    if (auto* root = rootWebArea())
+        postUserInfoForChanges(*root, *object, changes);
     [changes release];
 }
 
     [changes release];
 }
 
@@ -507,7 +509,9 @@ void AXObjectCache::postTextReplacementPlatformNotificationForTextControl(AXCore
         [changes addObject:change];
     if (NSDictionary *change = textReplacementChangeDictionary(*object, AXTextEditTypeInsert, insertedText, textControl))
         [changes addObject:change];
         [changes addObject:change];
     if (NSDictionary *change = textReplacementChangeDictionary(*object, AXTextEditTypeInsert, insertedText, textControl))
         [changes addObject:change];
-    postUserInfoForChanges(*rootWebArea(), *object, changes);
+
+    if (auto* root = rootWebArea())
+        postUserInfoForChanges(*root, *object, changes);
     [changes release];
 }
 
     [changes release];
 }