[webkit-changes] [WebKit/WebKit] 08b992: Support moving a Web Extension tab to and from WIN...

Timothy Hatcher noreply at github.com
Wed Feb 28 19:02:08 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 08b9923002071e6d00a4a90607710fa07b61676d
      https://github.com/WebKit/WebKit/commit/08b9923002071e6d00a4a90607710fa07b61676d
  Author: Timothy Hatcher <timothy at apple.com>
  Date:   2024-02-28 (Wed, 28 Feb 2024)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionContext.h
    M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionContext.mm
    M Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionController.h
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
    M Source/WebKit/UIProcess/Extensions/WebExtensionContext.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm
    M Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.h
    M Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.mm

  Log Message:
  -----------
  Support moving a Web Extension tab to and from WINDOW_ID_NONE.
https://webkit.org/b/270260
rdar://123102191

Reviewed by Brian Weinstein.

Safari needs to move tabs to and from WINDOW_ID_NONE when switching Tab Groups.
The existing didMoveTab:fromIndex:inWindow: method needed updated to support this,
and properly fire the tabs events.

Updated existing testing support to allow assigning nil to a tab's window.

* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionContext.h:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionContext.mm:
(-[_WKWebExtensionContext didMoveTab:fromIndex:inWindow:]): Handle NSNotFound.
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionController.h:
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::didMoveTab): Enumerate all the possible move combos
when logging, and fire the appropriate events for for each possibility.
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPITabs.mm:
(TEST(WKWebExtensionAPITabs, DetachAndAttachToWindowIDNone)): Added.
(TEST(WKWebExtensionAPITabs, DetachAndAttachFromWindowIDNone)): Added.
* Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.h:
* Tools/TestWebKitAPI/cocoa/WebExtensionUtilities.mm:
(-[TestWebExtensionTab assignWindow:]): Added.
(-[TestWebExtensionTab setWindow:]): Added. Call didMoveTab:::.
(-[TestWebExtensionWindow removeTab:]): Added.
(-[TestWebExtensionWindow insertTab:atIndex:]): Added.
(-[TestWebExtensionWindow moveTab:toIndex:]): Use assignWindow:. And pass self
when the tab is moving in the same window.

Canonical link: https://commits.webkit.org/275476@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