W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Elements and Blob

From: Bronislav Klučka <Bronislav.Klucka@bauglir.com>
Date: Tue, 14 Feb 2012 21:08:45 +0100
Message-ID: <4F3ABF4D.9000102@bauglir.com>
To: public-webapps@w3.org
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
Received on Tuesday, 14 February 2012 20:09:08 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:50 GMT