Web attributed text mixes outerOutlineColor with outlineWidth
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- css, typescript
- 领域
- frontend
调研方向
Start in web_renderer/src/utils/parseAttributedText.ts, where applyOutline is called with outerOutlineColor ?? outlineColor and outerOutlineWidth ?? outlineWidth, then find the attributed-text layout measurement code that reuses the same pairing. Read the AttributedTextAttributes docs for the pairing rule. Done when an inner outline applies only with both outlineColor and outlineWidth, an outer outline only with both outer properties, and the web fallback for both outlines is documented.
由索引模型根据 Issue 内容生成。
描述
Description
The Valdi web renderer incorrectly combines an outer-outline color with an inner-outline width when outerOutlineWidth is omitted.
AttributedTextAttributes documents that both outerOutlineColor and outerOutlineWidth must be provided for an outer outline. Instead, the web renderer mixes independently configured inner and outer outline properties.
Reproduction
builder.append('28', {
color: '#78350f',
outerOutlineColor: '#fef3c7',
outlineColor: '#f59e0b',
outlineWidth: 1,
});
On web, this produces approximately:
-webkit-text-stroke: 1px rgb(254, 243, 199);
The renderer takes outerOutlineColor but falls back to the inner outlineWidth. The intended orange inner outline is therefore lost.
Cause
In web_renderer/src/utils/parseAttributedText.ts, outline values are selected independently:
applyOutline(
span,
style.outerOutlineColor ?? style.outlineColor,
style.outerOutlineWidth ?? style.outlineWidth,
context,
);
This allows a color from one outline pair to be combined with a width from the other. The same mixed-pair logic is also used when calculating attributed-text layout measurements.
Expected behavior
- Apply an inner outline only when both
outlineColorandoutlineWidthare set. - Apply an outer outline only when both
outerOutlineColorandouterOutlineWidthare set. - Never combine an outer property with an inner property.
- If web cannot render both outlines simultaneously, use a documented fallback rather than silently mixing them.
Actual behavior
outerOutlineColor overrides outlineColor, while outlineWidth is reused as the missing outer width. This renders the wrong color and suppresses the requested inner outline.
Environment
- Valdi commit:
e90a983749b384ba403c3bcdd40f7d0432404694 - Target: Web/Chromium
- Bazel: 8.x
- 主要语言
- C++
- 星标
- 16.4k
- 派生
- 538
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Snapchat/Valdi 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 50/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 55/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 78/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
-
triage
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
patrick-hudson/put.gd-desktop#2044 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
uxlfoundation/oneDNN#6604 · 1 条评论 ·
维护者通常 2 天内回复