feat(nkwebkit): implement HTML color serialization #17917

Merged
alvaroelpob merged 13 commits from upstream-pr/17917 into main 2026-11-22 04:49:07 +00:00
alvaroelpob commented 2026-11-09 22:28:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alvaroelpob on 2026-11-09T22:28:43Z.


What

Implement WebCore::serializationForHTML(Color) for inline 8-bit sRGB values. Opaque colors use lowercase HTML hex; translucent colors use WebKit CSS rgba serialization. Invalid colors serialize as rgba(0, 0, 0, 0), as upstream does; out-of-line and color-function colors, which this layout does not model, throw.
Source: WebKit ColorSerialization.cpp.

Tested

Linux: suite.py feat/nkwebkit-color-html-serialization at 80a234b472: CTest 4814/4814 passed; conventions passed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #14138, #17352, #17602, #17907 and #17912
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5232244158 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17917). Originally posted by [alvaroelpob](https://github.com/alvaroelpob) on 2026-11-09T22:28:43Z. --- ### What Implement WebCore::serializationForHTML(Color) for inline 8-bit sRGB values. Opaque colors use lowercase HTML hex; translucent colors use WebKit CSS rgba serialization. Invalid colors serialize as `rgba(0, 0, 0, 0)`, as upstream does; out-of-line and color-function colors, which this layout does not model, throw. Source: [WebKit ColorSerialization.cpp](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/graphics/ColorSerialization.cpp#L595-L620). ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Linux: `suite.py feat/nkwebkit-color-html-serialization` at 80a234b472: CTest 4814/4814 passed; conventions passed. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #14138, #17352, #17602, #17907 and #17912 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-20 14:27:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T14:27:28Z.

Review: COMMENTED


Reviewed — no blocking findings

The reviewed serialization implementation and its tests show no concrete blocking defect; I could not verify two oversized changed files or run the checks, so a formal approval is not justified.

What I ran

Reviewed head f582444c27c488b310f19888379c19dc841d586f using the prepared diff and repo_read.py targeted reads. No commands or tests were run; the test result in the PR description is author-reported.

Results

Check Result Note
Diff and implementation review passed Serialization logic and tests inspected
Test suite not run PR description reports 4814/4814 passed
Full changed-file review not run Two changed files were excluded as too large

Findings

Blocking

None.

Non-blocking

None.

Not verified

Read the PR description, commits, manifest, diff, full WebCoreColorSerialization.cpp, full WebCoreColorSerialization test, WebCoreExports.hpp, relevant WebCoreColor.cpp and WebCoreTypes.hpp ranges, and CMakeLists.txt. The manifest lists five changed files; three were read, while Export.cpp, InventoryExports.hpp, and docs/dev/debt/libSceNKWebKit.md were excluded from full-text review. The diff shows their relevant changes, but their surrounding file contents were not inspected. Tests were not run, and console ABI/layout behavior remains unverified as the PR documentation states.

To get this to a good state

Nothing is required. Optional: provide full-text review access for the excluded files and run the checks on this head before seeking approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5994211344 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17917#pullrequestreview-5994211344). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T14:27:28Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The reviewed serialization implementation and its tests show no concrete blocking defect; I could not verify two oversized changed files or run the checks, so a formal approval is not justified. ## What I ran Reviewed head `f582444c27c488b310f19888379c19dc841d586f` using the prepared diff and `repo_read.py` targeted reads. No commands or tests were run; the test result in the PR description is author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and implementation review | passed | Serialization logic and tests inspected | | Test suite | not run | PR description reports 4814/4814 passed | | Full changed-file review | not run | Two changed files were excluded as too large | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Read the PR description, commits, manifest, diff, full `WebCoreColorSerialization.cpp`, full `WebCoreColorSerialization` test, `WebCoreExports.hpp`, relevant `WebCoreColor.cpp` and `WebCoreTypes.hpp` ranges, and `CMakeLists.txt`. The manifest lists five changed files; three were read, while `Export.cpp`, `InventoryExports.hpp`, and `docs/dev/debt/libSceNKWebKit.md` were excluded from full-text review. The diff shows their relevant changes, but their surrounding file contents were not inspected. Tests were not run, and console ABI/layout behavior remains unverified as the PR documentation states. ## To get this to a good state Nothing is required. Optional: provide full-text review access for the excluded files and run the checks on this head before seeking approval.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!17917
No description provided.