feat(libSceNKWebKit): implement Inspector::ContentSearchUtilities::findStylesheetSourceMapURL #24868
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24868"
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 XFlawless1 on 2026-11-21T08:13:43Z.
What
Implements
Inspector::ContentSearchUtilities::findStylesheetSourceMapURL(const String&), which was a throwing stub.The pinned ContentSearchUtilities.cpp L178-L205 compiles one fixed Yarr pattern and returns its first capture:
This library has no Yarr, so the export scans for that pattern directly and keeps Yarr's results:
bad value */) moves on to the next comment[#@][\040\t]#or the deprecated@, then exactly one space or tab([^\s'"]*)greedy, then[\040\t]*\*/*/, so/*# sourceMappingURL=a*/b*/givesa*/b, as backtracking does\screate_regex_tables:\t–\r, space, U+00A0, U+1680, U+2000–U+200A, U+2028, U+2029, U+202F, U+205F, U+3000, U+FEFF. U+180E, U+0085 and lone surrogates are value charactersMultilineflag^or$The result is
content.substring(start, length)through this library'sStringImpl::substring, so it keeps the content's 8-bit or 16-bit width, and an empty value gives the empty string rather than a null one. Null or empty content gives a null string, as the source's early return does. A nullString*throws.The new files are named
StylesheetSourceMap*rather thanContentSearchUtilities*because #24214 addsinclude/ContentSearchUtilitiesExports.hpp.Tested
Windows 11, MinGW GCC 15.2, Release.
nkwebkit_stylesheetsourcemappasses:#and@markers; tabs and spaces around the value; adata:URL value; the greedya*/b*/ccase; the first of two comments; a failed comment followed by a matching one;/*inside an earlier/*; a newline before*/; an empty value returning the shared empty string; two spaces, no space or a wrong marker after/*; lower-case name; single and double quotes; unterminated comments;//#comments; every\scode unit in 8-bit (\v,\f, U+00A0) and 16-bit (U+1680 … U+FEFF) content stopping the value; U+180E, U+200B, U+0085, a lone surrogate and U+FFFF kept in the value; 16-bit content giving a 16-bit result; a new string (refcount one) that is not the content's; the content's refcount unchanged; null and empty content; a null pointer.a*/b*/ccheck.nkwebkit|export|inventory|stub|nid|debt|convention|registrationgive 429 passes (180nkwebkit_*,test_registration,conventions_pr_template);agc_driver_stencil_ref_exportis skipped, unrelated.python tools/check_conventions.py --base origin/mainandpython tools/debt_fold.py --checkpass.Not tested on a console.
Overlap (
python tools/pr_overlap.py --namesand--branch feat/nkwebkit-stylesheet-source-map-url):findStylesheetSourceMapURL. #24322, the refactor that splits the large libraries, moves the stub without implementing it.ContentSearchUtilities::textPositionFromOffset. Its stub sits next to this one inExport.cppandInventoryExports.hpp, so whichever merges second gets a textual conflict there; the resolution keeps both deletions. The new files and thelibSceNKWebKit.hppinclude line do not collide (checked withgit merge-tree).mainand shareExport.cpp,InventoryExports.hpporlibSceNKWebKit.hpp; the--namessearch covers every open PR's changes and findsfindStylesheetSourceMapURLonly in #24322.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
Summary by CodeRabbit
#and@comment markers. The detector recognizes URLs in stylesheet comments, allowing tools that use this capability to identify the associated source map. It returns an empty result when the stylesheet is empty or contains no matching source-map comment.Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-21T08:15:48Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
f6c045b98f:tools/check_conventions.pypassed.nkwebkit_stylesheetsourcemap_testsbuilt cleanly.nkwebkit_stylesheetsourcemap):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/StylesheetSourceMap.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T08:28:16Z.
Review: APPROVED
Reviewed — looks good
The implementation follows the described source map matching behavior, adds focused coverage, and the inspected integration points include the new implementation and test through the existing CMake globs.
What I ran
Reviewed head
f6c045b98fde032c6a679ccb0e6da12c5b0a35dd. I usedrepo_read.pyto inspect the prepared description, commits, diff, manifest, changed source and test files, the library header, relevant legacy-file ranges, the CMake configuration, and the string ABI/substring implementation. No build or test commands were run by me; reported test runs are author-supplied.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
I did not run the reported Windows build, tests, convention checks, or debt check, and I did not test console behavior. The full text of
Export.cppandInventoryExports.hppwas excluded by the review bundle; I read the affected ranges from the pinned head instead. Other changed files read:StylesheetSourceMapExports.hpp,libSceNKWebKit.hpp,StylesheetSourceMap.cpp,tests/StylesheetSourceMap.cpp, and the debt change record. All six changed files markedreviewedin the manifest were read, with the two excluded files inspected at the relevant ranges.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-21T09:30:35Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
0874e2372c:tools/check_conventions.pypassed.nkwebkit_stylesheetsourcemap_testsbuilt cleanly.nkwebkit_stylesheetsourcemap):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/StylesheetSourceMap.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T09:34:39Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation matches the documented fixed-pattern behavior in the inspected source; review was limited because two changed files were excluded and no checks were run here.
What I ran
Reviewed head
0874e2372cffcf79f016e07179605c00b752e232using the prepared diff and pinned repository reader. No build or tests were run; the test results in the PR description are author-reported.Results
Findings
Blocking
None identified in the files read.
Non-blocking
None.
Not verified
Export.cppandinclude/InventoryExports.hppwere excluded from the review folder and not read. Their diff hunks are present in the prepared patch. The implementation was not compared against a console module; console behavior and author-reported Windows build and tests were not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:46:34Z.
Review: COMMENTED
Built the branch’s changed sources and ran
StylesheetSourceMapon Linux against the existing runtime libraries. The test run passed and covered both comment markers, whitespace around the URL, and selection of the first matching comment.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T12:57:41Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes show no verified blocking defect; this remains a comment because the pinned reader could not provide further source context after its read-only log write failed.
What I ran
Reviewed head
0c1272a612772845a9c4a0a4fa50a4f39ce5608f. Inspected the prepared diff and searched the pinned source forfindStylesheetSourceMapURL; no build or tests were run. The author reports Windows build and test results, which I did not verify.Results
Negative control
Not run by me. The author reports that a greedy-to-lazy change failed the
a*/b*/ctest.Findings
Blocking
None in the inspected changes.
Non-blocking
None.
Sources
Not verified
The changed hunks were inspected for all seven files in
files.json. Full text was available in the review folder for six files;Export.cppwas excluded there because it was too large, so I reviewed its diff only. I did not read the full text of the other included existing files. Further pinned-head context, build integration, and tests were not verified because subsequent reader calls failed when the reader could not write its log. Console behavior was not tested; the author also reports it was not tested.To get this to a good state
Nothing is required. Optional: verify the surrounding build integration and call sites once the pinned reader can provide further context.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.