41 Commits
Author SHA1 Message Date
Dean e3dd53a5ed Merge pull request #24419 from domx4q/fix/nkwebkit-wtf-cstring-ctor-guest-pointers
fix(libSceNKWebKit): copy WTF C string arguments safely
2026-12-05 09:02:11 +13:00
Dean 6553848b4c Merge pull request #24433 from domx4q/fix/nkwebkit-wtf-string-case-guest-pointers
fix(libSceNKWebKit): copy StringView case output and equalIgnoringNullity buffers safely
2026-12-05 08:29:16 +13:00
Dean 4ecf658449 Merge pull request #22789 from milescoviello/fix/nkwebkit-parse-double-guest-copies
fix(libSceNKWebKit): read parseDoubleFromLongString's string through checked guest copies
2026-12-04 22:01:10 +13:00
Dean d31f92829b Merge pull request #24353 from ToRaNek/fix/nkwebkit-utf8-for-characters-expected
fix(libSceNKWebKit): return Expected<CString, UTF8ConversionError> from StringImpl::utf8ForCharacters
2026-11-22 00:10:06 +13:00
milescovielloandClaude Opus 5.5 eb3ad368a7 fix(libSceNKWebKit): read parseDoubleFromLongString's string through checked guest copies
WTF::Internal::parseDoubleFromLongString read the caller's UTF-16 units
and wrote the parsed length through guest pointers, so an unmapped
string or output crashed the host. The units are now copied in with
GuestCopyIn_nid_no_patch, 2048 at a time through a 4 KiB stack chunk
into the existing narrow buffer, so no second buffer is sized from the
caller's length, and the parsed length is written with one
GuestCopyOut_nid_no_patch. A string that can't be read or an output
that can't be written throws std::invalid_argument.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 14:29:05 -05:00
Dean 637ce049c6 Merge pull request #24041 from ToRaNek/fix/libscenkwebkit-parse-double-from-long-string
fix(libSceNKWebKit): parse long UTF-16 numbers with the WTF converter instead of strtod
2026-11-21 08:25:07 +13:00
Dominik Fuchs f211455a4c fix(libSceNKWebKit): copy StringView case output and equalIgnoringNullity buffers safely
Both StringView::getCharactersWithASCIICase overloads read the guest
StringView and its characters directly and wrote the guest output
buffer element by element. equalIgnoringNullity(const UChar*, size_t,
StringImpl*) read the guest character buffer directly.

They now copy the StringView in with GuestCopyIn_nid_no_patch and walk
the characters in fixed chunks of 2048 code units: each chunk is copied
into a host array, converted or compared there, and the case-converted
chunk is written back with one GuestCopyOut_nid_no_patch. No host
buffer is sized from the guest length, so an oversized length with a
short guest buffer fails at the first unreadable chunk.

An unreadable StringView, character buffer or unwritable output throws
std::invalid_argument, like the other WtfString.cpp argument checks
and the merged FourCC::fromString guest copy; the GuestCopy helpers
keep errno. Results for readable inputs are unchanged. The StringImpl
argument is allocated by the library and stays a host object.
2026-11-20 17:24:56 +01:00
Dominik Fuchs 59feeb1626 fix(libSceNKWebKit): copy WTF C string arguments safely
String(const char*), String::fromUTF8(const LChar*), equal(StringImpl*,
const LChar*) and CString(const char*) ran strlen over the guest C
string. They now copy it into a host string in page-bounded chunks of
at most 4096 bytes with GuestCopyIn_nid_no_patch until the terminator,
and work on the copy. An unreadable string throws
std::invalid_argument, keeps errno and leaves the destination object
unchanged. The C2 constructors call the C1 ones.
2026-11-20 17:02:17 +01:00
ToRaNekandClaude Fable 5.2 5b656b778b fix(libSceNKWebKit): return Expected<CString, UTF8ConversionError> from StringImpl::utf8ForCharacters
Both overloads are declared to return Expected<CString,
UTF8ConversionError>: 16 bytes written through the hidden result
pointer, the CString or the error first and the has flag at offset 8.
The port returned a bare CString, so the flag a caller tests was never
written, and it threw on a strict-mode failure where WebKit returns the
error.

