Open zcorpan opened 8 years ago
So the idea would be <link rel="icon" href="#foo">
where elsewhere in the document there's <canvas id="foo">
?
Exactly so, yes.
Would this be a special-case thing just for icons, or should it be supported for all image-loading paths? What about external refs?
Maybe it's better to make this an API. srcObject
(or hrefObject
I guess). Otherwise we start special casing URLs in weird ways.
https://html.spec.whatwg.org/multipage/semantics.html#rel-icon
Some sites use a
canvas
and then update the<link rel=icon>
'shref
to thecanvas
'stoDataURL()
, e.g. to implement an animated icon or to show how many unread messages there are.I discussed with @fsoder in the context of supporting SVG favicons in Chromium and it seems like it would be better to be able to link to an in-document
svg
orcanvas
element directly for those use cases. Round-tripping via a data: URL is basically unnecessary overhead in principle.