feat(libSceNKWebKit): implement the TextStream operators for activity flags, touch actions and regions #24161
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24161"
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 ToRaNek on 2026-11-20T08:31:30Z.
What
Three
WebCore::operator<<(TextStream&, ...)exports were stubs that threw. They now print what WebKit prints.operator<<(TextStream&, OptionSet<ActivityState::Flag>)ActivityState.cppL33-L57,:active window,focused,visible,visible or occluded,in-window,visually idle,audible,loading,capturing mediaoperator<<(TextStream&, TouchAction)EventRegion.cppL346-L364auto,none,manipulation,pan-x,pan-yorpinch-zoomoperator<<(TextStream&, const Region&)Region.cppL656-L666(rect ...)line per rectangle ofRegion::rects()Which revision. The first symbol names a nested enum,
ActivityState::Flag. That enum exists atc55364d53f97,e12a212a531aand73a35b43be7a, where the function is the same nine-name list. The pinned 11.x tree has madeActivityStateanenum class, so its operator takesOptionSet<ActivityState>, mangles differently and has a tenth name; the inventory symbol cannot be that one. TheTouchActionandRegionoperators are the same text in all four trees.Values outside the enums. WebKit tests each flag with
contains, so bits above the ninth print nothing. For aTouchActionthat is not one of the six values theswitchfalls through toASSERT_NOT_REACHED(); return ts;, which in a release build returns the stream unchanged. The port does the same in both cases.Region. The operator writes the newline, raises the indent by one for the rectangle lines and restores it, as
TextStream::IndentScopedoes, and prints each rectangle with the existingIntRectoperator, so theSVGStyleRectflag applies to it. The rectangles come from the existingRegion::rects()export.FloatRoundedRectis left a stub on purpose: its operator differs between the three older revisions and 11.x, and nothing in the symbol tells them apart.Tested
Windows 11 IoT Enterprise LTSC 2024 (10.0.26100), WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON.core/libs/prx/libSceNKWebKit/tests/WebCoreDump.cpp(nkwebkit_webcoredump): each of the nine flags alone, all nine, all 32 bits set, two pairs, an unknown bit alone and with a known one; the six touch actions and six values outside the enum; an empty region, a one-rectangle region (default,SVGStyleRect, and single-line mode, where no indent is written), an L-shaped union of two rectangles, and the same union on a stream already indented by two, with the indent checked afterwards.maine825fa1492the three exports are the stubs removed here, which throwNotImplemented.maine825fa1492:ctest -R "^nkwebkit_"passes 162 of 162.python tools/check_conventions.py --base origin/mainpasses.python tools/pr_overlap.py --branch feat/nkwebkit-text-stream-activity-touch-region: it fails closed on 32 open PRs that editExport.cppor the export headers. I fetched each head and searched the added and removed lines of its diff for the three symbols and the two new file names. None implements them. #23758 and the three PRs stacked on it (#23999, #24000, #24009) call theRegionoperator from a translated wrapper and define a test double for it; they leave the operator itself a stub. #24011 implements otherTextStreamoperators (Vector,ScrollableAreaParameters,VisiblePosition,VisibleSelection) and removes the stub next to theTouchActionone, so the two branches touch neighbouring lines ofExport.cpp,InventoryExports.hpp,WebCoreDumpExports.hppandtests/WebCoreDump.cpp: whichever merges second needs a rebase, which I will do if it is this one.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-20T08:33:54Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
73ebad20fc:tools/check_conventions.pypassed.nkwebkit_webcoredump_testsbuilt cleanly.nkwebkit_webcoredump):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/include/WebCoreDumpExports.hpp,core/libs/prx/libSceNKWebKit/src/Region.cpp,core/libs/prx/libSceNKWebKit/src/ActivityState.cpp,core/libs/prx/libSceNKWebKit/src/TouchAction.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-20T08:39:28Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected implementation and tests support merging.
What I ran
73ebad20fce87c572aae95246d21cd6829e5d9f2; base ismain. No merged-preview check or commands were run.Export.cppandLegacyExports.hpp; also inspected targeted declarations, the reader's file listing, and build configuration.Results
Negative control
Not run; no local test execution was available in this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
Behavior and edge cases are supported by the reviewed implementation and tests at the pinned head: ActivityState.cpp, TouchAction.cpp, Region.cpp, and WebCoreDump.cpp.
Not verified
Export.cppandInventoryExports.hppwere excluded by size; only relevant regions were read. The other changed files listed as included in the manifest were read.To get this to a good state
Nothing is required.