feat(libSceNKWebKit): implement topPrivatelyControlledDomain and CustomHeaderFields::thirdPartyDomainsMatch #22997
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22997"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by opxdelwin on 2026-11-18T16:27:36Z.
What
Implements two libSceNKWebKit exports from the 11.x inventory, ported from the pinned PS5 WebKit 11.x source (
neonmodder123/PS5-WebKit-11.x@80f77e94c63e):WebCore::topPrivatelyControlledDomain(WTF::String const&)(GxVDSv5dIws) returns the registrable domain of a host (www.example.co.ukgivesexample.co.uk). It followsPublicSuffixCurl.cppand uses the libpsl integration already on main. A null or empty domain gives a null String. IP addresses and non-ASCII domains come back unchanged.localhostcomes back lowercased. A public suffix gives a null String. Leading dots are skipped, and the rest goes topsl_registrable_domain.WebCore::CustomHeaderFields::thirdPartyDomainsMatch(WTF::URL const&) const(-ivWQ60ptck) decides whether a page's custom header fields also apply to a third-party URL. It followsCustomHeaderFields.cppandRegistrableDomain.hregistrableDomainFromHost. An entry matches when it equals the URL's host, or when it is a*.domainpattern whose suffix the host ends with and which is longer than the host's registrable domain.The stubs are removed from
Export.cppandInventoryExports.hpp, and the declarations move toPublicSuffixExports.hppandCustomHeaderFieldsExports.hpp. The licence notices of all three upstream files are kept verbatim, each with aDerived fromline. The debt fragment records that neither function has been compared with a console module, and that the results depend on the bundled libpsl 0.21.5 suffix list.Tested
Unit tests only, no title. Targets
libSceNKWebKit nkwebkit_publicsuffix_tests nkwebkit_customheaderfields_tests nkwebkit_forwarding_tests nkwebkit_symbolset_tests, run withctest -R '^(nkwebkit_publicsuffix|nkwebkit_customheaderfields|nkwebkit_forwarding|nkwebkit_symbolset|public_headers.*)$'.All on this commit (
0cbe66a8f0, based on currentmain):public_headers_compile_9/25/40/51, all-Winvalid-offsetofonRegioninRegionExports.hpp, a known clang failure on main in a file this PR does not touch. GCC passes them.tools/check_conventions.py --base upstream/mainandtools/debt_fold.py --checkpass.New tests cover: null and empty input, IP addresses, non-ASCII input,
localhost, case folding, public suffixes, leading dots, multi-label suffixes, exact-host matches,*.patterns at and beyond the registrable-domain length, malformed patterns, empty hosts and null-argument throws.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T16:31:21Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
0cbe66a8f0:tools/check_conventions.pypassed.nkwebkit_customheaderfields_tests,nkwebkit_publicsuffix_testsbuilt cleanly.nkwebkit_customheaderfields,nkwebkit_publicsuffix):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/CustomHeaderFieldsExports.hpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/PublicSuffixExports.hpp,core/libs/prx/libSceNKWebKit/src/CustomHeaderFields.cpp,core/libs/prx/libSceNKWebKit/src/PublicSuffix.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me