feat(libSceNKWebKit): implement Inspector::ContentSearchUtilities::textPositionFromOffset #24214
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24214"
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 Callimann8 on 2026-11-20T10:33:07Z.
What
Implements
Inspector::ContentSearchUtilities::textPositionFromOffset(size_t, const Vector<size_t>&)in libSceNKWebKit (NIDjnonZqJRfQE), which was a throwing stub inExport.cpp.It lives in the new
src/InspectorContentSearchUtilities.cppand follows ContentSearchUtilities.cpp at the pinned e12a212a531a revision. The PlayStation 11.x source has the same body:approximateBinarySearch(binarySearchImplinReturnAdjacentElementIfKeyIsNotPresentmode, StdLibExtras.h), copied step for step, so the element it lands on matches WebKit's.WTF::TextPositionis twoOrdinalNumbers (oneinteach, zero-based), 8 bytes, returned in one register. The vector is read through the existingNKWebKit::WtfAbi::Vectorlayout (buffer, capacity, size).std::out_of_range. WebKit would crash inVector::at(0)there. The debt fragment records this under Functional and removes the name from the callable-exports table. The declaration is removed frominclude/InventoryExports.hpp.It needs no JSC cell, VM or string allocation.
Tested
New
nkwebkit_inspectorcontentsearchutilitiestest: offsets before, on and after each entry of a four-entry vector and a one-entry vector, plus every offset for vectors of 1 to 40 entries checked againststd::upper_bound, and the empty-vector throw. It passes on Linux (Ubuntu 24.04, GCC 13.3, Release) and also built standalone with-fsanitize=address,undefined.tools/check_conventions.pyandtools/debt_fold.py --checkpass. Not tested on a console or with a title.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-20T10:35:16Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
2c9dc24618:tools/check_conventions.pypassed.nkwebkit_inspectorcontentsearchutilities_testsbuilt cleanly.nkwebkit_inspectorcontentsearchutilities):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/InspectorContentSearchUtilities.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-20T10:45:13Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation and its added unit test were reviewed at head
2c9dc2461890c07dda403344007000465e33c647; no blocking defect was verified, and checks were not run in this review.What I ran
No commands or tests were run. I inspected the prepared diff and targeted source at the stated head.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Full file text was available and read for
include/ContentSearchUtilitiesExports.hpp,libSceNKWebKit.hpp,src/InspectorContentSearchUtilities.cpp,tests/InspectorContentSearchUtilities.cpp, anddocs/dev/debt/changes/feat-nkwebkit-text-position-from-offset.md. The diff was read for all changed files. Full text was not available forExport.cppandinclude/InventoryExports.hpp; their shown changes remove the old stub and declaration. The prepared bundle lists no excluded-by-rule file separately. Build and test outcomes in the description were not independently verified; console behavior and comparison against a console module were not verified.To get this to a good state
Nothing is required. Optional: verify the implementation against a console module, as the debt note specifies.