feat(libSceNKWebKit): implement WebCore ISO box, text-encoding default and hit-test rect static helpers #19771
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19771"
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 B-Howell on 2026-11-13T22:24:11Z.
What
Implements four 3.20 legacy
libSceNKWebKitexports that are static or free functions, from WebKit 73a35b43, the August 2020 revision already used for the other legacy exports:ISOWebVTTCue::boxTypeNamereturns thevttcFourCC,0x76747463(ISOVTTCue.h#L47, packed as in FourCC.h#L36-L41).WebCore::FourCCis added toWebCoreTypes.hppas a 4-byte trivially copyable struct withstatic_asserts, so it is returned ineaxas on the console.ISOBox::minimumBoxSizereturns2 * sizeof(uint32_t), 8 (ISOBox.h#L45).defaultTextEncodingNameForSystemLanguagereturns the non-Cocoa"ISO-8859-1"(TextEncodingRegistry.cpp#L304-L324); the pinned PS5 tree has the same branch. TheStringis built through the existingWTF::StringImpl::createexport, asDiagnosticLoggingKeys.cppdoes.HitTestLocation::rectForPointfloors theLayoutPointwithLayoutUnit::floor(including the clamp toINT_MIN / 64, LayoutUnit.h#L157-L164), moves it by the left and top padding and adds one to each padded extent (HitTestLocation.cpp#L150-L161). Padding sums wrap in 32 bits as the original unsigned-to-int arithmetic does. It uses theIntRectandLayoutPointlayouts already pinned inWebCoreTypes.hpp.The stubs and their untyped legacy declarations are replaced by typed declarations in
WebCoreExports.hpp. The debt file records that the console's WebKit revision is not verified.tools/progress.py: 15773 to 15777 implemented functions (+4).Tested
Ubuntu 22.04 (WSL), GCC 11, Release build of the needed targets.
nkwebkit_webcoreisotexthittest: theFourCCvalue, the box size of 8, the returned 8-bitString(ISO-8859-1, length 10, twice), and ninerectForPointcases: whole and fractional positive points, negative fractions (-1and-65raw floor to-1and-2), theINT_MIN + 63clamp toINT_MIN / 64,INT_MAX, and padding that wraps (UINT_MAXleft padding gives width 0).NotImplemented_nid_no_patchaborts (_ZN7WebCore12ISOWebVTTCue11boxTypeNameEv not implemented).nkwebkit_constants,nkwebkit_diagnosticloggingkeys,nkwebkit_webcoredumpandnkwebkit_webcoregeometrypass (5/5 with the new test).ctest -R '^public_headers': 65/65 passed.641ec02025merged onto main5f749eee1e(report):nkwebkit_webcoreisotexthittestpassed 3/3, none skipped.4f3454c37ef: Windows 11, WinLibs GCC 15.2, Release, all 18 of our main merges from this round built together on main790e9a371cc:ctest -R nkwebkit116/116 passed,patched_librariespassed once the #19822 fix was in. Re-merged ontob9fb5ab5a32(no NKWebKit changes in between);check_conventionspassed. Resolved a conflict in theWebCoreExports.hppinclude list by taking main's list, which already includes this PR's header.0026a41afd: merged mainc3d38470e0cand moved this PR's debt edits intodocs/dev/debt/changes/claude-webcore-iso-textenc-hittest.md; the debt files match main, and the fragment applied to main gives the same debt lines as the previous head.debt_fold.py --checkandcheck_conventions.py --base origin/mainpass. Documentation only, no build.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 PrivacyOnion on 2026-11-14T04:40:45Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
641ec02025:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_webcoreisotexthittest_testsbuilt cleanly.nkwebkit_webcoreisotexthittest):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp,core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hppreverted 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 PrivacyOnion on 2026-11-16T16:54:35Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
0026a41afd:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_webcoreisotexthittest_testsbuilt cleanly.nkwebkit_webcoreisotexthittest):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/include/WebCoreExports.hpp,core/libs/prx/libSceNKWebKit/src/WebCoreTypes.hppreverted 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-16T17:09:53Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the implementation matches the described helpers, and the only review concern is portability of signed right shift in the hit-test floor helper.
What I ran
Reviewed head
0026a41afd02a5849997c4c98ff7d36d539ca88cusing the prepared diff and the pinnedrepo_read.pyreader. No commands or tests were run in this review.Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceNKWebKit/src/WebCoreHitTestLocation.cpp:142uses right shift on a negative signed value to implement floor division. The C++ standard leaves this implementation-defined, so behavior may differ across compiler targets. Consider spelling out the negative-value floor calculation using division and remainder, while retaining the existing lower-bound clamp.Not verified
Export.cppwas excluded from the review bundle as too large; targeted reader search did not independently verify the removed stubs at their hunk locations.Files read:
description.md,commits.md,manifest.json,diff.patch;WebCoreExports.hpp,WebCoreHitTestLocation.cpp,WebCoreIsoBox.cpp,WebCoreIsoVttCue.cpp,WebCoreTextEncodingRegistry.cpp,WebCoreTypes.hpp,WebCoreIsoTextHitTest.cpp,WebCoreExports.hpp,WtfStringAbi.hpp,WtfString.cpp,CMakeLists.txt, and the debt fragment.LegacyExports.hppwas listed as included but its full text was not read.Export.cppwas excluded by size;files.jsonwas not available through the reader.To get this to a good state
Nothing is required. The signed-shift portability point is optional.