Title: [240773] trunk
Revision
240773
Author
cfleiz...@apple.com
Date
2019-01-31 01:55:34 -0800 (Thu, 31 Jan 2019)

Log Message

ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
https://bugs.webkit.org/show_bug.cgi?id=189094
<rdar://problem/43853526>

Reviewed by Zalan Bujtas.

Source/WebCore:

Protect against access to objects and cache's that can be removed while an object is still in memory.

Unskipped flaky tests on mac-wk2.

* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postTextStateChangePlatformNotification):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(textMarkerForVisiblePosition):
(textMarkerRangeFromVisiblePositions):

LayoutTests:

Unskip flaky test with crash resolved.

* platform/mac-wk2/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (240772 => 240773)


--- trunk/LayoutTests/ChangeLog	2019-01-31 08:40:58 UTC (rev 240772)
+++ trunk/LayoutTests/ChangeLog	2019-01-31 09:55:34 UTC (rev 240773)
@@ -1,3 +1,15 @@
+2019-01-31  Chris Fleizach  <cfleiz...@apple.com>
+
+        ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
+        https://bugs.webkit.org/show_bug.cgi?id=189094
+        <rdar://problem/43853526>
+
+        Reviewed by Zalan Bujtas.
+
+        Unskip flaky test with crash resolved.
+
+        * platform/mac-wk2/TestExpectations:
+
 2019-01-30  Ryosuke Niwa  <rn...@webkit.org>
 
         Enable swipe tests on iOS

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (240772 => 240773)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2019-01-31 08:40:58 UTC (rev 240772)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2019-01-31 09:55:34 UTC (rev 240773)
@@ -894,8 +894,6 @@
 imported/w3c/web-platform-tests/payment-request/user-abort-algorithm-manual.https.html [ Skip ]
 imported/w3c/web-platform-tests/payment-request/user-accepts-payment-request-algo-manual.https.html [ Skip ]
 
-webkit.org/b/189094 [ HighSierra+ ] accessibility/mac/focus-setting-selection-syncronizing-not-clearing.html [ Skip ]
-
 webkit.org/b/189598 compositing/backing/backing-store-attachment-fill-forwards-animation.html [ Pass Failure ]
 
 # Skip local authenticator tests for mac now.

Modified: trunk/Source/WebCore/ChangeLog (240772 => 240773)


--- trunk/Source/WebCore/ChangeLog	2019-01-31 08:40:58 UTC (rev 240772)
+++ trunk/Source/WebCore/ChangeLog	2019-01-31 09:55:34 UTC (rev 240773)
@@ -1,3 +1,21 @@
+2019-01-31  Chris Fleizach  <cfleiz...@apple.com>
+
+        ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
+        https://bugs.webkit.org/show_bug.cgi?id=189094
+        <rdar://problem/43853526>
+
+        Reviewed by Zalan Bujtas.
+
+        Protect against access to objects and cache's that can be removed while an object is still in memory.
+
+        Unskipped flaky tests on mac-wk2.
+
+        * accessibility/mac/AXObjectCacheMac.mm:
+        (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (textMarkerForVisiblePosition):
+        (textMarkerRangeFromVisiblePositions):
+
 2019-01-30  Chris Dumez  <cdu...@apple.com>
 
         Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error

Modified: trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm (240772 => 240773)


--- trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm	2019-01-31 08:40:58 UTC (rev 240772)
+++ trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm	2019-01-31 09:55:34 UTC (rev 240773)
@@ -408,9 +408,11 @@
     if (id wrapper = object->wrapper())
         [userInfo setObject:wrapper forKey:NSAccessibilityTextChangeElement];
 
-    AXPostNotificationWithUserInfo(rootWebArea()->wrapper(), NSAccessibilitySelectedTextChangedNotification, userInfo);
-    if (rootWebArea()->wrapper() != object->wrapper())
-        AXPostNotificationWithUserInfo(object->wrapper(), NSAccessibilitySelectedTextChangedNotification, userInfo);
+    if (auto root = rootWebArea()) {
+        AXPostNotificationWithUserInfo(rootWebArea()->wrapper(), NSAccessibilitySelectedTextChangedNotification, userInfo);
+        if (root->wrapper() != object->wrapper())
+            AXPostNotificationWithUserInfo(object->wrapper(), NSAccessibilitySelectedTextChangedNotification, userInfo);
+    }
 
     [userInfo release];
 }

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (240772 => 240773)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2019-01-31 08:40:58 UTC (rev 240772)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2019-01-31 09:55:34 UTC (rev 240773)
@@ -715,7 +715,9 @@
 static id textMarkerForVisiblePosition(AXObjectCache* cache, const VisiblePosition& visiblePos)
 {
     ASSERT(cache);
-
+    if (!cache)
+        return nil;
+    
     auto textMarkerData = cache->textMarkerDataForVisiblePosition(visiblePos);
     if (!textMarkerData)
         return nil;
@@ -1113,6 +1115,9 @@
 
 static id textMarkerRangeFromVisiblePositions(AXObjectCache* cache, const VisiblePosition& startPosition, const VisiblePosition& endPosition)
 {
+    if (!cache)
+        return nil;
+    
     id startTextMarker = textMarkerForVisiblePosition(cache, startPosition);
     id endTextMarker = textMarkerForVisiblePosition(cache, endPosition);
     return textMarkerRangeFromMarkers(startTextMarker, endTextMarker);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to