Repository navigation
feat(libSceNKWebKit): implement WebCore::DisplayList state items - #22555
oneandonlydean merged 3 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 41237a0c94:
- Conventions:
tools/check_conventions.pypassed. - Build:
nkwebkit_displayliststateitems_testsbuilt cleanly. - CTest (
nkwebkit_displayliststateitems):1/1 Test #4443: nkwebkit_displayliststateitems ... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
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. - Code reading:
- Verified all 83 WebCore::DisplayList Item, DrawingItem, and state item constructor and destructor exports in core/libs/prx/libSceNKWebKit/include/DisplayListItemExports.hpp and core/libs/prx/libSceNKWebKit/src/DisplayListItem.cpp against WebKit c55364d53f97 ABI layouts and virtual method conventions.
- Confirmed Checked() pointer safety checks and null-handling logic across all constructor and destructor entry points.
- Audited struct layouts, offsets, and tail-padding field alignments (FloatRect, FloatSize, AffineTransform, Vector) against standard Itanium C++ ABI specifications.
- Checked memory deallocation routines in D0 deleting destructors to ensure operator delete is called properly with matching sizes/types.
- Verified AGENTS.md compliance regarding comments, conventions gate passes, debt fragments, and conventional commits.
Looks Good To Me
Progress report (85f73c1 → 0692cab)📈 System libraries: 43.15% (+0.27%, +122 implemented, +1 declared functions) ✅ 122 implemented
⚪ 3 behaviourally empty (constant return or throw)
🆕 1 declared as stubs
Changed libraries (implemented exports)
|
…-list-state-items
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 53ad6f3c80:
- Conventions:
tools/check_conventions.pypassed. - Build:
nkwebkit_displayliststateitems_testsbuilt cleanly. - CTest (
nkwebkit_displayliststateitems):1/1 Test #4472: nkwebkit_displayliststateitems ... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
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. - Code reading:
- Verified ABI layouts, field offsets, and static_asserts in core/libs/prx/libSceNKWebKit/include/DisplayListItemExports.hpp against WebKit c55364d53f97 specifications
- Audited all 83 WebCore::DisplayList Item, DrawingItem, and state item constructor and destructor export signatures and mangled symbol definitions
- Checked memory safety, pointer handling, and Checked() validations across DisplayListItem.cpp and DisplayListStateItems.cpp entry points
- Confirmed Itanium C++ ABI virtual destructor semantics (D0 deleting destructor calls operator delete, D1 complete destructor, D2 base destructor)
- Validated strict AGENTS.md compliance regarding no forbidden comments, technical debt documentation, and conventional commit structure
Looks Good To Me
MarcZX10
left a comment
There was a problem hiding this comment.
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
| Check | Result | Note |
|---|---|---|
| Source review | passed | Changed implementation and ABI declarations read |
| Automated checks | not run | Results in the description are author reported |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Export.cpp was not read in full because it was excluded as too large; only its opening lines were checked. tests/DisplayListStateItems.cpp was read only through line 120 of 590. include/LegacyExports.hpp was 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.patch lines 1–599, include/Api.hpp, include/DisplayListItemExports.hpp, libSceNKWebKit.hpp, src/DisplayListItem.cpp, src/DisplayListItemAbi.hpp, src/DisplayListStateItems.cpp, and tests/DisplayListStateItems.cpp lines 1–120. Excluded changed file: Export.cpp (too large for the review folder).
To get this to a good state
Nothing is required.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
MarcZX10
left a comment
There was a problem hiding this comment.
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
| Check | Result | Note |
|---|---|---|
| Source inspection | not run | Partial review only |
| Tests | not run | Author reports passing tests |
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.patch excerpt, DisplayListItemAbi.hpp, DisplayListItem.cpp excerpt, DisplayListStateItems.cpp excerpt, and DisplayListItemExports.hpp excerpt. Export.cpp was 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.
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)