Repository navigation
[bugfix] canvas: preserve PNG transparency over other nodes - #667
Merged
Merged
Conversation
Signed-off-by: Weiming Liao <liaowm5@gmail.com>
david6666666
reviewed
Dec 3, 2026
david6666666
left a comment
Collaborator
There was a problem hiding this comment.
PASS 37c8200 · 无关联 Issue / no linked issue
Dot,代表 @david6666666。技术评审通过,以下是非表决 COMMENT。
这个修法只清掉已加载图像后面的两层底色,没动空节点和加载/失败占位。三张前后截图我打开后取了同一位置的像素:修复前全透明带是深灰 (32,33,36);修复后深浅主题都能透出下层绿 (0,220,144),半透明红叠成 (128,110,72),不透明白仍覆盖下层。没有发现需要阻塞的代码问题。
Ran: 独立检查了截图像素、完整 diff 和渲染分支;同 SHA 的 Release checks、CodeQL、DSH 均通过。作者报告新像素用例在 base 失败、在此 head 通过。
Not run: 我没有重跑 Chromium 用例;canvas_png_alpha.mjs 在 extended lane,不把本次 Release 绿灯当成它已在 CI 执行。
93/100:Scope 3/3(修复范围明确);Correctness 3/3(只改已加载图片);Validation 2/3(新用例有作者记录,未独立复跑);Claim evidence 3/3(三张截图与声明 SHA 对齐,关键像素已核对);Simplicity 3/3(小范围 CSS 变更)。后续可在 extended lane 留存像素回归的运行结果,非合入阻塞。
Coordinator: 当前未请求 @david6666666 正式投票,本条不计 Approve;交由已受邀 reviewer 和仓库 Coordinator 按流程处理。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The canvas painted a solid background behind loaded images, so transparent pixels hid the canvas and any lower node. Remove the background from the loaded image frame and media well. Empty image placeholders keep their existing appearance.
Linked issue
No issue applies.
Test plan
node tests/browser/canvas_png_alpha.mjsagainst the isolated creation API and Vite in Chromiumnode tests/browser/canvas_progressive_load.mjsagainst the same fixturenpm run check:browser-manifest,npm run check:browser-locale,npm run check:i18n, andnpm run buildpython -m pre_commit run --from-ref upstream/main --to-ref HEADTest result
Evidence
In an isolated project, place the synthetic PNG with transparent, half-opacity, and opaque bands over a solid green image. The base masks the green area with the image well. The candidate shows green through the clear band and blends it with the half-opacity band. Before in dark theme · After in dark theme · After in light theme
The before image was captured at
26e155aea8faff21b565603d574bc7bd653a881a. Both after images were captured at37c8200bcb6bee745f879f7867e2fdb9049d9af1. The fixture uses browser-rendered synthetic PNGs and makes no provider calls.Candidate review
26e155aea8faff21b565603d574bc7bd653a881a37c8200bcb6bee745f879f7867e2fdb9049d9af1