Skip to content

Conversation

@xeenon
Copy link
Contributor

@xeenon xeenon commented Nov 15, 2023

5effaab

Regression(270725@main) Many Web extensions API tests are crashing
https://webkit.org/b/264885
rdar://problem/118464397

Reviewed by Chris Dumez.

Remove the None and All values from Web Extension OptionSet enums, and use new OptionSet::all()
instead to get a valid OptionSet for the given enum.

Add back the EnumTraits for the OptionSets, since GeneratedSerializers does not generate them,
and they are needed by OptionSet to check valid values.

* Source/WTF/wtf/OptionSet.h:
(WTF::OptionSet::all): Added.
* Source/WebKit/Shared/Extensions/WebExtensionWindow.serialization.in:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionContext.mm:
(toImpl):
* Source/WebKit/UIProcess/Extensions/WebExtensionTab.h:
* Source/WebKit/UIProcess/Extensions/WebExtensionWindow.h:
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWindowsCocoa.mm:
(WebKit::WebExtensionAPIWindows::parseWindowTypesFilter):
(WebKit::toWindowTypeFilter):
(WebKit::WebExtensionContextProxy::dispatchWindowsEvent):
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWindowsEventCocoa.mm:
(WebKit::WebExtensionAPIWindowsEvent::invokeListenersWithArgument):
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIWindowsEvent.h:

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

bd4eb2d

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style 🛠 ios 🛠 mac 🛠 wpe 🛠 wincairo
🛠 ios-sim 🛠 mac-AS-debug 🧪 wpe-wk2
✅ 🧪 webkitperl 🧪 ios-wk2 🧪 api-mac 🛠 gtk
🧪 ios-wk2-wpt 🧪 mac-wk1 🧪 gtk-wk2
🛠 🧪 jsc 🧪 api-ios 🧪 mac-wk2 🧪 api-gtk
🛠 🧪 jsc-arm64 🛠 tv 🧪 mac-AS-debug-wk2 🛠 jsc-armv7
🛠 tv-sim 🧪 mac-wk2-stress 🧪 jsc-armv7-tests
🛠 watch
✅ 🛠 🧪 unsafe-merge 🛠 watch-sim

@xeenon xeenon self-assigned this Nov 15, 2023
@xeenon xeenon added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Nov 15, 2023
@xeenon xeenon changed the title REGRESSION (270722@main): [ macOS Debug ] Multiple TestWebKitAPI.WKWebExtension tests are failing Regression(270725@main) Many Web extensions API tests are crashing Nov 15, 2023
@xeenon xeenon added WebKit Extensions Bugs related to extension support. and removed New Bugs Unclassified bugs are placed in this component until the correct component can be determined. labels Nov 15, 2023
@webkit-early-warning-system
Copy link
Collaborator

Starting EWS tests for b428bfd. Live statuses available at the PR page, #20548

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks risky. It is setting all the bits, including the ones that don't have a valid enum value.

I could see how this function might return incorrect result as a result:

    constexpr bool containsAll(OptionSet optionSet) const
    {
        return (*this & optionSet) == optionSet;
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fromRaw makes the input to only valid options. return OptionSet(static_cast<E>(maskRawValue<E>(rawValue)), FromRawValue);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I had missed that 👍🏻

Copy link
Contributor

@cdumez cdumez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xeenon xeenon added unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing and removed unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing labels Nov 15, 2023
@xeenon xeenon added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 15, 2023
https://webkit.org/b/264885
rdar://problem/118464397

Reviewed by Chris Dumez.

Remove the None and All values from Web Extension OptionSet enums, and use new OptionSet::all()
instead to get a valid OptionSet for the given enum.

Add back the EnumTraits for the OptionSets, since GeneratedSerializers does not generate them,
and they are needed by OptionSet to check valid values.

* Source/WTF/wtf/OptionSet.h:
(WTF::OptionSet::all): Added.
* Source/WebKit/Shared/Extensions/WebExtensionWindow.serialization.in:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebExtensionContext.mm:
(toImpl):
* Source/WebKit/UIProcess/Extensions/WebExtensionTab.h:
* Source/WebKit/UIProcess/Extensions/WebExtensionWindow.h:
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWindowsCocoa.mm:
(WebKit::WebExtensionAPIWindows::parseWindowTypesFilter):
(WebKit::toWindowTypeFilter):
(WebKit::WebExtensionContextProxy::dispatchWindowsEvent):
* Source/WebKit/WebProcess/Extensions/API/Cocoa/WebExtensionAPIWindowsEventCocoa.mm:
(WebKit::WebExtensionAPIWindowsEvent::invokeListenersWithArgument):
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIWindowsEvent.h:

Canonical link: https://commits.webkit.org/270782@main
@webkit-commit-queue
Copy link
Collaborator

Committed 270782@main (5effaab): https://commits.webkit.org/270782@main

Reviewed commits have been landed. Closing PR #20548 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 5effaab into WebKit:main Nov 15, 2023
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 15, 2023
@xeenon xeenon deleted the bug/264884 branch November 15, 2023 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebKit Extensions Bugs related to extension support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants