mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
auto merge of #955 : kmcallister/servo/bindings, r=metajack
This commit is contained in:
commit
7ffcc29d54
79 changed files with 1329 additions and 1020 deletions
|
@ -1049,7 +1049,7 @@ for (uint32_t i = 0; i < length; ++i) {
|
|||
# "if (!ConvertJSValueToString(cx, ${val}, ${valPtr}, %s, %s, %s)) {\n"
|
||||
# " return false;\n"
|
||||
# "}" % (nullBehavior, undefinedBehavior, varName))
|
||||
strval = "str(strval.unwrap())"
|
||||
strval = "Some(strval.unwrap())"
|
||||
if isOptional:
|
||||
strval = "Some(%s)" % strval
|
||||
conversionCode = (
|
||||
|
@ -1068,7 +1068,7 @@ for (uint32_t i = 0; i < length; ++i) {
|
|||
return handleDefault(
|
||||
conversionCode,
|
||||
("static data: [u8, ..%s] = [ %s ];\n"
|
||||
"%s = str(str::from_utf8(data));" %
|
||||
"%s = Some(str::from_utf8(data));" %
|
||||
(len(defaultValue.value) + 1,
|
||||
", ".join(["'" + char + "' as u8" for char in defaultValue.value] + ["0"]),
|
||||
varName)))
|
||||
|
@ -2925,8 +2925,6 @@ class CGCallGenerator(CGThing):
|
|||
# Return values that go in outparams go here
|
||||
if resultOutParam:
|
||||
args.append(CGGeneric("result"))
|
||||
if isFallible:
|
||||
args.append(CGGeneric("&mut rv"))
|
||||
|
||||
needsCx = (typeNeedsCx(returnType, True) or
|
||||
any(typeNeedsCx(a.type) for (a, _) in arguments) or
|
||||
|
@ -2944,21 +2942,29 @@ class CGCallGenerator(CGThing):
|
|||
else:
|
||||
call = CGWrapper(call, pre="(*%s)." % object)
|
||||
call = CGList([call, CGWrapper(args, pre="(", post=");")])
|
||||
if result is not None:
|
||||
if declareResult:
|
||||
result = CGWrapper(result, pre="let mut result: ", post=";")
|
||||
self.cgRoot.prepend(result)
|
||||
if not resultOutParam:
|
||||
call = CGWrapper(call, pre="result = ")
|
||||
|
||||
if isFallible:
|
||||
self.cgRoot.prepend(CGWrapper(result if result is not None else CGGeneric("()"),
|
||||
pre="let mut result_fallible: Result<", post=",Error>;"))
|
||||
|
||||
if result is not None and declareResult:
|
||||
result = CGWrapper(result, pre="let mut result: ", post=";")
|
||||
self.cgRoot.prepend(result)
|
||||
|
||||
if isFallible:
|
||||
call = CGWrapper(call, pre="result_fallible = ")
|
||||
elif result is not None and not resultOutParam:
|
||||
call = CGWrapper(call, pre="result = ")
|
||||
|
||||
call = CGWrapper(call)
|
||||
self.cgRoot.append(call)
|
||||
|
||||
if isFallible:
|
||||
self.cgRoot.prepend(CGGeneric("let mut rv: ErrorResult = Ok(());"))
|
||||
self.cgRoot.append(CGGeneric("if (rv.is_err()) {"))
|
||||
self.cgRoot.append(CGGeneric("if (result_fallible.is_err()) {"))
|
||||
self.cgRoot.append(CGIndenter(errorReport))
|
||||
self.cgRoot.append(CGGeneric("}"))
|
||||
if result is not None and not resultOutParam:
|
||||
self.cgRoot.append(CGGeneric("result = result_fallible.unwrap();"))
|
||||
|
||||
def define(self):
|
||||
return self.cgRoot.define()
|
||||
|
@ -3190,7 +3196,7 @@ class CGAbstractBindingMethod(CGAbstractExternMethod):
|
|||
" return false as JSBool;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"let this: *rust_box<%s>;" % self.descriptor.concreteType))
|
||||
"let this: *Box<%s>;" % self.descriptor.concreteType))
|
||||
|
||||
def generate_code(self):
|
||||
assert(False) # Override me
|
||||
|
@ -3230,7 +3236,7 @@ class CGSpecializedMethod(CGAbstractExternMethod):
|
|||
self.method = method
|
||||
name = method.identifier.name
|
||||
args = [Argument('*JSContext', 'cx'), Argument('JSHandleObject', 'obj'),
|
||||
Argument('*mut rust_box<%s>' % descriptor.concreteType, 'this'),
|
||||
Argument('*mut Box<%s>' % descriptor.concreteType, 'this'),
|
||||
Argument('libc::c_uint', 'argc'), Argument('*mut JSVal', 'vp')]
|
||||
CGAbstractExternMethod.__init__(self, descriptor, name, 'JSBool', args)
|
||||
|
||||
|
@ -3247,7 +3253,7 @@ class CGSpecializedMethod(CGAbstractExternMethod):
|
|||
self.descriptor, self.method),
|
||||
pre=extraPre +
|
||||
" let obj = (*obj.unnamed);\n" +
|
||||
" let this = &mut (*this).payload;\n").define()
|
||||
" let this = &mut (*this).data;\n").define()
|
||||
|
||||
class CGGenericGetter(CGAbstractBindingMethod):
|
||||
"""
|
||||
|
@ -3283,7 +3289,7 @@ class CGSpecializedGetter(CGAbstractExternMethod):
|
|||
name = 'get_' + attr.identifier.name
|
||||
args = [ Argument('*JSContext', 'cx'),
|
||||
Argument('JSHandleObject', 'obj'),
|
||||
Argument('*mut rust_box<%s>' % descriptor.concreteType, 'this'),
|
||||
Argument('*mut Box<%s>' % descriptor.concreteType, 'this'),
|
||||
Argument('*mut JSVal', 'vp') ]
|
||||
CGAbstractExternMethod.__init__(self, descriptor, name, "JSBool", args)
|
||||
|
||||
|
@ -3309,7 +3315,7 @@ class CGSpecializedGetter(CGAbstractExternMethod):
|
|||
self.descriptor, self.attr)),
|
||||
pre=extraPre +
|
||||
" let obj = (*obj.unnamed);\n" +
|
||||
" let this = &mut (*this).payload;\n").define()
|
||||
" let this = &mut (*this).data;\n").define()
|
||||
|
||||
class CGGenericSetter(CGAbstractBindingMethod):
|
||||
"""
|
||||
|
@ -3350,7 +3356,7 @@ class CGSpecializedSetter(CGAbstractExternMethod):
|
|||
name = 'set_' + attr.identifier.name
|
||||
args = [ Argument('*JSContext', 'cx'),
|
||||
Argument('JSHandleObject', 'obj'),
|
||||
Argument('*mut rust_box<%s>' % descriptor.concreteType, 'this'),
|
||||
Argument('*mut Box<%s>' % descriptor.concreteType, 'this'),
|
||||
Argument('*mut JSVal', 'argv')]
|
||||
CGAbstractExternMethod.__init__(self, descriptor, name, "JSBool", args)
|
||||
|
||||
|
@ -3367,7 +3373,7 @@ class CGSpecializedSetter(CGAbstractExternMethod):
|
|||
self.descriptor, self.attr)),
|
||||
pre=extraPre +
|
||||
" let obj = (*obj.unnamed);\n" +
|
||||
" let this = &mut (*this).payload;\n").define()
|
||||
" let this = &mut (*this).data;\n").define()
|
||||
|
||||
def infallibleForMember(member, type, descriptorProvider):
|
||||
"""
|
||||
|
@ -3642,8 +3648,8 @@ class CGProxyUnwrap(CGAbstractMethod):
|
|||
obj = js::UnwrapObject(obj);
|
||||
}*/
|
||||
//MOZ_ASSERT(IsProxy(obj));
|
||||
let box: *rust_box<%s> = cast::transmute(RUST_JSVAL_TO_PRIVATE(GetProxyPrivate(obj)));
|
||||
return ptr::to_unsafe_ptr(&(*box).payload);""" % (self.descriptor.concreteType)
|
||||
let box: *Box<%s> = cast::transmute(RUST_JSVAL_TO_PRIVATE(GetProxyPrivate(obj)));
|
||||
return ptr::to_unsafe_ptr(&(*box).data);""" % (self.descriptor.concreteType)
|
||||
|
||||
class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||
def __init__(self, descriptor):
|
||||
|
@ -3721,7 +3727,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
|||
" if strval.is_err() {\n" +
|
||||
" return 0;\n" +
|
||||
" }\n" +
|
||||
" let name = str(strval.unwrap());\n" +
|
||||
" let name = Some(strval.unwrap());\n" +
|
||||
"\n" +
|
||||
" let this: *%s = UnwrapProxy(proxy);\n" +
|
||||
CGIndenter(CGProxyNamedGetter(self.descriptor, templateValues)).define() + "\n" +
|
||||
|
@ -3790,7 +3796,7 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
|
|||
" if strval.is_err() {\n" +
|
||||
" return 0;\n" +
|
||||
" }\n" +
|
||||
" let name = str(strval.unwrap());\n" +
|
||||
" let name = Some(strval.unwrap());\n" +
|
||||
"\n" +
|
||||
" let this: *%s = UnwrapProxy(proxy);\n" +
|
||||
CGIndenter(CGProxyNamedSetter(self.descriptor)).define() + "\n" +
|
||||
|
@ -3806,7 +3812,7 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
|
|||
" if strval.is_err() {\n" +
|
||||
" return 0;\n" +
|
||||
" }\n" +
|
||||
" let name = str(strval.unwrap());\n" +
|
||||
" let name = Some(strval.unwrap());\n" +
|
||||
" let this: %%s = UnwrapProxy(proxy);\n" +
|
||||
CGIndenter(CGProxyNamedGetter(self.descriptor)).define() +
|
||||
" if (found) {\n"
|
||||
|
@ -3852,7 +3858,7 @@ class CGDOMJSProxyHandler_hasOwn(CGAbstractExternMethod):
|
|||
" if strval.is_err() {\n" +
|
||||
" return 0;\n" +
|
||||
" }\n" +
|
||||
" let name = str(strval.unwrap());\n" +
|
||||
" let name = Some(strval.unwrap());\n" +
|
||||
"\n" +
|
||||
" let this: *%s = UnwrapProxy(proxy);\n" +
|
||||
CGIndenter(CGProxyNamedGetter(self.descriptor)).define() + "\n" +
|
||||
|
@ -3997,7 +4003,7 @@ class CGAbstractClassHook(CGAbstractExternMethod):
|
|||
|
||||
def definition_body_prologue(self):
|
||||
return """
|
||||
let this: *%s = &(*unwrap::<*rust_box<%s>>(obj)).payload;
|
||||
let this: *%s = &(*unwrap::<*Box<%s>>(obj)).data;
|
||||
""" % (self.descriptor.concreteType, self.descriptor.concreteType)
|
||||
|
||||
def definition_body(self):
|
||||
|
@ -4686,6 +4692,7 @@ class CGBindingRoot(CGThing):
|
|||
'std::vec',
|
||||
'std::str',
|
||||
'std::num',
|
||||
'std::unstable::raw::Box',
|
||||
],
|
||||
[],
|
||||
curr)
|
||||
|
|
|
@ -14,7 +14,7 @@ use std::libc;
|
|||
use std::ptr;
|
||||
use std::ptr::{null, to_unsafe_ptr};
|
||||
use std::str;
|
||||
use std::unstable::intrinsics;
|
||||
use std::unstable::raw::Box;
|
||||
use js::glue::*;
|
||||
use js::glue::{DefineFunctionWithReserved, GetObjectJSClass, RUST_OBJECT_TO_JSVAL};
|
||||
use js::glue::{js_IsObjectProxyClass, js_IsFunctionProxyClass, IsProxyHandlerFamily};
|
||||
|
@ -83,48 +83,27 @@ extern fn InterfaceObjectToString(cx: *JSContext, _argc: c_uint, vp: *mut JSVal)
|
|||
}
|
||||
|
||||
let name = jsval_to_str(cx, *v).unwrap();
|
||||
let retval = str(~"function " + name + "() {\n [native code]\n}");
|
||||
let retval = Some(~"function " + name + "() {\n [native code]\n}");
|
||||
*vp = domstring_to_jsval(cx, &retval);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
#[deriving(Clone)]
|
||||
pub enum DOMString {
|
||||
str(~str),
|
||||
null_string
|
||||
}
|
||||
pub type DOMString = Option<~str>;
|
||||
|
||||
impl DOMString {
|
||||
pub fn to_str(&self) -> ~str {
|
||||
match *self {
|
||||
str(ref s) => s.clone(),
|
||||
null_string => ~""
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_ref<'a>(&'a self) -> &'a str {
|
||||
match *self {
|
||||
str(ref s) => s.as_slice(),
|
||||
null_string => &'a "",
|
||||
}
|
||||
}
|
||||
|
||||
// XXX This is temporary until issue #875 is fixed.
|
||||
pub fn unwrap(&self) -> ~str {
|
||||
match self {
|
||||
&str(ref s) => s.clone(),
|
||||
&null_string => fail!("Cannot unwrap a null string.")
|
||||
}
|
||||
pub fn null_str_as_empty(s: &DOMString) -> ~str {
|
||||
// We don't use map_default because it would allocate ~"" even for Some.
|
||||
match *s {
|
||||
Some(ref s) => s.clone(),
|
||||
None => ~""
|
||||
}
|
||||
}
|
||||
|
||||
pub struct rust_box<T> {
|
||||
rc: uint,
|
||||
td: *intrinsics::TyDesc,
|
||||
next: *(),
|
||||
prev: *(),
|
||||
payload: T
|
||||
pub fn null_str_as_empty_ref<'a>(s: &'a DOMString) -> &'a str {
|
||||
match *s {
|
||||
Some(ref s) => s.as_slice(),
|
||||
None => &'a ""
|
||||
}
|
||||
}
|
||||
|
||||
fn is_dom_class(clasp: *JSClass) -> bool {
|
||||
|
@ -193,8 +172,8 @@ pub fn unwrap_value<T>(val: *JSVal, proto_id: PrototypeList::id::ID, proto_depth
|
|||
}
|
||||
}
|
||||
|
||||
pub unsafe fn squirrel_away<T>(x: @mut T) -> *rust_box<T> {
|
||||
let y: *rust_box<T> = cast::transmute(x);
|
||||
pub unsafe fn squirrel_away<T>(x: @mut T) -> *Box<T> {
|
||||
let y: *Box<T> = cast::transmute(x);
|
||||
cast::forget(x);
|
||||
y
|
||||
}
|
||||
|
@ -223,10 +202,10 @@ pub fn jsval_to_str(cx: *JSContext, v: JSVal) -> Result<~str, ()> {
|
|||
#[fixed_stack_segment]
|
||||
pub unsafe fn domstring_to_jsval(cx: *JSContext, string: &DOMString) -> JSVal {
|
||||
match string {
|
||||
&null_string => {
|
||||
&None => {
|
||||
JSVAL_NULL
|
||||
}
|
||||
&str(ref s) => {
|
||||
&Some(ref s) => {
|
||||
do s.as_imm_buf |buf, len| {
|
||||
let cbuf = cast::transmute(buf);
|
||||
RUST_STRING_TO_JSVAL(JS_NewStringCopyN(cx, cbuf, len as libc::size_t))
|
||||
|
@ -536,7 +515,7 @@ pub fn initialize_global(global: *JSObject) {
|
|||
unsafe {
|
||||
//XXXjdm we should be storing the box pointer instead of the inner
|
||||
let box = squirrel_away(protoArray);
|
||||
let inner = ptr::to_unsafe_ptr(&(*box).payload);
|
||||
let inner = ptr::to_unsafe_ptr(&(*box).data);
|
||||
JS_SetReservedSlot(global,
|
||||
DOM_PROTOTYPE_SLOT,
|
||||
RUST_PRIVATE_TO_JSVAL(inner as *libc::c_void));
|
||||
|
@ -773,7 +752,9 @@ pub enum Error {
|
|||
InvalidCharacter,
|
||||
}
|
||||
|
||||
pub type ErrorResult = Result<(), Error>;
|
||||
pub type Fallible<T> = Result<T, Error>;
|
||||
|
||||
pub type ErrorResult = Fallible<()>;
|
||||
|
||||
pub struct EnumEntry {
|
||||
value: &'static str,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
//! DOM bindings for `CharacterData`.
|
||||
|
||||
use dom::bindings::utils::{DOMString, str, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper, WrapperCache};
|
||||
use dom::node::{Node, NodeTypeId, ScriptView};
|
||||
use js::jsapi::{JSObject, JSContext};
|
||||
|
@ -23,34 +23,36 @@ impl CharacterData {
|
|||
}
|
||||
|
||||
pub fn Data(&self) -> DOMString {
|
||||
str(self.data.clone())
|
||||
Some(self.data.clone())
|
||||
}
|
||||
|
||||
pub fn SetData(&mut self, arg: &DOMString, _rv: &mut ErrorResult) {
|
||||
self.data = arg.unwrap();
|
||||
pub fn SetData(&mut self, arg: &DOMString) -> ErrorResult {
|
||||
self.data = arg.get_ref().clone();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Length(&self) -> u32 {
|
||||
self.data.len() as u32
|
||||
}
|
||||
|
||||
pub fn SubstringData(&self, offset: u32, count: u32, _rv: &mut ErrorResult) -> DOMString {
|
||||
str(self.data.slice(offset as uint, count as uint).to_str())
|
||||
pub fn SubstringData(&self, offset: u32, count: u32) -> Fallible<DOMString> {
|
||||
Ok(Some(self.data.slice(offset as uint, count as uint).to_str()))
|
||||
}
|
||||
|
||||
pub fn AppendData(&mut self, arg: &DOMString, _rv: &mut ErrorResult) {
|
||||
self.data.push_str(arg.unwrap());
|
||||
pub fn AppendData(&mut self, arg: &DOMString) -> ErrorResult {
|
||||
self.data.push_str(arg.get_ref().clone());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn InsertData(&mut self, _offset: u32, _arg: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn InsertData(&mut self, _offset: u32, _arg: &DOMString) -> ErrorResult {
|
||||
fail!("CharacterData::InsertData() is unimplemented")
|
||||
}
|
||||
|
||||
pub fn DeleteData(&mut self, _offset: u32, _count: u32, _rv: &mut ErrorResult) {
|
||||
pub fn DeleteData(&mut self, _offset: u32, _count: u32) -> ErrorResult {
|
||||
fail!("CharacterData::DeleteData() is unimplemented")
|
||||
}
|
||||
|
||||
pub fn ReplaceData(&mut self, _offset: u32, _count: u32, _arg: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn ReplaceData(&mut self, _offset: u32, _count: u32, _arg: &DOMString) -> ErrorResult {
|
||||
fail!("CharacterData::ReplaceData() is unimplemented")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, str, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, Fallible, null_str_as_empty};
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::node::{AbstractNode, ScriptView, CommentNodeTypeId, Node};
|
||||
use dom::window::Window;
|
||||
|
@ -20,14 +20,11 @@ impl Comment {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: @mut Window, data: &DOMString, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
|
||||
let s = match *data {
|
||||
str(ref s) => s.clone(),
|
||||
null_string => ~""
|
||||
};
|
||||
pub fn Constructor(owner: @mut Window, data: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
|
||||
let s = null_str_as_empty(data);
|
||||
unsafe {
|
||||
let compartment = (*owner.page).js_info.get_ref().js_compartment;
|
||||
Node::as_abstract_node(compartment.cx.ptr, @Comment::new(s))
|
||||
Ok(Node::as_abstract_node(compartment.cx.ptr, @Comment::new(s)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::DocumentBinding;
|
||||
use dom::bindings::utils::{DOMString, WrapperCache, ErrorResult, null_string, str};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper, rust_box, DerivedWrapper};
|
||||
use dom::bindings::utils::{is_valid_element_name, InvalidCharacter, Traceable};
|
||||
use dom::bindings::utils::{DOMString, WrapperCache, ErrorResult, Fallible};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper, DerivedWrapper};
|
||||
use dom::bindings::utils::{is_valid_element_name, InvalidCharacter, Traceable, null_str_as_empty};
|
||||
use dom::element::{Element};
|
||||
use dom::element::{HTMLHtmlElementTypeId, HTMLHeadElementTypeId, HTMLTitleElementTypeId};
|
||||
use dom::event::Event;
|
||||
|
@ -29,6 +29,7 @@ use std::ptr;
|
|||
use std::str::eq_slice;
|
||||
use std::libc;
|
||||
use std::ascii::StrAsciiExt;
|
||||
use std::unstable::raw::Box;
|
||||
|
||||
pub trait WrappableDocument {
|
||||
fn init_wrapper(@mut self, cx: *JSContext);
|
||||
|
@ -48,13 +49,13 @@ impl AbstractDocument {
|
|||
}
|
||||
|
||||
unsafe fn transmute<T, R>(&self, f: &fn(&T) -> R) -> R {
|
||||
let box: *rust_box<T> = cast::transmute(self.document);
|
||||
f(&(*box).payload)
|
||||
let box: *Box<T> = cast::transmute(self.document);
|
||||
f(&(*box).data)
|
||||
}
|
||||
|
||||
unsafe fn transmute_mut<T, R>(&self, f: &fn(&mut T) -> R) -> R {
|
||||
let box: *mut rust_box<T> = cast::transmute(self.document);
|
||||
f(&mut (*box).payload)
|
||||
let box: *mut Box<T> = cast::transmute(self.document);
|
||||
f(&mut (*box).data)
|
||||
}
|
||||
|
||||
pub fn with_base<R>(&self, callback: &fn(&Document) -> R) -> R {
|
||||
|
@ -103,14 +104,14 @@ impl Document {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: @mut Window, _rv: &mut ErrorResult) -> AbstractDocument {
|
||||
pub fn Constructor(owner: @mut Window) -> Fallible<AbstractDocument> {
|
||||
let root = @HTMLHtmlElement {
|
||||
parent: HTMLElement::new(HTMLHtmlElementTypeId, ~"html")
|
||||
};
|
||||
|
||||
let cx = owner.page.js_info.get_ref().js_compartment.cx.ptr;
|
||||
let root = unsafe { Node::as_abstract_node(cx, root) };
|
||||
AbstractDocument::as_abstract(cx, @mut Document::new(root, None, XML))
|
||||
Ok(AbstractDocument::as_abstract(cx, @mut Document::new(root, None, XML)))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -187,23 +188,23 @@ impl BindingObject for Document {
|
|||
|
||||
impl Document {
|
||||
pub fn URL(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn DocumentURI(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn CompatMode(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn CharacterSet(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn ContentType(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn GetDocumentElement(&self) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -224,7 +225,7 @@ impl Document {
|
|||
}
|
||||
|
||||
pub fn GetElementsByTagName(&self, tag: &DOMString) -> @mut HTMLCollection {
|
||||
self.createHTMLCollection(|elem| eq_slice(elem.tag_name, tag.to_str()))
|
||||
self.createHTMLCollection(|elem| eq_slice(elem.tag_name, null_str_as_empty(tag)))
|
||||
}
|
||||
|
||||
pub fn GetElementsByTagNameNS(&self, _ns: &DOMString, _tag: &DOMString) -> @mut HTMLCollection {
|
||||
|
@ -241,45 +242,43 @@ impl Document {
|
|||
None
|
||||
}
|
||||
|
||||
pub fn CreateElement(&self, local_name: &DOMString, rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
|
||||
pub fn CreateElement(&self, local_name: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
|
||||
let cx = self.get_cx();
|
||||
let local_name = local_name.to_str();
|
||||
let local_name = null_str_as_empty(local_name);
|
||||
if !is_valid_element_name(local_name) {
|
||||
*rv = Err(InvalidCharacter);
|
||||
// FIXME #909: what to return here?
|
||||
fail!("invalid character");
|
||||
return Err(InvalidCharacter);
|
||||
}
|
||||
let local_name = local_name.to_ascii_lower();
|
||||
build_element_from_tag(cx, local_name)
|
||||
Ok(build_element_from_tag(cx, local_name))
|
||||
}
|
||||
|
||||
pub fn CreateElementNS(&self, _namespace: &DOMString, _qualified_name: &DOMString, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
|
||||
pub fn CreateElementNS(&self, _namespace: &DOMString, _qualified_name: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
|
||||
fail!("stub")
|
||||
}
|
||||
|
||||
pub fn CreateTextNode(&self, data: &DOMString) -> AbstractNode<ScriptView> {
|
||||
let cx = self.get_cx();
|
||||
unsafe { Node::as_abstract_node(cx, @Text::new(data.to_str())) }
|
||||
unsafe { Node::as_abstract_node(cx, @Text::new(null_str_as_empty(data))) }
|
||||
}
|
||||
|
||||
pub fn CreateEvent(&self, _interface: &DOMString, _rv: &mut ErrorResult) -> @mut Event {
|
||||
pub fn CreateEvent(&self, _interface: &DOMString) -> Fallible<@mut Event> {
|
||||
fail!("stub")
|
||||
}
|
||||
|
||||
pub fn GetInputEncoding(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn Referrer(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn LastModified(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn ReadyState(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn Title(&self) -> DOMString {
|
||||
|
@ -297,7 +296,7 @@ impl Document {
|
|||
if child.is_text() {
|
||||
do child.with_imm_text() |text| {
|
||||
let s = text.parent.Data();
|
||||
title = title + s.to_str();
|
||||
title = title + null_str_as_empty(&s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -308,10 +307,10 @@ impl Document {
|
|||
let v: ~[&str] = title.word_iter().collect();
|
||||
title = v.connect(" ");
|
||||
title = title.trim().to_owned();
|
||||
str(title)
|
||||
Some(title)
|
||||
}
|
||||
|
||||
pub fn SetTitle(&self, title: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetTitle(&self, title: &DOMString) -> ErrorResult {
|
||||
match self.doctype {
|
||||
SVG => {
|
||||
fail!("no SVG document yet")
|
||||
|
@ -348,10 +347,11 @@ impl Document {
|
|||
};
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Dir(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetDir(&self, _dir: &DOMString) {
|
||||
|
@ -365,8 +365,8 @@ impl Document {
|
|||
None
|
||||
}
|
||||
|
||||
pub fn HasFocus(&self, _rv: &mut ErrorResult) -> bool {
|
||||
false
|
||||
pub fn HasFocus(&self) -> Fallible<bool> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
pub fn GetCurrentScript(&self) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -380,8 +380,8 @@ impl Document {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn GetMozFullScreenElement(&self, _rv: &mut ErrorResult) -> Option<AbstractNode<ScriptView>> {
|
||||
None
|
||||
pub fn GetMozFullScreenElement(&self) -> Fallible<Option<AbstractNode<ScriptView>>> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn GetMozPointerLockElement(&self) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -408,18 +408,18 @@ impl Document {
|
|||
}
|
||||
|
||||
pub fn GetSelectedStyleSheetSet(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSelectedStyleSheetSet(&self, _sheet: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn GetLastStyleSheetSet(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn GetPreferredStyleSheetSet(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn EnableStyleSheetsForSet(&self, _name: &DOMString) {
|
||||
|
@ -429,13 +429,13 @@ impl Document {
|
|||
None
|
||||
}
|
||||
|
||||
pub fn QuerySelector(&self, _selectors: &DOMString, _rv: &mut ErrorResult) -> Option<AbstractNode<ScriptView>> {
|
||||
None
|
||||
pub fn QuerySelector(&self, _selectors: &DOMString) -> Fallible<Option<AbstractNode<ScriptView>>> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn GetElementsByName(&self, name: &DOMString) -> @mut HTMLCollection {
|
||||
self.createHTMLCollection(|elem|
|
||||
elem.get_attr("name").is_some() && eq_slice(elem.get_attr("name").unwrap(), name.to_str()))
|
||||
elem.get_attr("name").is_some() && eq_slice(elem.get_attr("name").unwrap(), null_str_as_empty(name)))
|
||||
}
|
||||
|
||||
pub fn createHTMLCollection(&self, callback: &fn(elem: &Element) -> bool) -> @mut HTMLCollection {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, str, null_string};
|
||||
use dom::bindings::utils::DOMString;
|
||||
use dom::node::{ScriptView, Node, DoctypeNodeTypeId};
|
||||
|
||||
/// The `DOCTYPE` tag.
|
||||
|
@ -31,20 +31,14 @@ impl DocumentType<ScriptView> {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
str(self.name.clone())
|
||||
Some(self.name.clone())
|
||||
}
|
||||
|
||||
pub fn PublicId(&self) -> DOMString {
|
||||
match self.public_id {
|
||||
Some(ref s) => str(s.clone()),
|
||||
None => null_string
|
||||
}
|
||||
self.public_id.clone()
|
||||
}
|
||||
|
||||
pub fn SystemId(&self) -> DOMString {
|
||||
match self.system_id {
|
||||
Some(ref s) => str(s.clone()),
|
||||
None => null_string
|
||||
}
|
||||
self.system_id.clone()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
use dom::bindings::codegen::DOMParserBinding;
|
||||
use dom::bindings::codegen::DOMParserBinding::SupportedTypeValues::{Text_html, Text_xml};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, WrapperCache, CacheableWrapper};
|
||||
use dom::bindings::utils::{DOMString, Fallible, WrapperCache, CacheableWrapper};
|
||||
use dom::document::{AbstractDocument, Document, XML};
|
||||
use dom::element::HTMLHtmlElementTypeId;
|
||||
use dom::htmldocument::HTMLDocument;
|
||||
|
@ -33,15 +33,14 @@ impl DOMParser {
|
|||
parser
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: @mut Window, _rv: &mut ErrorResult) -> @mut DOMParser {
|
||||
DOMParser::new(owner)
|
||||
pub fn Constructor(owner: @mut Window) -> Fallible<@mut DOMParser> {
|
||||
Ok(DOMParser::new(owner))
|
||||
}
|
||||
|
||||
pub fn ParseFromString(&self,
|
||||
_s: &DOMString,
|
||||
ty: DOMParserBinding::SupportedType,
|
||||
_rv: &mut ErrorResult)
|
||||
-> AbstractDocument {
|
||||
ty: DOMParserBinding::SupportedType)
|
||||
-> Fallible<AbstractDocument> {
|
||||
unsafe {
|
||||
let root = @HTMLHtmlElement {
|
||||
parent: HTMLElement::new(HTMLHtmlElementTypeId, ~"html")
|
||||
|
@ -52,10 +51,10 @@ impl DOMParser {
|
|||
|
||||
match ty {
|
||||
Text_html => {
|
||||
HTMLDocument::new(root, None)
|
||||
Ok(HTMLDocument::new(root, None))
|
||||
}
|
||||
Text_xml => {
|
||||
AbstractDocument::as_abstract(cx, @mut Document::new(root, None, XML))
|
||||
Ok(AbstractDocument::as_abstract(cx, @mut Document::new(root, None, XML)))
|
||||
}
|
||||
_ => {
|
||||
fail!("unsupported document type")
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
//! Element nodes.
|
||||
|
||||
use dom::bindings::utils::{null_string, str};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResult, WrapperCache};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper, DOMString, ErrorResult, Fallible, WrapperCache};
|
||||
use dom::bindings::utils::{null_str_as_empty, null_str_as_empty_ref};
|
||||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::clientrect::ClientRect;
|
||||
use dom::clientrectlist::ClientRectList;
|
||||
|
@ -143,8 +143,8 @@ impl<'self> Element {
|
|||
abstract_self: AbstractNode<ScriptView>,
|
||||
raw_name: &DOMString,
|
||||
raw_value: &DOMString) {
|
||||
let name = raw_name.to_str();
|
||||
let value_cell = Cell::new(raw_value.to_str());
|
||||
let name = null_str_as_empty(raw_name);
|
||||
let value_cell = Cell::new(null_str_as_empty(raw_value));
|
||||
let mut found = false;
|
||||
for attr in self.attrs.mut_iter() {
|
||||
if eq_slice(attr.name, name) {
|
||||
|
@ -161,7 +161,7 @@ impl<'self> Element {
|
|||
self.style_attribute = Some(
|
||||
Stylesheet::from_attribute(
|
||||
FromStr::from_str("http://www.example.com/").unwrap(),
|
||||
raw_value.get_ref()));
|
||||
null_str_as_empty_ref(raw_value)));
|
||||
}
|
||||
|
||||
//XXXjdm We really need something like a vtable so we can call AfterSetAttr.
|
||||
|
@ -198,44 +198,42 @@ impl<'self> Element {
|
|||
|
||||
impl Element {
|
||||
pub fn TagName(&self) -> DOMString {
|
||||
str(self.tag_name.to_owned().to_ascii_upper())
|
||||
Some(self.tag_name.to_owned().to_ascii_upper())
|
||||
}
|
||||
|
||||
pub fn Id(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetId(&self, _id: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn GetAttribute(&self, name: &DOMString) -> DOMString {
|
||||
match self.get_attr(name.get_ref()) {
|
||||
Some(val) => str(val.to_owned()),
|
||||
None => null_string
|
||||
}
|
||||
self.get_attr(null_str_as_empty_ref(name)).map(|s| s.to_owned())
|
||||
}
|
||||
|
||||
pub fn GetAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAttribute(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
name: &DOMString,
|
||||
value: &DOMString,
|
||||
_rv: &mut ErrorResult) {
|
||||
value: &DOMString) -> ErrorResult {
|
||||
self.set_attr(abstract_self, name, value);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn SetAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString, _value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn RemoveAttribute(&self, _name: &DOMString, _rv: &mut ErrorResult) -> bool {
|
||||
false
|
||||
pub fn RemoveAttribute(&self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn RemoveAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString, _rv: &mut ErrorResult) -> bool {
|
||||
false
|
||||
pub fn RemoveAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn HasAttribute(&self, _name: &DOMString) -> bool {
|
||||
|
@ -251,9 +249,9 @@ impl Element {
|
|||
HTMLCollection::new(~[], cx, scope)
|
||||
}
|
||||
|
||||
pub fn GetElementsByTagNameNS(&self, _namespace: &DOMString, _localname: &DOMString, _rv: &mut ErrorResult) -> @mut HTMLCollection {
|
||||
pub fn GetElementsByTagNameNS(&self, _namespace: &DOMString, _localname: &DOMString) -> Fallible<@mut HTMLCollection> {
|
||||
let (scope, cx) = self.get_scope_and_cx();
|
||||
HTMLCollection::new(~[], cx, scope)
|
||||
Ok(HTMLCollection::new(~[], cx, scope))
|
||||
}
|
||||
|
||||
pub fn GetElementsByClassName(&self, _names: &DOMString) -> @mut HTMLCollection {
|
||||
|
@ -261,8 +259,8 @@ impl Element {
|
|||
HTMLCollection::new(~[], cx, scope)
|
||||
}
|
||||
|
||||
pub fn MozMatchesSelector(&self, _selector: &DOMString, _rv: &mut ErrorResult) -> bool {
|
||||
false
|
||||
pub fn MozMatchesSelector(&self, _selector: &DOMString) -> Fallible<bool> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
pub fn SetCapture(&self, _retargetToElement: bool) {
|
||||
|
@ -391,25 +389,28 @@ impl Element {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn GetInnerHTML(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetInnerHTML(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn SetInnerHTML(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetInnerHTML(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetOuterHTML(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetOuterHTML(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn SetOuterHTML(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetOuterHTML(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn InsertAdjacentHTML(&mut self, _position: &DOMString, _text: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn InsertAdjacentHTML(&mut self, _position: &DOMString, _text: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn QuerySelector(&self, _selectors: &DOMString, _rv: &mut ErrorResult) -> Option<AbstractNode<ScriptView>> {
|
||||
None
|
||||
pub fn QuerySelector(&self, _selectors: &DOMString) -> Fallible<Option<AbstractNode<ScriptView>>> {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ use dom::eventtarget::EventTarget;
|
|||
use dom::window::Window;
|
||||
use dom::bindings::codegen::EventBinding;
|
||||
use dom::bindings::utils::{CacheableWrapper, BindingObject, DerivedWrapper};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, WrapperCache};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, Fallible, WrapperCache};
|
||||
|
||||
use geom::point::Point2D;
|
||||
use js::glue::RUST_OBJECT_TO_JSVAL;
|
||||
|
@ -95,11 +95,11 @@ impl Event {
|
|||
pub fn InitEvent(&mut self,
|
||||
type_: &DOMString,
|
||||
bubbles: bool,
|
||||
cancelable: bool,
|
||||
_rv: &mut ErrorResult) {
|
||||
cancelable: bool) -> ErrorResult {
|
||||
self.type_ = (*type_).clone();
|
||||
self.cancelable = cancelable;
|
||||
self.bubbles = bubbles;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn IsTrusted(&self) -> bool {
|
||||
|
@ -108,9 +108,8 @@ impl Event {
|
|||
|
||||
pub fn Constructor(_global: @mut Window,
|
||||
type_: &DOMString,
|
||||
_init: &EventBinding::EventInit,
|
||||
_rv: &mut ErrorResult) -> @mut Event {
|
||||
@mut Event::new(type_)
|
||||
_init: &EventBinding::EventInit) -> Fallible<@mut Event> {
|
||||
Ok(@mut Event::new(type_))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::utils::{CacheableWrapper, BindingObject, DerivedWrapper};
|
||||
use dom::bindings::utils::{WrapperCache, DOMString, str};
|
||||
use dom::bindings::utils::{WrapperCache, DOMString, null_str_as_empty};
|
||||
use dom::bindings::codegen::FormDataBinding;
|
||||
use dom::blob::Blob;
|
||||
use script_task::{page_from_context};
|
||||
|
@ -39,13 +39,13 @@ impl FormData {
|
|||
pub fn Append(&mut self, name: &DOMString, value: @mut Blob, filename: Option<DOMString>) {
|
||||
let blob = BlobData {
|
||||
blob: value,
|
||||
name: filename.unwrap_or_default(str(~"default"))
|
||||
name: filename.unwrap_or_default(Some(~"default"))
|
||||
};
|
||||
self.data.insert(name.to_str(), blob);
|
||||
self.data.insert(null_str_as_empty(name), blob);
|
||||
}
|
||||
|
||||
pub fn Append_(&mut self, name: &DOMString, value: &DOMString) {
|
||||
self.data.insert(name.to_str(), StringData((*value).clone()));
|
||||
self.data.insert(null_str_as_empty(name), StringData((*value).clone()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::bindings::utils::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
|
||||
pub struct HTMLAnchorElement {
|
||||
parent: HTMLElement
|
||||
|
@ -11,93 +11,106 @@ pub struct HTMLAnchorElement {
|
|||
|
||||
impl HTMLAnchorElement {
|
||||
pub fn Href(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHref(&mut self, _href: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHref(&mut self, _href: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Download(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetDownload(&self, _download: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetDownload(&self, _download: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Ping(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetPing(&self, _ping: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetPing(&self, _ping: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Rel(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetRel(&self, _rel: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetRel(&self, _rel: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Hreflang(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHreflang(&self, _href_lang: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHreflang(&self, _href_lang: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Text(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Coords(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCoords(&mut self, _coords: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCoords(&mut self, _coords: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Charset(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Rev(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetRev(&mut self, _rev: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetRev(&mut self, _rev: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Shape(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetShape(&mut self, _shape: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetShape(&mut self, _shape: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLAppletElement {
|
||||
|
@ -11,79 +11,90 @@ pub struct HTMLAppletElement {
|
|||
|
||||
impl HTMLAppletElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlt(&self, _alt: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlt(&self, _alt: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Archive(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetArchive(&self, _archive: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetArchive(&self, _archive: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Code(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCode(&self, _code: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCode(&self, _code: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CodeBase(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCodeBase(&self, _code_base: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCodeBase(&self, _code_base: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHeight(&self, _height: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHeight(&self, _height: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Hspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetHspace(&mut self, _hspace: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetHspace(&mut self, _hspace: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Object(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetObject(&mut self, _object: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetObject(&mut self, _object: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Vspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetVspace(&mut self, _vspace: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetVspace(&mut self, _vspace: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLAreaElement {
|
||||
|
@ -11,58 +11,66 @@ pub struct HTMLAreaElement {
|
|||
|
||||
impl HTMLAreaElement {
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlt(&self, _alt: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlt(&self, _alt: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Coords(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCoords(&self, _coords: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCoords(&self, _coords: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Shape(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetShape(&self, _shape: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetShape(&self, _shape: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Href(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHref(&self, _href: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHref(&self, _href: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Download(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetDownload(&self, _download: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetDownload(&self, _download: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Ping(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetPing(&self, _ping: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetPing(&self, _ping: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn NoHref(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetNoHref(&mut self, _no_href: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetNoHref(&mut self, _no_href: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLBaseElement {
|
||||
|
@ -11,16 +11,18 @@ pub struct HTMLBaseElement {
|
|||
|
||||
impl HTMLBaseElement {
|
||||
pub fn Href(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHref(&self, _href: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHref(&self, _href: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetTarget(&self, _target: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLBodyElement {
|
||||
|
@ -11,44 +11,50 @@ pub struct HTMLBodyElement {
|
|||
|
||||
impl HTMLBodyElement {
|
||||
pub fn Text(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Link(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetLink(&self, _link: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetLink(&self, _link: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn VLink(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetVLink(&self, _v_link: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetVLink(&self, _v_link: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ALink(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetALink(&self, _a_link: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetALink(&self, _a_link: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn BgColor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Background(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetBackground(&self, _background: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetBackground(&self, _background: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLBRElement {
|
||||
|
@ -11,9 +11,10 @@ pub struct HTMLBRElement {
|
|||
|
||||
impl HTMLBRElement {
|
||||
pub fn Clear(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetClear(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetClear(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
use dom::validitystate::ValidityState;
|
||||
|
@ -16,14 +16,16 @@ impl HTMLButtonElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetAutofocus(&mut self, _autofocus: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Disabled(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetForm(&self) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -31,59 +33,67 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
pub fn FormAction(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFormAction(&mut self, _formaction: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFormAction(&mut self, _formaction: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FormEnctype(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFormEnctype(&mut self, _formenctype: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFormEnctype(&mut self, _formenctype: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FormMethod(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFormMethod(&mut self, _formmethod: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFormMethod(&mut self, _formmethod: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FormNoValidate(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetFormNoValidate(&mut self, _novalidate: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetFormNoValidate(&mut self, _novalidate: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FormTarget(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFormTarget(&mut self, _formtarget: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFormTarget(&mut self, _formtarget: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn WillValidate(&self) -> bool {
|
||||
|
@ -101,10 +111,11 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValidationMessage(&mut self, _message: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
@ -113,4 +124,4 @@ impl HTMLButtonElement {
|
|||
|
||||
pub fn SetCustomValidity(&mut self, _error: &DOMString) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,13 +14,15 @@ impl HTMLCanvasElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetWidth(&mut self, _width: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetHeight(&mut self, _height: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetHeight(&mut self, _height: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
use dom::bindings::codegen::HTMLCollectionBinding;
|
||||
use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, Fallible};
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
use script_task::page_from_context;
|
||||
|
||||
|
@ -44,9 +44,8 @@ impl HTMLCollection {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn NamedItem(&self, _cx: *JSContext, _name: &DOMString, rv: &mut ErrorResult) -> *JSObject {
|
||||
*rv = Ok(());
|
||||
ptr::null()
|
||||
pub fn NamedItem(&self, _cx: *JSContext, _name: &DOMString) -> Fallible<*JSObject> {
|
||||
Ok(ptr::null())
|
||||
}
|
||||
|
||||
pub fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -54,8 +53,8 @@ impl HTMLCollection {
|
|||
self.Item(index)
|
||||
}
|
||||
|
||||
pub fn NamedGetter(&self, _cx: *JSContext, _name: &DOMString, _found: &mut bool, _rv: &mut ErrorResult) -> *JSObject {
|
||||
ptr::null()
|
||||
pub fn NamedGetter(&self, _cx: *JSContext, _name: &DOMString, _found: &mut bool) -> Fallible<*JSObject> {
|
||||
Ok(ptr::null())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLDataElement {
|
||||
|
@ -11,9 +11,10 @@ pub struct HTMLDataElement {
|
|||
|
||||
impl HTMLDataElement {
|
||||
pub fn Value(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ impl HTMLDirectoryElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetCompact(&mut self, _compact: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetCompact(&mut self, _compact: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLDivElement {
|
||||
|
@ -11,9 +11,10 @@ pub struct HTMLDivElement {
|
|||
|
||||
impl HTMLDivElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLDListElement {
|
||||
|
@ -14,13 +14,15 @@ impl HTMLDListElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetCompact(&mut self, _compact: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetCompact(&mut self, _compact: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::HTMLDocumentBinding;
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, null_string};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
|
||||
use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache};
|
||||
use dom::document::{AbstractDocument, Document, WrappableDocument, HTML};
|
||||
use dom::element::HTMLHeadElementTypeId;
|
||||
|
@ -49,22 +49,24 @@ impl WrappableDocument for HTMLDocument {
|
|||
}
|
||||
|
||||
impl HTMLDocument {
|
||||
pub fn NamedGetter(&self, _cx: *JSContext, _name: &DOMString, _found: &mut bool, _rv: &mut ErrorResult) -> *JSObject {
|
||||
ptr::null()
|
||||
pub fn NamedGetter(&self, _cx: *JSContext, _name: &DOMString, _found: &mut bool) -> Fallible<*JSObject> {
|
||||
Ok(ptr::null())
|
||||
}
|
||||
|
||||
pub fn GetDomain(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetDomain(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn SetDomain(&self, _domain: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetDomain(&self, _domain: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetCookie(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetCookie(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn SetCookie(&self, _cookie: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCookie(&self, _cookie: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetHead(&self) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -104,70 +106,72 @@ impl HTMLDocument {
|
|||
self.parent.createHTMLCollection(|elem| eq_slice(elem.tag_name, "script"))
|
||||
}
|
||||
|
||||
pub fn Close(&self, _rv: &mut ErrorResult) {
|
||||
pub fn Close(&self) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn DesignMode(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetDesignMode(&self, _mode: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetDesignMode(&self, _mode: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ExecCommand(&self, _command_id: &DOMString, _show_ui: bool, _value: &DOMString, _rv: &mut ErrorResult) -> bool {
|
||||
false
|
||||
pub fn ExecCommand(&self, _command_id: &DOMString, _show_ui: bool, _value: &DOMString) -> Fallible<bool> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
pub fn QueryCommandEnabled(&self, _command_id: &DOMString, _rv: &mut ErrorResult) -> bool {
|
||||
false
|
||||
pub fn QueryCommandEnabled(&self, _command_id: &DOMString) -> Fallible<bool> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
pub fn QueryCommandIndeterm(&self, _command_id: &DOMString, _rv: &mut ErrorResult) -> bool {
|
||||
false
|
||||
pub fn QueryCommandIndeterm(&self, _command_id: &DOMString) -> Fallible<bool> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
pub fn QueryCommandState(&self, _command_id: &DOMString, _rv: &mut ErrorResult) -> bool {
|
||||
false
|
||||
pub fn QueryCommandState(&self, _command_id: &DOMString) -> Fallible<bool> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
pub fn QueryCommandSupported(&self, _command_id: &DOMString) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn QueryCommandValue(&self, _command_id: &DOMString, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn QueryCommandValue(&self, _command_id: &DOMString) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn FgColor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFgColor(&self, _color: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn LinkColor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetLinkColor(&self, _color: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn VlinkColor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetVlinkColor(&self, _color: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn AlinkColor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlinkColor(&self, _color: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn BgColor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetBgColor(&self, _color: &DOMString) {
|
||||
|
@ -186,8 +190,8 @@ impl HTMLDocument {
|
|||
pub fn Clear(&self) {
|
||||
}
|
||||
|
||||
pub fn GetAll(&self, _cx: *JSContext, _rv: &mut ErrorResult) -> *libc::c_void {
|
||||
ptr::null()
|
||||
pub fn GetAll(&self, _cx: *JSContext) -> Fallible<*libc::c_void> {
|
||||
Ok(ptr::null())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::HTMLElementBinding;
|
||||
use dom::bindings::utils::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
|
||||
use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache};
|
||||
use dom::element::{Element, ElementTypeId};
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
|
@ -24,38 +24,41 @@ impl HTMLElement {
|
|||
|
||||
impl HTMLElement {
|
||||
pub fn Title(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetTitle(&mut self, _title: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn Lang(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetLang(&mut self, _lang: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn Dir(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetDir(&mut self, _dir: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetDir(&mut self, _dir: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetItemValue(&self, _cx: *JSContext, _rv: &mut ErrorResult) -> JSVal {
|
||||
JSVAL_NULL
|
||||
pub fn GetItemValue(&self, _cx: *JSContext) -> Fallible<JSVal> {
|
||||
Ok(JSVAL_NULL)
|
||||
}
|
||||
|
||||
pub fn SetItemValue(&mut self, _cx: *JSContext, _val: JSVal, _rv: &mut ErrorResult) {
|
||||
pub fn SetItemValue(&mut self, _cx: *JSContext, _val: JSVal) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Hidden(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetHidden(&mut self, _hidden: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetHidden(&mut self, _hidden: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Click(&self) {
|
||||
|
@ -65,38 +68,44 @@ impl HTMLElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn SetTabIndex(&mut self, _index: i32, _rv: &mut ErrorResult) {
|
||||
pub fn SetTabIndex(&mut self, _index: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Focus(&self, _rv: &mut ErrorResult) {
|
||||
pub fn Focus(&self) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Blur(&self, _rv: &mut ErrorResult) {
|
||||
pub fn Blur(&self) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn AccessKey(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAccessKey(&self, _key: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAccessKey(&self, _key: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn AccessKeyLabel(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn Draggable(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDraggable(&mut self, _draggable: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDraggable(&mut self, _draggable: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ContentEditable(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetContentEditable(&mut self, _val: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetContentEditable(&mut self, _val: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn IsContentEditable(&self) -> bool {
|
||||
|
@ -107,11 +116,12 @@ impl HTMLElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetSpellcheck(&self, _val: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetSpellcheck(&self, _val: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ClassName(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetClassName(&self, _class: &DOMString) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
|
@ -12,45 +12,51 @@ pub struct HTMLEmbedElement {
|
|||
|
||||
impl HTMLEmbedElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetSVGDocument(&self) -> Option<AbstractDocument> {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult, CacheableWrapper};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, CacheableWrapper};
|
||||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
|
@ -19,7 +19,8 @@ impl HTMLFieldSetElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetForm(&self) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -27,14 +28,15 @@ impl HTMLFieldSetElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
fn get_scope_and_cx(&self) -> (*JSObject, *JSContext) {
|
||||
|
@ -60,7 +62,7 @@ impl HTMLFieldSetElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
@ -69,4 +71,4 @@ impl HTMLFieldSetElement {
|
|||
|
||||
pub fn SetCustomValidity(&mut self, _error: &DOMString) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLFontElement {
|
||||
|
@ -11,23 +11,26 @@ pub struct HTMLFontElement {
|
|||
|
||||
impl HTMLFontElement {
|
||||
pub fn Color(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetColor(&mut self, _color: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetColor(&mut self, _color: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Face(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFace(&mut self, _face: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFace(&mut self, _face: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Size(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSize(&mut self, _size: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSize(&mut self, _size: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{CacheableWrapper, DOMString, ErrorResult, null_string};
|
||||
use dom::bindings::utils::{CacheableWrapper, DOMString, ErrorResult};
|
||||
use dom::element::HTMLFormElementTypeId;
|
||||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
@ -25,66 +25,75 @@ impl HTMLFormElement {
|
|||
}
|
||||
|
||||
pub fn AcceptCharset(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAcceptCharset(&mut self, _accept_charset: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAcceptCharset(&mut self, _accept_charset: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Action(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAction(&mut self, _action: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAction(&mut self, _action: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Autocomplete(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAutocomplete(&mut self, _autocomplete: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAutocomplete(&mut self, _autocomplete: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Enctype(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetEnctype(&mut self, _enctype: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetEnctype(&mut self, _enctype: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Encoding(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetEncoding(&mut self, _encoding: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetEncoding(&mut self, _encoding: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Method(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetMethod(&mut self, _method: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetMethod(&mut self, _method: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn NoValidate(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetNoValidate(&mut self, _no_validate: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetNoValidate(&mut self, _no_validate: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetTarget(&mut self, _target: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetTarget(&mut self, _target: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Elements(&self) -> @mut HTMLCollection {
|
||||
|
@ -96,7 +105,8 @@ impl HTMLFormElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn Submit(&self, _rv: &mut ErrorResult) {
|
||||
pub fn Submit(&self) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Reset(&self) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::windowproxy::WindowProxy;
|
||||
|
@ -13,45 +13,51 @@ pub struct HTMLFrameElement {
|
|||
|
||||
impl HTMLFrameElement {
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Scrolling(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetScrolling(&mut self, _scrolling: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetScrolling(&mut self, _scrolling: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FrameBorder(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn LongDesc(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn NoResize(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetNoResize(&mut self, _no_resize: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetNoResize(&mut self, _no_resize: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetContentDocument(&self) -> Option<AbstractDocument> {
|
||||
|
@ -63,16 +69,18 @@ impl HTMLFrameElement {
|
|||
}
|
||||
|
||||
pub fn MarginHeight(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetMarginHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetMarginHeight(&mut self, _height: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn MarginWidth(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetMarginWidth(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetMarginWidth(&mut self, _height: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLFrameSetElement {
|
||||
|
@ -11,16 +11,18 @@ pub struct HTMLFrameSetElement {
|
|||
|
||||
impl HTMLFrameSetElement {
|
||||
pub fn Cols(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCols(&mut self, _cols: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCols(&mut self, _cols: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Rows(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetRows(&mut self, _rows: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetRows(&mut self, _rows: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string};
|
||||
use dom::bindings::utils::DOMString;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub enum HeadingLevel {
|
||||
|
@ -21,7 +21,7 @@ pub struct HTMLHeadingElement {
|
|||
|
||||
impl HTMLHeadingElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLHRElement {
|
||||
|
@ -11,37 +11,42 @@ pub struct HTMLHRElement {
|
|||
|
||||
impl HTMLHRElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Color(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetColor(&mut self, _color: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetColor(&mut self, _color: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn NoShade(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetNoShade(&self, _no_shade: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetNoShade(&self, _no_shade: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Size(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSize(&mut self, _size: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSize(&mut self, _size: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLHtmlElement {
|
||||
|
@ -11,9 +11,10 @@ pub struct HTMLHtmlElement {
|
|||
|
||||
impl HTMLHtmlElement {
|
||||
pub fn Version(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetVersion(&mut self, _version: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetVersion(&mut self, _version: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult, str};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty};
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
|
@ -60,40 +60,42 @@ impl HTMLIFrameElement {
|
|||
|
||||
impl HTMLIFrameElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Srcdoc(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrcdoc(&mut self, _srcdoc: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSrcdoc(&mut self, _srcdoc: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Sandbox(&self, _abstract_self: AbstractNode<ScriptView>) -> DOMString {
|
||||
self.parent.parent.GetAttribute(&str(~"sandbox"))
|
||||
self.parent.parent.GetAttribute(&Some(~"sandbox"))
|
||||
}
|
||||
|
||||
pub fn SetSandbox(&mut self, abstract_self: AbstractNode<ScriptView>, sandbox: &DOMString) {
|
||||
let mut rv = Ok(());
|
||||
self.parent.parent.SetAttribute(abstract_self, &str(~"sandbox"), sandbox, &mut rv);
|
||||
self.parent.parent.SetAttribute(abstract_self, &Some(~"sandbox"), sandbox);
|
||||
}
|
||||
|
||||
pub fn AfterSetAttr(&mut self, name: &DOMString, value: &DOMString) {
|
||||
let name = name.to_str();
|
||||
let name = null_str_as_empty(name);
|
||||
if "sandbox" == name {
|
||||
let mut modes = AllowNothing as u8;
|
||||
let words = value.to_str();
|
||||
let words = null_str_as_empty(value);
|
||||
for word in words.split_iter(' ') {
|
||||
modes |= match word.to_ascii_lower().as_slice() {
|
||||
"allow-same-origin" => AllowSameOrigin,
|
||||
|
@ -113,21 +115,24 @@ impl HTMLIFrameElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetAllowFullscreen(&mut self, _allow: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetAllowFullscreen(&mut self, _allow: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetContentDocument(&self) -> Option<AbstractDocument> {
|
||||
|
@ -139,45 +144,51 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Scrolling(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetScrolling(&mut self, _scrolling: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetScrolling(&mut self, _scrolling: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FrameBorder(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn LongDesc(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn MarginHeight(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetMarginHeight(&mut self, _marginheight: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetMarginHeight(&mut self, _marginheight: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn MarginWidth(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetMarginWidth(&mut self, _marginwidth: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetMarginWidth(&mut self, _marginwidth: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetSVGDocument(&self) -> Option<AbstractDocument> {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, str, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{ScriptView, AbstractNode};
|
||||
use extra::url::Url;
|
||||
|
@ -40,7 +40,7 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn AfterSetAttr(&mut self, name: &DOMString, _value: &DOMString) {
|
||||
let name = name.to_str();
|
||||
let name = null_str_as_empty(name);
|
||||
if "src" == name {
|
||||
let doc = self.parent.parent.parent.owner_doc;
|
||||
for doc in doc.iter() {
|
||||
|
@ -55,45 +55,49 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlt(&mut self, _alt: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlt(&mut self, _alt: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Src(&self, _abstract_self: AbstractNode<ScriptView>) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
src: &DOMString,
|
||||
_rv: &mut ErrorResult) {
|
||||
src: &DOMString) -> ErrorResult {
|
||||
let node = &mut self.parent.parent;
|
||||
node.set_attr(abstract_self,
|
||||
&str(~"src"),
|
||||
&str(src.to_str()));
|
||||
&Some(~"src"),
|
||||
&Some(null_str_as_empty(src)));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CrossOrigin(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn UseMap(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetUseMap(&mut self, _use_map: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetUseMap(&mut self, _use_map: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn IsMap(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetIsMap(&self, _is_map: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetIsMap(&self, _is_map: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Width(&self, abstract_self: AbstractNode<ScriptView>) -> u32 {
|
||||
|
@ -125,12 +129,12 @@ impl HTMLImageElement {
|
|||
|
||||
pub fn SetWidth(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
width: u32,
|
||||
_rv: &mut ErrorResult) {
|
||||
width: u32) -> ErrorResult {
|
||||
let node = &mut self.parent.parent;
|
||||
node.set_attr(abstract_self,
|
||||
&str(~"width"),
|
||||
&str(width.to_str()));
|
||||
&Some(~"width"),
|
||||
&Some(width.to_str()));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Height(&self, abstract_self: AbstractNode<ScriptView>) -> u32 {
|
||||
|
@ -162,12 +166,12 @@ impl HTMLImageElement {
|
|||
|
||||
pub fn SetHeight(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
height: u32,
|
||||
_rv: &mut ErrorResult) {
|
||||
height: u32) -> ErrorResult {
|
||||
let node = &mut self.parent.parent;
|
||||
node.set_attr(abstract_self,
|
||||
&str(~"height"),
|
||||
&str(height.to_str()));
|
||||
&Some(~"height"),
|
||||
&Some(height.to_str()));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn NaturalWidth(&self) -> u32 {
|
||||
|
@ -183,44 +187,50 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Hspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetHspace(&mut self, _hspace: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetHspace(&mut self, _hspace: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Vspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetVspace(&mut self, _vspace: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetVspace(&mut self, _vspace: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn LongDesc(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Border(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetBorder(&mut self, _border: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetBorder(&mut self, _border: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLInputElement {
|
||||
|
@ -11,38 +11,43 @@ pub struct HTMLInputElement {
|
|||
|
||||
impl HTMLInputElement {
|
||||
pub fn Accept(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAccept(&mut self, _accept: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAccept(&mut self, _accept: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlt(&mut self, _alt: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlt(&mut self, _alt: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Autocomplete(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAutocomplete(&mut self, _autocomple: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAutocomplete(&mut self, _autocomple: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Autofocus(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetAutofocus(&mut self, _autofocus: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn DefaultChecked(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDefaultChecked(&mut self, _default_checked: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDefaultChecked(&mut self, _default_checked: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Checked(&self) -> bool {
|
||||
|
@ -56,49 +61,56 @@ impl HTMLInputElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FormAction(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFormAction(&mut self, _form_action: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFormAction(&mut self, _form_action: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FormEnctype(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFormEnctype(&mut self, _form_enctype: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFormEnctype(&mut self, _form_enctype: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FormMethod(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFormMethod(&mut self, _form_method: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFormMethod(&mut self, _form_method: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FormNoValidate(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetFormNoValidate(&mut self, _form_no_validate: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetFormNoValidate(&mut self, _form_no_validate: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn FormTarget(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFormTarget(&mut self, _form_target: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFormTarget(&mut self, _form_target: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetHeight(&mut self, _height: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetHeight(&mut self, _height: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Indeterminate(&self) -> bool {
|
||||
|
@ -109,115 +121,131 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn InputMode(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetInputMode(&mut self, _input_mode: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetInputMode(&mut self, _input_mode: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Max(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetMax(&mut self, _max: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetMax(&mut self, _max: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn MaxLength(&self) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetMaxLength(&mut self, _max_length: i32, _rv: &mut ErrorResult) {
|
||||
pub fn SetMaxLength(&mut self, _max_length: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Min(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetMin(&mut self, _min: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetMin(&mut self, _min: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Multiple(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetMultiple(&mut self, _multiple: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetMultiple(&mut self, _multiple: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Pattern(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetPattern(&mut self, _pattern: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetPattern(&mut self, _pattern: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Placeholder(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetPlaceholder(&mut self, _placeholder: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetPlaceholder(&mut self, _placeholder: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ReadOnly(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetReadOnly(&mut self, _read_only: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetReadOnly(&mut self, _read_only: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Required(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetRequired(&mut self, _required: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetRequired(&mut self, _required: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Size(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetSize(&mut self, _size: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetSize(&mut self, _size: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Step(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetStep(&mut self, _step: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetStep(&mut self, _step: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn DefaultValue(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetDefaultValue(&mut self, _default_value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetDefaultValue(&mut self, _default_value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> u32 {
|
||||
|
@ -234,8 +262,8 @@ impl HTMLInputElement {
|
|||
pub fn SetWillValidate(&self, _will_validate: bool) {
|
||||
}
|
||||
|
||||
pub fn GetValidationMessage(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetValidationMessage(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
@ -248,38 +276,43 @@ impl HTMLInputElement {
|
|||
pub fn Select(&self) {
|
||||
}
|
||||
|
||||
pub fn GetSelectionStart(&self, _rv: &mut ErrorResult) -> i32 {
|
||||
0
|
||||
pub fn GetSelectionStart(&self) -> Fallible<i32> {
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
pub fn SetSelectionStart(&mut self, _selection_start: i32, _rv: &mut ErrorResult) {
|
||||
pub fn SetSelectionStart(&mut self, _selection_start: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetSelectionEnd(&self, _rv: &mut ErrorResult) -> i32 {
|
||||
0
|
||||
pub fn GetSelectionEnd(&self) -> Fallible<i32> {
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
pub fn SetSelectionEnd(&mut self, _selection_end: i32, _rv: &mut ErrorResult) {
|
||||
pub fn SetSelectionEnd(&mut self, _selection_end: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetSelectionDirection(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetSelectionDirection(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn SetSelectionDirection(&mut self, _selection_direction: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSelectionDirection(&mut self, _selection_direction: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn UseMap(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetUseMap(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetUseMap(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string};
|
||||
use dom::bindings::utils::DOMString;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLLabelElement {
|
||||
|
@ -11,7 +11,7 @@ pub struct HTMLLabelElement {
|
|||
|
||||
impl HTMLLabelElement {
|
||||
pub fn HtmlFor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHtmlFor(&mut self, _html_for: &DOMString) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLLegendElement {
|
||||
|
@ -11,9 +11,10 @@ pub struct HTMLLegendElement {
|
|||
|
||||
impl HTMLLegendElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLLIElement {
|
||||
|
@ -14,13 +14,15 @@ impl HTMLLIElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: i32, _rv: &mut ErrorResult) {
|
||||
pub fn SetValue(&mut self, _value: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLLinkElement {
|
||||
|
@ -18,65 +18,74 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn Href(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHref(&mut self, _href: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHref(&mut self, _href: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CrossOrigin(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Rel(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetRel(&mut self, _rel: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetRel(&mut self, _rel: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Media(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Hreflang(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHreflang(&mut self, _href: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHreflang(&mut self, _href: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Charset(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Rev(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetRev(&mut self, _rev: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetRev(&mut self, _rev: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetTarget(&mut self, _target: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetTarget(&mut self, _target: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult, CacheableWrapper};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, CacheableWrapper};
|
||||
use dom::htmlcollection::HTMLCollection;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use js::jsapi::{JSObject, JSContext};
|
||||
|
@ -13,10 +13,11 @@ pub struct HTMLMapElement {
|
|||
|
||||
impl HTMLMapElement {
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_scope_and_cx(&self) -> (*JSObject, *JSContext) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::element::ElementTypeId;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
|
@ -20,35 +20,38 @@ impl HTMLMediaElement {
|
|||
|
||||
impl HTMLMediaElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CurrentSrc(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn CrossOrigin(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Preload(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetPreload(&mut self, _preload: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetPreload(&mut self, _preload: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Load(&self) {
|
||||
}
|
||||
|
||||
pub fn CanPlayType(&self, _type: &DOMString) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn ReadyState(&self) -> u16 {
|
||||
|
@ -63,7 +66,8 @@ impl HTMLMediaElement {
|
|||
0f64
|
||||
}
|
||||
|
||||
pub fn SetCurrentTime(&mut self, _current_time: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetCurrentTime(&mut self, _current_time: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetDuration(&self) -> f64 {
|
||||
|
@ -78,14 +82,16 @@ impl HTMLMediaElement {
|
|||
0f64
|
||||
}
|
||||
|
||||
pub fn SetDefaultPlaybackRate(&mut self, _default_playback_rate: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetDefaultPlaybackRate(&mut self, _default_playback_rate: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn PlaybackRate(&self) -> f64 {
|
||||
0f64
|
||||
}
|
||||
|
||||
pub fn SetPlaybackRate(&mut self, _playback_rate: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetPlaybackRate(&mut self, _playback_rate: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Ended(&self) -> bool {
|
||||
|
@ -96,34 +102,40 @@ impl HTMLMediaElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetAutoplay(&mut self, _autoplay: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetAutoplay(&mut self, _autoplay: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Loop(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetLoop(&mut self, _loop: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetLoop(&mut self, _loop: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Play(&self, _rv: &mut ErrorResult) {
|
||||
pub fn Play(&self) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Pause(&self, _rv: &mut ErrorResult) {
|
||||
pub fn Pause(&self) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Controls(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetControls(&mut self, _controls: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetControls(&mut self, _controls: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Volume(&self) -> f64 {
|
||||
0f64
|
||||
}
|
||||
|
||||
pub fn SetVolume(&mut self, _volume: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetVolume(&mut self, _volume: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Muted(&self) -> bool {
|
||||
|
@ -137,6 +149,7 @@ impl HTMLMediaElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetDefaultMuted(&mut self, _default_muted: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDefaultMuted(&mut self, _default_muted: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLMetaElement {
|
||||
|
@ -11,30 +11,34 @@ pub struct HTMLMetaElement {
|
|||
|
||||
impl HTMLMetaElement {
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn HttpEquiv(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHttpEquiv(&mut self, _http_equiv: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHttpEquiv(&mut self, _http_equiv: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Content(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetContent(&mut self, _content: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetContent(&mut self, _content: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Scheme(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetScheme(&mut self, _scheme: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetScheme(&mut self, _scheme: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,41 +14,47 @@ impl HTMLMeterElement {
|
|||
0.0
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetValue(&mut self, _value: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Min(&self) -> f64 {
|
||||
0.0
|
||||
}
|
||||
|
||||
pub fn SetMin(&mut self, _min: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetMin(&mut self, _min: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Max(&self) -> f64 {
|
||||
0.0
|
||||
}
|
||||
|
||||
pub fn SetMax(&mut self, _max: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetMax(&mut self, _max: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Low(&self) -> f64 {
|
||||
0.0
|
||||
}
|
||||
|
||||
pub fn SetLow(&mut self, _low: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetLow(&mut self, _low: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn High(&self) -> f64 {
|
||||
0.0
|
||||
}
|
||||
|
||||
pub fn SetHigh(&mut self, _high: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetHigh(&mut self, _high: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Optimum(&self) -> f64 {
|
||||
0.0
|
||||
}
|
||||
|
||||
pub fn SetOptimum(&mut self, _optimum: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetOptimum(&mut self, _optimum: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLModElement {
|
||||
|
@ -11,16 +11,18 @@ pub struct HTMLModElement {
|
|||
|
||||
impl HTMLModElement {
|
||||
pub fn Cite(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCite(&mut self, _cite: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCite(&mut self, _cite: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn DateTime(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetDateTime(&mut self, _datetime: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetDateTime(&mut self, _datetime: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
|
@ -15,31 +15,35 @@ pub struct HTMLObjectElement {
|
|||
|
||||
impl HTMLObjectElement {
|
||||
pub fn Data(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetData(&mut self, _data: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetData(&mut self, _data: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn UseMap(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetUseMap(&mut self, _use_map: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetUseMap(&mut self, _use_map: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetForm(&self) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -47,17 +51,19 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetContentDocument(&self) -> Option<AbstractDocument> {
|
||||
|
@ -77,7 +83,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
@ -88,76 +94,86 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Archive(&self) -> DOMString {
|
||||
null_string
|
||||
pub fn Archive(&self) -> DOMString {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetArchive(&mut self, _archive: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetArchive(&mut self, _archive: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Code(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCode(&mut self, _code: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCode(&mut self, _code: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Declare(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDeclare(&mut self, _declare: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDeclare(&mut self, _declare: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Hspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetHspace(&mut self, _hspace: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetHspace(&mut self, _hspace: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Standby(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetStandby(&mut self, _standby: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetStandby(&mut self, _standby: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Vspace(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetVspace(&mut self, _vspace: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetVspace(&mut self, _vspace: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CodeBase(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCodeBase(&mut self, _codebase: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCodeBase(&mut self, _codebase: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CodeType(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCodeType(&mut self, _codetype: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCodeType(&mut self, _codetype: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Border(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetBorder(&mut self, _border: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetBorder(&mut self, _border: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetSVGDocument(&self) -> Option<AbstractDocument> {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLOListElement {
|
||||
|
@ -14,27 +14,31 @@ impl HTMLOListElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetReversed(&self, _reversed: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetReversed(&self, _reversed: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Start(&self) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetStart(&mut self, _start: i32, _rv: &mut ErrorResult) {
|
||||
pub fn SetStart(&mut self, _start: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Compact(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetCompact(&self, _compact: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetCompact(&self, _compact: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, ErrorResult, null_string};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLOptGroupElement {
|
||||
|
@ -14,13 +14,15 @@ impl HTMLOptGroupElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Label(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetLabel(&mut self, _label: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, ErrorResult, null_string};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
|
||||
|
@ -15,7 +15,8 @@ impl HTMLOptionElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetForm(&self) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -23,41 +24,46 @@ impl HTMLOptionElement {
|
|||
}
|
||||
|
||||
pub fn Label(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetLabel(&mut self, _label: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn DefaultSelected(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDefaultSelected(&mut self, _default_selected: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDefaultSelected(&mut self, _default_selected: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Selected(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetSelected(&mut self, _selected: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetSelected(&mut self, _selected: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Text(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Index(&self) -> i32 {
|
||||
0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, ErrorResult, null_string};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
use dom::validitystate::ValidityState;
|
||||
|
@ -17,28 +17,31 @@ impl HTMLOutputElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn DefaultValue(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetDefaultValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetDefaultValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn WillValidate(&self) -> bool {
|
||||
|
@ -56,10 +59,11 @@ impl HTMLOutputElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValidationMessage(&mut self, _message: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLParagraphElement {
|
||||
|
@ -11,9 +11,10 @@ pub struct HTMLParagraphElement {
|
|||
|
||||
impl HTMLParagraphElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, ErrorResult, null_string};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLParamElement {
|
||||
|
@ -11,30 +11,34 @@ pub struct HTMLParamElement {
|
|||
|
||||
impl HTMLParamElement {
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ValueType(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValueType(&mut self, _value_type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetValueType(&mut self, _value_type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ impl HTMLPreElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: i32, _rv: &mut ErrorResult) {
|
||||
pub fn SetWidth(&mut self, _width: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{ErrorResult};
|
||||
use dom::bindings::utils::{ErrorResult, Fallible};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLProgressElement {
|
||||
|
@ -14,21 +14,23 @@ impl HTMLProgressElement {
|
|||
0f64
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetValue(&mut self, _value: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Max(&self) -> f64 {
|
||||
0f64
|
||||
}
|
||||
|
||||
pub fn SetMax(&mut self, _max: f64, _rv: &mut ErrorResult) {
|
||||
pub fn SetMax(&mut self, _max: f64) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Position(&self) -> f64 {
|
||||
0f64
|
||||
}
|
||||
|
||||
pub fn GetPositiom(&self, _rv: &mut ErrorResult) -> f64 {
|
||||
0f64
|
||||
pub fn GetPositiom(&self) -> Fallible<f64> {
|
||||
Ok(0f64)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLQuoteElement {
|
||||
|
@ -11,9 +11,10 @@ pub struct HTMLQuoteElement {
|
|||
|
||||
impl HTMLQuoteElement {
|
||||
pub fn Cite(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCite(&self, _cite: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCite(&self, _cite: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLScriptElement {
|
||||
|
@ -11,65 +11,74 @@ pub struct HTMLScriptElement {
|
|||
|
||||
impl HTMLScriptElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Charset(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCharset(&mut self, _charset: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Async(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetAsync(&self, _async: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetAsync(&self, _async: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Defer(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDefer(&self, _defer: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDefer(&self, _defer: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CrossOrigin(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Text(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Event(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetEvent(&mut self, _event: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetEvent(&mut self, _event: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn HtmlFor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHtmlFor(&mut self, _html_for: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHtmlFor(&mut self, _html_for: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, ErrorResult, null_string};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
use dom::validitystate::ValidityState;
|
||||
|
@ -16,14 +16,16 @@ impl HTMLSelectElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetAutofocus(&mut self, _autofocus: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Disabled(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetForm(&self) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -34,39 +36,44 @@ impl HTMLSelectElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetMultiple(&mut self, _multiple: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetMultiple(&mut self, _multiple: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Required(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetRequired(&mut self, _multiple: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetRequired(&mut self, _multiple: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Size(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetSize(&mut self, _size: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetSize(&mut self, _size: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn Length(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetLength(&mut self, _length: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetLength(&mut self, _length: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Item(&self, _index: u32) -> Option<AbstractNode<ScriptView>> {
|
||||
|
@ -81,7 +88,8 @@ impl HTMLSelectElement {
|
|||
None
|
||||
}
|
||||
|
||||
pub fn IndexedSetter(&mut self, _index: u32, _option: Option<AbstractNode<ScriptView>>, _rv: &mut ErrorResult) {
|
||||
pub fn IndexedSetter(&mut self, _index: u32, _option: Option<AbstractNode<ScriptView>>) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Remove_(&self) {
|
||||
|
@ -94,11 +102,12 @@ impl HTMLSelectElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn SetSelectedIndex(&mut self, _index: i32, _rv: &mut ErrorResult) {
|
||||
pub fn SetSelectedIndex(&mut self, _index: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString) {
|
||||
|
@ -119,10 +128,11 @@ impl HTMLSelectElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValidationMessage(&mut self, _message: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
@ -131,4 +141,4 @@ impl HTMLSelectElement {
|
|||
|
||||
pub fn SetCustomValidity(&mut self, _error: &DOMString) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLSourceElement {
|
||||
|
@ -11,23 +11,26 @@ pub struct HTMLSourceElement {
|
|||
|
||||
impl HTMLSourceElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Media(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLStyleElement {
|
||||
|
@ -18,23 +18,26 @@ impl HTMLStyleElement {
|
|||
}
|
||||
|
||||
pub fn Media(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetMedia(&mut self, _media: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Scoped(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetScoped(&self, _scoped: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetScoped(&self, _scoped: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTableCaptionElement {
|
||||
|
@ -11,9 +11,10 @@ pub struct HTMLTableCaptionElement {
|
|||
|
||||
impl HTMLTableCaptionElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTableCellElement {
|
||||
|
@ -14,104 +14,119 @@ impl HTMLTableCellElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn SetColSpan(&self, _col_span: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetColSpan(&self, _col_span: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn RowSpan(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetRowSpan(&self, _col_span: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetRowSpan(&self, _col_span: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Headers(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHeaders(&self, _headers: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHeaders(&self, _headers: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CellIndex(&self) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn GetCellIndex(&self, _cell_index: i32, _rv: &mut ErrorResult) {
|
||||
pub fn GetCellIndex(&self, _cell_index: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Abbr(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAbbr(&self, _abbr: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAbbr(&self, _abbr: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Scope(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetScope(&self, _abbr: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetScope(&self, _abbr: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Axis(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAxis(&self, _axis: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAxis(&self, _axis: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetHeight(&self, _height: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetHeight(&self, _height: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetWidth(&self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetWidth(&self, _width: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Ch(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCh(&self, _ch: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCh(&self, _ch: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ChOff(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetChOff(&self, _ch_off: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetChOff(&self, _ch_off: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn NoWrap(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetNoWrap(&self, _no_wrap: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetNoWrap(&self, _no_wrap: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn VAlign(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetVAlign(&self, _valign: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetVAlign(&self, _valign: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn BgColor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTableColElement {
|
||||
|
@ -14,41 +14,47 @@ impl HTMLTableColElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn SetSpan(&mut self, _span: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetSpan(&mut self, _span: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Ch(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCh(&mut self, _ch: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCh(&mut self, _ch: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ChOff(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetChOff(&mut self, _ch_off: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetChOff(&mut self, _ch_off: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn VAlign(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetVAlign(&mut self, _v_align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetVAlign(&mut self, _v_align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTableElement {
|
||||
|
@ -20,7 +20,8 @@ impl HTMLTableElement {
|
|||
pub fn DeleteTFoot(&self) {
|
||||
}
|
||||
|
||||
pub fn DeleteRow(&mut self, _index: i32, _rv: &mut ErrorResult) {
|
||||
pub fn DeleteRow(&mut self, _index: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Sortable(&self) -> bool {
|
||||
|
@ -34,65 +35,74 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Border(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetBorder(&self, _border: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetBorder(&self, _border: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Frame(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetFrame(&self, _frame: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetFrame(&self, _frame: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Rules(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetRules(&self, _rules: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetRules(&self, _rules: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Summary(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSummary(&self, _summary: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSummary(&self, _summary: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetWidth(&self, _width: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetWidth(&self, _width: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn BgColor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CellPadding(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCellPadding(&self, _cell_padding: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCellPadding(&self, _cell_padding: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CellSpacing(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCellSpacing(&self, _cell_spacing: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCellSpacing(&self, _cell_spacing: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTableRowElement {
|
||||
|
@ -26,41 +26,47 @@ impl HTMLTableRowElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn DeleteCell(&mut self, _index: i32, _rv: &mut ErrorResult) {
|
||||
pub fn DeleteCell(&mut self, _index: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Ch(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCh(&self, _ch: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCh(&self, _ch: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ChOff(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetChOff(&self, _ch_off: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetChOff(&self, _ch_off: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn VAlign(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetVAlign(&self, _v_align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetVAlign(&self, _v_align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn BgColor(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTableSectionElement {
|
||||
|
@ -10,34 +10,39 @@ pub struct HTMLTableSectionElement {
|
|||
}
|
||||
|
||||
impl HTMLTableSectionElement {
|
||||
pub fn DeleteRow(&mut self, _index: i32, _rv: &mut ErrorResult) {
|
||||
pub fn DeleteRow(&mut self, _index: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Ch(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetCh(&mut self, _ch: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetCh(&mut self, _ch: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ChOff(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetChOff(&mut self, _ch_off: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetChOff(&mut self, _ch_off: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn VAlign(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetVAlign(&mut self, _v_align: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetVAlign(&mut self, _v_align: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTextAreaElement {
|
||||
|
@ -14,88 +14,99 @@ impl HTMLTextAreaElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetAutofocus(&mut self, _autofocus: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Cols(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetCols(&self, _cols: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetCols(&self, _cols: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Disabled(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDisabled(&mut self, _disabled: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn MaxLength(&self) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetMaxLength(&self, _max_length: i32, _rv: &mut ErrorResult) {
|
||||
pub fn SetMaxLength(&self, _max_length: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Placeholder(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetPlaceholder(&mut self, _placeholder: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetPlaceholder(&mut self, _placeholder: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ReadOnly(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetReadOnly(&mut self, _read_only: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetReadOnly(&mut self, _read_only: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Required(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetRequired(&mut self, _required: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetRequired(&mut self, _required: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Rows(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetRows(&self, _rows: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetRows(&self, _rows: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Wrap(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetWrap(&mut self, _wrap: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetWrap(&mut self, _wrap: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn DefaultValue(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetDefaultValue(&mut self, _default_value: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetDefaultValue(&mut self, _default_value: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString) {
|
||||
|
@ -105,18 +116,20 @@ impl HTMLTextAreaElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn SetTextLength(&self, _text_length: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetTextLength(&self, _text_length: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn WillValidate(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetWillValidate(&mut self, _will_validate: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetWillValidate(&mut self, _will_validate: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
@ -129,25 +142,28 @@ impl HTMLTextAreaElement {
|
|||
pub fn Select(&self) {
|
||||
}
|
||||
|
||||
pub fn GetSelectionStart(&self, _rv: &mut ErrorResult) -> u32 {
|
||||
0
|
||||
pub fn GetSelectionStart(&self) -> Fallible<u32> {
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
pub fn SetSelectionStart(&self, _selection_start: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetSelectionStart(&self, _selection_start: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetSelectionEnd(&self, _rv: &mut ErrorResult) -> u32 {
|
||||
0
|
||||
pub fn GetSelectionEnd(&self) -> Fallible<u32> {
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
pub fn SetSelectionEnd(&self, _selection_end: u32, _rv: &mut ErrorResult) {
|
||||
pub fn SetSelectionEnd(&self, _selection_end: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetSelectionDirection(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetSelectionDirection(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn SetSelectionDirection(&self, _selection_direction: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSelectionDirection(&self, _selection_direction: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn SetRangeText(&self, _replacement: &DOMString) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTimeElement {
|
||||
|
@ -11,9 +11,10 @@ pub struct HTMLTimeElement {
|
|||
|
||||
impl HTMLTimeElement {
|
||||
pub fn DateTime(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetDateTime(&mut self, _dateTime: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetDateTime(&mut self, _dateTime: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTitleElement {
|
||||
|
@ -11,9 +11,10 @@ pub struct HTMLTitleElement {
|
|||
|
||||
impl HTMLTitleElement {
|
||||
pub fn Text(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetText(&mut self, _text: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLTrackElement {
|
||||
|
@ -11,38 +11,43 @@ pub struct HTMLTrackElement {
|
|||
|
||||
impl HTMLTrackElement {
|
||||
pub fn Kind(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetKind(&mut self, _kind: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetKind(&mut self, _kind: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Src(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Srclang(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetSrclang(&mut self, _srclang: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetSrclang(&mut self, _srclang: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Label(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetLabel(&mut self, _label: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Default(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDefault(&mut self, _default: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetDefault(&mut self, _default: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ReadyState(&self) -> u16 {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
||||
pub struct HTMLUListElement {
|
||||
|
@ -14,13 +14,15 @@ impl HTMLUListElement {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn SetCompact(&mut self, _compact: bool, _rv: &mut ErrorResult) {
|
||||
pub fn SetCompact(&mut self, _compact: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, null_string, ErrorResult};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::htmlmediaelement::HTMLMediaElement;
|
||||
|
||||
pub struct HTMLVideoElement {
|
||||
|
@ -14,14 +14,16 @@ impl HTMLVideoElement {
|
|||
0
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: u32, _rv: &ErrorResult) {
|
||||
pub fn SetWidth(&mut self, _width: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Height(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetHeight(&mut self, _height: u32, _rv: &ErrorResult) {
|
||||
pub fn SetHeight(&mut self, _height: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn VideoWidth(&self) -> u32 {
|
||||
|
@ -33,9 +35,10 @@ impl HTMLVideoElement {
|
|||
}
|
||||
|
||||
pub fn Poster(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetPoster(&mut self, _poster: &DOMString, _rv: &ErrorResult) {
|
||||
pub fn SetPoster(&mut self, _poster: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::MouseEventBinding;
|
||||
use dom::bindings::utils::{ErrorResult, DOMString};
|
||||
use dom::bindings::utils::{ErrorResult, Fallible, DOMString};
|
||||
use dom::bindings::utils::{CacheableWrapper, WrapperCache, BindingObject, DerivedWrapper};
|
||||
use dom::eventtarget::EventTarget;
|
||||
use dom::uievent::UIEvent;
|
||||
|
@ -54,12 +54,11 @@ impl MouseEvent {
|
|||
|
||||
pub fn Constructor(_owner: @mut Window,
|
||||
type_: &DOMString,
|
||||
init: &MouseEventBinding::MouseEventInit,
|
||||
_rv: &mut ErrorResult) -> @mut MouseEvent {
|
||||
@mut MouseEvent::new(type_, init.bubbles, init.cancelable, init.view, init.detail,
|
||||
init.screenX, init.screenY, init.clientX, init.clientY,
|
||||
init.ctrlKey, init.shiftKey, init.altKey, init.metaKey,
|
||||
init.button, init.buttons, init.relatedTarget)
|
||||
init: &MouseEventBinding::MouseEventInit) -> Fallible<@mut MouseEvent> {
|
||||
Ok(@mut MouseEvent::new(type_, init.bubbles, init.cancelable, init.view, init.detail,
|
||||
init.screenX, init.screenY, init.clientX, init.clientY,
|
||||
init.ctrlKey, init.shiftKey, init.altKey, init.metaKey,
|
||||
init.button, init.buttons, init.relatedTarget))
|
||||
}
|
||||
|
||||
pub fn ScreenX(&self) -> i32 {
|
||||
|
@ -127,8 +126,7 @@ impl MouseEvent {
|
|||
shiftKeyArg: bool,
|
||||
metaKeyArg: bool,
|
||||
buttonArg: u16,
|
||||
relatedTargetArg: Option<@mut EventTarget>,
|
||||
_rv: &mut ErrorResult) {
|
||||
relatedTargetArg: Option<@mut EventTarget>) -> ErrorResult {
|
||||
self.parent.InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
|
||||
self.screen_x = screenXArg;
|
||||
self.screen_y = screenYArg;
|
||||
|
@ -140,6 +138,7 @@ impl MouseEvent {
|
|||
self.meta_key = metaKeyArg;
|
||||
self.button = buttonArg;
|
||||
self.related_target = relatedTargetArg;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::utils::{WrapperCache, BindingObject, CacheableWrapper};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, str, null_string};
|
||||
use dom::bindings::utils::{DOMString, Fallible};
|
||||
use dom::bindings::codegen::NavigatorBinding;
|
||||
use script_task::{page_from_context};
|
||||
|
||||
|
@ -23,35 +23,35 @@ impl Navigator {
|
|||
}
|
||||
|
||||
pub fn DoNotTrack(&self) -> DOMString {
|
||||
str(~"unspecified")
|
||||
Some(~"unspecified")
|
||||
}
|
||||
|
||||
pub fn Vendor(&self) -> DOMString {
|
||||
str(~"") // Like Gecko
|
||||
Some(~"") // Like Gecko
|
||||
}
|
||||
|
||||
pub fn VendorSub(&self) -> DOMString {
|
||||
str(~"") // Like Gecko
|
||||
Some(~"") // Like Gecko
|
||||
}
|
||||
|
||||
pub fn Product(&self) -> DOMString {
|
||||
str(~"Gecko") // This is supposed to be constant, see webidl.
|
||||
Some(~"Gecko") // This is supposed to be constant, see webidl.
|
||||
}
|
||||
|
||||
pub fn ProductSub(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn CookieEnabled(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn GetBuildID(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetBuildID(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn JavaEnabled(&self, _rv: &mut ErrorResult) -> bool {
|
||||
false
|
||||
pub fn JavaEnabled(&self) -> Fallible<bool> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
pub fn TaintEnabled(&self) -> bool {
|
||||
|
@ -59,27 +59,27 @@ impl Navigator {
|
|||
}
|
||||
|
||||
pub fn AppName(&self) -> DOMString {
|
||||
str(~"Netscape") // Like Gecko/Webkit
|
||||
Some(~"Netscape") // Like Gecko/Webkit
|
||||
}
|
||||
|
||||
pub fn GetAppCodeName(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
str(~"Mozilla") // Like Gecko/Webkit
|
||||
pub fn GetAppCodeName(&self) -> Fallible<DOMString> {
|
||||
Ok(Some(~"Mozilla")) // Like Gecko/Webkit
|
||||
}
|
||||
|
||||
pub fn GetAppVersion(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetAppVersion(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn GetPlatform(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetPlatform(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn GetUserAgent(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetUserAgent(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn GetLanguage(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn OnLine(&self) -> bool {
|
||||
|
@ -105,4 +105,4 @@ impl BindingObject for Navigator {
|
|||
Some((*page).frame.get_ref().window as @mut CacheableWrapper)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
//! The core DOM types. Defines the basic DOM hierarchy as well as all the HTML elements.
|
||||
|
||||
use dom::bindings::node;
|
||||
use dom::bindings::utils::{WrapperCache, DOMString, null_string, str, ErrorResult, NotFound, HierarchyRequest};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper, rust_box};
|
||||
use dom::bindings;
|
||||
use dom::bindings::utils::{WrapperCache, DOMString, ErrorResult, Fallible, NotFound, HierarchyRequest};
|
||||
use dom::bindings::utils::{BindingObject, CacheableWrapper, null_str_as_empty};
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::element::{Element, ElementTypeId, HTMLImageElementTypeId, HTMLIframeElementTypeId};
|
||||
|
@ -19,6 +18,7 @@ use dom::text::Text;
|
|||
use std::cast;
|
||||
use std::cast::transmute;
|
||||
use std::libc::c_void;
|
||||
use std::unstable::raw::Box;
|
||||
use extra::arc::Arc;
|
||||
use js::jsapi::{JSObject, JSContext};
|
||||
use netsurfcss::util::VoidPtrLike;
|
||||
|
@ -170,7 +170,7 @@ impl<'self, View> AbstractNode<View> {
|
|||
/// Allow consumers to recreate an AbstractNode from the raw boxed type.
|
||||
/// Must only be used in situations where the boxed type is in the inheritance
|
||||
/// chain for nodes.
|
||||
pub fn from_box<T>(ptr: *mut rust_box<T>) -> AbstractNode<View> {
|
||||
pub fn from_box<T>(ptr: *mut Box<T>) -> AbstractNode<View> {
|
||||
AbstractNode {
|
||||
obj: ptr as *mut Node<View>
|
||||
}
|
||||
|
@ -219,12 +219,12 @@ impl<'self, View> AbstractNode<View> {
|
|||
|
||||
pub fn transmute<T, R>(self, f: &fn(&T) -> R) -> R {
|
||||
unsafe {
|
||||
let node_box: *mut bindings::utils::rust_box<Node<View>> = transmute(self.obj);
|
||||
let node = &mut (*node_box).payload;
|
||||
let node_box: *mut Box<Node<View>> = transmute(self.obj);
|
||||
let node = &mut (*node_box).data;
|
||||
let old = node.abstract;
|
||||
node.abstract = Some(self);
|
||||
let box: *bindings::utils::rust_box<T> = transmute(self.obj);
|
||||
let rv = f(&(*box).payload);
|
||||
let box: *Box<T> = transmute(self.obj);
|
||||
let rv = f(&(*box).data);
|
||||
node.abstract = old;
|
||||
rv
|
||||
}
|
||||
|
@ -232,12 +232,12 @@ impl<'self, View> AbstractNode<View> {
|
|||
|
||||
pub fn transmute_mut<T, R>(self, f: &fn(&mut T) -> R) -> R {
|
||||
unsafe {
|
||||
let node_box: *mut bindings::utils::rust_box<Node<View>> = transmute(self.obj);
|
||||
let node = &mut (*node_box).payload;
|
||||
let node_box: *mut Box<Node<View>> = transmute(self.obj);
|
||||
let node = &mut (*node_box).data;
|
||||
let old = node.abstract;
|
||||
node.abstract = Some(self);
|
||||
let box: *bindings::utils::rust_box<T> = transmute(self.obj);
|
||||
let rv = f(cast::transmute(&(*box).payload));
|
||||
let box: *Box<T> = transmute(self.obj);
|
||||
let rv = f(cast::transmute(&(*box).data));
|
||||
node.abstract = old;
|
||||
rv
|
||||
}
|
||||
|
@ -516,11 +516,11 @@ impl Node<ScriptView> {
|
|||
}
|
||||
|
||||
pub fn NodeName(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn GetBaseURI(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn GetOwnerDocument(&self) -> Option<AbstractDocument> {
|
||||
|
@ -556,10 +556,11 @@ impl Node<ScriptView> {
|
|||
}
|
||||
|
||||
pub fn GetNodeValue(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetNodeValue(&mut self, _val: &DOMString, _rv: &mut ErrorResult) {
|
||||
pub fn SetNodeValue(&mut self, _val: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetTextContent(&self, abstract_self: AbstractNode<ScriptView>) -> DOMString {
|
||||
|
@ -570,11 +571,11 @@ impl Node<ScriptView> {
|
|||
if node.is_text() {
|
||||
do node.with_imm_text() |text| {
|
||||
let s = text.parent.Data();
|
||||
content = content + s.to_str();
|
||||
content = content + null_str_as_empty(&s);
|
||||
}
|
||||
}
|
||||
}
|
||||
str(content)
|
||||
Some(content)
|
||||
}
|
||||
CommentNodeTypeId | TextNodeTypeId => {
|
||||
do abstract_self.with_imm_characterdata() |characterdata| {
|
||||
|
@ -582,7 +583,7 @@ impl Node<ScriptView> {
|
|||
}
|
||||
}
|
||||
DoctypeNodeTypeId => {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -592,24 +593,22 @@ impl Node<ScriptView> {
|
|||
abstract_self: AbstractNode<ScriptView>,
|
||||
node: Option<AbstractNode<ScriptView>>) {
|
||||
//FIXME: We should batch document notifications that occur here
|
||||
let mut rv = Ok(());
|
||||
for child in abstract_self.children() {
|
||||
self.RemoveChild(abstract_self, child, &mut rv);
|
||||
self.RemoveChild(abstract_self, child);
|
||||
}
|
||||
match node {
|
||||
None => {},
|
||||
Some(node) => {
|
||||
self.AppendChild(abstract_self, node, &mut rv);
|
||||
self.AppendChild(abstract_self, node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn SetTextContent(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
value: &DOMString,
|
||||
_rv: &mut ErrorResult) {
|
||||
value: &DOMString) -> ErrorResult {
|
||||
let is_empty = match value {
|
||||
&str(~"") | &null_string => true,
|
||||
&Some(~"") | &None => true,
|
||||
_ => false
|
||||
};
|
||||
match self.type_id {
|
||||
|
@ -628,7 +627,7 @@ impl Node<ScriptView> {
|
|||
self.wait_until_safe_to_modify_dom();
|
||||
|
||||
do abstract_self.with_mut_characterdata() |characterdata| {
|
||||
characterdata.data = value.to_str();
|
||||
characterdata.data = null_str_as_empty(value);
|
||||
|
||||
// Notify the document that the content of this node is different
|
||||
for doc in self.owner_doc.iter() {
|
||||
|
@ -640,9 +639,10 @@ impl Node<ScriptView> {
|
|||
}
|
||||
DoctypeNodeTypeId => {}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn InsertBefore(&mut self, _node: AbstractNode<ScriptView>, _child: Option<AbstractNode<ScriptView>>, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
|
||||
pub fn InsertBefore(&mut self, _node: AbstractNode<ScriptView>, _child: Option<AbstractNode<ScriptView>>) -> Fallible<AbstractNode<ScriptView>> {
|
||||
fail!("stub")
|
||||
}
|
||||
|
||||
|
@ -656,8 +656,7 @@ impl Node<ScriptView> {
|
|||
|
||||
pub fn AppendChild(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
node: AbstractNode<ScriptView>,
|
||||
rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
|
||||
node: AbstractNode<ScriptView>) -> Fallible<AbstractNode<ScriptView>> {
|
||||
fn is_hierarchy_request_err(this_node: AbstractNode<ScriptView>,
|
||||
new_child: AbstractNode<ScriptView>) -> bool {
|
||||
if new_child.is_doctype() {
|
||||
|
@ -680,35 +679,32 @@ impl Node<ScriptView> {
|
|||
}
|
||||
|
||||
if is_hierarchy_request_err(abstract_self, node) {
|
||||
*rv = Err(HierarchyRequest);
|
||||
return Err(HierarchyRequest);
|
||||
}
|
||||
|
||||
// TODO: Should we handle WRONG_DOCUMENT_ERR here?
|
||||
|
||||
if rv.is_ok() {
|
||||
self.wait_until_safe_to_modify_dom();
|
||||
self.wait_until_safe_to_modify_dom();
|
||||
|
||||
// If the node already exists it is removed from current parent node.
|
||||
node.parent_node().map(|parent| parent.remove_child(node));
|
||||
abstract_self.add_child(node);
|
||||
match self.owner_doc {
|
||||
Some(doc) => do node.with_mut_base |node| {
|
||||
node.add_to_doc(doc);
|
||||
},
|
||||
None => ()
|
||||
}
|
||||
// If the node already exists it is removed from current parent node.
|
||||
node.parent_node().map(|parent| parent.remove_child(node));
|
||||
abstract_self.add_child(node);
|
||||
match self.owner_doc {
|
||||
Some(doc) => do node.with_mut_base |node| {
|
||||
node.add_to_doc(doc);
|
||||
},
|
||||
None => ()
|
||||
}
|
||||
node
|
||||
Ok(node)
|
||||
}
|
||||
|
||||
pub fn ReplaceChild(&mut self, _node: AbstractNode<ScriptView>, _child: AbstractNode<ScriptView>, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
|
||||
pub fn ReplaceChild(&mut self, _node: AbstractNode<ScriptView>, _child: AbstractNode<ScriptView>) -> Fallible<AbstractNode<ScriptView>> {
|
||||
fail!("stub")
|
||||
}
|
||||
|
||||
pub fn RemoveChild(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
node: AbstractNode<ScriptView>,
|
||||
rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
|
||||
node: AbstractNode<ScriptView>) -> Fallible<AbstractNode<ScriptView>> {
|
||||
fn is_not_found_err(this_node: AbstractNode<ScriptView>,
|
||||
old_child: AbstractNode<ScriptView>) -> bool {
|
||||
match old_child.parent_node() {
|
||||
|
@ -718,21 +714,20 @@ impl Node<ScriptView> {
|
|||
}
|
||||
|
||||
if is_not_found_err(abstract_self, node) {
|
||||
*rv = Err(NotFound);
|
||||
return Err(NotFound);
|
||||
}
|
||||
if rv.is_ok() {
|
||||
self.wait_until_safe_to_modify_dom();
|
||||
|
||||
abstract_self.remove_child(node);
|
||||
self.remove_from_doc();
|
||||
}
|
||||
node
|
||||
self.wait_until_safe_to_modify_dom();
|
||||
|
||||
abstract_self.remove_child(node);
|
||||
self.remove_from_doc();
|
||||
Ok(node)
|
||||
}
|
||||
|
||||
pub fn Normalize(&mut self) {
|
||||
}
|
||||
|
||||
pub fn CloneNode(&self, _deep: bool, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
|
||||
pub fn CloneNode(&self, _deep: bool) -> Fallible<AbstractNode<ScriptView>> {
|
||||
fail!("stub")
|
||||
}
|
||||
|
||||
|
@ -749,11 +744,11 @@ impl Node<ScriptView> {
|
|||
}
|
||||
|
||||
pub fn LookupPrefix(&self, _prefix: &DOMString) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn LookupNamespaceURI(&self, _namespace: &DOMString) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn IsDefaultNamespace(&self, _namespace: &DOMString) -> bool {
|
||||
|
@ -761,15 +756,15 @@ impl Node<ScriptView> {
|
|||
}
|
||||
|
||||
pub fn GetNamespaceURI(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn GetPrefix(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn GetLocalName(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn HasAttributes(&self) -> bool {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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::{DOMString, ErrorResult, null_string};
|
||||
use dom::bindings::utils::{DOMString, Fallible, null_str_as_empty};
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::node::{AbstractNode, ScriptView, Node, TextNodeTypeId};
|
||||
use dom::window::Window;
|
||||
|
@ -20,16 +20,16 @@ impl Text {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: @mut Window, text: &DOMString, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
|
||||
pub fn Constructor(owner: @mut Window, text: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
|
||||
let cx = owner.page.js_info.get_ref().js_compartment.cx.ptr;
|
||||
unsafe { Node::as_abstract_node(cx, @Text::new(text.to_str())) }
|
||||
unsafe { Ok(Node::as_abstract_node(cx, @Text::new(null_str_as_empty(text)))) }
|
||||
}
|
||||
|
||||
pub fn SplitText(&self, _offset: u32, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
|
||||
pub fn SplitText(&self, _offset: u32) -> Fallible<AbstractNode<ScriptView>> {
|
||||
fail!("unimplemented")
|
||||
}
|
||||
|
||||
pub fn GetWholeText(&self, _rv: &mut ErrorResult) -> DOMString {
|
||||
null_string
|
||||
pub fn GetWholeText(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::UIEventBinding;
|
||||
use dom::bindings::utils::{ErrorResult, DOMString};
|
||||
use dom::bindings::utils::{DOMString, Fallible};
|
||||
use dom::bindings::utils::{CacheableWrapper, WrapperCache, BindingObject, DerivedWrapper};
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
use dom::event::Event;
|
||||
|
@ -39,10 +39,9 @@ impl UIEvent {
|
|||
|
||||
pub fn Constructor(_owner: @mut Window,
|
||||
type_: &DOMString,
|
||||
init: &UIEventBinding::UIEventInit,
|
||||
_rv: &mut ErrorResult) -> @mut UIEvent {
|
||||
@mut UIEvent::new(type_, init.parent.bubbles, init.parent.cancelable,
|
||||
init.view, init.detail)
|
||||
init: &UIEventBinding::UIEventInit) -> Fallible<@mut UIEvent> {
|
||||
Ok(@mut UIEvent::new(type_, init.parent.bubbles, init.parent.cancelable,
|
||||
init.view, init.detail))
|
||||
}
|
||||
|
||||
pub fn GetView(&self) -> Option<@mut WindowProxy> {
|
||||
|
@ -59,8 +58,7 @@ impl UIEvent {
|
|||
cancelable: bool,
|
||||
view: Option<@mut WindowProxy>,
|
||||
detail: i32) {
|
||||
let mut rv = Ok(());
|
||||
self.parent.InitEvent(type_, can_bubble, cancelable, &mut rv);
|
||||
self.parent.InitEvent(type_, can_bubble, cancelable);
|
||||
self.can_bubble = can_bubble;
|
||||
self.cancelable = cancelable;
|
||||
self.view = view;
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::WindowBinding;
|
||||
use dom::bindings::utils::{WrapperCache, DOMString, null_string, Traceable};
|
||||
use dom::bindings::utils::{CacheableWrapper, BindingObject};
|
||||
use dom::bindings::utils::{WrapperCache, DOMString, Traceable};
|
||||
use dom::bindings::utils::{CacheableWrapper, BindingObject, null_str_as_empty};
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
use dom::navigator::Navigator;
|
||||
|
@ -69,7 +69,7 @@ pub struct TimerData {
|
|||
impl Window {
|
||||
pub fn Alert(&self, s: &DOMString) {
|
||||
// Right now, just print to the console
|
||||
io::println(fmt!("ALERT: %s", s.to_str()));
|
||||
io::println(fmt!("ALERT: %s", null_str_as_empty(s)));
|
||||
}
|
||||
|
||||
pub fn Close(&self) {
|
||||
|
@ -81,14 +81,14 @@ impl Window {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetName(&self, _name: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn Status(&self) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn SetStatus(&self, _status: &DOMString) {
|
||||
|
@ -123,7 +123,7 @@ impl Window {
|
|||
}
|
||||
|
||||
pub fn Prompt(&self, _message: &DOMString, _default: &DOMString) -> DOMString {
|
||||
null_string
|
||||
None
|
||||
}
|
||||
|
||||
pub fn Print(&self) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
* 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::str;
|
||||
use dom::element::*;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::htmlheadingelement::{Heading1, Heading2, Heading3, Heading4, Heading5, Heading6};
|
||||
|
@ -374,7 +373,7 @@ pub fn parse_html(cx: *JSContext,
|
|||
debug!("-- attach attrs");
|
||||
do node.as_mut_element |element| {
|
||||
for attr in tag.attributes.iter() {
|
||||
element.set_attr(node, &str(attr.name.clone()), &str(attr.value.clone()));
|
||||
element.set_attr(node, &Some(attr.name.clone()), &Some(attr.value.clone()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue