[webkit-changes] [WebKit/WebKit] 3fd749: REGRESSION (275819 at main): 5 Tests in TestWebKitAPI...

Timothy Hatcher noreply at github.com
Thu Mar 21 13:01:12 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3fd7495076360b9c977af182f895ac3c1a62eaaf
      https://github.com/WebKit/WebKit/commit/3fd7495076360b9c977af182f895ac3c1a62eaaf
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-03-21 (Thu, 21 Mar 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
    M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h

  Log Message:
  -----------
  REGRESSION (275819 at main): 5 Tests in TestWebKitAPI.WKWebExtensionAPIWebRequest sometimes timeout (270812).
https://webkit.org/b/271392
rdar://124401551

Reviewed by Brian Weinstein.

Change from using webView:didFinishNavigation: to _webView:navigationDidFinishDocumentLoad: for
tracking when the background page has finished loading. This will properly fire after modules have
executed, or any async script elements in a custom background page.

This allows us to remove the arbitrary delay we had before, which was wholly inadequate across different
machines, and was firing too soon for slow machines. By waiting for the document load, we know any
background content event listeners will be registered and can properly dispatch events.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(-[_WKWebExtensionContextDelegate _webView:navigationDidFinishDocumentLoad:]): Added.
(WebKit::WebExtensionContext::performTasksAfterBackgroundContentLoads): Removed dispatch_after().
(WebKit::WebExtensionContext::didFinishDocumentLoad):
(-[_WKWebExtensionContextDelegate webView:didFinishNavigation:]): Deleted.
(WebKit::WebExtensionContext::didFinishNavigation): Deleted.
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:

Canonical link: https://commits.webkit.org/276487@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list