Bug 131528 - [Mac] Prevent crash when exiting fullscreen mode
Summary: [Mac] Prevent crash when exiting fullscreen mode
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
Keywords: InRadar
Depends on:
Reported: 2014-04-10 22:04 PDT by Brent Fulgham
Modified: 2014-04-11 09:52 PDT (History)
3 users (show)

See Also:

Patch (1.40 KB, patch)
2014-04-10 22:06 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
I think this resolves the 'real' problem (1.92 KB, patch)
2014-04-11 09:13 PDT, Brent Fulgham
jer.noble: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2014-04-10 22:04:28 PDT
It is possible to cause a crash in WebKit if you enter full screen mode, exit full screen mode, and close the main view quickly enough.

The crash is due to an animation thread attempting to interact with a deallocated window. When we decide to rapidly terminate a window, we need to tell any existing animation controllers to stop animating, and clear their window references.
Comment 1 Brent Fulgham 2014-04-10 22:06:58 PDT
Created attachment 229107 [details]
Comment 2 Brent Fulgham 2014-04-10 22:07:20 PDT
Comment 3 Jer Noble 2014-04-10 22:44:52 PDT
Comment on attachment 229107 [details]

Nice! r=me.
Comment 4 Brent Fulgham 2014-04-11 09:13:51 PDT
Created attachment 229138 [details]
I think this resolves the 'real' problem
Comment 5 Brent Fulgham 2014-04-11 09:15:58 PDT
It was bothering me that we were entering the WKFullScreenWindowController::close method with _fullScreenState != ExitingFullScreen, but _scaleAnimation still non-nil and running an animation.

I think the actual fix need to be done 'finishedExitFullScreenAnimation', where we clean up the _fadeAnimation, but don't touch the _scaleAnimation.

I still like the initial fix to protect us against leaving a running animation when the window is going away, but I think the 'real' fix is this second patch.
Comment 6 Brent Fulgham 2014-04-11 09:16:58 PDT
Comment on attachment 229138 [details]
I think this resolves the 'real' problem

Updated patch that makes sure we never are in a state where '_fullScreenState != ExitingFullScreen' while we have a running animation.
Comment 7 Jer Noble 2014-04-11 09:51:27 PDT
Comment on attachment 229138 [details]
I think this resolves the 'real' problem

Comment 8 Brent Fulgham 2014-04-11 09:52:15 PDT
Committed r167130: <http://trac.webkit.org/changeset/167130>