Commit Graph
4 Commits
Author SHA1 Message Date
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
simnJS 2b10aa4211 fix(libSceJsc): bound UTF-8 input and decoded length as WebKit does
The shared UTF-8 decoder behind JSStringCreateWithUTF8CString and
JSStringIsEqualToUTF8CString now applies StringImpl::create's bounds: more
than INT32_MAX bytes throws before decoding, and non-ASCII input decoding to
more than 2147483635 UTF-16 units throws after a successful conversion.
GuestJSStringValidLength mirrors isValidLength and is tested at both limits.
2026-10-28 15:51:00 +01:00
simnJS 50c8d4cd8f feat(libSceJsc): answer the JSString null and length cases as JavaScriptCore does
JSStringCreateWithUTF8CString and JSStringIsEqualToUTF8CString take a null
UTF-8 pointer as a null string, and JSStringCreateWithCharacters returns a
null string for null characters of any length, as WebKit's JSStringRef.cpp
and WTF's String constructors do. A length above WebKit's 2147483635-unit
limit and a null handle given to retain, release or the maximum-size query
throw std exceptions where JavaScriptCore crashes. The reference count is a
wrapping 32-bit counter and the maximum UTF-8 size is computed in 32 bits,
as in WTF.
2026-10-28 14:55:42 +01:00
AZLisme 5746326efc feat(libSceJsc): implement JavaScriptCore string API 2026-10-25 18:20:03 +08:00