feat(libSceNKWebKit): implement WKBackForwardList and item getters #15157
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15157"
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 nicolasabosch on 2026-11-02T19:30:39Z.
What
Implements the nine
WKBackForwardListfunctions (Clear,GetCurrentItem,GetBackItem,GetForwardItem,GetItemAtIndex,GetBackListCount,GetForwardListCount,CopyBackListWithLimit,CopyForwardListWithLimit) and the threeWKBackForwardListItemgetters (CopyURL,CopyTitle,CopyOriginalURL) inlibSceNKWebKit, following the pinned WKBackForwardListRef.cpp, WKBackForwardListItemRef.cpp and WebBackForwardList.cpp. The list holds its items, a current index and an attached flag standing for the page pointer; a detached list or one without a current item returns null and zero,GetItemAtIndexrange-checks without arithmetic on the index, andClearkeeps only the current item. A null or wrong-type reference throws as for the otherWK*objects.The
7439total on line 30 ofdocs/dev/debt/libSceNKWebKit.mdbecomes7427; the other openlibSceNKWebKitPRs edit the same line, so whichever merges second needs that number rebased.Tested
Windows, MinGW GCC Release build of
nkwebkit_base_tests: passes, including a new test of normal, empty, out-of-range, null and wrong-type inputs.python tools/check_conventions.py --base upstream/mainpasses.public_headershit its 90 s timeout on this machine and was not run onmain, so it is unconfirmed. No title was run.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T20:18:31Z.
Review: APPROVED
Matches the pinned WebBackForwardList.cpp function by function:
currentItem,backItem,forwardItem,backListCountandforwardListCountwithattachedstanding form_page.itemAtIndex's range checks without arithmetic on the index (the 64-bit negation also avoids-INT_MIN).clearkeeping only the current item, or emptying the list when there is none.backListAsAPIArrayWithLimittaking the lastmin(backCount, limit)entries before the current one andforwardListAsAPIArrayWithLimitthe firstmin(forwardCount, limit)after it, with an empty array when there's no current item.CurrentIndexalso returns no index when the stored one is past the end, where WebKit only asserts. That's a harmless extra guard.Tested on Windows 11, WinLibs GCC 15.2.0, with this head merged onto
main:nkwebkit_baseandpublic_headerspass (nothing skipped). Withmain'sExport.cpp,InventoryExports.hppandWebKitValueExports.hpp, the new test doesn't build against the old declarations.