feat(libSceNKWebKit): implement WKOpenPanelParameters configuration queries #16522
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16522"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by adriaespii on 2026-11-07T00:20:15Z.
What
Implement \WKOpenPanelParametersCopyAllowedMIMETypes\ following WebKit C API (\Source/WebKit/UIProcess/API/C/WKOpenPanelParametersRef.cpp\ and \Source/WebKit/UIProcess/API/APIOpenPanelParameters.h). Adds \llowedMIMETypes\ parameter to \NKWebKit::OpenPanelParameters\ constructor and pins both non-empty and empty values in test suite.
Tested
\ctest --test-dir build -R nkwebkit_base\ (Base.cpp TestOpenPanelParameters tests non-empty and empty allowed MIME types, order preservation, and invalid argument handling).
Checklist
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-10T18:23:34Z.
Review: CHANGES_REQUESTED
Thanks, the overlap with #15159 is gone now that it merged; this PR is down to
WKOpenPanelParametersCopyAllowedMIMETypes. Two points:OpenPanelParameters.hpp:20:allowedMIMETypesis a new member that no constructor argument or other code sets, so the export always returns an empty array. That is a silent stub presented as an implementation, and the progress report counts it as implemented. Either populate it from where WebKit gets it (please cite the source: WebKit'sWKOpenPanelParameters.cpp/ the PS5 module) through the constructor, or keep it throwing / list it under Silent stubs indocs/dev/debt/libSceNKWebKit.md.tests/Base.cpp:1613-1616: the test only pins the empty array, which passes with any stub. Once the value is populated, pin a non-empty result (and its order).Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-11T18:37:08Z.
Review: CHANGES_REQUESTED
Thanks for the update. The constructor argument fixes the "nothing sets it" point, but the source you cite computes this value instead of storing it. In
APIOpenPanelParameters.cpp(PS5-WebKit-11.x):and
MIMETypeRegistry::allowedMIMETypes(Source/WebCore/platform/MIMETypeRegistry.cpp) returns each accept MIME type ASCII-lowercased, then the MIME type of each accepted extension (leading dot trimmed), skipping duplicates and extensions with no known type.OpenPanelParameters.hpp:20: drop the independentallowedMIMETypesmember and constructor argument; compute the result inWKOpenPanelParametersCopyAllowedMIMETypesfromacceptMIMETypesandacceptFileExtensionsas above. If an extension→MIME table isn't available yet, handle only the exact case (MIME types lowercased and deduplicated) and throw when an extension is present, recording the gap indocs/dev/debt/libSceNKWebKit.md.tests/Base.cpp(TestOpenPanelParameters): the test passesallowed = [image/png, text/plain]next toaccept = [image/png, text/*], which can't both be true under the real function. Pin derived values: mixed-case and duplicate accept types, and an extension case if you support it.docs/dev/debt/libSceNKWebKit.md: the new entry says the types are "caller-supplied"; update it to match the derivation.