feat(libSceNKWebKit): implement WTF::aboutBlankURL and aboutSrcDocURL #17726

Merged
AlexWhitehouse merged 1 commit from upstream-pr/17726 into main 2026-11-12 04:58:06 +00:00
AlexWhitehouse commented 2026-11-09 13:06:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexWhitehouse on 2026-11-09T13:06:06Z.


What

Two libSceNKWebKit exports threw not implemented:

  • WTF::aboutBlankURL() (_ZN3WTF13aboutBlankURLEv, NID 3nmBMeZtd+Y);
  • WTF::aboutSrcDocURL() (_ZN3WTF14aboutSrcDocURLEv, NID Mw84qLwnIs4).

This PR implements them from the PS5 WebKit tree the other NKWebKit ports use, 80f77e94. In URL.cpp lines 920–941, each returns a reference to a URL that is built once from a static string (about:blank, about:srcdoc) by the absolute-URL parsing constructor, and is never destroyed.

  • Layout: each object uses the existing 40-byte WtfAbi::URL layout, which matches URL.h lines 229–250: the String, then m_isValid, m_protocolIsInHTTPFamily, m_cannotBeABaseURL, m_portLength and m_schemeEnd packed into one word, then seven offsets.
  • Field values: every value is what URLParser produces for these literals:
    • the packed word is 0x145: valid, not HTTP-family, cannot-be-a-base-URL, port length 0, scheme end 5. It comes from the non-special-scheme branch, URLParser.cpp lines 1242–1263;
    • the user, password, host and path-after-last-slash offsets stay at 6, because the cannot-be-a-base path handling (lines 1750–1773) keeps them there;
    • path end and query end are 11 for about:blank and 12 for about:srcdoc, set by URL completion (lines 2001–2027).
  • Backing strings: these are static 8-bit StringImpls with WebKit's static-string reference count, so they are never freed. Their hash is computed through the existing StringImpl::hashSlowCase.
  • Initialisation: each object is a function-local static, so it is created once (thread-safe) and both functions return the same address on every call.
  • Debt: the two stubs and their inventory rows are removed, the NKWebKit count drops from 6311 to 6309, and a debt entry records that the console ABI is unverified.

Tested

  • New test: nkwebkit_wtfabouturls covers:
    • the same address on repeated calls and from concurrent first calls on several threads;
    • the two objects being distinct;
    • every URL field and flag;
    • the string contents and length, the 8-bit flag and the static reference count;
    • existing URL getters reading the expected scheme and path from these objects.
  • Linux x86-64 (Ubuntu 26.04, GCC 15, Release):
    • on main, the test fails with _ZN3WTF13aboutBlankURLEv not implemented and _ZN3WTF14aboutSrcDocURLEv not implemented;
    • with this PR, nkwebkit_wtfabouturls, nkwebkit_wtf and public_headers pass.
  • Windows 11: (build 26300, WinLibs MinGW-w64 GCC 15.2.0 UCRT, Release): nkwebkit_wtfabouturls and nkwebkit_wtf pass at ba6b0a81ad, with no compiler warnings in the changed files.
  • Mutation check: changing about:blank's path end from 11 to 10 fails the field check.
  • python3 tools/check_conventions.py --base origin/main: all checks passed.
  • python3 tools/pr_overlap.py: no open PR implements these exports.
    • My #16853, #16890 and #16901 conflict only on the NKWebKit count line, so whichever merges second recounts.
    • The WTF URL parser series (#14926–#14930, #15867) implements other URL exports, and this PR doesn't touch its hunks.
    • #14946–#14948 remove dumpCharacter next to aboutBlankURL in Export.cpp. That merges cleanly; the neighbouring inventory and debt lines need the usual resolution.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5224342066 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17726). Originally posted by [AlexWhitehouse](https://github.com/AlexWhitehouse) on 2026-11-09T13:06:06Z. --- ### What Two libSceNKWebKit exports threw `not implemented`: - `WTF::aboutBlankURL()` (`_ZN3WTF13aboutBlankURLEv`, NID `3nmBMeZtd+Y`); - `WTF::aboutSrcDocURL()` (`_ZN3WTF14aboutSrcDocURLEv`, NID `Mw84qLwnIs4`). This PR implements them from the PS5 WebKit tree the other NKWebKit ports use, 80f77e94. In [`URL.cpp` lines 920–941](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/URL.cpp#L920-L941), each returns a reference to a URL that is built once from a static string (`about:blank`, `about:srcdoc`) by the absolute-URL parsing constructor, and is never destroyed. - **Layout:** each object uses the existing 40-byte `WtfAbi::URL` layout, which matches [`URL.h` lines 229–250](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/URL.h#L229-L250): the String, then `m_isValid`, `m_protocolIsInHTTPFamily`, `m_cannotBeABaseURL`, `m_portLength` and `m_schemeEnd` packed into one word, then seven offsets. - **Field values:** every value is what URLParser produces for these literals: - the packed word is `0x145`: valid, not HTTP-family, cannot-be-a-base-URL, port length 0, scheme end 5. It comes from the non-special-scheme branch, [`URLParser.cpp` lines 1242–1263](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/URLParser.cpp#L1242-L1263); - the user, password, host and path-after-last-slash offsets stay at 6, because the cannot-be-a-base path handling (lines 1750–1773) keeps them there; - path end and query end are 11 for `about:blank` and 12 for `about:srcdoc`, set by URL completion ([lines 2001–2027](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/URLParser.cpp#L2001-L2027)). - **Backing strings:** these are static 8-bit `StringImpl`s with WebKit's static-string reference count, so they are never freed. Their hash is computed through the existing `StringImpl::hashSlowCase`. - **Initialisation:** each object is a function-local static, so it is created once (thread-safe) and both functions return the same address on every call. - **Debt:** the two stubs and their inventory rows are removed, the NKWebKit count drops from 6311 to 6309, and a debt entry records that the console ABI is unverified. ### Tested - **New test:** `nkwebkit_wtfabouturls` covers: - the same address on repeated calls and from concurrent first calls on several threads; - the two objects being distinct; - every URL field and flag; - the string contents and length, the 8-bit flag and the static reference count; - existing URL getters reading the expected scheme and path from these objects. - **Linux x86-64** (Ubuntu 26.04, GCC 15, Release): - on `main`, the test fails with `_ZN3WTF13aboutBlankURLEv not implemented` and `_ZN3WTF14aboutSrcDocURLEv not implemented`; - with this PR, `nkwebkit_wtfabouturls`, `nkwebkit_wtf` and `public_headers` pass. - **Windows 11:** (build 26300, WinLibs MinGW-w64 GCC 15.2.0 UCRT, Release): `nkwebkit_wtfabouturls` and `nkwebkit_wtf` pass at ba6b0a81ad, with no compiler warnings in the changed files. - **Mutation check:** changing `about:blank`'s path end from 11 to 10 fails the field check. - `python3 tools/check_conventions.py --base origin/main`: all checks passed. - **`python3 tools/pr_overlap.py`:** no open PR implements these exports. - My #16853, #16890 and #16901 conflict only on the NKWebKit count line, so whichever merges second recounts. - The WTF URL parser series (#14926–#14930, #15867) implements other URL exports, and this PR doesn't touch its hunks. - #14946–#14948 remove `dumpCharacter` next to `aboutBlankURL` in `Export.cpp`. That merges cleanly; the neighbouring inventory and debt lines need the usual resolution. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!17726
No description provided.