WebKit Bugzilla
Attachment 357472 Details for
Bug 192774
: Flicker when exiting element fullscreen.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192774-20181217134047.patch (text/plain), 6.63 KB, created by
Jeremy Jones
on 2018-12-17 13:40:47 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jeremy Jones
Created:
2018-12-17 13:40:47 PST
Size:
6.63 KB
patch
obsolete
>Subversion Revision: 238527 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 659f6fd4b4137859088bc260824cc60ca07ff2c0..0fb554e1c09ca9a86e289ed719fb89ccf6b5b3e3 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2018-12-17 Jeremy Jones <jeremyj@apple.com> >+ >+ Flicker when exiting element fullscreen. >+ https://bugs.webkit.org/show_bug.cgi?id=192774 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fixes an issue where the web page would flicker upon exiting elemnent fullscreen. >+ >+ Replace WebView with a snapshot while the WebView is restyled and resized for inline. >+ >+ * UIProcess/mac/WKFullScreenWindowController.h: >+ * UIProcess/mac/WKFullScreenWindowController.mm: >+ (-[WKFullScreenWindowController initWithWindow:webView:page:]): >+ (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): >+ (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): >+ > 2018-11-26 Alex Christensen <achristensen@webkit.org> > > Rename WKWebView._safeBrowsingWarningForTesting to _safeBrowsingWarning to use it for more than testing >diff --git a/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.h b/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.h >index 33c58e78d0e5d763aa2eba882fa3fc996987d261..4336c250854a849f6f016a6a1841d07bd264551f 100644 >--- a/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.h >+++ b/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.h >@@ -48,6 +48,7 @@ typedef enum FullScreenState : NSInteger FullScreenState; > NSView *_webView; // Cannot be retained, see <rdar://problem/14884666>. > WebKit::WebPageProxy* _page; > RetainPtr<WebCoreFullScreenPlaceholderView> _webViewPlaceholder; >+ RetainPtr<NSView> _exitPlaceholder; > RetainPtr<NSView> _clipView; > RetainPtr<NSView> _backgroundView; > NSRect _initialFrame; >diff --git a/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm b/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm >index 10668e62623409f1a4605b42d3886423f73c8a1a..8ae643368779cf1971159e8b312ad63499ad7025 100644 >--- a/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm >+++ b/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm >@@ -140,6 +140,12 @@ - (id)initWithWindow:(NSWindow *)window webView:(NSView *)webView page:(WebKit:: > [_clipView setWantsLayer:YES]; > [_clipView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; > [_backgroundView addSubview:_clipView.get()]; >+ >+ _exitPlaceholder = adoptNS([[NSView alloc] initWithFrame:[_webView frame]]); >+ [_exitPlaceholder setWantsLayer: YES]; >+ [_exitPlaceholder setAutoresizesSubviews: YES]; >+ [_exitPlaceholder setLayerContentsPlacement: NSViewLayerContentsPlacementScaleProportionallyToFit]; >+ [_exitPlaceholder setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawNever]; > > [self windowDidLoad]; > [window displayIfNeeded]; >@@ -457,28 +463,34 @@ - (void)finishedExitFullScreenAnimation:(bool)completed > > NSResponder *firstResponder = [[self window] firstResponder]; > >- ALLOW_DEPRECATED_DECLARATIONS_BEGIN >- // Screen updates to be re-enabled in completeFinishExitFullScreenAnimationAfterRepaint. >- NSDisableScreenUpdates(); >- ALLOW_DEPRECATED_DECLARATIONS_END >- _page->setSuppressVisibilityUpdates(true); >- [[self window] orderOut:self]; >- NSView *contentView = [[self window] contentView]; >- contentView.hidden = YES; >+ [CATransaction begin]; >+ [CATransaction setDisableActions:YES]; >+ NSRect exitPlaceholderScreenRect = _initialFrame; >+ exitPlaceholderScreenRect.origin.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - NSMaxY(exitPlaceholderScreenRect); >+ RetainPtr<CGImageRef> webViewContents = adoptCF(CGWindowListCreateImage(NSRectToCGRect(exitPlaceholderScreenRect), kCGWindowListOptionIncludingWindow, [[_webView window] windowNumber], kCGWindowImageDefault)); >+ webViewContents = createImageWithCopiedData(webViewContents.get()); >+ [_exitPlaceholder setFrame:[_webView frame]]; >+ [[_exitPlaceholder layer] setContents:(__bridge id)webViewContents.get()]; >+ [[_webView superview] addSubview:_exitPlaceholder.get() positioned:NSWindowAbove relativeTo:_webView]; >+ [CATransaction commit]; >+ [CATransaction flush]; >+ >+ [CATransaction begin]; >+ [CATransaction setDisableActions:YES]; >+ > [_backgroundView.get().layer removeAllAnimations]; >- ALLOW_DEPRECATED_DECLARATIONS_BEGIN >- [[_webViewPlaceholder window] setAutodisplay:NO]; >- ALLOW_DEPRECATED_DECLARATIONS_END >+ _page->setSuppressVisibilityUpdates(true); >+ [_webView removeFromSuperview]; >+ [_webView setFrame:[_webViewPlaceholder frame]]; >+ [_webView setAutoresizingMask:[_webViewPlaceholder autoresizingMask]]; >+ [[_webViewPlaceholder superview] addSubview:_webView positioned:NSWindowBelow relativeTo:_webViewPlaceholder.get()]; > >- [self _replaceView:_webViewPlaceholder.get() with:_webView]; > BEGIN_BLOCK_OBJC_EXCEPTIONS > [NSLayoutConstraint activateConstraints:self.savedConstraints]; > END_BLOCK_OBJC_EXCEPTIONS > self.savedConstraints = nil; > makeResponderFirstResponderIfDescendantOfView(_webView.window, firstResponder, _webView); > >- [[_webView window] makeKeyAndOrderFront:self]; >- > // These messages must be sent after the swap or flashing will occur during forceRepaint: > [self _manager]->didExitFullScreen(); > [self _manager]->setAnimatingFullScreen(false); >@@ -496,19 +508,31 @@ - (void)finishedExitFullScreenAnimation:(bool)completed > [self completeFinishExitFullScreenAnimationAfterRepaint]; > }); > _page->forceRepaint(_repaintCallback.copyRef()); >+ >+ [CATransaction commit]; >+ [CATransaction flush]; > } > > - (void)completeFinishExitFullScreenAnimationAfterRepaint > { >+ [CATransaction begin]; >+ [CATransaction setDisableActions:YES]; >+ >+ [_webViewPlaceholder removeFromSuperview]; >+ [[self window] orderOut:self]; >+ NSView *contentView = [[self window] contentView]; >+ contentView.hidden = YES; >+ [_exitPlaceholder removeFromSuperview]; >+ [[_exitPlaceholder layer] setContents:nil]; >+ >+ [[_webView window] makeKeyAndOrderFront:self]; >+ _webViewPlaceholder = nil; >+ > _repaintCallback = nullptr; >- ALLOW_DEPRECATED_DECLARATIONS_BEGIN >- [[_webView window] setAutodisplay:YES]; >- ALLOW_DEPRECATED_DECLARATIONS_END >- [[_webView window] displayIfNeeded]; > _page->setSuppressVisibilityUpdates(false); >- ALLOW_DEPRECATED_DECLARATIONS_BEGIN >- NSEnableScreenUpdates(); >- ALLOW_DEPRECATED_DECLARATIONS_END >+ >+ [CATransaction commit]; >+ [CATransaction flush]; > } > > - (void)performClose:(id)sender
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192774
:
357472
|
357835
|
357877