feat(libSceNKWebKit): implement six ContainerNode and Node element navigation exports #24319
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24319"
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:04:07Z.
What
Implements 6
libSceNKWebKitexports that walk the child and sibling links of a DOM node. All six throwNotImplementedonmaintoday.ContainerNode::firstElementChild() constandlastElementChild() const: the first or last child whose node flags carry the element bit, or null.ContainerNode::childElementCount() const: the number of children with the element bit.ContainerNode::traverseToChildAt(unsigned) const: the child at the given index (the first child for 0), or null when the index is past the end.Node::nextElementSibling() constandpreviousElementSibling() const: the next or previous sibling with the element bit, or null.Source: the
libSceNKWebKit.sprxwith SHA-2563af992253665387feeb5df90ff27dff683e3aa270cc4d92a0535b46ab18fa20d. The logic follows the pinned WebKitContainerNode.cpp(ElementTraversal::firstChild/lastChild,childrenOfType<Element>,traverseToChildAt) andNode.cpp(ElementTraversal::nextSibling/previousSibling). The offsets come from the module's own code and match the pinnedNode.handContainerNode.h: flags at0x1c(element bit0x8), previous sibling0x30, next sibling0x38, first child0x50, last child0x58. All except the element bit were already insrc/NodeAbi.hpp. Like the merged NodeTraversal exports, a null or unreadable node throws instead of faulting.Only the fields the six functions read were checked against the module; the other
Nodemembers are laid out from the pinned header.Debt: the fragment
docs/dev/debt/changes/feat-nkwebkit-element-navigation.mdadds the Functional entry and removes the six inventory rows.Overlap: no open PR matches these names (all 166 open PRs touching
libSceNKWebKitwere diffed againstmain), and on currentorigin/mainall six are still only theNotImplementedstubs.How it was checked
Offline, against the module's own code (none of it is in the repository): the six function bodies were disassembled and their bytes run against this implementation in a harness.
In the repository, the new
nkwebkit_elementnavigationtest builds node trees of element, container and text nodes and checks all six exports, including no elements, a single element, an index past the end, and null or unreadable nodes.Tested
Linux Mint 22.3, GCC 13.3, Release:
nkwebkit_elementnavigationpasses (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-20T14:19:21Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation and changed lines are reviewable at the supplied head, but I did not run the reported checks, so a formal approval is not justified.
What I ran
4bf9b3d3a20a435fd377f0cac928fc79ba071c76against basemainusing the prepared diff and pinned reader.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwas excluded from the review folder; their removals were inspected in the diff.ElementNavigationExports.hpp,libSceNKWebKit.hpp,ElementNavigation.cpp,NodeAbi.hpp,tests/ElementNavigation.cpp, anddocs/dev/debt/changes/feat-nkwebkit-element-navigation.md; also read the relevant diff hunks forExport.cppandInventoryExports.hpp.To get this to a good state
Nothing is required. Optional: run the reported checks on this head and verify on Windows.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T14:20:46Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
4bf9b3d3a2:tools/check_conventions.pypassed.nkwebkit_elementnavigation_testsbuilt cleanly.nkwebkit_elementnavigation):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/NodeAbi.hpp,core/libs/prx/libSceNKWebKit/src/ElementNavigation.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-21T03:05:05Z.
Review: COMMENTED
Reviewed — comments
The implementation follows the described child and sibling walks, but its error handling needs a targeted follow-up before the review can be fully resolved.
What I ran
Inspected head
6351124a0102f93f8d34d47fc480d9f51998c883. No commands or tests were run; the reported Linux test and checks are author-reported. The base merge check is also author-reported as clean. Read the prepared description, commits, manifest, diff, and the full text ofElementNavigation.cpp,ElementNavigationExports.hpp,NodeAbi.hpp,ElementNavigation.cpptests,libSceNKWebKit.hpp, andCMakeLists.txt. The full text ofExport.cppandInventoryExports.hppwas excluded from the review folder and not read; their changed hunks were inspected in the diff. Also inspected the debt entry hunk.Results
Findings
Blocking
None.
Non-blocking
ElementNavigation.cpp:20andElementNavigation.cpp:21—errnois restored only afterGuestCopyIn_nid_no_patchreturns normally. If that helper throws, the intended errno preservation is bypassed. Consider using a small RAII guard so restoration also occurs during exception unwinding. This is low priority unlessGuestCopyIn_nid_no_patchcan throw in this runtime.Not verified
Export.cppandInventoryExports.hppwere excluded by the review-folder size rule; only the changed hunks in the prepared diff were inspected.ElementNavigation.cppwas read in full; only the relevant diff hunk of the tests and debt entry were inspected.To get this to a good state
Nothing is required. Optional: use an errno guard if the guest-copy helper can throw.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T18:16:43Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation matches the described child and sibling traversal behavior, and the reviewed source supports merging.
What I ran
Reviewed head
23c6f168b5f6eca8901d5762c375d02a186f8076using the prepared diff and pinnedrepo_read.pyreader. No commands or tests were run by me; the reported Linux test and checks are author supplied.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read the full text of
ElementNavigationExports.hpp,ElementNavigation.cpp,NodeAbi.hpp,ElementNavigation.cpptests, and the debt entry; I read the relevant portions oflibSceNKWebKit.hpp,InventoryExports.hpp, andExport.cpp. The latter three were included in the review folder, though only relevant ranges were read.Export.cppwas excluded from the prepared folder and accessed through the pinned reader. I did not read the remaining contents of the largeInventoryExports.hpporlibSceNKWebKit.hppfiles, and did not run builds, tests, or checks.To get this to a good state
Nothing is required.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.