feat(libSceNKWebKit): implement the WebCore::NodeTraversal deepLastChild, last and nextAncestorSibling exports #23888
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23888"
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-19T20:49:12Z.
What
Implements 4
libSceNKWebKitexports ofWebCore::NodeTraversal. All four throwNotImplementedonmaintoday.deepLastChild(Node&): descends through last children until a node has none, returns that node.last(const ContainerNode&): the deepest last descendant, or null when the container is empty.nextAncestorSibling(const Node&): the next sibling of the closest ancestor that has one, or null.nextAncestorSibling(const Node&, const Node*): the same, but returns null on reachingstayWithin.Source: the
libSceNKWebKit.sprxwith SHA-2563af992253665387feeb5df90ff27dff683e3aa270cc4d92a0535b46ab18fa20d. The algorithm follows the pinned WebKitNodeTraversal.cpp. The object offsets come from the module's own code, and they match the pinnedNode.handContainerNode.h: node flags at0x1c(bit0x4isIsContainerNode), parent at0x20, next sibling at0x38,ContainerNodelast child at0x58. They live in the newsrc/NodeAbi.hpp.The mangled name of
lastends in4lastERKNS_13ContainerNodeE(ContainerNodeis 13 characters).Only the fields the four functions read are described. The other
Nodefields are not compared with a console module.Debt: the fragment
docs/dev/debt/changes/feat-nkwebkit-node-traversal.mdadds the Functional entry and removes the 4 inventory rows.Overlap: no open PR matches
NodeTraversal(searched the open PRs for the name and for each of the three mangled-name fragments), and on currentorigin/mainthe 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 byte blobs run against this implementation in a harness.
stayWithinchoices), 2,462,494 comparisons of the four functions, 0 mismatches.stayWithincheck from the two-argument overload gives 9574 mismatches, so the harness does tell the behaviours apart.In the repository, the new
nkwebkit_nodetraversaltest builds node trees in memory and checks all four exports on nested, empty and lone containers and on leaves, plus the field offsets (firstChildat0x50,lastChildat0x58) and a node whose container flag is cleared but still has a child, which must be treated as a leaf.Tested
Linux Mint 22.3, GCC 13.3, Release:
nkwebkit_nodetraversalpasses (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.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 MarcZX10 on 2026-11-19T21:09:14Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed code and integration support merging.
What I ran
Reviewed head
78c1616dad2758ed72065238373d9bcc20774f8c. I read the prepared description, commits, manifest and diff, the included changed files, and the relevant ranges in the two excluded files throughrepo_read.py. No tests or build commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The changed files read were
include/NodeTraversalExports.hpp,libSceNKWebKit.hpp,src/NodeAbi.hpp,src/NodeTraversal.cpp,tests/NodeTraversal.cpp, anddocs/dev/debt/changes/feat-nkwebkit-node-traversal.md. The full texts ofExport.cppandinclude/InventoryExports.hppwere excluded from the review bundle; I read the relevant ranges at the pinned head. The PR description’s reported Linux test, conventions check, header audit, merge-tree result, and external module harness were not independently run. Windows and console behavior were not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T21:14:28Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
78c1616dad:tools/check_conventions.pypassed.nkwebkit_nodetraversal_testsbuilt cleanly.nkwebkit_nodetraversal):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/NodeTraversal.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me