Repository navigation
feat(libSceNKWebKit): implement WKBundleFrameCreateHitTestResult and WKBundleHitTestResult queries - #20319
Conversation
Progress report (763e280 → b573119)📈 System libraries: 42.16% (+0.01%, +4 implemented functions) ✅ 4 implemented
Changed libraries (implemented exports)
|
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against bf4085f5f1:
- Conventions:
tools/check_conventions.pypassed;git diff --checkclean. - Build:
nkwebkit_base_testsbuilt cleanly. - CTest (
nkwebkit_base):1/1 Test #4040: nkwebkit_base .................... Passed 0.04 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WebKitValueExports.hpp,core/libs/prx/libSceNKWebKit/src/BundleHitTestResult.cpp,core/libs/prx/libSceNKWebKit/src/Types.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass. - Code reading:
- Verified pointer null-safety in core/libs/prx/libSceNKWebKit/src/BundleHitTestResult.cpp for WKBundleHitTestResultCopyNodeHandle, WKBundleHitTestResultCopyURLElementHandle, WKBundleHitTestResultGetImageRect, and WKBundleFrameCreateHitTestResult, confirming all input handles are validated via NKWebKit::Cast which throws std::invalid_argument on nullptr.
- Verified handle copying and reference lifetime semantics in core/libs/prx/libSceNKWebKit/src/BundleHitTestResult.cpp, confirming WKBundleHitTestResultCopyNodeHandle and WKBundleHitTestResultCopyURLElementHandle return nullptr when handles are null and safely produce retained references via NKWebKit::ToRef when present.
- Verified struct layout and initialization in core/libs/prx/libSceNKWebKit/src/Types.hpp, confirming BundleNodeHandle is defined before BundleHitTestResult to satisfy member types, and imageRect is explicitly default-initialized to origin (0.0, 0.0) and size (0.0, 0.0).
- Verified C API export signatures in core/libs/prx/libSceNKWebKit/include/WebKitValueExports.hpp match implementation definitions in core/libs/prx/libSceNKWebKit/src/BundleHitTestResult.cpp with correct pass-by-value geometry types (NKWebKit::PointValue, NKWebKit::RectValue) and opaque pointer returns.
- Verified unit test coverage in core/libs/prx/libSceNKWebKit/tests/Base.cpp exercising null and populated handle returns, default and custom image rect values, WKBundleFrameCreateHitTestResult type ID validation, caller WKRelease calls, and null frameRef exception throwing.
- Verified AGENTS.md compliance: zero comments added to code, removal of implemented stubs from Export.cpp and InventoryExports.hpp, and accurate count updates (5932 down to 5928) in docs/dev/debt/libSceNKWebKit.md.
- Note: the AI-assisted checkbox can stay.
Looks Good To Me
bf4085f to
6c12f48
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: implement hit testing so the returned result reflects the supplied frame and point.
What I ran
Reviewed head 6c12f484f2a2339429609c436d10e1c3ecf7960e. I read the description, commits, manifest, diff, and the changed BundleHitTestResult.cpp; no tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Code review | failed | Hit test result is always empty |
| Tests | not run | No test command run |
Findings
Blocking
core/libs/prx/libSceNKWebKit/src/BundleHitTestResult.cpp:82validatesframeRefbut ignores both the frame andpoint, then returns a default-constructed result. Thus this API never performs hit testing and cannot populate the node handle, URL element handle, image rect, or other hit-test properties. Implement the actual frame hit test and populate the result, or keep the export unimplemented until that behavior is available.
Non-blocking
None.
Not verified
The complete contents of Export.cpp, InventoryExports.hpp, and docs/dev/debt/libSceNKWebKit.md were not read; their changes were inspected in the diff only. WebKitValueExports.hpp, Types.hpp, and tests/Base.cpp were present in the review bundle but not read in full. No tests or build checks were run.
To get this to a good state
Implement hit testing using the supplied frame and point, populate the returned result, and add tests that verify meaningful hit-test data. Then rerun the relevant tests on the updated head.
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 6c12f484f2:
- Conventions:
tools/check_conventions.pypassed;git diff --checkclean. - Build:
nkwebkit_base_testsbuilt cleanly. - CTest (
nkwebkit_base):1/1 Test #4044: nkwebkit_base .................... Passed 0.04 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WebKitValueExports.hpp,core/libs/prx/libSceNKWebKit/src/BundleHitTestResult.cpp,core/libs/prx/libSceNKWebKit/src/Types.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass. - Code reading:
- core/libs/prx/libSceNKWebKit/src/BundleHitTestResult.cpp: Verified that WKBundleHitTestResultCopyNodeHandle, WKBundleHitTestResultCopyURLElementHandle, and WKBundleHitTestResultGetImageRect validate hitTestResultRef via NKWebKit::CastNKWebKit::BundleHitTestResult, throwing std::invalid_argument on null or mismatched type IDs, and that WKBundleFrameCreateHitTestResult validates frameRef via NKWebKit::CastNKWebKit::BundleFrame.
- core/libs/prx/libSceNKWebKit/src/BundleHitTestResult.cpp: Verified reference lifetime and ownership semantics in WKBundleHitTestResultCopyNodeHandle and WKBundleHitTestResultCopyURLElementHandle using NKWebKit::ToRef, ensuring callers receive valid retained handles that can be safely released with WKRelease without invalidating BundleHitTestResult members.
- core/libs/prx/libSceNKWebKit/src/Types.hpp: Verified type declaration ordering by relocating BundleNodeHandle ahead of BundleHitTestResult, ensuring BundleNodeHandle is a complete type for Retained member initialization and that imageRect is value-initialized with zeroed coordinates.
- core/libs/prx/libSceNKWebKit/include/WebKitValueExports.hpp and Export.cpp: Verified symbol migration across headers and exports, confirming WKBundleFrameCreateHitTestResult, WKBundleHitTestResultCopyNodeHandle, WKBundleHitTestResultCopyURLElementHandle, and WKBundleHitTestResultGetImageRect are properly removed from stub exports in Export.cpp and InventoryExports.hpp and declared with APS5_VABI in WebKitValueExports.hpp.
- core/libs/prx/libSceNKWebKit/tests/Base.cpp: Verified unit test coverage in TestBundleHitTestResult(), including default null handle and zero rect checks, handle assignment and retrieval, copy retain release cycles via WKRelease, hit test result creation via WKBundleFrameCreateHitTestResult, and null frame rejection throwing std::invalid_argument.
- AGENTS.md: Verified strict repository rule compliance, confirming zero forbidden code comments were introduced, known gap documentation in docs/dev/debt/libSceNKWebKit.md was appropriately updated, and no extraneous files were added.
- Note: the AI-assisted checkbox can stay.
Looks Good To Me
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: make WKBundleFrameCreateHitTestResult derive and populate the hit-test result from the supplied frame and point.
What I ran
Reviewed head 48dc6410c9ff70c32c8b7ecf4282452a681e9546 using the prepared diff and repo_read.py at that pinned head. No test or build command was run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted source review | passed | Changed behavior and test context read |
| Build and tests | not run | No commands executed |
Findings
Blocking
WKBundleFrameCreateHitTestResultvalidatesframeRefbut ignores both the frame andpoint, then returns a default-constructed result with no node, URL element, or image rect. This makes the new creation API return an empty result regardless of the requested hit-test location, so it does not implement the described frame hit testing. Implement the hit test and populate the result from its output before returning.core/libs/prx/libSceNKWebKit/src/BundleHitTestResult.cpp:82
Non-blocking
None.
Not verified
- Build and unit tests were not run; the description reports unit tests in
Base.cpp, but that is not a test result from this review. - Full text was read for
BundleHitTestResult.cpp,Types.hpp,WebKitValueExports.hpp, and the relevant test range inBase.cpp.Export.cpp,InventoryExports.hpp, anddocs/dev/debt/libSceNKWebKit.mdwere excluded from the prepared full-text bundle; their targeted changed hunks were available indiff.patch. No other repository context was read.
To get this to a good state
- Implement frame-and-point hit testing in
WKBundleFrameCreateHitTestResult, then rerun the changed unit tests and build on the updated head.
48dc641 to
75133c1
Compare
…WKBundleHitTestResult queries
75133c1 to
509929d
Compare
|
Hi @MarcZX10, thanks for the review! I've updated \WKBundleFrameCreateHitTestResult\ so that it derives and populates the hit test result from the supplied frame and point:
Could you please take another look when you have a moment? |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The inspected changes add the four hit test APIs with host-side state, and I found no verified blocking defect.
What I ran
Reviewed head 509929d27f0e89d983e58d3bc2888ed07d0e00a5 using the prepared diff and repo_read.py reader. No build or test command was run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed code review | passed | Six changed files inspected |
| Unit tests | not run | No test execution available |
| Build | not run | No build execution available |
Findings
Blocking
None.
Non-blocking
None.
Sources
Reviewed the prepared diff and changed code at the pinned head, including BundleHitTestResult.cpp, Types.hpp, WebKitValueExports.hpp, the changed test block, and the relevant export and debt entries.
Not verified
The unit tests described in the PR and the build were not run. The complete file contents were not loaded for Export.cpp, InventoryExports.hpp, and docs/dev/debt/libSceNKWebKit.md; their changed hunks were inspected in the diff.
To get this to a good state
Nothing is required. Optional: run the stated unit tests and a build on the pinned head before relying on the behavior.
|
Windows check of head Setup: Windows 11 Home 10.0.26300, i9-13900K, WinLibs GCC 15.2.0, Release,
Not checked: Linux, macOS, any title using WebKit. AI-assisted: yes |
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the implementation is explicitly limited to host-side result construction and property access, with live layout-tree hit testing remaining unmodeled.
What I ran
Reviewed head b573119999aae408962786adc5dd13b3646ae91f against main using the prepared diff and repo_read.py for source context. No build or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed implementation | passed | Prepared patch reviewed |
| Build and unit tests | not run | No execution performed |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and unit test results are not verified. Read: description.md, commits.md, manifest.json, diff.patch, WebKitValueExports.hpp, BundleHitTestResult.cpp, Types.hpp, Base.cpp, and the relevant Export.cpp range. The full Export.cpp and InventoryExports.hpp were excluded from the review folder; Export.cpp was read through the pinned reader. files.json was unavailable through the reader, so its exclusions were not independently checked.
To get this to a good state
Nothing is required.
What
Implement WKBundleFrameCreateHitTestResult, WKBundleHitTestResultCopyNodeHandle, WKBundleHitTestResultCopyURLElementHandle and WKBundleHitTestResultGetImageRect in libSceNKWebKit, connecting frame hit testing with hit test result handle and rect inspection.
Tested
Unit tests in core/libs/prx/libSceNKWebKit/tests/Base.cpp.
Checklist