feat(libSceNKWebKit): implement WebCore GridPosition, Length functions and unitedBoundingBoxes #15515
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15515"
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 Jawschamp on 2026-11-03T17:10:05Z.
What
Implements 6 libSceNKWebKit exports that still threw
NotImplemented_nid_no_patchas parameterless placeholders on currentmain:WebCore::GridPositionsetExplicitPosition,setSpanPositionandsetMaxPositionForTesting;valueForLengthandfloatValueForLength; andunitedBoundingBoxes. Their placeholders leaveExport.cppandinclude/InventoryExports.hpp, anddocs/dev/debt/libSceNKWebKit.mdgoes from 5995 to 5989 additional callable exports and loses their 6 table rows. Declarations with real signatures are ininclude/WebCoreLayoutExports.hpp, the code insrc/WebCoreLayout.cpp.GridPosition::integerPositionandspanPositionwere already implemented onmainas measured field getters (offset0x4). This branch no longer redefines them; the layout tests still call thosemainsymbols to read back values written by the setters.LengthFunctions.cpp,GridPosition.h/GridPosition.cppandFloatQuad.cpp.ASSERTpaths follow release-build behaviour. A nullthison the setters throws.Lengthis checked against pinnedvalueForLength/floatValueForLengthinLengthFunctions.cpp(Calculated goes throughminimumValueForLengthorLength::nonNanCalculatedValue). WebKit evaluates the calculation-value heap object (calculationValues().get(handle).evaluate(maxValue), NaN becomes 0). That map andCalculationValueare not implemented here, so these two exports throwstd::invalid_argumentforLengthType::Calculatedrather than guessing an evaluation. That is a deliberate gap, not the ASSERT-not-reached path used for the other non-fixed types.setSpanPositionis checked against pinnedGridPosition::setSpanPositionandsetIntegerPosition, which clamp to[min(), max()](min()is-max(), default ±1000000, or the testing maximum). The export therefore still accepts and clamps negatives. CSSspanis positive-only in a different function,consumeGridLine, which rejects a negative (or zero) span integer before style conversion;createGridPositionthen callssetSpanPosition(gridLineNumber ? gridLineNumber : 1, ...). That parser is not this export, so the signed clamp was left unchanged.Stringreference count.GridPosition,LengthandWTF::Vectorlayouts are taken from the pinned source and asserted at compile time; they are not measured on a console. The field-getter offsets already onmainmatchm_integerPositionat0x4.src/WebCoreLayout.cppandinclude/WebCoreLayoutExports.hppcarry the verbatim upstream licence notices from the pinned files, each with aDerived from <path>@80f77e94c63ee7202eec3d4b5b1a021dd89011baline, matchingsrc/WebCoreViewport.cpp.computeViewportAttributes,restrictMinimumScaleFactorToViewportSize,computeMinimumScaleFactorForContentContainedandrestrictScaleFactorToInitialScaleIfNotUserScalable, which open PR #15125 already implements.Tested
Linux x86_64, GCC 14.2,
-DBUILD_TESTING=ON, after merging currentmain(021d3612e8) as0d888b9bac(and earlier65351c2931as964ee94e92), dropping the duplicate getters in75d45116c7, and adding the upstream licence notices ind589a74423. Hardware and titles: not tested.nkwebkit_webcorelayoutandnkwebkit_fieldgettersboth pass, andlibSceNKWebKitlinks with a single definition ofintegerPosition/spanPosition.tools/check_conventions.py --base origin/main --head HEAD,tools/check_test_registration.pyandcore/libs/tests/test_public_headers.py --audit-onlypass. Licence blocks are allowed bycheck_conventions.py(license_run) and do not trip the no-comments rule.a15f0cbb38was a link error (multiple definitionofintegerPositionandspanPositioninWebCoreLayout.cppvsFieldGetters.cpp), notagc_commands. Waiting on a green run of this head for 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)