Skip to content

Fix: Handling Blob image in updateNodeStyles - #88

Closed
nicolas-hoarau wants to merge 1 commit into
solid-tv:mainfrom
nicolas-hoarau:fix/blob-image-management
Closed

nicolas-hoarau wants to merge 1 commit into
solid-tv:mainfrom
nicolas-hoarau:fix/blob-image-management

Conversation

@nicolas-hoarau

Copy link
Copy Markdown

No description provided.

@chiefcll

chiefcll commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for this! While reviewing it, I found a few gaps and opened #101 to cover them. It builds on the same idea (an object URL per Blob):

  • ElementNode.set src dropped anything that wasn't a string, so <view src={blob}> never reached the DOM node. fix: a Blob src shows on both renderers, with its object URLs revoked #101 passes Blobs through, which also makes them load on the WebGL renderer.
  • After destroy, clearBlobUrl() cleared blobSrc, so a later restyle (for example from an animation that's still running) made a new URL that never got revoked.
  • A SubTexture whose ImageTexture src is a Blob threw in applyPendingImageSrc (startsWith on a Blob).
  • The old URL was revoked while an out-of-bounds <img> still pointed at it.
  • blob: URLs were loaded with crossorigin. data: URLs already skip it because old WebKit fails with it.

#101 also adds tests for these cases. Could you check whether it covers your use case? If it does, we can close this one in favor of it.

chiefcll added a commit that referenced this pull request Dec 1, 2026
…#101)

`<view src={blob}>` did nothing: ElementNode's src setter only passed
strings to the renderer node (and turned the view transparent otherwise).
It now passes a Blob too; the WebGL renderer already loads one as
ImageTexture does.

The DOM renderer shows a Blob through an object URL the node owns:
- one URL per Blob, reused while that Blob stays the source
- a URL is revoked once nothing uses it: when the source changes, after
  the <img> has moved off it (out of bounds it keeps the old one until it
  is back in bounds), and when the node is destroyed
- a destroyed node makes no new URL, so a late write cannot leak one
- a SubTexture whose ImageTexture src is a Blob shows it, instead of
  throwing in applyPendingImageSrc (pendingSrc.startsWith on a Blob)
- blob: URLs load without crossorigin, as data: URIs do (old WebKit)

Supersedes #88.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@chiefcll chiefcll closed this Dec 1, 2026
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.

2 participants