mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
auto merge of #1810 : Ms2ger/servo/test-binding, r=jdm
This commit is contained in:
commit
a6410e86b3
4 changed files with 63 additions and 0 deletions
|
@ -89,6 +89,8 @@ DOMInterfaces = {
|
|||
|
||||
'WindowProxy': {},
|
||||
|
||||
'TestBinding': {},
|
||||
|
||||
}
|
||||
|
||||
# FIXME: This should be renamed: https://github.com/mozilla/servo/issues/1625
|
||||
|
|
42
src/components/script/dom/testbinding.rs
Normal file
42
src/components/script/dom/testbinding.rs
Normal file
|
@ -0,0 +1,42 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::utils::{Reflector, Reflectable};
|
||||
|
||||
#[deriving(Encodable)]
|
||||
pub struct TestBinding {
|
||||
reflector: Reflector,
|
||||
}
|
||||
|
||||
impl TestBinding {
|
||||
pub fn BooleanAttribute(&self) -> bool { false }
|
||||
pub fn SetBooleanAttribute(&self, _: bool) {}
|
||||
pub fn ByteAttribute(&self) -> i8 { 0 }
|
||||
pub fn OctetAttribute(&self) -> u8 { 0 }
|
||||
pub fn ShortAttribute(&self) -> i16 { 0 }
|
||||
pub fn UnsignedShortAttribute(&self) -> u16 { 0 }
|
||||
pub fn SetUnsignedShortAttribute(&self, _: u16) {}
|
||||
pub fn LongAttribute(&self) -> i32 { 0 }
|
||||
pub fn SetLongAttribute(&self, _: i32) {}
|
||||
pub fn UnsignedLongAttribute(&self) -> u32 { 0 }
|
||||
pub fn SetUnsignedLongAttribute(&self, _: u32) {}
|
||||
pub fn LongLongAttribute(&self) -> i64 { 0 }
|
||||
pub fn SetLongLongAttribute(&self, _: i64) {}
|
||||
pub fn UnsignedLongLongAttribute(&self) -> u64 { 0 }
|
||||
pub fn SetUnsignedLongLongAttribute(&self, _: u64) {}
|
||||
pub fn FloatAttribute(&self) -> f32 { 0. }
|
||||
pub fn SetFloatAttribute(&self, _: f32) {}
|
||||
pub fn DoubleAttribute(&self) -> f64 { 0. }
|
||||
pub fn SetDoubleAttribute(&self, _: f64) {}
|
||||
}
|
||||
|
||||
impl Reflectable for TestBinding {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
&self.reflector
|
||||
}
|
||||
|
||||
fn mut_reflector<'a>(&'a mut self) -> &'a mut Reflector {
|
||||
&mut self.reflector
|
||||
}
|
||||
}
|
17
src/components/script/dom/webidls/TestBinding.webidl
Normal file
17
src/components/script/dom/webidls/TestBinding.webidl
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
interface TestBinding {
|
||||
attribute boolean booleanAttribute;
|
||||
readonly attribute byte byteAttribute;
|
||||
readonly attribute octet octetAttribute;
|
||||
readonly attribute short shortAttribute;
|
||||
attribute unsigned short unsignedShortAttribute;
|
||||
attribute long longAttribute;
|
||||
attribute unsigned long unsignedLongAttribute;
|
||||
attribute long long longLongAttribute;
|
||||
readonly attribute unsigned long long unsignedLongLongAttribute;
|
||||
attribute float floatAttribute;
|
||||
attribute double doubleAttribute;
|
||||
};
|
|
@ -151,6 +151,8 @@ pub mod dom {
|
|||
pub mod validitystate;
|
||||
pub mod window;
|
||||
pub mod windowproxy;
|
||||
|
||||
pub mod testbinding;
|
||||
}
|
||||
|
||||
pub mod html {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue