feat(libSceNKWebKit): implement WKHitTestResult property getters #15171

Merged
adriaespii merged 2 commits from upstream-pr/15171 into main 2026-11-05 08:47:08 +00:00
adriaespii commented 2026-11-02 19:51:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriaespii on 2026-11-02T19:51:23Z.


What

Implement WKHitTestResult property getters in libSceNKWebKit:

  • WKHitTestResultCopyAbsoluteImageURL: returns the image URL.
  • WKHitTestResultCopyAbsoluteLinkURL: returns the link URL.
  • WKHitTestResultCopyAbsoluteMediaURL: returns the media URL.
  • WKHitTestResultCopyAbsolutePDFURL: returns the PDF URL.
  • WKHitTestResultCopyLinkLabel: returns the link label string.
  • WKHitTestResultCopyLinkTitle: returns the link title string.
  • WKHitTestResultCopyLookupText: returns the lookup text string.
  • WKHitTestResultGetElementBoundingBox: returns the element's bounding rectangle.
  • WKHitTestResultIsContentEditable: returns whether the hit element is editable.

The HitTestResult host object holds these fields in memory; null or wrong-type references throw std::invalid_argument via NKWebKit::Cast.

Tested

check_conventions.py --base origin/main passed. Added test coverage in Base.cpp covering URL copying, label, title, text snippet, bounding box rect coordinates, boolean editable query, and null reference exception handling.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5126459578 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15171). Originally posted by [adriaespii](https://github.com/adriaespii) on 2026-11-02T19:51:23Z. --- ### What Implement `WKHitTestResult` property getters in `libSceNKWebKit`: - `WKHitTestResultCopyAbsoluteImageURL`: returns the image URL. - `WKHitTestResultCopyAbsoluteLinkURL`: returns the link URL. - `WKHitTestResultCopyAbsoluteMediaURL`: returns the media URL. - `WKHitTestResultCopyAbsolutePDFURL`: returns the PDF URL. - `WKHitTestResultCopyLinkLabel`: returns the link label string. - `WKHitTestResultCopyLinkTitle`: returns the link title string. - `WKHitTestResultCopyLookupText`: returns the lookup text string. - `WKHitTestResultGetElementBoundingBox`: returns the element's bounding rectangle. - `WKHitTestResultIsContentEditable`: returns whether the hit element is editable. The `HitTestResult` host object holds these fields in memory; null or wrong-type references throw `std::invalid_argument` via `NKWebKit::Cast`. ### Tested `check_conventions.py --base origin/main` passed. Added test coverage in `Base.cpp` covering URL copying, label, title, text snippet, bounding box rect coordinates, boolean editable query, and null reference exception handling. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-02 20:00:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T20:00:38Z.

Review: COMMENTED


Reviewed — no blocking findings

Source inspection found no blocking defect; however, the four URL-copy tests only assert non-null results, and the hosted Windows job is still pending.

What I ran

Reviewed all seven changed files at head bb23e636aedbd13c77a353d937773a20120e6a14, against PR base 784ab0968325144612249cf14cb281997f08c745. The individual merge preview is clean against current main 096c45570f516de76a43bbe1b97781381c84f55f. Environment: Debian 12 x86-64, Python 3.11.2, GCC 12.2.0. No local build or CTest was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15171 --output-dir /tmp/anyps5-pr-precheck-15171-current
git diff --check 784ab0968325144612249cf14cb281997f08c745...bb23e636aedbd13c77a353d937773a20120e6a14
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 784ab0968325144612249cf14cb281997f08c745 --head bb23e636aedbd13c77a353d937773a20120e6a14 --json
python3 tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck-15171-current/head-bb23e636aedb-cb7bcebe --json 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/HitTestResult.cpp core/libs/prx/libSceNKWebKit/src/Types.hpp core/libs/prx/libSceNKWebKit/tests/Base.cpp docs/dev/debt/libSceNKWebKit.md
python3 /marc/AnyPS5/tools/pr_stack_check.py 15171 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck-15171-current/stack
python3 tools/pr_overlap.py --branch refs/review/pr-15171-20261102T1958Z --repo boykopovar/AnyPS5 --jobs 8
gh pr list --repo boykopovar/AnyPS5 --state open --search HitTestResult --limit 100 --json number,title,url,headRefOid
gh pr checks 15171 --repo boykopovar/AnyPS5

Results

Check Result Note
Diff and conventions passed Exact PR head and base.
Export audit passed 10,252 symbols scanned; no lexical findings.
Current-main merge preview passed Clean against current main.
Test registration passed CMake globs include the new source and test.
Test-quality heuristic failed It flagged two registrations; manual CMake inspection confirms both are globbed.
Open-PR overlap scan not run Helper could not parse one API response; targeted title search found no other HitTestResult PR.
Hosted policy checks passed Conventions, intake, labels, eligibility, portability and report passed.
Windows build not run Pending at the final refresh.
Specialized jobs not applicable Linux and specialized jobs were skipped by workflow filters.
Local build and CTest not run These require compiled binaries; no build was run.
Precheck wrapper failed Its isolated checkout lacks the optional ABI and test-quality scripts; both were run separately from the workspace.
Commands and unedited output
All conventions checks passed.
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck-15171-current/head-bb23e636aedb-cb7bcebe/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck-15171-current/head-bb23e636aedb-cb7bcebe/tools/pr_test_quality.py': [Errno 2] No such file or directory
{
  "findings": [
    {
      "path": "core/libs/prx/libSceNKWebKit/src/HitTestResult.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    },
    {
      "path": "core/libs/prx/libSceNKWebKit/tests/Base.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}
{
  "status": "passed",
  "symbols": 10252,
  "findings": []
}
PAIRWISE PR STACK
Target branch tip: 096c45570f516de76a43bbe1b97781381c84f55f
PR #15171: clean against current base; head bb23e636aedbd13c77a353d937773a20120e6a14
pr_overlap: Invalid \uXXXX escape: line 1 column 126329 (char 126328)

The CMake inspection showed src/*.cpp and tests/*.cpp are both globbed; WKURLCopyString provides a way to verify copied URL contents:

file(GLOB nkWebKitSources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB nkWebKitTests CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp)
windows	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516204238
edge-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516207315
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516207877
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516207550
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516207797
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516207869
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516206833
conventions	pass	30s	https://github.com/boykopovar/AnyPS5/actions/runs/41513814568/job/125512106625
eligibility	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125512122101
intake	pass	23s	https://github.com/boykopovar/AnyPS5/actions/runs/41513814589/job/125512113901
labels	pass	10s	https://github.com/boykopovar/AnyPS5/actions/runs/41513814569/job/125512107189
library-portability	pass	1m29s	https://github.com/boykopovar/AnyPS5/actions/runs/41513814654/job/125512105372
report	pass	32s	https://github.com/boykopovar/AnyPS5/actions/runs/41513814593/job/125512104332

Negative control

No mutation or negative control was run locally because the new C++ tests require a build. The PR does not report a negative-control run.

Findings

Blocking

None found in the source review of this exact head.

Non-blocking

  • Each WKHitTestResultCopyAbsolute*URL test currently checks only that the returned reference is non-null. A wrong or empty URL would also pass. Please compare WKURLCopyString on each returned object with its distinct expected URL.

Sources

Not verified

I did not run a local build, CTest, a negative control, console behavior, or PS5 ABI execution. The hosted Windows build is still pending. The overlap helper did not complete, so the targeted title search is not a full duplicate check.

To get this to a good state

No blocking code change is requested. Please let the Windows job finish and consider asserting the returned URL strings. I will recheck the exact head and hosted checks before approval, and rerun the same no-build checks if the head changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5742553038 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15171#pullrequestreview-5742553038). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T20:00:38Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Source inspection found no blocking defect; however, the four URL-copy tests only assert non-null results, and the hosted Windows job is still pending. ## What I ran Reviewed all seven changed files at head `bb23e636aedbd13c77a353d937773a20120e6a14`, against PR base `784ab0968325144612249cf14cb281997f08c745`. The individual merge preview is clean against current `main` `096c45570f516de76a43bbe1b97781381c84f55f`. Environment: Debian 12 x86-64, Python 3.11.2, GCC 12.2.0. No local build or CTest was run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15171 --output-dir /tmp/anyps5-pr-precheck-15171-current git diff --check 784ab0968325144612249cf14cb281997f08c745...bb23e636aedbd13c77a353d937773a20120e6a14 python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 784ab0968325144612249cf14cb281997f08c745 --head bb23e636aedbd13c77a353d937773a20120e6a14 --json python3 tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck-15171-current/head-bb23e636aedb-cb7bcebe --json 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/HitTestResult.cpp core/libs/prx/libSceNKWebKit/src/Types.hpp core/libs/prx/libSceNKWebKit/tests/Base.cpp docs/dev/debt/libSceNKWebKit.md python3 /marc/AnyPS5/tools/pr_stack_check.py 15171 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck-15171-current/stack python3 tools/pr_overlap.py --branch refs/review/pr-15171-20261102T1958Z --repo boykopovar/AnyPS5 --jobs 8 gh pr list --repo boykopovar/AnyPS5 --state open --search HitTestResult --limit 100 --json number,title,url,headRefOid gh pr checks 15171 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | Exact PR head and base. | | Export audit | passed | 10,252 symbols scanned; no lexical findings. | | Current-main merge preview | passed | Clean against current main. | | Test registration | passed | CMake globs include the new source and test. | | Test-quality heuristic | failed | It flagged two registrations; manual CMake inspection confirms both are globbed. | | Open-PR overlap scan | not run | Helper could not parse one API response; targeted title search found no other `HitTestResult` PR. | | Hosted policy checks | passed | Conventions, intake, labels, eligibility, portability and report passed. | | Windows build | not run | Pending at the final refresh. | | Specialized jobs | not applicable | Linux and specialized jobs were skipped by workflow filters. | | Local build and CTest | not run | These require compiled binaries; no build was run. | | Precheck wrapper | failed | Its isolated checkout lacks the optional ABI and test-quality scripts; both were run separately from the workspace. | <details><summary>Commands and unedited output</summary> ```text All conventions checks passed. ``` ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck-15171-current/head-bb23e636aedb-cb7bcebe/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck-15171-current/head-bb23e636aedb-cb7bcebe/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` ```json { "findings": [ { "path": "core/libs/prx/libSceNKWebKit/src/HitTestResult.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." }, { "path": "core/libs/prx/libSceNKWebKit/tests/Base.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` ```json { "status": "passed", "symbols": 10252, "findings": [] } ``` ```text PAIRWISE PR STACK Target branch tip: 096c45570f516de76a43bbe1b97781381c84f55f PR #15171: clean against current base; head bb23e636aedbd13c77a353d937773a20120e6a14 ``` ```text pr_overlap: Invalid \uXXXX escape: line 1 column 126329 (char 126328) ``` The CMake inspection showed `src/*.cpp` and `tests/*.cpp` are both globbed; `WKURLCopyString` provides a way to verify copied URL contents: ```text file(GLOB nkWebKitSources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) file(GLOB nkWebKitTests CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp) ``` ```text windows pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516204238 edge-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516207315 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516207877 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516207550 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516207797 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516207869 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125516206833 conventions pass 30s https://github.com/boykopovar/AnyPS5/actions/runs/41513814568/job/125512106625 eligibility pass 6s https://github.com/boykopovar/AnyPS5/actions/runs/41513814594/job/125512122101 intake pass 23s https://github.com/boykopovar/AnyPS5/actions/runs/41513814589/job/125512113901 labels pass 10s https://github.com/boykopovar/AnyPS5/actions/runs/41513814569/job/125512107189 library-portability pass 1m29s https://github.com/boykopovar/AnyPS5/actions/runs/41513814654/job/125512105372 report pass 32s https://github.com/boykopovar/AnyPS5/actions/runs/41513814593/job/125512104332 ``` </details> ## Negative control No mutation or negative control was run locally because the new C++ tests require a build. The PR does not report a negative-control run. ## Findings ### Blocking None found in the source review of this exact head. ### Non-blocking - Each `WKHitTestResultCopyAbsolute*URL` test currently checks only that the returned reference is non-null. A wrong or empty URL would also pass. Please compare `WKURLCopyString` on each returned object with its distinct expected URL. ## Sources - [Getter implementations at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/bb23e636aedbd13c77a353d937773a20120e6a14/core/libs/prx/libSceNKWebKit/src/HitTestResult.cpp#L6-L49) - [URL copy API and existing string check at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/bb23e636aedbd13c77a353d937773a20120e6a14/core/libs/prx/libSceNKWebKit/src/URL.cpp#L6-L13) - [HitTestResult test at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/bb23e636aedbd13c77a353d937773a20120e6a14/core/libs/prx/libSceNKWebKit/tests/Base.cpp#L354-L409) - [CMake source and test registration at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/bb23e636aedbd13c77a353d937773a20120e6a14/core/libs/prx/libSceNKWebKit/CMakeLists.txt#L20-L58) ## Not verified I did not run a local build, CTest, a negative control, console behavior, or PS5 ABI execution. The hosted Windows build is still pending. The overlap helper did not complete, so the targeted title search is not a full duplicate check. ## To get this to a good state No blocking code change is requested. Please let the Windows job finish and consider asserting the returned URL strings. I will recheck the exact head and hosted checks before approval, and rerun the same no-build checks if the head changes.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!15171
No description provided.