feat(libSceNKWebKit): implement WebCore::DisplayList state items #22555
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22555"
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 RiverWhy on 2026-11-17T20:38:44Z.
What
Implements the constructors and destructors of
WebCore::DisplayList::Item,DrawingItemand 15 state items: 83 3.20 exports that all throw onmaintoday.C2(ItemType),D0/D1/D2.C1/C2/D0/D1/D2(75):Save,Restore,Translate,Rotate,Scale,SetCTM,ConcatenateCTM,SetLineCap,SetLineDash,SetLineJoin,SetMiterLimit,ClearShadow,ApplyDeviceScaleFactor,Clip,ClipOut.This is the base for the drawing items and the color and image items in the two PRs that follow.
Source: DisplayListItems.cpp and DisplayList.h at
c55364d53f97(September 2020). The exports are the pre-2021 design, in which items areRefCountedand have virtual destructors, and this is the first revision whosePutImageDataconstructors take thedestFormatthe exported ones have.ItemTypevalues countDrawNativeImage(USE(CAIRO)), which this module exports.ABI, measured by compiling that source with
-fdump-lang-class:Item: 16 bytes (vtable, reference count 1 at 8, type at 12).DrawingItemadds itsOptional<FloatRect>extent at 16 (flag first, rect at 20). Derived fields start at 16 for items and at 36 for drawing items, in the base's tail padding.[D1, D0, apply, isDrawingItem], plus[localBounds, globalBounds]for drawing items. Constructors install host vtables of that shape; after destruction the object holdsItem's vtable, as the base destructors leave it.DrawingItemconstructor writes only what the 2020Optionaldefault constructor writes: the flag and the first storage byte.applyneeds aGraphicsContext, which NKWebKit doesn't have. One shared slot throwsNotImplemented_nid_no_patch, naming the item from its type. That slot is the "+1 declared function" in the progress report. The "+122 implemented" also counts the local vtable callbacks; the PR implements 83 exports.Other details:
SetLineDashcopies itsDashArraywithWTF::fastMallocand keeps the source's capacity. At this revision,Vector's copy constructor didBase(other.capacity(), other.size()); 2021 switched to the size.operator delete.Debt: a fragment,
docs/dev/debt/changes/feat-nkwebkit-display-list-state-items.md, adds the entry. These are 3.20 exports with no inventory rows.Overlap:
pr_overlap.pyfinds no open PR with these exports. It could not compare #21957 and #21958, which conflict withmain; I checked their diffs by hand and they have no DisplayList code. The conflicts it reports are lines next to each other only: the shared last include line oflibSceNKWebKit.hpp(#18797, #18805, #20327, #21422, #21432, #21979, #22449–#22456, #22480–#22482), and stubs next to these ones that #18377, #19636, #20296, #20326, #20327, #22450 and #22480–#22482 also remove.Tested
Linux Mint 22.3. A shared driver constructs random items of every kind from random floats (zero, small, fractional, large), transforms, dash arrays with spare capacity, and enum values. It installs them over a
0xCD-filled buffer and hashes every byte outside the pointers, the vector contents and capacity,isDrawingItem, the bounds, and the reference counts after destruction. The hash is compared with the one from the real September 2020 item classes, constructors andFloatRectcode, compiled against WTF with that revision'sVectorcopy constructor and running the same driver.nkwebkit_displayliststateitemstest: 16 sequences of 500 items match. As a one-off, 300 sequences of 5,000 also matched.applythrowing for every kind;forwardingandbase.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-17T20:42:45Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
41237a0c94:tools/check_conventions.pypassed.nkwebkit_displayliststateitems_testsbuilt cleanly.nkwebkit_displayliststateitems):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/Api.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/DisplayListItem.cpp,core/libs/prx/libSceNKWebKit/src/DisplayListStateItems.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 PrivacyOnion on 2026-11-17T23:53:43Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
53ad6f3c80:tools/check_conventions.pypassed.nkwebkit_displayliststateitems_testsbuilt cleanly.nkwebkit_displayliststateitems):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/Api.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/DisplayListItem.cpp,core/libs/prx/libSceNKWebKit/src/DisplayListStateItems.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-17T23:59:25Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the behavior claims in the description are supported by the source and prepared test report.
What I ran
Reviewed head
53ad6f3c8028174c655c84da069fb581b7ed7aad. No commands or tests were run. The author reports the Linux Mint 22.3 comparison test and all 120 NKWebKit tests passed; these results were not independently verified.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Export.cppwas not read in full because it was excluded as too large; only its opening lines were checked.tests/DisplayListStateItems.cppwas read only through line 120 of 590.include/LegacyExports.hppwas listed but not read. The remainder of the diff, test source, and all reported test runs were not independently verified. Files read:description.md,commits.md,manifest.json,diff.patchlines 1–599,include/Api.hpp,include/DisplayListItemExports.hpp,libSceNKWebKit.hpp,src/DisplayListItem.cpp,src/DisplayListItemAbi.hpp,src/DisplayListStateItems.cpp, andtests/DisplayListStateItems.cpplines 1–120. Excluded changed file:Export.cpp(too large for the review folder).To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T13:14:08Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this review; the available source supports the reported ABI layout and constructor/destructor approach, but the full review is incomplete.
What I ran
Read the prepared description, commit list, manifest, diff excerpt, ABI header, implementation excerpt, export declarations, and test excerpt at head
0692cab1db8b8fcd3654933e236e1b97464c6093. No commands or tests were run.Results
Findings
Blocking
None verified in the inspected portions.
Non-blocking
None.
Not verified
The full changed implementation, the remaining test code,
Export.cpp(excluded because it is too large), and behavior on the reported test environment were not verified. Files read:description.md,commits.md,manifest.json,diff.patchexcerpt,DisplayListItemAbi.hpp,DisplayListItem.cppexcerpt,DisplayListStateItems.cppexcerpt, andDisplayListItemExports.hppexcerpt.Export.cppwas excluded from the review folder and not read.To get this to a good state
Nothing is required. Optional: complete inspection of the unreviewed changed code before making a formal approval decision.