Repository navigation
fix(cli): check judges SVG gradient text by its gradient stops, not as black - #7258
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Approving at 8cfe7350. I found no blockers.
- Fix:
url(#id)fills on SVG text no longer fall back to CSScolor, which was the black at 1.07:1. They resolve through the gradient's stops, followinghref/xlink:hreffor at most 8 hops. Stops are scaled bystop-opacity, and transparent stops are dropped. The ratio comes from the stop with the lowest contrast, and the reportedfgis that stop. Pattern fills and missing references are skipped, which matches the existingbackground-clip:textskip. The stroke override still compares against the weakest-stop ratio, as it should. - fails without the fix:
contrast-svg-gradient.browser.test.tschecks the four selectors with an exacttoEqual. On main's audit, all four come backrgb(0,0,0)and#pattern-textis still emitted, so the test can't pass there. On this head it ran green in CI: the flake gate passed it 10/10 and the chrome vitest project passed it. CI, Comments, preview-regression, regression and CodeQL are green. Windows render was still running when I posted this. - The
contrast-fg.tsmirror now returnsRgba | null. Its only caller is its own test, so nothing downstream breaks.
Non-blocking, and already listed under "did NOT exercise": judging every stop can be too strict for userSpaceOnUse or gradientTransform spans the glyphs never reach. A url(#missing) <colour> fallback is skipped rather than judged by its colour. Both are fine to leave as follow-ups.
miguel-heygen
enabled auto-merge
November 5, 2026 19:00
SanHsien
added a commit
to SanHsien/hyperframes
that referenced
this pull request
Nov 6, 2026
…view Adopts heygen-com#7240 (deferred frame extraction leaves the distributed code), heygen-com#7241 (a capture segment extracts and deletes its own frames), heygen-com#7255 (segmented and sequential capture check drawElement samples), heygen-com#7254 (normalize-audio --reference stops short of the peak ceiling), heygen-com#7256 (engine names a failed script's origin first), heygen-com#7258 (SVG gradient text judged by its stops) and heygen-com#7242 (windowed source frames, off unless HF_VIDEO_FRAME_WINDOW=true). Release v0.9.17 is not synced wholesale; the producer packed budget takes upstream's +12000 from this range. Watermark advances to 32eb4c3. Co-authored-by: Vance Ingalls <vance@heygen.com> Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SanHsien
added a commit
to SanHsien/hyperframes
that referenced
this pull request
Nov 6, 2026
…view to heygen-com#7258 Adopts heygen-com#7306 (motion-blur composition counts in render_complete telemetry, adapted to discoverMovers; readEvents stays false without heygen-com#7191) and heygen-com#7318 (a set that interrupts a tween holds at any worker count) together with its merged prerequisite heygen-com#6851. PR axis advances to heygen-com#7258; heygen-com#7253 and heygen-com#7257 are open and pinned as monitored (97->99). Co-authored-by: Vance Ingalls <vance@heygen.com> Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What changed
hyperframes checknow judges SVG text filled with a gradient (fill="url(#id)") by the gradient's own stop colours, and stops reading it as black. Near-white gradient titles on a dark backdrop no longer failcontrast_aa_failureat about 1:1.The rule: a gradient fill is judged by its weakest stop, the one with the lowest contrast against the measured backdrop, since some glyph pixels really are that colour. Stops come from the gradient itself or, when it has none, from the gradient its
hrefnames. Stop opacity counts, and fully transparent stops are left out. A fill that points at a pattern or at nothing has no colour to judge, so that text is skipped. HTML gradient text (background-clip: textwith transparentcolor) is already skipped in the same way.Why
The audit read SVG text's colour from
fillonly whenfillwas a solid colour; forurl(#...)it fell back to CSScolor. That is not the paint SVG text uses, and it is usually the initial black. Every gradient title was judged as black text. Reported from the field on animated multicolour gradient text that was visibly white.What I measured
#fff,#ffe3f1,#e3f6ff, two animated with GSAP) on#0b0b14failshyperframes@0.9.16 checkwithcontrast_aa_failure, severity error,fg rgb(0,0,0), 1.07:1.contrast-svg-gradient.browser.test.tsruns the audit in Chromium on four SVG texts and expects the light gradient and thehref-borrowed gradient to pass, judged on their weakest stop (#e3f6ff), a gradient with one dark stop (#202030) to fail on that stop, and the pattern fill to be skipped. Withmain's audit every one of the four is read asrgb(0,0,0). With the fix the contrast tests (this file, the clip, solid, occlusion and fg tests) pass 45/45 three runs in a row on Linux Chromium.contrast-fg.test.ts: the TypeScript mirror of the foreground rule returns null for aurl(...)fill instead ofcolor.What I did NOT exercise
userSpaceOnUsespans wider than the text,gradientTransform,spreadMethod): every stop is judged, so such text can be held to a stop it never shows.url(#missing) <colour>fallback paint: skipped rather than judged by the fallback colour.hyperframes checkcommand built from this branch: the fixture ran on released 0.9.16 only; the fix is proven through the audit script in Chromium.Size
About 40 lines in the browser audit, the mirror's rule and test, and one browser test file.