what is apple’s beef with SVG https://fediverse.zachleat.com/@zachleat/113114654283999351
8 replies
@zachleat They don't like that it requires a full DOM model to render an image.
@litherum was tasked for a while with coming up with a standardized subset of SVG that could be rendered much more efficiently with fewer potential security leaks. But that project stalled when all SVG standards work did, and he's doing unrelated stuff now, so not sure if any change in SVG support is likely.
For icons, I still think they could render the image once when the web page is open & cache as a PNG.
@AmeliaBR @zachleat @litherum Interesting. I’m sure they could make it work. Like: even Finder/Preview support rendering SVGs, but yeah, it’s comparatively heavy.
Going by how images are handled elsewhere in the ecosystem (iOS homescreen icons, app store previews, retina handling of all those), I’m sure Apple would also prefer developers to upload different hand-optimized images for the various resolutions they require.
@AmeliaBR @zachleat @litherum Oh, there is progress on svg favicons in safari! https://bsky.app/profile/jensimmons.bsky.social/post/3ljb77vytl22v
@zachleat Yes, SVG-as-image is sandboxed (no script or references to external files) but in browsers it still uses the full web rendering engine, just with those features blocked.
The goal with the "SVG Native" subset was to be able to create SVG renderers that didn't need a full web engine & its security/sandboxing model. The graphics would be a more direct equivalent to Android "drawable" vector graphics.
Use cases & overview in the draft spec:
https://svgwg.org/specs/svg-native/@AmeliaBR oh fascinating — super interested to read the CSS support crossover 👀
@zachleat The idea was that "SVG Native" graphics would use CSS-compatible presentation attributes, but very limited CSS features. However, CSS variables would be allowed because of their use for palette theming in SVG-in-OpenType fonts (which were supposed to be an important use case for the standardized restricted SVG rendering environment).
Given how fast CSS has been adding new features, that section would probably need to be re-written as an allow-list instead of a block-list, though.