Skip to content

Fix a bug with incorrect resolving of fill/stroke color - #953

Merged
LaurenzV merged 1 commit into
mainfrom
color-resolve
Aug 26, 2025
Merged

LaurenzV merged 1 commit into
mainfrom
color-resolve

Conversation

@LaurenzV

Copy link
Copy Markdown
Collaborator

Previously, we would first search for an ancestor node that contains the fill/stroke attribute, and then search for the actual color starting from that ancestor node. However, the actual color can potentially be defined in a child of the ancestor node (see the introduced tests). This PR fixes that.

@RazrFalcon

Copy link
Copy Markdown
Collaborator

Yep, looks good.

@LaurenzV

LaurenzV commented Aug 26, 2025 •

Copy link
Copy Markdown
Collaborator Author

Are you sure? Check the issue again, it seems like the behavior we currently have might actually be correct if I'm understanding correctly.

@LaurenzV
LaurenzV merged commit fcc516e into main Aug 26, 2025
@LaurenzV
LaurenzV deleted the color-resolve branch August 26, 2025 18:11
simartin added a commit to simartin/servo that referenced this pull request May 6, 2026
Since I have a pending patch in resvg to fix issue servo#41273, I figured
it'd be useful to update to using the latest version, which this patch
does.

As a bonus, we can get rid of 3 known failures:
   - /css/filter-effects/svg-feoffset-001.html
   - /svg/embedded/image-embedding-nesteder-data-url.html
   - /svg/pservers/reftests/radialgradient-basic-002.svg

that I believe were respectively fixed by:
   - linebender/resvg#953
   - linebender/resvg#958
   - linebender/resvg#1014

Testing: 3 known-to-fail tests now pass, and the rest in untouched
Signed-off-by: Simon Martin <[email protected]>
simartin added a commit to simartin/servo that referenced this pull request May 9, 2026
Since I have a pending patch in resvg to fix issue servo#41273, I figured
it'd be useful to update to using the latest version, which this patch
does.

As a bonus, we can get rid of 3 known failures:
   - /css/filter-effects/svg-feoffset-001.html
   - /svg/embedded/image-embedding-nesteder-data-url.html
   - /svg/pservers/reftests/radialgradient-basic-002.svg

that I believe were respectively fixed by:
   - linebender/resvg#953
   - linebender/resvg#958
   - linebender/resvg#1014

Testing: 3 known-to-fail tests now pass, and the rest in untouched
Signed-off-by: Simon Martin <[email protected]>
dmtrKovalenko pushed a commit to dmtrKovalenko/svgr that referenced this pull request Oct 13, 2026
…inebender#953)

Upstream: linebender/resvg@fcc516e

Adaptation: the fork's svgtree stores typed attribute values, so instead of
upstream's `value: &str` parameter convert_paint() takes the ancestor node
that defines the paint (`paint_node`) and reads the typed value from it,
while `currentColor`, paint-server fallbacks and links are resolved
relative to the current element.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Renderig Bug due to some combination of currentColor, CSS classes & inheritance

2 participants