Repository navigation
fix(capture): keep svg content in screenshots after an empty <style> (19.3.3) - #186
Merged
Merged
Conversation
An inline style sheet without rules was captured as <link rel="stylesheet" href="null">. Inside an <svg> that link is serialized without an end tag, so re-parsing the capture nests every following svg element inside it and the chart renders blank. Sheets without an href now always become a <style> (empty when they have no rules); sheets with an href and unreadable rules still fall back to a <link>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LucaB01
approved these changes
Oct 19, 2026
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.
Problem
Ticket 225583 (Vizzlo): charts are missing from screenshots, and the whole chart area renders blank.
replaceStyleNodesreplaced every style sheet without readable rules with<link rel="stylesheet" href={styleSheet.href}>. For an inline<style>with no rules,hrefisnull, which gives<link … href="null">. Inside an<svg>, outerHTML writes that HTML<link>without an end tag. When the renderer re-parses it in svg (foreign content),linkis not void, so everything after it in the svg is nested inside it and not painted. This code is unchanged since v6.0.0.Fix
A sheet without an
href(inline) now always takes the existing<style>branch, with its readable rules, or empty when it has none. That is the same "no CSS" result the null link gave, without breaking the svg. Sheets with anhrefand unreadable rules (cross-origin) still fall back to a<link>. Side effect: the renderer no longer requests<base>/nullfor empty<style>tags in the head.Commit 2 is the usual version bump: 19.3.3, CHANGELOG,
build/,published/19.3.3/,published/latest/.Verification
master); full suite 572/572 green.ScreenCapture.js, old vs new:href="null"anywhere.<link>stays a<link>.fix-225583-svg-empty-style) covers captures from older SDKs; this PR also covers svg inside same-origin iframesrcdoc, which the renderer change doesn't reach.Release
Merge (deploys the CDN), then
git tag 19.3.3 && git push origin 19.3.3for npm.🤖 Generated with Claude Code