Web attributed text mixes outerOutlineColor with outlineWidth

Aperta
#222 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
css, typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 outlineColor and outlineWidth are set.
  • Apply an outer outline only when both outerOutlineColor and outerOutlineWidth are 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
Lingua principale
C++
Stelle
16.4k
Fork
538
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Snapchat/Valdi

Tutte le issue di Snapchat/Valdi

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.