Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
<rdar://problem/12128557>
REGRESSION (r121482, Lion-only): Closing a popover containing a WKView can crash
        
Reviewed by Darin Adler.

* UIProcess/API/mac/WKView.mm:
(-[WKView viewWillMoveToWindow:]):
Avoid calling the code added in 121482 that ensures that the undo stack is cleaned up
before the WKView is moved from one window to another when the WKView is being moved
out of a popover window. This avoids a bug in OS X 10.7 that was fixed in 10.8.
While this technically reopens a potentially crashing code path that 121482 closed,
it only reopens it for WKViews that are used for text editing and that are removed
from an NSPopover at some time earlier than tear-down of the NSPopover.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
John Sullivan committed Aug 20, 2012
1 parent b4df266 commit d5361fe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
17 changes: 17 additions & 0 deletions Source/WebKit2/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2012-08-18 John Sullivan <sullivan@apple.com>

<https://bugs.webkit.org/show_bug.cgi?id=94486>
<rdar://problem/12128557>
REGRESSION (r121482, Lion-only): Closing a popover containing a WKView can crash

Reviewed by Darin Adler.

* UIProcess/API/mac/WKView.mm:
(-[WKView viewWillMoveToWindow:]):
Avoid calling the code added in 121482 that ensures that the undo stack is cleaned up
before the WKView is moved from one window to another when the WKView is being moved
out of a popover window. This avoids a bug in OS X 10.7 that was fixed in 10.8.
While this technically reopens a potentially crashing code path that 121482 closed,
it only reopens it for WKViews that are used for text editing and that are removed
from an NSPopover at some time earlier than tear-down of the NSPopover.

2012-08-20 Allan Sandfeld Jensen <allan.jensen@nokia.com>

[Qt] Custom tap-highlight-color renders fully opaque
Expand Down
13 changes: 11 additions & 2 deletions Source/WebKit2/UIProcess/API/mac/WKView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1895,8 +1895,17 @@ - (void)viewWillMoveToWindow:(NSWindow *)window
NSWindow *currentWindow = [self window];
if (window == currentWindow)
return;

_data->_pageClient->viewWillMoveToAnotherWindow();

#if __MAC_OS_X_VERSION_MIN_REQUIRED == 1070
// Avoid calling the code added in 121482 that ensures that the undo stack is cleaned up
// before the WKView is moved from one window to another when the WKView is being moved
// out of a popover window. This avoids a bug in OS X 10.7 that was fixed in 10.8.
// While this technically reopens a potentially crashing code path that 121482 closed,
// it only reopens it for WKViews that are used for text editing and that are removed
// from an NSPopover at some time earlier than tear-down of the NSPopover.
if (![currentWindow isKindOfClass:NSClassFromString(@"_NSPopoverWindow")])
#endif
_data->_pageClient->viewWillMoveToAnotherWindow();

[self removeWindowObservers];
[self addWindowObserversForWindow:window];
Expand Down

0 comments on commit d5361fe

Please sign in to comment.