Repository navigation
Inherit dominant-baseline into nested <tspan> elements - #1086
Merged
LaurenzV merged 1 commit intoOct 7, 2026
Merged
Conversation
Contributor
|
lgtm Approach is correct but I'm not sure the comment block in |
Contributor
Author
|
I won't have the time to continue with the PR. You can take it over. |
Treat dominant-baseline as inherited so nested spans resolve the value through the full ancestor chain. Add a render regression test for an unstyled intermediate span. Fixes linebender#864. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LaurenzV
force-pushed
the
fix/864-dominant-baseline-inheritance
branch
from
October 7, 2026 17:47
7ff45ee to
30d315b
Compare
Collaborator
|
Thanks! |
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.
dominant-baselinewas listed inis_non_inheritable, so usvg only let a<tspan>pick up the value from its direct parent element. For a nested<tspan>whose immediate parent does not carry the property, the value of an ancestor<text>was therefore lost and the span fell back toauto(alphabetic baseline). The nested run then sat on a different baseline than its siblings — the "weird" positioning reported in #864.dominant-baselineis actually an inherited property, unlike its siblingsalignment-baselineandbaseline-shift:inherited: true(field groupsvginherited), whilealignment-baselineandbaseline-shiftare not inherited: https://github.com/chromium/chromium/blob/main/third_party/blink/renderer/core/css/css_properties.json5 (name: "dominant-baseline" ... inherited: true)SPIEnum(defaultinherits = true).Removing it from
is_non_inheritablemakesfind_attribute/resolve_inheritwalk the full ancestor chain, matching Chrome's rendering (verified by comparison) and the spec.Fixes #864.
Generated with Claude
Note: I accidentally closed the original PR (#1070) by deleting my fork, which auto-closed it. This reopens the same change — the branch and commits are unchanged.