Title: [119641] branches/safari-536-branch/Source/WebKit2
Revision
119641
Author
[email protected]
Date
2012-06-06 17:07:15 -0700 (Wed, 06 Jun 2012)

Log Message

Merge r119570.

Modified Paths

Diff

Modified: branches/safari-536-branch/Source/WebKit2/ChangeLog (119640 => 119641)


--- branches/safari-536-branch/Source/WebKit2/ChangeLog	2012-06-07 00:06:14 UTC (rev 119640)
+++ branches/safari-536-branch/Source/WebKit2/ChangeLog	2012-06-07 00:07:15 UTC (rev 119641)
@@ -1,5 +1,45 @@
 2012-06-06  Mark Rowe  <[email protected]>
 
+        Merge r119570.
+
+    2012-06-06  Tim Horton  <[email protected]>
+
+        WebPage::windowIsVisible is incorrect during resumePainting
+        https://bugs.webkit.org/show_bug.cgi?id=88374
+        <rdar://problem/11587039>
+
+        Reviewed by Simon Fraser.
+
+        Currently, when changing window visibility, WKView calls viewStateDidChange(ViewIsVisible)
+        and then _updateWindowVisibility. This means that during viewStateDidChange, the WebPage's
+        windowIsVisible state is incorrect.
+
+        viewStateDidChange(ViewIsVisible) can end up in (one of the DrawingArea implementations)::resumePainting(),
+        which uses windowIsVisible to determine whether or not to unpause requestAnimationFrame.
+
+        This results in a state where, with some configurations, doing the following:
+
+            1. requestAnimationFrame()
+            2. requestFullScreen()
+            3. requestAnimationFrame()
+            4. cancelFullScreen()
+            5. requestAnimationFrame()
+
+        Will cause the second and third rAF calls to have no effect. Even after cancelFullScreen() is called,
+        the fact that we have had unpaired suspend/resumeScriptedAnimations will cause the suspend count
+        on the ScriptedAnimationController to never return to zero, which will cause us to never
+        recover rAF functionality.
+
+        The fix is very simple: we should _updateWindowVisibility *before* viewStateDidChange, so that it is
+        always correct for any code called underneath that method.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView viewDidMoveToWindow]):
+        (-[WKView _windowDidOrderOffScreen:]):
+        (-[WKView _windowDidOrderOnScreen:]):
+
+2012-06-06  Mark Rowe  <[email protected]>
+
         Merge r119535.
 
     2012-06-05  Brady Eidson  <[email protected]>

Modified: branches/safari-536-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (119640 => 119641)


--- branches/safari-536-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2012-06-07 00:06:14 UTC (rev 119640)
+++ branches/safari-536-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2012-06-07 00:07:15 UTC (rev 119641)
@@ -1874,9 +1874,9 @@
     // update the active state.
     if ([self window]) {
         _data->_windowHasValidBackingStore = NO;
+        [self _updateWindowVisibility];
         _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive);
         _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible | WebPageProxy::ViewIsInWindow);
-        [self _updateWindowVisibility];
         [self _updateWindowAndViewFrames];
 
         if (!_data->_flagsChangedEventMonitor) {
@@ -1965,20 +1965,22 @@
 
 - (void)_windowDidOrderOffScreen:(NSNotification *)notification
 {
+    [self _updateWindowVisibility];
+
     // We want to make sure to update the active state while hidden, so since the view is about to be hidden,
     // we hide it first and then update the active state.
     _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
     _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive);
-    [self _updateWindowVisibility];
 }
 
 - (void)_windowDidOrderOnScreen:(NSNotification *)notification
 {
+    [self _updateWindowVisibility];
+
     // We want to make sure to update the active state while hidden, so since the view is about to become visible,
     // we update the active state first and then make it visible.
     _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive);
     _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
-    [self _updateWindowVisibility];
 }
 
 - (void)_windowDidChangeBackingProperties:(NSNotification *)notification
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to