feat(libSceNKWebKit): implement WKOpenPanelParameters configuration queries #16522

Merged
adriaespii merged 2 commits from upstream-pr/16522 into main 2026-11-11 23:37:32 +00:00
adriaespii commented 2026-11-07 00:20:15 +00:00 (Migrated from github.com)

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

  • Based on current \main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (\NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md\ files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5196679190 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16522). Originally posted by [adriaespii](https://github.com/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 <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current \main\; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (\NotImplemented_nid_no_patch\); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation \.md\ files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
adriadam10 commented 2026-11-10 18:23:34 +00:00 (Migrated from github.com)

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: allowedMIMETypes is 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's WKOpenPanelParameters.cpp / the PS5 module) through the constructor, or keep it throwing / list it under Silent stubs in docs/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).
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5847153782 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16522#pullrequestreview-5847153782). Originally posted by [adriadam10](https://github.com/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`: `allowedMIMETypes` is 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's `WKOpenPanelParameters.cpp` / the PS5 module) through the constructor, or keep it throwing / list it under Silent stubs in `docs/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).
adriadam10 commented 2026-11-11 18:37:08 +00:00 (Migrated from github.com)

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):

Ref<API::Array> OpenPanelParameters::allowedMIMETypes() const
{
    return API::Array::createStringArray(WebCore::MIMETypeRegistry::allowedMIMETypes(m_settings.acceptMIMETypes, m_settings.acceptFileExtensions));
}

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 independent allowedMIMETypes member and constructor argument; compute the result in WKOpenPanelParametersCopyAllowedMIMETypes from acceptMIMETypes and acceptFileExtensions as 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 in docs/dev/debt/libSceNKWebKit.md.
  • tests/Base.cpp (TestOpenPanelParameters): the test passes allowed = [image/png, text/plain] next to accept = [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.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5863709202 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16522#pullrequestreview-5863709202). Originally posted by [adriadam10](https://github.com/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): ```cpp Ref<API::Array> OpenPanelParameters::allowedMIMETypes() const { return API::Array::createStringArray(WebCore::MIMETypeRegistry::allowedMIMETypes(m_settings.acceptMIMETypes, m_settings.acceptFileExtensions)); } ``` 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 independent `allowedMIMETypes` member and constructor argument; compute the result in `WKOpenPanelParametersCopyAllowedMIMETypes` from `acceptMIMETypes` and `acceptFileExtensions` as 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 in `docs/dev/debt/libSceNKWebKit.md`. - `tests/Base.cpp` (`TestOpenPanelParameters`): the test passes `allowed = [image/png, text/plain]` next to `accept = [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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!16522
No description provided.