aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/blob.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/blob.rs')
-rw-r--r--components/script/dom/blob.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs
index 60763f7aa7e..bfecd088bbe 100644
--- a/components/script/dom/blob.rs
+++ b/components/script/dom/blob.rs
@@ -23,6 +23,7 @@ pub enum BlobTypeId {
File,
}
+// http://dev.w3.org/2006/webapi/FileAPI/#blob
#[dom_struct]
pub struct Blob {
reflector_: Reflector,
@@ -59,10 +60,12 @@ impl Blob {
BlobBinding::Wrap)
}
+ // http://dev.w3.org/2006/webapi/FileAPI/#constructorBlob
pub fn Constructor(global: GlobalRef) -> Fallible<Temporary<Blob>> {
Ok(Blob::new(global, None, ""))
}
+ // http://dev.w3.org/2006/webapi/FileAPI/#constructorBlob
pub fn Constructor_(global: GlobalRef, blobParts: DOMString, blobPropertyBag: &BlobBinding::BlobPropertyBag) -> Fallible<Temporary<Blob>> {
//TODO: accept other blobParts types - ArrayBuffer or ArrayBufferView or Blob
let bytes: Option<Vec<u8>> = Some(blobParts.into_bytes());
@@ -77,6 +80,7 @@ impl Blob {
}
impl<'a> BlobMethods for JSRef<'a, Blob> {
+ // http://dev.w3.org/2006/webapi/FileAPI/#dfn-size
fn Size(self) -> u64{
match self.bytes {
None => 0,
@@ -84,10 +88,12 @@ impl<'a> BlobMethods for JSRef<'a, Blob> {
}
}
+ // http://dev.w3.org/2006/webapi/FileAPI/#dfn-type
fn Type(self) -> DOMString {
self.typeString.clone()
}
+ // http://dev.w3.org/2006/webapi/FileAPI/#slice-method-algo
fn Slice(self, start: Option<i64>, end: Option<i64>,
contentType: Option<DOMString>) -> Temporary<Blob> {
let size: i64 = self.Size().to_i64().unwrap();
@@ -135,10 +141,12 @@ impl<'a> BlobMethods for JSRef<'a, Blob> {
}
}
+ // http://dev.w3.org/2006/webapi/FileAPI/#dfn-isClosed
//fn IsClosed(self) -> bool {
// self.isClosed_.clone()
//}
+ // http://dev.w3.org/2006/webapi/FileAPI/#dfn-close
//fn Close(self) {
// TODO
//}