Skip to content

Fix text decoration color fallback to use per-span foreground color#57087

Open
cortinico wants to merge 1 commit into
facebook:mainfrom
cortinico:export-D107645191
Open

Fix text decoration color fallback to use per-span foreground color#57087
cortinico wants to merge 1 commit into
facebook:mainfrom
cortinico:export-D107645191

Conversation

@cortinico
Copy link
Copy Markdown
Contributor

Summary:
D104680895 introduced custom decoration drawing that falls back to layout.paint.color when textDecorationColor is not set. This is the base paint color (typically black), not the actual foreground color of the text span. For text with ForegroundColorSpan (e.g., link text with teal color, white text on dark backgrounds), the decoration was drawn in the wrong color.

Fix: when textDecorationColor is TRANSPARENT (default), look up the ForegroundColorSpan at the decoration start position and use its color instead.

Changelog: [Android][Fixed] - Fix text decoration color not matching foreground color when textDecorationColor is not set

Differential Revision: D107645191

Summary:
D104680895 introduced custom decoration drawing that falls back to `layout.paint.color` when `textDecorationColor` is not set. This is the base paint color (typically black), not the actual foreground color of the text span. For text with `ForegroundColorSpan` (e.g., link text with teal color, white text on dark backgrounds), the decoration was drawn in the wrong color.

Fix: when `textDecorationColor` is TRANSPARENT (default), look up the `ForegroundColorSpan` at the decoration start position and use its color instead.

Changelog: [Android][Fixed] - Fix text decoration color not matching foreground color when `textDecorationColor` is not set

Differential Revision: D107645191
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 5, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jun 5, 2026

@cortinico has exported this pull request. If you are a Meta employee, you can view the originating Diff in D107645191.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant