Title: [263591] trunk/Source/WebKit
Revision
263591
Author
[email protected]
Date
2020-06-26 15:00:52 -0700 (Fri, 26 Jun 2020)

Log Message

[iOS] Layout tests sometimes assert under -[WKContentView hasContent]
https://bugs.webkit.org/show_bug.cgi?id=213656
<rdar://problem/64818648>

Reviewed by Tim Horton.

Make it safe to invoke `-[WKContentView hasContent]` when post-layout data is not present, and there is no
ranged or caret selection. Some editing layout tests on iOS tend to hit the post-layout data assertion due to
the callout bar presentation callback firing while we reset the test harness to a consistent state (and spin the
runloop while doing so).

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView hasContent]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (263590 => 263591)


--- trunk/Source/WebKit/ChangeLog	2020-06-26 21:57:39 UTC (rev 263590)
+++ trunk/Source/WebKit/ChangeLog	2020-06-26 22:00:52 UTC (rev 263591)
@@ -1,3 +1,19 @@
+2020-06-26  Wenson Hsieh  <[email protected]>
+
+        [iOS] Layout tests sometimes assert under -[WKContentView hasContent]
+        https://bugs.webkit.org/show_bug.cgi?id=213656
+        <rdar://problem/64818648>
+
+        Reviewed by Tim Horton.
+
+        Make it safe to invoke `-[WKContentView hasContent]` when post-layout data is not present, and there is no
+        ranged or caret selection. Some editing layout tests on iOS tend to hit the post-layout data assertion due to
+        the callout bar presentation callback firing while we reset the test harness to a consistent state (and spin the
+        runloop while doing so).
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView hasContent]):
+
 2020-06-26  Pablo Saavedra  <[email protected]>
 
         [GTK][WPE] Fix the matching of an empty value in getCgroupControllerPath() when only cgroupsV2 hierarchy is found

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (263590 => 263591)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-06-26 21:57:39 UTC (rev 263590)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-06-26 22:00:52 UTC (rev 263591)
@@ -5661,7 +5661,8 @@
 
 - (BOOL)hasContent
 {
-    return _page->editorState().postLayoutData().hasContent;
+    auto& editorState = _page->editorState();
+    return !editorState.selectionIsNone && editorState.postLayoutData().hasContent;
 }
 
 - (void)selectAll
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to