Hi,
regarding current discussion about Blobs, URL, etc. I'd like to have
following proposition:
every element would have following additional methods/fields:
Blob function saveToBlob();
that would return a blob containing element data (e.g. for img element
that would be image data, for p element that would be basically
innerHTML, for input it would be current value, for script it would be
either script element content [if exists], or it would be empty blob [if
src is used]). With CORS applied here. There are progress events needed.
void function loadFromBlob(Blob blob);
that would load the blob content as element content (e.g. for img
element it would display image data in that blob [no changes to src
attribute], for p element that would be basically innerHTML, for input
it serve as value, for script this would load data as script (and
element content) and execute it [no changes to src attribute]). Function
should create no reference between element and blob, just load blob
data. There are progress events needed.
attribute Blob blob;
that would do the same as loadFromBlob, but it would also create
reference between element and blob
and why that:
1/ saveToBlob - would create easy access to any element data, we are
already talking about media elements (canvas, image), I see no point of
limiting it. Do you want blob from image or textarea? Just one function.
2/ loadFromBlob, blob - could solve current issue with createObjectUrl
(that functionality would remain as it is): no reference issues,
intuitive usage
Brona