Bug 187500

Summary: doAfterNextPresentationUpdate should not be called while content is hidden due to animated resize
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, ews-watchlist, simon.fraser, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
simon.fraser: review+
Patch
none
Patch none

Description Tim Horton 2018-07-09 18:01:23 PDT
doAfterNextPresentationUpdate should not be called while content is hidden due to animated resize
Comment 1 Tim Horton 2018-07-09 18:01:48 PDT
Created attachment 344649 [details]
Patch
Comment 2 EWS Watchlist 2018-07-09 18:03:37 PDT
Attachment 344649 [details] did not pass style-queue:


ERROR: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:350:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Simon Fraser (smfr) 2018-07-09 18:09:13 PDT
Comment on attachment 344649 [details]
Patch

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

> Source/WebKit/ChangeLog:14
> +        and asynchronously hide it when the resize/rotation is complete. This

"asynchronously hide" -> "asynchronously show"?

> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:6358
> +- (void)_internalDoAfterNextPresentationUpdate:(void (^)(void))updateBlock withoutWaitingForPainting:(BOOL)withoutWaitingForPainting withoutWaitingForAnimatedResize:(BOOL)withoutWaitingForAnimatedResize

The "without" BOOLs lead to hard to read code (imagine withoutWaitingForPainting:NO which is a double negative).

> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:6378
> +        if (!withoutWaitingForAnimatedResize && strongSelf->_dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing) {

Now I have to think about what !withoutWaitingForAnimatedResize means

> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:6394
> +    [self _internalDoAfterNextPresentationUpdate:updateBlock withoutWaitingForPainting:NO withoutWaitingForAnimatedResize:NO];

Arg
Comment 4 Tim Horton 2018-07-09 18:18:09 PDT
Comment on attachment 344649 [details]
Patch

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

>> Source/WebKit/ChangeLog:14
>> +        and asynchronously hide it when the resize/rotation is complete. This
> 
> "asynchronously hide" -> "asynchronously show"?

... yes

>> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:6358
>> +- (void)_internalDoAfterNextPresentationUpdate:(void (^)(void))updateBlock withoutWaitingForPainting:(BOOL)withoutWaitingForPainting withoutWaitingForAnimatedResize:(BOOL)withoutWaitingForAnimatedResize
> 
> The "without" BOOLs lead to hard to read code (imagine withoutWaitingForPainting:NO which is a double negative).

I know, but withoutWaitingForPainting is the name of the existing and used SPI :(
Comment 5 Tim Horton 2018-07-09 20:36:06 PDT
<rdar://problem/41294139>
Comment 6 Tim Horton 2018-07-09 22:45:49 PDT
Created attachment 344668 [details]
Patch
Comment 7 EWS Watchlist 2018-07-09 22:47:29 PDT
Attachment 344668 [details] did not pass style-queue:


ERROR: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:350:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Simon Fraser (smfr) 2018-07-10 13:45:35 PDT
Comment on attachment 344649 [details]
Patch

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

> Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:456
> +- (void)_doAfterNextPresentationUpdateWithoutWaitingForAnimatedResize:(void (^)(void))updateBlock WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));

For testing?
Comment 9 Tim Horton 2018-07-10 13:50:13 PDT
Created attachment 344719 [details]
Patch
Comment 10 EWS Watchlist 2018-07-10 13:53:14 PDT
Attachment 344719 [details] did not pass style-queue:


ERROR: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:350:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 WebKit Commit Bot 2018-07-10 14:29:31 PDT
Comment on attachment 344719 [details]
Patch

Clearing flags on attachment: 344719

Committed r233698: <https://trac.webkit.org/changeset/233698>
Comment 12 WebKit Commit Bot 2018-07-10 14:29:33 PDT
All reviewed patches have been landed.  Closing bug.