diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index e0b044b28a3..e88bb70a191 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -6,16 +6,9 @@ use dom::bindings::codegen::Bindings::EventListenerBinding::EventListener; use dom::bindings::codegen::Bindings::FunctionBinding::Function; -use dom::bindings::codegen::Bindings::TestBindingBinding::TestBindingMethods; -use dom::bindings::codegen::Bindings::TestBindingBinding::TestEnum; -use dom::bindings::codegen::Bindings::TestBindingBinding::TestEnum::_empty; -use dom::bindings::codegen::UnionTypes::BlobOrString; -use dom::bindings::codegen::UnionTypes::EventOrString; -use dom::bindings::codegen::UnionTypes::EventOrString::eString; -use dom::bindings::codegen::UnionTypes::EventOrUSVString; -use dom::bindings::codegen::UnionTypes::EventOrUSVString::eUSVString; -use dom::bindings::codegen::UnionTypes::HTMLElementOrLong; -use dom::bindings::codegen::UnionTypes::HTMLElementOrLong::eLong; +use dom::bindings::codegen::Bindings::TestBindingBinding::{TestBindingMethods, TestEnum}; +use dom::bindings::codegen::UnionTypes::{BlobOrString, EventOrString}; +use dom::bindings::codegen::UnionTypes::{EventOrUSVString, HTMLElementOrLong}; use dom::bindings::global::{GlobalRef, global_root_from_reflector}; use dom::bindings::js::Root; use dom::bindings::num::Finite; @@ -67,17 +60,19 @@ impl TestBindingMethods for TestBinding { fn SetUsvstringAttribute(&self, _: USVString) {} fn ByteStringAttribute(&self) -> ByteString { ByteString::new(vec!()) } fn SetByteStringAttribute(&self, _: ByteString) {} - fn EnumAttribute(&self) -> TestEnum { _empty } + fn EnumAttribute(&self) -> TestEnum { TestEnum::_empty } fn SetEnumAttribute(&self, _: TestEnum) {} fn InterfaceAttribute(&self) -> Root { Blob::new(global_root_from_reflector(self).r(), None, "") } fn SetInterfaceAttribute(&self, _: &Blob) {} - fn UnionAttribute(&self) -> HTMLElementOrLong { eLong(0) } + fn UnionAttribute(&self) -> HTMLElementOrLong { HTMLElementOrLong::eLong(0) } fn SetUnionAttribute(&self, _: HTMLElementOrLong) {} - fn Union2Attribute(&self) -> EventOrString { eString(DOMString::new()) } + fn Union2Attribute(&self) -> EventOrString { EventOrString::eString(DOMString::new()) } fn SetUnion2Attribute(&self, _: EventOrString) {} - fn Union3Attribute(&self) -> EventOrUSVString { eUSVString(USVString("".to_owned())) } + fn Union3Attribute(&self) -> EventOrUSVString { + EventOrUSVString::eUSVString(USVString("".to_owned())) + } fn SetUnion3Attribute(&self, _: EventOrUSVString) {} fn ArrayAttribute(&self, _: *mut JSContext) -> *mut JSObject { NullValue().to_object_or_null() } fn AnyAttribute(&self, _: *mut JSContext) -> JSVal { NullValue() } @@ -124,16 +119,20 @@ impl TestBindingMethods for TestBinding { fn BinaryRenamedAttribute2(&self) -> DOMString { DOMString::new() } fn Attr_to_automatically_rename(&self) -> DOMString { DOMString::new() } fn SetAttr_to_automatically_rename(&self, _: DOMString) {} - fn GetEnumAttributeNullable(&self) -> Option { Some(_empty) } + fn GetEnumAttributeNullable(&self) -> Option { Some(TestEnum::_empty) } fn GetInterfaceAttributeNullable(&self) -> Option> { Some(Blob::new(global_root_from_reflector(self).r(), None, "")) } fn SetInterfaceAttributeNullable(&self, _: Option<&Blob>) {} fn GetObjectAttributeNullable(&self, _: *mut JSContext) -> *mut JSObject { ptr::null_mut() } fn SetObjectAttributeNullable(&self, _: *mut JSContext, _: *mut JSObject) {} - fn GetUnionAttributeNullable(&self) -> Option { Some(eLong(0)) } + fn GetUnionAttributeNullable(&self) -> Option { + Some(HTMLElementOrLong::eLong(0)) + } fn SetUnionAttributeNullable(&self, _: Option) {} - fn GetUnion2AttributeNullable(&self) -> Option { Some(eString(DOMString::new())) } + fn GetUnion2AttributeNullable(&self) -> Option { + Some(EventOrString::eString(DOMString::new())) + } fn SetUnion2AttributeNullable(&self, _: Option) {} fn BinaryRenamedMethod(&self) -> () {} fn ReceiveVoid(&self) -> () {} @@ -153,14 +152,14 @@ impl TestBindingMethods for TestBinding { fn ReceiveString(&self) -> DOMString { DOMString::new() } fn ReceiveUsvstring(&self) -> USVString { USVString("".to_owned()) } fn ReceiveByteString(&self) -> ByteString { ByteString::new(vec!()) } - fn ReceiveEnum(&self) -> TestEnum { _empty } + fn ReceiveEnum(&self) -> TestEnum { TestEnum::_empty } fn ReceiveInterface(&self) -> Root { Blob::new(global_root_from_reflector(self).r(), None, "") } fn ReceiveAny(&self, _: *mut JSContext) -> JSVal { NullValue() } fn ReceiveObject(&self, _: *mut JSContext) -> *mut JSObject { panic!() } - fn ReceiveUnion(&self) -> HTMLElementOrLong { eLong(0) } - fn ReceiveUnion2(&self) -> EventOrString { eString(DOMString::new()) } + fn ReceiveUnion(&self) -> HTMLElementOrLong { HTMLElementOrLong::eLong(0) } + fn ReceiveUnion2(&self) -> EventOrString { EventOrString::eString(DOMString::new()) } fn ReceiveNullableBoolean(&self) -> Option { Some(false) } fn ReceiveNullableByte(&self) -> Option { Some(0) } @@ -178,13 +177,17 @@ impl TestBindingMethods for TestBinding { fn ReceiveNullableString(&self) -> Option { Some(DOMString::new()) } fn ReceiveNullableUsvstring(&self) -> Option { Some(USVString("".to_owned())) } fn ReceiveNullableByteString(&self) -> Option { Some(ByteString::new(vec!())) } - fn ReceiveNullableEnum(&self) -> Option { Some(_empty) } + fn ReceiveNullableEnum(&self) -> Option { Some(TestEnum::_empty) } fn ReceiveNullableInterface(&self) -> Option> { Some(Blob::new(global_root_from_reflector(self).r(), None, "")) } fn ReceiveNullableObject(&self, _: *mut JSContext) -> *mut JSObject { ptr::null_mut() } - fn ReceiveNullableUnion(&self) -> Option { Some(eLong(0)) } - fn ReceiveNullableUnion2(&self) -> Option { Some(eString(DOMString::new())) } + fn ReceiveNullableUnion(&self) -> Option { + Some(HTMLElementOrLong::eLong(0)) + } + fn ReceiveNullableUnion2(&self) -> Option { + Some(EventOrString::eString(DOMString::new())) + } fn PassBoolean(&self, _: bool) {} fn PassByte(&self, _: i8) {}