feat(libSceNKWebKit): implement the WebCore::FrameTree childCount, top, traverseNext and isDescendantOf exports #24332
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24332"
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 RiverWhy on 2026-11-20T14:18:23Z.
What
Implements 4
libSceNKWebKitexports ofWebCore::FrameTree. All four throwNotImplementedonmaintoday.childCount() const: the number of children, counted along the first child and next sibling links.top() const: the outermost ancestor of the frame (the frame itself when it has no parent).traverseNext(const Frame* stayWithin) const: the next frame in pre-order: the first child, else the next sibling, else the next sibling of the nearest ancestor, stopping atstayWithin.isDescendantOf(const Frame* ancestor) const: true whenancestoris this frame or one of its parents and both frames belong to the same page.Source: the
libSceNKWebKit.sprxwith SHA-2563af992253665387feeb5df90ff27dff683e3aa270cc4d92a0535b46ab18fa20d. The logic follows the pinned WebKitFrameTree.cpp. The offsets come from the module's own code and match the pinnedFrameTree.h,WeakPtr.handFrame.h: inFrame, the page weak pointer at0x40and theFrameTreemember at0x50; inFrameTree, the parent weak pointer at0x8, the next sibling at0x20and the first child at0x30; a weak pointer is a reference count and the pointer at0x8. They live in the newsrc/FrameAbi.hpp. Like the merged NodeTraversal exports, a null or unreadable pointer throws instead of faulting.traverseNext(CanWrap, DidWrap*)is left a stub: the module returns the main frame fromFrameoffset0x38, but the pinnedFrame.hdeclares its main frame member elsewhere and downcasts toLocalFrame, so that layout is not pinned. Only the fields the four functions read were checked against the module; the otherFramemembers are not modelled.Debt: the fragment
docs/dev/debt/changes/feat-nkwebkit-frame-tree-walks.mdadds the Functional entry and removes the four inventory rows.Overlap: no open PR matches these names (all 169 open PRs touching
libSceNKWebKitwere diffed againstmain), and on currentorigin/mainall four are still only theNotImplementedstubs.How it was checked
Offline, against the module's own code (none of it is in the repository): the four function bodies were disassembled and their bytes run against this implementation in a harness.
stayWithinandancestorarguments, 0 mismatches, comparing the returned pointer (the count as 32 bits, the boolean as a byte).stayWithin, not stopping at the parent equal tostayWithin, sibling before child, ignoring the page, excluding the frame itself) give between 42,851 and 564,475 mismatches per 200,000 runs, so the harness does tell the behaviours apart.In the repository, the new
nkwebkit_frametreewalkstest builds frame trees and checks all four exports, includingstayWithinat every level, pages, cleared and missing weak pointers, detached frames, and null or unreadable pointers.Tested
Linux Mint 22.3, GCC 13.3, Release:
nkwebkit_frametreewalkspasses (100% of the 1 test selected).tools/check_conventions.pypasses.core/libs/tests/test_public_headers.py --audit-onlypasses.git merge-treeagainst currentorigin/mainis clean.-fsyntax-onlywith WinLibs GCC 15.2.0 on the new source and test, 0 errors; the test itself was not run 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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T14:33:12Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
53c27cc585:tools/check_conventions.pypassed.nkwebkit_frametreewalks_testsbuilt cleanly.nkwebkit_frametreewalks):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/FrameTreeWalks.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-20T15:00:53Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected implementation and tests show no concrete blocking defect; the review is incomplete because two changed files were excluded from the bundle and the tests were not run here.
What I ran
Reviewed head
53c27cc585e103510901af91f252949c25d0d644using the pinnedrepo_read.pyreader. No tests or build checks were run.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
The reviewed implementation is in
core/libs/prx/libSceNKWebKit/src/FrameTreeWalks.cpp; its tests are incore/libs/prx/libSceNKWebKit/tests/FrameTreeWalks.cpp. The implementation follows the behavior described in the PR description; that upstream source was not independently checked.Not verified
core/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwere excluded from the review bundle. The relevantExport.cppregion was read through the reader; the full file andInventoryExports.hppwere not read. All other changed files listed inmanifest.jsonwere read through the diff or their included full text. Build, tests, the author-reported harness, and Windows behavior were not independently verified.To get this to a good state
Nothing is required. The optional follow-up is to inspect the excluded
InventoryExports.hppchanges and run the reported checks on this head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:30:20Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
68e2858ebc9471a290aa1cf1e7ff4a74787e7564. No commands or tests were run; the author reports Linux tests and Windows syntax checks in the PR description.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceNKWebKit/include/InventoryExports.hppwas excluded as too large; only the changed declaration-removal hunk inreview/diff.patchwas read.core/libs/prx/libSceNKWebKit/Export.cppwas excluded as too large; its changed-area context was read throughrepo_read.py. The module disassembly and offline harness described by the author were not available for independent verification. No tests were run.Files read:
review/description.md,review/commits.md,review/manifest.json,review/diff.patch,core/libs/prx/libSceNKWebKit/include/FrameTreeExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/FrameAbi.hpp,core/libs/prx/libSceNKWebKit/src/FrameTreeWalks.cpp,core/libs/prx/libSceNKWebKit/tests/FrameTreeWalks.cpp, anddocs/dev/debt/changes/feat-nkwebkit-frame-tree-walks.md. The changed filescore/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwere not fully read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T18:15:44Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at head
44038b4758956d7f935737c987ea34c3e6e9bd5bimplements fourFrameTreeexports and adds focused tests; the supplied report says its Linux checks passed, but I did not run them.What I ran
No commands were run. I reviewed the supplied diff and read the changed implementation, declarations, tests and debt entry.
Export.cppwas not available in the review folder; I inspected its relevant head lines through the reader.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the test, convention, header audit, Windows syntax check, or merge-tree check. The author reports successful results for these in the PR description. I did not independently verify the module disassembly, ABI offsets against the external module, or runtime behavior on console hardware.
Files read:
review/description.md,review/commits.md,review/manifest.json,review/diff.patch,review/README.md,core/libs/prx/libSceNKWebKit/Export.cpp(relevant head lines),core/libs/prx/libSceNKWebKit/include/FrameTreeExports.hpp(from diff),core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp(relevant head line),core/libs/prx/libSceNKWebKit/src/FrameAbi.hpp(from diff),core/libs/prx/libSceNKWebKit/src/FrameTreeWalks.cpp,core/libs/prx/libSceNKWebKit/tests/FrameTreeWalks.cpp, anddocs/dev/debt/changes/feat-nkwebkit-frame-tree-walks.md(from diff).core/libs/prx/libSceNKWebKit/include/InventoryExports.hpphad no added lines and was not read. No changed files were excluded by review rules;Export.cppwas too large for the review folder and was read through the reader.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T23:21:31Z.
Review: COMMENTED
Actionable comments posted: 1
d59c1677-7f26-4e96-b1b7-25a16789953bReviewing files that changed from the base of the PR and between
460d3ece6fandac43bf71d4.core/libs/prx/libSceNKWebKit/Export.cppcore/libs/prx/libSceNKWebKit/include/FrameTreeExports.hppcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppcore/libs/prx/libSceNKWebKit/libSceNKWebKit.hppcore/libs/prx/libSceNKWebKit/src/FrameAbi.hppcore/libs/prx/libSceNKWebKit/src/FrameTreeWalks.cppcore/libs/prx/libSceNKWebKit/tests/FrameTreeWalks.cppdocs/dev/debt/changes/feat-nkwebkit-frame-tree-walks.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T23:49:13Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed implementation and test coverage support merging.
What I ran
Reviewed head
ac43bf71d4f33e504ec647598f21547a27f81e5c. Read the prepared description, commit list, manifest, diff, the implementation, its test, the export declarations and include registration, and the relevant existing export stubs. No commands or tests were run. The source and test are registered through the existing CMake source and test globs.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
The implementation, layout declarations, export signatures, and tests were read at the reviewed head. The four corresponding
Export.cppstubs were also confirmed in the pinned source.Not verified
Export.cppwas excluded from the prepared full-text files due to size; only the relevant stub range was read.InventoryExports.hppand the debt change note were listed in the manifest but not read. No tests or builds were run independently; author-reported checks were not independently confirmed. The module disassembly and external WebKit source cited in the description were not verified.To get this to a good state
Nothing is required.