Title: [176969] trunk/Source/WebKit2
Revision
176969
Author
m...@apple.com
Date
2014-12-08 13:53:54 -0800 (Mon, 08 Dec 2014)

Log Message

<rdar://problem/18046692> [iOS] Safari crashes at -[_NSUndoStack popAndInvoke] when trying to undo typing on closed tab
https://bugs.webkit.org/show_bug.cgi?id=139408

Reviewed by Anders Carlsson.

* UIProcess/ios/WKContentView.mm:
(-[WKContentView undoManager]): Override to initialize if necessary and return a unique undo
manager for this instance. This ensures that undoable operations for this webview don’t get
put in other undo managers, and matches UIWebView behavior.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (176968 => 176969)


--- trunk/Source/WebKit2/ChangeLog	2014-12-08 21:10:13 UTC (rev 176968)
+++ trunk/Source/WebKit2/ChangeLog	2014-12-08 21:53:54 UTC (rev 176969)
@@ -1,3 +1,15 @@
+2014-12-08  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/18046692> [iOS] Safari crashes at -[_NSUndoStack popAndInvoke] when trying to undo typing on closed tab
+        https://bugs.webkit.org/show_bug.cgi?id=139408
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView undoManager]): Override to initialize if necessary and return a unique undo
+        manager for this instance. This ensures that undoable operations for this webview don’t get
+        put in other undo managers, and matches UIWebView behavior.
+
 2014-12-08  Chris Dumez  <cdu...@apple.com>
 
         Revert r176293 & r176275

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (176968 => 176969)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm	2014-12-08 21:10:13 UTC (rev 176968)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm	2014-12-08 21:53:54 UTC (rev 176969)
@@ -178,6 +178,8 @@
     RetainPtr<WKInspectorHighlightView> _inspectorHighlightView;
 
     HistoricalVelocityData _historicalKinematicData;
+
+    RetainPtr<NSUndoManager> _undoManager;
 }
 
 - (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView
@@ -375,6 +377,14 @@
     [self _didEndScrollingOrZooming];
 }
 
+- (NSUndoManager *)undoManager
+{
+    if (!_undoManager)
+        _undoManager = adoptNS([[NSUndoManager alloc] init]);
+
+    return _undoManager.get();
+}
+
 #pragma mark Internal
 
 - (void)_windowDidMoveToScreenNotification:(NSNotification *)notification
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to