aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/blob.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-04-10 21:29:54 -0400
committerJosh Matthews <josh@joshmatthews.net>2014-05-03 14:18:30 -0400
commit76783b029e5e10da7fd61ab356a8f80a1eaf32e0 (patch)
tree93697ff8906d2661434abc660ae57607b1871b59 /src/components/script/dom/blob.rs
parentdfdda0098a3f169a37c100b36d4dd36ec1d815aa (diff)
downloadservo-76783b029e5e10da7fd61ab356a8f80a1eaf32e0.tar.gz
servo-76783b029e5e10da7fd61ab356a8f80a1eaf32e0.zip
Move WebIDL methods to traits implemented by JSRef types.
Diffstat (limited to 'src/components/script/dom/blob.rs')
-rw-r--r--src/components/script/dom/blob.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/components/script/dom/blob.rs b/src/components/script/dom/blob.rs
index 0399568063d..a40715f00f2 100644
--- a/src/components/script/dom/blob.rs
+++ b/src/components/script/dom/blob.rs
@@ -28,28 +28,35 @@ impl Blob {
window,
BlobBinding::Wrap)
}
-}
-impl Blob {
pub fn Constructor(window: &JSRef<Window>) -> Fallible<Unrooted<Blob>> {
Ok(Blob::new(window))
}
+}
+
+pub trait BlobMethods {
+ fn Size(&self) -> u64;
+ fn Type(&self) -> DOMString;
+ fn Slice(&self, _start: Option<i64>, _end: Option<i64>, _contentType: Option<DOMString>) -> Unrooted<Blob>;
+ fn Close(&self);
+}
- pub fn Size(&self) -> u64 {
+impl<'a> BlobMethods for JSRef<'a, Blob> {
+ fn Size(&self) -> u64 {
0
}
- pub fn Type(&self) -> DOMString {
+ fn Type(&self) -> DOMString {
~""
}
- pub fn Slice(&self, _start: Option<i64>, _end: Option<i64>, _contentType: Option<DOMString>) -> Unrooted<Blob> {
+ fn Slice(&self, _start: Option<i64>, _end: Option<i64>, _contentType: Option<DOMString>) -> Unrooted<Blob> {
let roots = RootCollection::new();
let window = self.window.root(&roots);
Blob::new(&window.root_ref())
}
- pub fn Close(&self) {}
+ fn Close(&self) {}
}
impl Reflectable for Blob {