feat(libSceNKWebKit): implement WebCore::parseHTMLNonNegativeInteger #15241
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15241"
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 AlexWhitehouse on 2026-11-02T22:00:27Z.
What
Implements the libSceNKWebKit export
WebCore::parseHTMLNonNegativeInteger(WTF::StringView)(_ZN7WebCore27parseHTMLNonNegativeIntegerEN3WTF10StringViewE, NIDV4T4zWxST6E), which threw throughNotImplemented_nid_no_patch.It is ported from the PS5 WebKit source the library's debt file already pins,
neonmodder123/PS5-WebKit-11.x@80f77e94c63e:parseHTMLNonNegativeIntegerand theparseHTMLIntegerInternalandparseHTMLIntegerit calls, fromHTMLParserIdioms.cpplines 130 to 194. Behaviour matches upstream:isASCIIWhitespace) and an optional+; parsing stops at the first non-digit;-0is 0.INT_MAX, notUINT_MAX, because upstream parses a signed integer first.HTMLIntegerParsingError(HTMLParserIdioms.h:57) keeps its three values. An empty view isOther, an overflowing positive number isPositiveOverflow, and any negative number or negative overflow isNegativeOverflow.StringViewwith null characters throws, where upstream would dereference null.The new file
core/libs/prx/libSceNKWebKit/src/HtmlInteger.cppstarts withHTMLParserIdioms.cpp's copyright and licence notice, copied byte for byte from the pinned revision, followed by aDerived from neonmodder123/PS5-WebKit-11.x/Source/WebCore/html/parser/HTMLParserIdioms.cpp@80f77e94c63ee7202eec3d4b5b1a021dd89011baline.Return type: the export returns upstream's
Expected<unsigned, HTMLIntegerParsingError>.HTMLNonNegativeIntegerResultinsrc/WtfStringAbi.hppreproduces the pinnedExpected.hstorage:boolat offset 4;rax;static_asserts pin all of this. A probe compiled against the pinnedExpected.hgave the same layout and return register.Debt (
docs/dev/debt/libSceNKWebKit.md):Expectedlayout.Export.cpp: 6982 of the table's rows onmainstill throw, matching its prose (the table also still listsURL::lastPathComponentandURL::strippedForUseAsReferrer, which #14387 implemented). It now says 6981.Tested
nkwebkit_htmlinteger(core/libs/prx/libSceNKWebKit/tests/HtmlInteger.cpp, registered by the existingtests/*.cppglob) covers:+and-, and trailing junk;-0and negatives;2147483647,2147483648and long overflowing inputs;mainwith only the test added,nkwebkit_htmlintegerfails with_ZN7WebCore27parseHTMLNonNegativeIntegerEN3WTF10StringViewE not implemented;main(38379be3f0) all 27 NKWebKit tests pass, includingguest_nkwebkit_dates,guest_nkwebkit_numbersandguest_nkwebkit_urls.HtmlInteger.cpp;RAX: the value or error in the low 32 bits andhasValueat bit 32;mainthe new test doesn't compile, because it needs the new declarations; there the export is theNotImplemented_nid_no_patchstub.UINT_MAXfailsnkwebkit_htmlintegerat its has-value check (line 25), because inputs aboveINT_MAXare then accepted.python3 tools/check_conventions.py --base origin/main: all conventions checks passed. The public-header audit passes.python3 tools/pr_overlap.py: no other PR implements this export.WtfExports.hpp: the declaration's sorted place is next to #14607's.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)🤖 Generated with Claude Code