They now write the whole object: IllegalSource for an unpaired surrogate
in strict mode, SourceExhausted for a lead surrogate that ends the
buffer, OutOfMemory above MaxLength / 3 characters.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 15:58:11 +01:00
ToRaNekandClaude Fable 5.2 5c2f02731e fix(libSceNKWebKit): write U+FFFD for an unpaired surrogate in lenient UTF-8
The lenient mode of StringImpl::utf8, String::utf8, StringView::utf8 and
utf8ForCharacters encoded every unpaired surrogate as three bytes.
WebKit's convertUTF16ToUTF8 replaces an unpaired surrogate with U+FFFD
when it is not strict, and only a lead surrogate that ends the buffer
reaches the three-byte encoding, through the SourceExhausted branch of
utf8Impl. Do the same.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 06:46:33 +01:00
ToRaNekandClaude Fable 5.2 b7cad524f4 fix(libSceNKWebKit): parse long UTF-16 numbers with the WTF converter instead of strtod
WTF::Internal::parseDoubleFromLongString went through the host's
strtod, which skips leading white space, reads hexadecimal, "inf" and
"nan", and follows the host's numeric locale. WebKit narrows the text
and calls StringToDoubleConverter::StringToDouble, which accepts none
of those, and this library already exports that converter. Call it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 02:50:35 +01:00
Delwin Mathew ffff26d9e1 feat(libSceNKWebKit): implement WebCore::SecurityOrigin and SecurityOriginData origin queries 2026-11-18 12:10:38 +05:30
KernelPanicNT c4b104c84e feat(libSceNKWebKit): implement WTF file-system representation and path joining (#19106) 2026-11-17 14:28:11 +13:00
HarnoorandClaude Sonnet 5.5 9c254f8ec4 feat(libSceNKWebKit): implement WTF::StringImpl::utf8ForCharacters for 8-bit and 16-bit characters
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 23:57:54 -04:00
1b78372dbe feat(libSceNKWebKit): implement WebCore unionRect, exposed tile edges, presentingApplicationPID, SVG legacy feature test and autofill field names (#19607)
* feat(libSceNKWebKit): implement WebCore unionRect, exposed tile edges, presentingApplicationPID, SVG legacy feature test and autofill field names
* docs(libSceNKWebKit): carry the upstream WebKit notices on the ported helpers
* chore(libSceNKWebKit): give each Derived from line its path and full revision
* docs(libSceNKWebKit): keep one callable export count line after the merge of main
* docs(libSceNKWebKit): drop duplicate export count line after merge

Co-authored-by: pr-review2 <pr-review2@users.noreply.github.com>
Co-authored-by: Dean Galvin <dean.galvin@live.com>
2026-11-15 21:40:38 +13:00
SAKIBUL HUDA ONNAY 1db7c14adc feat(libSceNKWebKit): implement WTF string case mapping, foldCase and normalizedNFC (#18391) 2026-11-15 00:49:57 +13:00
THEMANnt 2f35d96e0d feat(nkwebkit): implement WTF URL scheme and form exports 2026-11-10 04:07:39 +03:00
KernelPanicNT 00adff64fd feat(libSceNKWebKit): implement WTF::URLParser::allValuesEqual and internalValuesConsistent
Both follow WebKit URLParser.cpp at 3539f609da3d over the URL layout the
other WTF::URL exports already decode: allValuesEqual compares the string
and every field, internalValuesConsistent checks the offset ordering with
the scheme end in bits 6-31 and the port length in bits 3-5. Null URL
references throw, as the other URL exports do.
2026-11-09 20:12:45 +01:00
Dean Galvin 66b7cba5b1 Merge branch 'main' 2026-11-07 17:46:56 +13:00
Ashwin 52251ad21a fix(libSceNKWebKit): keep pinned OR for avoidDeletedValue and add provenance notices 2026-11-06 20:52:11 +05:30
AshwinandClaude Sonnet 5.5 2ec4285661 docs(libSceNKWebKit): record that the sign-bit choice of computeSharedStringHash is unmeasured on the console
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 20:50:52 +05:30
Ashwin 4dccc95ea8 fix(libSceNKWebKit): avoid hash-table deleted sentinel in computeSharedStringHash 2026-11-06 20:50:11 +05:30
AshwinandClaude Sonnet 5.5 0d7a5a9186 docs(libSceNKWebKit): keep the upstream notices of StringHash.h and StringHasher.h
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 20:49:17 +05:30
AshwinandClaude Sonnet 5.5 114853e5fd feat(libSceNKWebKit): implement WebCore::computeSharedStringHash
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 20:48:32 +05:30
lakhantheboss a1a7983f11 feat(libSceNKWebKit): implement WTF::protocolHostAndPortAreEqual 2026-11-06 01:04:11 +05:30
Dean Galvin 5e38b0df5d Merge branch 'main' 2026-11-06 07:44:48 +13:00
AshwinandClaude Sonnet 5.5 0b7587c034 feat(libSceNKWebKit): implement foldQuoteMarks, defaultMIMEType and redirectChainAllowsReuse
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 00:05:48 +05:30
Dean Galvin a5d9a7cb9f Merge branch 'main' 2026-11-06 07:25:40 +13:00
Dean Galvin 1467bbe31d Merge branch 'main' 2026-11-06 07:04:46 +13:00
Dean Galvin 4cc27d3f88 Merge branch 'main' 2026-11-06 07:04:46 +13:00
Dean Galvin 364a59a58d Merge branch 'main' 2026-11-06 07:04:46 +13:00
lakhantheboss 9932dd3b1e feat(libSceNKWebKit): implement WTF::portAllowed 2026-11-05 12:01:10 +05:30
AshwinandClaude Sonnet 5.5 ede1bb0eb4 feat(libSceNKWebKit): implement WTF::FileSystemImpl encodeForFileName, decodeFromFilename and lastComponentOfPathIgnoringTrailingSlash
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 23:21:27 +05:30
AshwinandClaude Sonnet 5.5 6098f93a12 feat(libSceNKWebKit): implement WTF::URL::lastPathComponent and strippedForUseAsReferrer
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 23:18:33 +05:30
winstrex d15cf41cfa Merge remote-tracking branch 'upstream/main' into feat/nkwebkit-wtf-text
# Conflicts:
#	docs/dev/debt/libSceNKWebKit.md
2026-11-02 19:42:29 -03:00
AshwinandClaude Sonnet 5.5 dd166cdd67 feat(libSceNKWebKit): implement WTF::mimeTypeFromDataURL and URL::stringCenterEllipsizedToLength
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 20:21:26 +05:30
winstrexandClaude Opus 5.5 a598f96e19 Merge remote-tracking branch 'upstream/main' into feat/nkwebkit-wtf-text
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 04:13:31 -03:00
winstrexandClaude Opus 5.5 83413ef468 fix(libSceNKWebKit): record a failed WTF::StringBuilder allocation as an overflow
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:03:43 -03:00
lakhantheboss 3f6c98a049 feat(libSceNKWebKit): implement WTF::equalIgnoringFragmentIdentifier 2026-11-01 04:26:09 +05:30
winstrexandClaude Opus 5.5 9ef85aeeb2 feat(libSceNKWebKit): implement the WTF::StringBuilder and WTF::TextStream exports
Ports the 27 StringBuilder and TextStream exports that still threw from
public WebKit c55364d53f97: appendCharacters, reserveCapacity,
shrinkToFit, reifyString, appendNumber(float) and appendQuotedJSONString,
the TextStream operators, release, groups and indent, and the Seconds and
URL operators. Both layouts are pinned with static_assert from the
release headers of that revision; they are not checked against a console
binary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 18:53:16 -03:00
PrivacyOnion 1383e29dac feat(libSceNKWebKit): implement the WebKit C API objects, preferences, JavaScriptCore C API and WTF primitives
Replace 1137 NotImplemented stubs with implementations that follow the PS5 11.x OSS WebKit source: the API object model and value types, WKPreferences with PlayStation defaults, context, page, website data store and user script configuration objects, the JS* API on QuickJS-NG with libSceJsc strings, WebCore geometry, transform and color values, and WTF allocation, time, string and URL value operations. Exports whose behaviour needs the WebKit engine, the WebCore URL parser or unproven layouts stay stubs; the gaps are in docs/dev/debt/libSceNKWebKit.md.

Every export is declared once in headers reachable from the library umbrella. Allocation size, alignment and header overhead are computed with overflow checks and the try variants return null at the boundaries. tryFastMalloc, tryFastZeroedMalloc, tryFastCalloc and tryFastRealloc return WTF::TryMallocReturnValue, which is returned in memory, so they take the caller's result pointer first, store the allocation through it and return it.

The libSceJsc string exports that libSceNKWebKit calls are named with the _nid_postfix suffix, so the NID patcher renames those imports along with the exports and the patched libSceNKWebKit.prx resolves them on Linux; their NIDs are unchanged.
2026-10-31 11:10:47 +01:00