[webkit-changes] [WebKit/WebKit] d1de4e: Paths in browser.action.setIcon should be relative.

Timothy Hatcher noreply at github.com
Wed Mar 27 07:21:43 PDT 2024


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

  Changed paths:
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm
    M Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIActionCocoa.mm
    M Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIAction.h
    M Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIAction.idl
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAction.mm

  Log Message:
  -----------
  Paths in browser.action.setIcon should be relative.
https://webkit.org/b/271739
rdar://125436223

Reviewed by Brian Weinstein.

Resolve the path passed to action.setIcon() as relative to the current document.

* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm:
(WebKit::WebExtensionAction::icon): If custom icons fail, fallback to the default icons.
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIActionCocoa.mm:
(WebKit::WebExtensionAPIAction::setIcon): Resolve paths as relative against the frame's URL,
unless it is a data URL.
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIAction.h:
* Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIAction.idl:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAction.mm:
(TEST(WKWebExtensionAPIAction, SetIconSinglePathRelative)): Added.
(TEST(WKWebExtensionAPIAction, SetIconMultipleSizesRelative)): Added.

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