-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for icon_variants and variants in menus and action APIs for Web Extensions. #33130
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EWS run on previous version of this PR (hash 313c248) |
xeenon
requested review from
davidjohnson91,
AriYoung00,
elijahsawyers,
jeffmapple and
kiaraarose
September 4, 2024 19:36
EWS run on previous version of this PR (hash 67d59ed) |
EWS run on previous version of this PR (hash 3c878d8) |
b-weinstein
reviewed
Sep 5, 2024
Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIActionCocoa.mm
Outdated
Show resolved
Hide resolved
b-weinstein
approved these changes
Sep 5, 2024
EWS run on current version of this PR (hash 95477d9)
|
xeenon
added
the
unsafe-merge-queue
Applied to send a pull request to merge-queue, but skip building and testing
label
Sep 5, 2024
…or Web Extensions. https://webkit.org/b/279135 rdar://problem/134885372 Reviewed by Brian Weinstein. Add support for the `icons_variants` key in `menus.create()` and `menus.update()`. Also add support for `variants` key in `action.setIcon()`. Proposal: https://github.com/w3c/webextensions/blob/main/proposals/dark_mode_extension_icons.md WECG issue: w3c/webextensions#229 * Source/WebKit/Shared/Extensions/WebExtensionMenuItem.serialization.in: * Source/WebKit/Shared/Extensions/WebExtensionMenuItemParameters.h: * Source/WebKit/UIProcess/Extensions/Cocoa/API/WebExtensionContextAPIActionCocoa.mm: (WebKit::WebExtensionContext::actionSetIcon): * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionActionCocoa.mm: (WebKit::WebExtensionAction::clearCustomizations): (WebKit::WebExtensionAction::icon): (WebKit::WebExtensionAction::setIcons): (WebKit::WebExtensionAction::setIconVariants): (WebKit::WebExtensionAction::clearIconCache): (WebKit::WebExtensionAction::setIconsDictionary): Deleted. * Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionMenuItemCocoa.mm: (WebKit::WebExtensionMenuItem::WebExtensionMenuItem): (WebKit::WebExtensionMenuItem::minimalParameters const): (WebKit::WebExtensionMenuItem::update): (WebKit::WebExtensionMenuItem::icon const): (WebKit::WebExtensionMenuItem::clearIconCache const): * Source/WebKit/UIProcess/Extensions/WebExtensionAction.h: * Source/WebKit/UIProcess/Extensions/WebExtensionContext.h: * Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in: * Source/WebKit/UIProcess/Extensions/WebExtensionMenuItem.h: * Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIActionCocoa.mm: (WebKit::WebExtensionAPIAction::isValidDimensionKey): (WebKit::WebExtensionAPIAction::parseIconPath): (WebKit::WebExtensionAPIAction::parseIconPathsDictionary): (WebKit::WebExtensionAPIAction::parseIconImageDataDictionary): (WebKit::WebExtensionAPIAction::parseIconVariants): (WebKit::WebExtensionAPIAction::setIcon): * Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIMenusCocoa.mm: (WebKit::WebExtensionAPIMenus::parseCreateAndUpdateProperties): (WebKit::WebExtensionAPIMenus::createMenu): (WebKit::WebExtensionAPIMenus::update): * Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIAction.h: * Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIMenus.h: * Source/WebKit/WebProcess/Extensions/Bindings/Scripts/CodeGeneratorExtensions.pm: (_generateImplementationFile): * Source/WebKit/WebProcess/Extensions/Interfaces/WebExtensionAPIMenus.idl: * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIAction.mm: (TestWebKitAPI::TEST(WKWebExtensionAPIAction, SetIconWithDataURL)): Renamed. (TestWebKitAPI::TEST(WKWebExtensionAPIAction, SetIconWithVariants)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIAction, SetIconWithImageDataAndVariants)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIAction, SetIconThrowsWithNoValidVariants)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIAction, SetIconWithMixedValidAndInvalidVariants)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIAction, SetIconWithAnySizeVariantAndSVGDataURL)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIAction, SetIconWithSVGDataURL)): Deleted. * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIMenus.mm: (TestWebKitAPI::TEST(WKWebExtensionAPIMenus, Errors)): Fixed expectations. (TestWebKitAPI::TEST(WKWebExtensionAPIMenus, MenuItemWithIconVariants)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIMenus, MenuItemWithImageDataVariants)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIMenus, MenuItemWithWithNoValidVariants)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIMenus, MenuItemWithMixedValidAndInvalidIconVariants)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIMenus, MenuItemWithAnySizeVariantAndSVGDataURL)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIMenus, UpdateMenuItemWithIconVariants)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIMenus, ClearMenuItemIconVariantsWithNull)): Added. (TestWebKitAPI::TEST(WKWebExtensionAPIMenus, ClearMenuItemIconVariantsWithEmpty)): Added. Canonical link: https://commits.webkit.org/283219@main
webkit-commit-queue
force-pushed
the
bug/279135
branch
from
September 5, 2024 17:34
95477d9
to
ad1823e
Compare
Committed 283219@main (ad1823e): https://commits.webkit.org/283219@main Reviewed commits have been landed. Closing PR #33130 and removing active labels. |
webkit-commit-queue
removed
the
unsafe-merge-queue
Applied to send a pull request to merge-queue, but skip building and testing
label
Sep 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ad1823e
95477d9
🛠 ios🛠 mac🛠 wpe🛠 ios-sim🛠 mac-AS-debug🧪 wpe-wk2🧪 wincairo-tests🧪 ios-wk2🧪 api-mac🧪 api-wpe🧪 ios-wk2-wpt🧪 mac-wk1🧪 api-ios🧪 mac-wk2🛠 gtk🛠 vision🧪 mac-AS-debug-wk2🧪 gtk-wk2🛠 vision-sim🧪 mac-wk2-stress🧪 api-gtk🧪 mac-intel-wk2🛠 tv🛠 tv-sim🛠 watch🛠 watch-sim