Bug 184210 - REGRESSION (r229828): web view doesn’t update or respond to resizing until client calls policy decision handler
Summary: REGRESSION (r229828): web view doesn’t update or respond to resizing until cl...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar, Regression
Depends on:
Blocks: 183787
  Show dependency treegraph
 
Reported: 2018-03-31 01:09 PDT by mitz
Modified: 2018-04-20 18:55 PDT (History)
8 users (show)

See Also:


Attachments
Patch (13.14 KB, patch)
2018-04-20 14:19 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (13.13 KB, patch)
2018-04-20 17:04 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (13.12 KB, patch)
2018-04-20 17:06 PDT, Chris Dumez
wenson_hsieh: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2018-03-31 01:09:41 PDT
In TOT (r230129), WKWebView isn’t updating and responding to resizing between when it calls -webView:decidePolicyForNavigationAction:decisionHandler: and when the client calls the decision handler. To see the bug, build and run attachment 336921 [details]. Click the WebKit link in the window and observe that as long as the sheet is up, the link remains red, the seconds counter isn’t updating, and resizing the window doesn’t cause the yellow rectangle to resize to fit the new width.

Compare to the correct behavior with built-in WebKit in macOS 10.13.4, where the link reverts to inactive color, the numbers keep updating, and the rectangle follows along as the window is resized.
Comment 1 Radar WebKit Bug Importer 2018-03-31 08:52:16 PDT
<rdar://problem/39072354>
Comment 2 Chris Dumez 2018-03-31 08:59:02 PDT
Yes, I caused this by freezing the layer tree during the navigation policy decision.
This change was made to make the async code path more like the old sync code path. Several API tests started failing on iOS when we moved everybody over to the async policy code path. The reason for those failures is that the view would now do an initial layer tree commit for about:blank even though it was navigated to a test page as soon as it was created. This confused the tests which were getting temporarily a blank view and doing things like snapshots.

If it is not acceptable freeze the layer tree during this policy decision then we’ll need to find another solution to make those API tests happy. I thought it was would acceptable because the policy decision is normally quick as most clients respond right away.
Comment 3 Chris Dumez 2018-03-31 09:01:13 PDT
Caused by fix for https://bugs.webkit.org/show_bug.cgi?id=183787
Comment 4 Chris Dumez 2018-04-19 16:44:40 PDT
API tests that were failing on iOS without r229828:
>   DataInteractionTests.AdditionalLinkAndImageIntoContentEditable
>   DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
>   DataInteractionTests.DoNotCrashWhenSelectionMovesOffscreenAfterDragStart
>   DataInteractionTests.DragEventClientCoordinatesBasic
>   DataInteractionTests.DragImageFromContentEditable
>   DataInteractionTests.DragLiftPreviewDataTransferSetDragImage
>   DataInteractionTests.ImageDoesNotUseElementSizeAsEstimatedSize
>   DataInteractionTests.ImageToContentEditable
>   DataInteractionTests.ImageToTextarea
>   DataInteractionTests.InjectedBundleAttachmentElementData
>   DataInteractionTests.InjectedBundleImageElementData
>   DataInteractionTests.LargeImageToTargetDiv
>   ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash
>   WKWebView.SnapshotImageLargeAsyncDecoding

So we need to find an alternative to r229828 and make sure those API tests still pass on iOS.
Comment 5 Chris Dumez 2018-04-20 14:19:37 PDT
Created attachment 338460 [details]
Patch
Comment 6 Chris Dumez 2018-04-20 17:04:50 PDT
Created attachment 338495 [details]
Patch
Comment 7 Chris Dumez 2018-04-20 17:06:13 PDT
Created attachment 338497 [details]
Patch
Comment 8 Wenson Hsieh 2018-04-20 17:08:47 PDT
Comment on attachment 338497 [details]
Patch

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

> Source/WebCore/ChangeLog:13
> +        To address the issue, this patch revers r229828 and instead updates the iOS

Nit - s/revers/reverts

> Source/WebKit/ChangeLog:13
> +        To address the issue, this patch revers r229828 and instead updates the iOS

Nit - s/revers/reverts
Comment 9 Chris Dumez 2018-04-20 18:55:40 PDT
Committed r230876: <https://trac.webkit.org/changeset/230876>