Changeset 201405 in webkit
- Timestamp:
- May 25, 2016 3:07:17 PM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r201398 r201405 1 2016-05-25 Jer Noble <jer.noble@apple.com> 2 3 Flashiness and jumpiness when entering fullscreen 4 https://bugs.webkit.org/show_bug.cgi?id=158087 5 6 Reviewed by Beth Dakin. 7 8 Multiple independant sources of jumpiness and flashiness are addressed here: 9 10 - Setting the top content inset on the WKView cause a vertical jump during fullscreen 11 transition. Instead of setting the content inset to 0, take the existing inset into account 12 when placing the WKView in the NSWindow. 13 14 - The enter fullscreen transition causes a white flash due to the NSWindow needing 15 display before ordering onscreen. Ensure the window has a backing by calling -displayIfNeeded 16 before entering fullscreen mode. 17 18 - The exit fullscreen transition causes a white background color flash for an unknown 19 reason, but is solved by not making the window's content view layer-backed. Rather than 20 directly animating the contentView's background color, create a specific background view 21 and animate it's background color instead. 22 23 * UIProcess/mac/WKFullScreenWindowController.h: 24 * UIProcess/mac/WKFullScreenWindowController.mm: 25 (-[WKFullScreenWindowController initWithWindow:webView:page:]): 26 (-[WKFullScreenWindowController enterFullScreen:]): 27 (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): 28 (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): 29 (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): 30 (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): 31 * WebProcess/FullScreen/WebFullScreenManager.cpp: 32 (WebKit::WebFullScreenManager::saveScrollPosition): Deleted. 33 (WebKit::WebFullScreenManager::restoreScrollPosition): Deleted. 34 1 35 2016-05-25 Alex Christensen <achristensen@webkit.org> 2 36 -
trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h
r191320 r201405 50 50 RetainPtr<WebCoreFullScreenPlaceholderView> _webViewPlaceholder; 51 51 RetainPtr<NSView> _clipView; 52 RetainPtr<NSView> _backgroundView; 52 53 NSRect _initialFrame; 53 54 NSRect _finalFrame; -
trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm
r200862 r201405 95 95 96 96 NSView *contentView = [window contentView]; 97 contentView.wantsLayer = YES; 98 contentView.layer.hidden = YES; 97 contentView.hidden = YES; 99 98 contentView.autoresizesSubviews = YES; 99 100 _backgroundView = adoptNS([[NSView alloc] initWithFrame:contentView.bounds]); 101 _backgroundView.get().layer = [CALayer layer]; 102 _backgroundView.get().wantsLayer = YES; 103 _backgroundView.get().autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; 104 [contentView addSubview:_backgroundView.get()]; 100 105 101 106 _clipView = adoptNS([[NSView alloc] initWithFrame:contentView.bounds]); 102 107 [_clipView setWantsLayer:YES]; 103 108 [_clipView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; 104 [ contentView addSubview:_clipView.get()];109 [_backgroundView addSubview:_clipView.get()]; 105 110 106 111 [self windowDidLoad]; 112 [window displayIfNeeded]; 107 113 _webView = webView; 108 114 _page = &page; … … 235 241 NSView *contentView = [[self window] contentView]; 236 242 [_clipView addSubview:_webView positioned:NSWindowBelow relativeTo:nil]; 237 [_webView setFrame:[contentView bounds]];243 _webView.frame = NSInsetRect(contentView.bounds, 0, -_page->topContentInset()); 238 244 239 245 makeResponderFirstResponderIfDescendantOfView(self.window, webWindowFirstResponder, _webView); … … 273 279 [self _manager]->setAnimatingFullScreen(false); 274 280 275 NSView *contentView = [[self window] contentView]; 276 [contentView.layer removeAllAnimations]; 281 [_backgroundView.get().layer removeAllAnimations]; 277 282 [[_clipView layer] removeAllAnimations]; 278 283 [[_clipView layer] setMask:nil]; … … 370 375 [[self window] orderOut:self]; 371 376 NSView *contentView = [[self window] contentView]; 372 contentView.layer.hidden = YES; 377 contentView.hidden = YES; 378 [_backgroundView.get().layer removeAllAnimations]; 373 379 [[_webViewPlaceholder window] setAutodisplay:NO]; 374 380 … … 577 583 [_clipView layer].mask = maskLayer; 578 584 579 contentView. layer.hidden = NO;580 [ contentView.layer addAnimation:fadeAnimation(duration, AnimateIn) forKey:@"fullscreen"];585 contentView.hidden = NO; 586 [_backgroundView.get().layer addAnimation:fadeAnimation(duration, AnimateIn) forKey:@"fullscreen"]; 581 587 582 588 NSWindow* window = [self window]; … … 606 612 607 613 NSView* contentView = [[self window] contentView]; 608 contentView. layer.hidden = NO;609 [ contentView.layer addAnimation:fadeAnimation(duration, AnimateOut) forKey:@"fullscreen"];614 contentView.hidden = NO; 615 [_backgroundView.get().layer addAnimation:fadeAnimation(duration, AnimateOut) forKey:@"fullscreen"]; 610 616 611 617 _page->setSuppressVisibilityUpdates(false); -
trunk/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
r185637 r201405 158 158 { 159 159 m_scrollPosition = m_page->corePage()->mainFrame().view()->scrollPosition(); 160 m_topContentInset = m_page->corePage()->topContentInset();161 m_page->corePage()->setTopContentInset(0);162 160 } 163 161 164 162 void WebFullScreenManager::restoreScrollPosition() 165 163 { 166 m_page->corePage()->setTopContentInset(m_topContentInset);167 164 m_page->corePage()->mainFrame().view()->setScrollPosition(m_scrollPosition); 168 165 }
Note: See TracChangeset
for help on using the changeset viewer.