Bug 165697 - Fullscreen in WebKit2 does not restore topContentInset upon exiting; leaves top of page not visible
Summary: Fullscreen in WebKit2 does not restore topContentInset upon exiting; leaves t...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-12-09 15:58 PST by Jer Noble
Modified: 2017-01-03 00:51 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.51 KB, patch)
2016-12-09 15:59 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (8.48 KB, patch)
2016-12-12 11:08 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (8.52 KB, patch)
2016-12-12 14:49 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (7.50 KB, patch)
2016-12-12 16:52 PST, Jer Noble
thorton: review+
Details | Formatted Diff | Diff
Patch for landing (7.26 KB, patch)
2016-12-13 10:28 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (7.25 KB, patch)
2016-12-13 10:33 PST, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2016-12-09 15:58:47 PST
Fullscreen in WebKit2 does not restore topContentInset upon exiting; leaves top of page not visible
Comment 1 Jer Noble 2016-12-09 15:59:23 PST
Created attachment 296729 [details]
Patch
Comment 2 Darin Adler 2016-12-09 21:15:36 PST
Comment on attachment 296729 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=296729&action=review

No way to regression-test?

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:421
> +    _page->setTopContentInset(_savedTopContentInset);

Can we make this share some code? At least three lines of this code are identical to part of finishedEnterFullScreenAnimation: and all five lines are the same although for some reason they are not in the same order here and there.

We should make the two methods share as much as possible, to help us avoid bugs like this one.
Comment 3 Jer Noble 2016-12-12 11:08:03 PST
Created attachment 296935 [details]
Patch
Comment 4 Jer Noble 2016-12-12 14:49:51 PST
Created attachment 296952 [details]
Patch
Comment 5 Tim Horton 2016-12-12 15:35:14 PST
Comment on attachment 296952 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=296952&action=review

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:521
> +    if ([_webView isKindOfClass:[WKWebView class]]) {

This should go through PageClient and be implemented in WebViewImpl for Mac.
Comment 6 Jer Noble 2016-12-12 15:39:34 PST
(In reply to comment #5)
> Comment on attachment 296952 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=296952&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:521
> > +    if ([_webView isKindOfClass:[WKWebView class]]) {
> 
> This should go through PageClient and be implemented in WebViewImpl for Mac.

Tim told me (in person) to ignore the fact he said this.
Comment 7 Jer Noble 2016-12-12 16:52:40 PST
Created attachment 296970 [details]
Patch
Comment 8 Tim Horton 2016-12-13 10:24:50 PST
Comment on attachment 296970 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=296970&action=review

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h:63
> +    bool _savedAutomaticallyAdjustsContentInsets;

Don't think you use this anymore?

> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenTopContentInset.mm:61
> +    [webView _setAutomaticallyAdjustsContentInsets:NO];

Do you still need this? I don't think it's on by default, is it?
Comment 9 Jer Noble 2016-12-13 10:26:21 PST
(In reply to comment #8)
> Comment on attachment 296970 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=296970&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.h:63
> > +    bool _savedAutomaticallyAdjustsContentInsets;
> 
> Don't think you use this anymore?

Good point.

> > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenTopContentInset.mm:61
> > +    [webView _setAutomaticallyAdjustsContentInsets:NO];
> 
> Do you still need this? I don't think it's on by default, is it?

It is on Mac.

Thanks!
Comment 10 Jer Noble 2016-12-13 10:28:57 PST
Created attachment 297020 [details]
Patch for landing
Comment 11 Jer Noble 2016-12-13 10:33:43 PST
Created attachment 297022 [details]
Patch for landing
Comment 12 Jon Lee 2016-12-13 10:37:22 PST
rdar://problem/27954473
Comment 13 WebKit Commit Bot 2016-12-13 15:37:50 PST
Comment on attachment 297022 [details]
Patch for landing

Clearing flags on attachment: 297022

Committed r209782: <http://trac.webkit.org/changeset/209782>