feat(libSceNKWebKit): implement the WebCore::DragImage special members #22977
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22977"
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 FinleyLaempe on 2026-11-18T15:28:19Z.
What
Implements the
WebCore::DragImagespecial members in libSceNKWebKit —WebCore::DragImage::DragImage(),WebCore::DragImage::DragImage(WebCore::DragImage&&),WebCore::DragImage::operator=(WebCore::DragImage&&)andWebCore::DragImage::~DragImage(), each in its complete- and base-object variant — replacing the seven parameterlessintstubs inExport.cpp.DragImage.cpp: default construction leaves the surface ref null, move construction steals it and move-constructs the optional members, move assignment releases the target's previous surface and steals the source's.deleteDragImagetakes itsDragImageRef(RefPtr<cairo_surface_t>) by value and is a no-op, so destruction amounts to one dereference of the surface; implemented through libcairo'scairo_surface_destroy, reached from this library through a newCairoSurfaceDestroy_nid_no_patchhelper inlibcairo/Surface.cppbecause another library cannot import the NID-patchedcairo_surface_destroyexport on Windows.DragImage.hvariant: a 200-byteDragImageholdingWtfAbi::RefPtr<CairoSurface> m_dragImageRef,Optional<TextIndicatorData> m_indicatorDataandOptional<Path> m_visiblePath, with engagement stored after the payload and the 64-bytePathtagged union carrying its index after the union. Sizes and offsets are pinned bystatic_asserts insrc/DragImageAbi.hpp.WtfAbi::Vectorfrom the existingsrc/WtfVector.hppforTextIndicatorData::textRectsInBoundingRectCoordinates(freed through the existing_ZN3WTF8fastFreeEPv) and theWebCore::Colorand geometry types fromsrc/WebCoreTypes.hpp; the newsrc/WtfRefPtr.hppadds the 8-byteWtfAbi::RefPtr.m_colorAndFlagsbits, empty the source and no-op on packed equality, followingColor.cpp.NotImplemented_nid_no_patchwhen the engagedTextIndicatorDataholds a non-nullImage(contentImage,contentImageWithHighlightorcontentImageWithoutSelection) or an out-of-lineestimatedBackgroundColor(bit 51), or the engagedPathholds aPathImpl, because those destructors are unmodeled.std::invalid_argumentwhere WebKit would fault: nullthisfor every entry point, null source for move construction and move assignment; self-assignment returns early.Export.cpploses the seven stub definitions andinclude/InventoryExports.hpptheirintdeclarations; they move to the newinclude/DragImageExports.hppwith real signatures (void/DragImage&, self and source pointers).libSceNKWebKit.hppincludes the new header, and CMake linkslibcairoplus the newdragimagetest.tests/DragImage.cppcovers construct, move, assign and destruct round-trips over poisoned storage, surface release tracking via cairo user data, the throw paths and the color/optional/Pathmove edge cases.docs/dev/debt/changes/feat-nkwebkit-drag-image.mdadds a Functional entry that records the guest layout as derived from the Cairo variant and the console ABI as not compared with a console module; the seven_ZN7WebCore9DragImage*rows are removed from the NID inventory.Tested
Arch Linux x86-64, GCC 16.2.1, Release build with
-DBUILD_TESTING=ON: the newnkwebkit_dragimagetest and every othernkwebkit_*test, 143 of 143 passed.python3 tools/check_conventions.py --base upstream/mainpasses. Not tested on a console or on Windows.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 copilot-pull-request-reviewer[bot] on 2026-11-18T15:28:33Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T15:33:25Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
e9e048c32f:tools/check_conventions.pypassed.nkwebkit_dragimage_testsbuilt cleanly.nkwebkit_dragimage):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/DragImage.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-18T16:43:21Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
ea8046f03e:tools/check_conventions.pypassed.nkwebkit_dragimage_testsbuilt cleanly.nkwebkit_dragimage):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libcairo/Surface.cpp,core/libs/prx/libcairo/include/Surface.hpp,core/libs/prx/libSceNKWebKit/src/DragImage.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-18T17:06:00Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
No commands were run. I reviewed head
ea8046f03e4bf798b0f9344d1124ad603086f80b; the author reports 143 tests passed and the conventions check passed. I read all added lines in the included changed files, plus the changed declaration ranges inExport.cppandInventoryExports.hpp,WebCoreTypes.hpp, andWtfVector.hpp. The two large changed files were read only at their relevant ranges. No repository files were excluded from review;files.jsonwas unavailable, so the review-folder README served as the changed-file inventory.Results
Findings
Blocking
None.
Non-blocking
DragImageAbi.hpp:225anddocs/dev/debt/changes/feat-nkwebkit-drag-image.md:4.Not verified
Export.cppandInventoryExports.hppwere not read in full; only the relevant changed declaration ranges inInventoryExports.hppand the diff hunks were inspected. The exact full-file export/inventory consistency was not verified.To get this to a good state
Nothing is required. Optional: compare the ABI against a console module as recorded in the debt entry.