feat(libSceNKWebKit): implement the WebCore::SettingsBase member exports #22903
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22903"
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 FinleyLaempe on 2026-11-18T13:34:08Z.
What
Implements 17
WebCore::SettingsBasemember exports in libSceNKWebKit — the sevenset*FontFamily(const WTF::AtomString&, UScriptCode)setters, the seven matching*FontFamily(UScriptCode)getters,setMinimumDOMTimerInterval(WTF::Seconds)and bothsetMediaContentTypesRequiringHardwareSupportoverloads — replacing theirNotImplementedstubs inExport.cpp.SettingsBase.cppandFontGenericFamilies.cpp, with the table hash and vector growth from pinnedHashTable.handVector.h. The newsrc/SettingsBase.cppcarries the upstream notices.fontGenericFamilies()at vtable slots 0 and 1 with the sevenHashMap<int, String>maps at offsets 0–48;WeakPtr<Page>at 8,Secondsat 16, a 48-byteTimer, and the media vector at 72, per the pinnedSettingsBase.hmember order, checked bystatic_asserts in the newsrc/SettingsBaseAbi.hpp. Not compared with a console module.NKWebKit::UserPrefersSimplifiedChinese_nid_no_patch(), then to script 0 (Common), else to the shared emptyString. Getters go through the const vtable slot.UserPrefersSimplifiedChinese_nid_no_patch(insrc/WtfLanguage.cpp) checks the preferred-languages override forzh-tw/zh-cnand otherwise readsSYSTEM_LANGUAGEas libScePosixForWebKit'sgetenv_npdoes, through a newGetenvNp_nid_no_patchhelper thatgetenv_npnow wraps (another library cannot import the NID-patchedgetenv_npexport on Windows); libScePosixForWebKit is newly linked as a private dependency inCMakeLists.txt; it recomputes on every call instead of caching, as the debt entry records.NotImplemented_nid_no_patchbefore touching the map, because the unmodelledFontCascadeCacheinvalidation and per-page style recalculation cannot run, and because upstream mutations with script -2 (the table's empty-bucket sentinel) corrupt the map's key count.setMinimumDOMTimerIntervalstores theSecondsvalue at offset 16 and throwsNotImplemented_nid_no_patchfirst when theWeakPtr<Page>at offset 8 is non-null, since the unmodelledadjustMinimumDOMTimerIntervalpage-frame walk cannot run.Stringmedia overload splits on':'skipping empty entries and appendsContentTypes into the storedWTF::Vectorwith the pinned growth policy; theVectoroverload shrinks or grows the stored vector and copy-assigns element-wise, with a self-assignment guard. Storage goes throughWTF::fastMalloc/fastFreeandWTF::StringImpl::create.this,AtomString,StringorVectorarguments throwstd::invalid_argumentbefore anything is modified; the tests cover each case. Reuses the existing_ZN3WTF5equalEPKNS_10StringImplES2_,StringImpl::createandfastMalloc/fastFreeexports, theWtfAbiString/AtomString/Vectorguest types andContentTypeAbi.hpp; new headerssrc/SettingsBaseAbi.hpp,src/WtfLanguageAbi.hppandinclude/SettingsBaseExports.hppare included fromlibSceNKWebKit.hpp.Export.cpp, the matching declarations are dropped frominclude/InventoryExports.hppandinclude/LegacyExports.hpp,src/WtfLanguage.cppgains the language helper,CMakeLists.txtlinks libScePosixForWebKit, and libScePosixForWebKit gains theGetenvNp_nid_no_patchhelper thatgetenv_npnow wraps.docs/dev/debt/changes/feat-nkwebkit-settings-base.mdadds three Functional entries (font family layout, font family changes, timer and media content types — each "not compared with a console module") and removes the ten NID inventory rows for the getters and the timer/media exports.tests/SettingsBase.cppexercises the exports against guest-layout stand-ins: argument checks, lookup fallbacks including Han and the sentinel scripts, the setter no-op/throw split, the page-null timer path and both media overloads.Tested
Arch Linux x86-64, GCC 16.2.1, Release build with
-DBUILD_TESTING=ON: the newnkwebkit_settingsbasetest and every othernkwebkit_*test, 143 of 143 passed.python3 tools/check_conventions.py --base upstream/mainpasses. Not tested on a console or on Windows.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-18T13:34:16Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T13:40:24Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
4109e891a8:tools/check_conventions.pypassed.nkwebkit_settingsbase_testsbuilt cleanly.nkwebkit_settingsbase):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/WtfLanguage.cpp,core/libs/prx/libSceNKWebKit/src/SettingsBase.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T22:58:08Z.
Review: COMMENTED
Reviewed — comments
The review is incomplete because several included changed files and the full text of two excluded files were not read, so a formal approval is not justified.
What I ran
Reviewed the prepared diff for head
f6ec3364aa7be9f0036906caf4067e94a7ed192aand targeted source excerpts throughrepo_read.py. No tests or builds were run.Results
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
Read:
description.md,commits.md,manifest.json,diff.patch; source excerpts fromSettingsBase.cpp,SettingsBaseAbi.hpp,WtfLanguage.cpp,WtfStringAbi.hpp, andlibScePosixForWebKit/Export.cpp; and the changed-file listing.Did not read the complete text of every included changed file. In particular,
Export.cppandInventoryExports.hppwere excluded from the review folder, and their full text was not read through the reader. Console and Windows behavior were not verified. Test results in the description are author-reported, not runs performed in this review.To get this to a good state
Nothing is required. Optional: complete the source review, including the excluded files, before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:39:33Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks merging; the notes below are optional.
What I ran
Reviewed head
9afbb526478b33f1787b04838bffdf350799c4cfand the prepared diff againstmain. No commands or tests were run. The author reports 143 of 143 tests passed on Arch Linux x86-64 with GCC 16.2.1; this was not independently verified.Results
Findings
Blocking
None.
Non-blocking
ClearMediaVectorcan free storage still referenced by the source before copying (especially when source size exceeds target capacity). Consider handling shared-buffer aliasing or documenting that such aliasing is outside the API contract. Changed line:core/libs/prx/libSceNKWebKit/src/SettingsBase.cpp:313.Not verified
Did not run the reported tests or convention check, compare behavior on a console, or verify Windows behavior. The full text of
core/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwas excluded as too large; their relevant removals were visible in the prepared diff. Read the other changed files listed as included in the manifest, including the full implementation, ABI header, language helper, POSIX export changes, tests, and debt entry.To get this to a good state
Nothing is required. Optional: cover or constrain distinct vector objects that share a backing allocation in the media-vector setter tests.