diff options
author | Corey Farwell <coreyf@rwell.org> | 2015-04-11 11:35:40 -0700 |
---|---|---|
committer | Corey Farwell <coreyf@rwell.org> | 2015-04-14 18:03:13 -0400 |
commit | cc4a64e1feb4e4a94621374f993ba548ab3681ff (patch) | |
tree | ac9041361e143795e170ce026c334745475ac8b9 /components/script/dom/blob.rs | |
parent | 7f422e2076e7ebc9949e9fb2ffc3f09c653130c0 (diff) | |
download | servo-cc4a64e1feb4e4a94621374f993ba548ab3681ff.tar.gz servo-cc4a64e1feb4e4a94621374f993ba548ab3681ff.zip |
Add/update comments with links to spec
Extracted out of #5649
* add more hyperlinks to associated specification for structs/methods
* follow redirects and update links
* replace broken links
* removal of WHATWG multipage page name since the page name is not
guaranteed to be stable
Diffstat (limited to 'components/script/dom/blob.rs')
-rw-r--r-- | components/script/dom/blob.rs | 8 |
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 //} |