feat(libSceNKWebKit): implement stripLeadingAndTrailingHTMLSpaces #18797
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18797"
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-12T09:58:21Z.
What
libSceNKWebKit
WebCore::stripLeadingAndTrailingHTMLSpaces(const WTF::String&)(_ZN7WebCore33stripLeadingAndTrailingHTMLSpacesERKN3WTF6StringE, NIDIUY0ho-22JE) threwnot implemented. This PR ports it from WebKit c55364d5, the historical revision other NKWebKit ports here already use; the newer PS5-WebKit tree (80f77e94) no longer has thisconst String&overload.HTMLParserIdioms.cpplines 39–76: the trimming itself;HTMLParserIdioms.hlines 91–109:isHTMLSpace, which is only TAB, LF, FF, CR and SPACE;WTFString.cpplines 309–313 andStringImpl.cpplines 324–339:substring.Behaviour:
emptyAtom().string()does upstream.StringImplcomes back with one more reference, asreturn stringdoes upstream.StringImpl::substringexport, so its character width matches the input's.The new
src/HtmlSpaceTrim.cppstarts withHTMLParserIdioms.cpp's notice. It reuses the existing String support without editingWtfString.cpporWtfStringAbi.hpp. The stub and its legacy declaration are removed (it had no inventory row, so the NKWebKit count line is untouched), and a debt fragment,docs/dev/debt/changes/feat-libscenkwebkit-strip-html-spaces.md, adds an entry recording that the console's String layout and sret ABI are unverified.Tested
nkwebkit_htmlspacetrim(core/libs/prx/libSceNKWebKit/tests/HtmlSpaceTrim.cpp) runs every case on 8-bit and 16-bit strings:x, trimmed only if it is one of the five HTML spaces;main, the test fails with_ZN7WebCore33stripLeadingAndTrailingHTMLSpacesERKN3WTF6StringE not implemented;nkwebkit_htmlspacetrim,nkwebkit_webcoreparsers,nkwebkit_wtfandpublic_headerspass.nkwebkit_htmlspacetrim,nkwebkit_webcoreparsersandnkwebkit_wtfpass at 0481db5a90, with no compiler warnings in the changed files. The branch was then rebased onto currentmainwithout conflicts, and the tests pass again on Linux.python3 tools/check_conventions.py --base origin/main: all checks passed.python3 tools/pr_overlap.py: no open PR implements this export.#includelines inlibSceNKWebKit.hpp; the PR no longer touches the NKWebKit debt file. Whichever merges second rebases.WebCoreParsers.cpp) aren't touched.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
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T10:25:23Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
94778ba91c:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_htmlspacetrim_testsbuilt cleanly.nkwebkit_htmlspacetrim):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Generated withfooter from the description; the AI-assisted checkbox can stay.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T14:17:17Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
d0e0a17de5:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_htmlspacetrim_testsbuilt cleanly.nkwebkit_htmlspacetrim):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Generated withfooter from the description; the AI-assisted checkbox can stay.Looks Good To Me