mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
auto merge of #1215 : Ms2ger/servo/DOMString-nonnull, r=jdm
This commit is contained in:
commit
6a0201a5a6
74 changed files with 417 additions and 415 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
use dom::bindings::codegen::AttrBinding;
|
||||
use dom::bindings::utils::{Reflectable, Reflector, DOMString};
|
||||
use dom::bindings::utils::{reflect_dom_object, null_str_as_empty};
|
||||
use dom::bindings::utils::reflect_dom_object;
|
||||
use dom::namespace::{Namespace, Null};
|
||||
use dom::window::Window;
|
||||
|
||||
|
@ -16,7 +16,7 @@ pub struct Attr {
|
|||
value: ~str,
|
||||
name: ~str,
|
||||
namespace: Namespace,
|
||||
prefix: DOMString
|
||||
prefix: Option<DOMString>
|
||||
}
|
||||
|
||||
impl Reflectable for Attr {
|
||||
|
@ -70,26 +70,26 @@ impl Attr {
|
|||
}
|
||||
|
||||
pub fn LocalName(&self) -> DOMString {
|
||||
Some(self.local_name().to_owned())
|
||||
self.local_name().to_owned()
|
||||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
Some(self.value.clone())
|
||||
self.value.clone()
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, value: &DOMString) {
|
||||
self.value = null_str_as_empty(value);
|
||||
self.value = value.clone();
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
Some(self.name.clone())
|
||||
self.name.clone()
|
||||
}
|
||||
|
||||
pub fn GetNamespaceURI(&self) -> DOMString {
|
||||
pub fn GetNamespaceURI(&self) -> Option<DOMString> {
|
||||
self.namespace.to_str()
|
||||
}
|
||||
|
||||
pub fn GetPrefix(&self) -> DOMString {
|
||||
pub fn GetPrefix(&self) -> Option<DOMString> {
|
||||
self.prefix.clone()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1066,9 +1066,6 @@ for (uint32_t i = 0; i < length; ++i) {
|
|||
|
||||
def getConversionCode(varName, isOptional=False):
|
||||
strval = "strval"
|
||||
if not type.nullable():
|
||||
# XXX #1207 Actually pass non-nullable strings to callees.
|
||||
strval = "Some(%s)" % strval
|
||||
if isOptional:
|
||||
strval = "Some(%s)" % strval
|
||||
if type.nullable():
|
||||
|
@ -1092,7 +1089,7 @@ for (uint32_t i = 0; i < length; ++i) {
|
|||
return handleDefault(
|
||||
conversionCode,
|
||||
("static data: [u8, ..%s] = [ %s ];\n"
|
||||
"%s = Some(str::from_utf8(data));" %
|
||||
"%s = str::from_utf8(data)" %
|
||||
(len(defaultValue.value) + 1,
|
||||
", ".join(["'" + char + "' as u8" for char in defaultValue.value] + ["0"]),
|
||||
varName)))
|
||||
|
@ -1109,12 +1106,14 @@ for (uint32_t i = 0; i < length; ++i) {
|
|||
"}\n" % CGIndenter(CGGeneric(getConversionCode("str"))).define(),
|
||||
declType, None, isOptional, None)
|
||||
|
||||
declType = "DOMString"
|
||||
initialValue = None
|
||||
if type.nullable():
|
||||
declType = "Option<%s>" % declType
|
||||
|
||||
if isOptional:
|
||||
declType = "Option<DOMString>"
|
||||
declType = "Option<%s>" % declType
|
||||
initialValue = "None"
|
||||
else:
|
||||
declType = "DOMString"
|
||||
initialValue = None
|
||||
|
||||
return (
|
||||
"%s\n" %
|
||||
|
@ -1587,8 +1586,7 @@ for (uint32_t i = 0; i < length; ++i) {
|
|||
if type.nullable():
|
||||
return (wrapAndSetPtr("*${jsvalPtr} = domstring_to_jsval(cx, &%s)" % result), False)
|
||||
else:
|
||||
#XXXjdm Can we be smarter when we know it's not nullable?
|
||||
return (wrapAndSetPtr("*${jsvalPtr} = domstring_to_jsval(cx, &%s)" % result), False)
|
||||
return (wrapAndSetPtr("*${jsvalPtr} = str_to_jsval(cx, &%s)" % result), False)
|
||||
|
||||
if type.isEnum():
|
||||
if type.nullable():
|
||||
|
@ -1722,7 +1720,10 @@ def getRetvalDeclarationForType(returnType, descriptorProvider,
|
|||
result = CGWrapper(result, pre="Nullable<", post=">")
|
||||
return result, False
|
||||
if returnType.isString():
|
||||
return CGGeneric("DOMString"), False
|
||||
result = CGGeneric("DOMString")
|
||||
if returnType.nullable():
|
||||
result = CGWrapper(result, pre="Option<", post=">")
|
||||
return result, False
|
||||
if returnType.isEnum():
|
||||
if returnType.nullable():
|
||||
raise TypeError("We don't support nullable enum return values")
|
||||
|
@ -2960,8 +2961,8 @@ class CGCallGenerator(CGThing):
|
|||
if a.type.isObject() and not a.type.nullable() and not a.optional:
|
||||
name = "(JSObject&)" + name
|
||||
#XXXjdm Perhaps we should pass all nontrivial types by borrowed pointer
|
||||
# Aoid passing Option<DOMString> by reference. If only one of optional or
|
||||
# defaultValue are truthy we pass an Option, otherwise it's a concrete DOMString.
|
||||
# Aoid passing Option<Option<DOMString>> by reference. If only one of optional or
|
||||
# defaultValue are truthy we pass an Option, otherwise it's a concrete Option<DOMString>.
|
||||
if a.type.isDictionary() or (a.type.isString() and not (bool(a.defaultValue) ^ a.optional)):
|
||||
name = "&" + name
|
||||
args.append(CGGeneric(name))
|
||||
|
|
|
@ -116,9 +116,9 @@ extern fn InterfaceObjectToString(cx: *JSContext, _argc: c_uint, vp: *mut JSVal)
|
|||
}
|
||||
}
|
||||
|
||||
pub type DOMString = Option<~str>;
|
||||
pub type DOMString = ~str;
|
||||
|
||||
pub fn null_str_as_empty(s: &DOMString) -> ~str {
|
||||
pub fn null_str_as_empty(s: &Option<DOMString>) -> ~str {
|
||||
// We don't use map_default because it would allocate ~"" even for Some.
|
||||
match *s {
|
||||
Some(ref s) => s.clone(),
|
||||
|
@ -126,14 +126,14 @@ pub fn null_str_as_empty(s: &DOMString) -> ~str {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn null_str_as_empty_ref<'a>(s: &'a DOMString) -> &'a str {
|
||||
pub fn null_str_as_empty_ref<'a>(s: &'a Option<DOMString>) -> &'a str {
|
||||
match *s {
|
||||
Some(ref s) => s.as_slice(),
|
||||
None => &'a ""
|
||||
}
|
||||
}
|
||||
|
||||
pub fn null_str_as_word_null(s: &DOMString) -> ~str {
|
||||
pub fn null_str_as_word_null(s: &Option<DOMString>) -> ~str {
|
||||
// We don't use map_default because it would allocate ~"null" even for Some.
|
||||
match *s {
|
||||
Some(ref s) => s.clone(),
|
||||
|
@ -259,7 +259,7 @@ pub fn jsval_to_str(cx: *JSContext, v: JSVal,
|
|||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
pub fn jsval_to_domstring(cx: *JSContext, v: JSVal) -> Result<DOMString, ()> {
|
||||
pub fn jsval_to_domstring(cx: *JSContext, v: JSVal) -> Result<Option<DOMString>, ()> {
|
||||
if jsval::is_null(v) || jsval::is_undefined(v) {
|
||||
Ok(None)
|
||||
} else {
|
||||
|
@ -273,18 +273,23 @@ pub fn jsval_to_domstring(cx: *JSContext, v: JSVal) -> Result<DOMString, ()> {
|
|||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
pub unsafe fn domstring_to_jsval(cx: *JSContext, string: &DOMString) -> JSVal {
|
||||
pub unsafe fn str_to_jsval(cx: *JSContext, string: &DOMString) -> JSVal {
|
||||
do string.to_utf16().as_imm_buf |buf, len| {
|
||||
let jsstr = JS_NewUCStringCopyN(cx, buf, len as libc::size_t);
|
||||
if jsstr.is_null() {
|
||||
// FIXME: is there something else we should do on failure?
|
||||
JSVAL_NULL
|
||||
} else {
|
||||
RUST_STRING_TO_JSVAL(jsstr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[fixed_stack_segment]
|
||||
pub unsafe fn domstring_to_jsval(cx: *JSContext, string: &Option<DOMString>) -> JSVal {
|
||||
match string {
|
||||
&None => JSVAL_NULL,
|
||||
&Some(ref s) => do s.to_utf16().as_imm_buf |buf, len| {
|
||||
let jsstr = JS_NewUCStringCopyN(cx, buf, len as libc::size_t);
|
||||
if jsstr.is_null() {
|
||||
// FIXME: is there something else we should do on failure?
|
||||
JSVAL_NULL
|
||||
} else {
|
||||
RUST_STRING_TO_JSVAL(jsstr)
|
||||
}
|
||||
}
|
||||
&Some(ref s) => str_to_jsval(cx, s),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@ impl CharacterData {
|
|||
}
|
||||
|
||||
pub fn Data(&self) -> DOMString {
|
||||
Some(self.data.clone())
|
||||
self.data.clone()
|
||||
}
|
||||
|
||||
pub fn SetData(&mut self, arg: &DOMString) -> ErrorResult {
|
||||
self.data = arg.get_ref().clone();
|
||||
self.data = arg.clone();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -36,11 +36,11 @@ impl CharacterData {
|
|||
}
|
||||
|
||||
pub fn SubstringData(&self, offset: u32, count: u32) -> Fallible<DOMString> {
|
||||
Ok(Some(self.data.slice(offset as uint, count as uint).to_str()))
|
||||
Ok(self.data.slice(offset as uint, count as uint).to_str())
|
||||
}
|
||||
|
||||
pub fn AppendData(&mut self, arg: &DOMString) -> ErrorResult {
|
||||
self.data.push_str(arg.get_ref().clone());
|
||||
self.data.push_str(*arg);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::CommentBinding;
|
||||
use dom::bindings::utils::{DOMString, Fallible, null_str_as_empty};
|
||||
use dom::bindings::utils::{DOMString, Fallible};
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::node::{AbstractNode, ScriptView, CommentNodeTypeId, Node};
|
||||
|
@ -27,6 +27,6 @@ impl Comment {
|
|||
}
|
||||
|
||||
pub fn Constructor(owner: @mut Window, data: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
|
||||
Ok(Comment::new(null_str_as_empty(data), owner.Document()))
|
||||
Ok(Comment::new(data.clone(), owner.Document()))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ use dom::comment::Comment;
|
|||
use dom::bindings::codegen::DocumentBinding;
|
||||
use dom::bindings::utils::{Reflectable, Reflector, Traceable, reflect_dom_object};
|
||||
use dom::bindings::utils::{ErrorResult, Fallible, NotSupported, InvalidCharacter};
|
||||
use dom::bindings::utils::{DOMString, null_str_as_empty_ref, null_str_as_empty, null_str_as_word_null};
|
||||
use dom::bindings::utils::DOMString;
|
||||
use dom::bindings::utils::{xml_name_type, InvalidXMLName};
|
||||
use dom::documentfragment::DocumentFragment;
|
||||
use dom::element::{Element};
|
||||
|
@ -181,10 +181,10 @@ impl Document {
|
|||
}
|
||||
|
||||
pub fn GetElementsByTagName(&self, tag: &DOMString) -> @mut HTMLCollection {
|
||||
self.createHTMLCollection(|elem| eq_slice(elem.tag_name, null_str_as_empty(tag)))
|
||||
self.createHTMLCollection(|elem| eq_slice(elem.tag_name, *tag))
|
||||
}
|
||||
|
||||
pub fn GetElementsByTagNameNS(&self, _ns: &DOMString, _tag: &DOMString) -> @mut HTMLCollection {
|
||||
pub fn GetElementsByTagNameNS(&self, _ns: &Option<DOMString>, _tag: &DOMString) -> @mut HTMLCollection {
|
||||
HTMLCollection::new(self.window, ~[])
|
||||
}
|
||||
|
||||
|
@ -193,18 +193,16 @@ impl Document {
|
|||
}
|
||||
|
||||
pub fn GetElementById(&self, id: &DOMString) -> Option<AbstractNode<ScriptView>> {
|
||||
let key: &~str = &null_str_as_empty(id);
|
||||
// TODO: "in tree order, within the context object's tree"
|
||||
// http://dom.spec.whatwg.org/#dom-document-getelementbyid.
|
||||
match self.idmap.find_equiv(key) {
|
||||
match self.idmap.find_equiv(id) {
|
||||
None => None,
|
||||
Some(node) => Some(*node),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn CreateElement(&self, abstract_self: AbstractDocument, local_name: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
|
||||
let local_name = null_str_as_empty(local_name);
|
||||
if xml_name_type(local_name) == InvalidXMLName {
|
||||
if xml_name_type(*local_name) == InvalidXMLName {
|
||||
return Err(InvalidCharacter);
|
||||
}
|
||||
let local_name = local_name.to_ascii_lower();
|
||||
|
@ -216,15 +214,15 @@ impl Document {
|
|||
}
|
||||
|
||||
pub fn CreateTextNode(&self, abstract_self: AbstractDocument, data: &DOMString) -> AbstractNode<ScriptView> {
|
||||
Text::new(null_str_as_empty(data), abstract_self)
|
||||
Text::new(data.clone(), abstract_self)
|
||||
}
|
||||
|
||||
pub fn CreateComment(&self, abstract_self: AbstractDocument, data: &DOMString) -> AbstractNode<ScriptView> {
|
||||
Comment::new(null_str_as_word_null(data), abstract_self)
|
||||
Comment::new(data.clone(), abstract_self)
|
||||
}
|
||||
|
||||
pub fn CreateEvent(&self, interface: &DOMString) -> Fallible<AbstractEvent> {
|
||||
match null_str_as_empty_ref(interface) {
|
||||
match interface.as_slice() {
|
||||
"UIEvents" => Ok(UIEvent::new(self.window, UIEventTypeId)),
|
||||
"MouseEvents" => Ok(MouseEvent::new(self.window)),
|
||||
"HTMLEvents" => Ok(Event::new(self.window, HTMLEventTypeId)),
|
||||
|
@ -249,8 +247,7 @@ impl Document {
|
|||
for child in node.children() {
|
||||
if child.is_text() {
|
||||
do child.with_imm_text() |text| {
|
||||
let s = text.element.Data();
|
||||
title = title + null_str_as_empty(&s);
|
||||
title = title + text.element.Data();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -263,7 +260,7 @@ impl Document {
|
|||
let v: ~[&str] = title.word_iter().collect();
|
||||
title = v.connect(" ");
|
||||
title = title.trim().to_owned();
|
||||
Some(title)
|
||||
title
|
||||
}
|
||||
|
||||
pub fn SetTitle(&self, abstract_self: AbstractDocument, title: &DOMString) -> ErrorResult {
|
||||
|
@ -307,7 +304,7 @@ impl Document {
|
|||
|
||||
pub fn GetElementsByName(&self, name: &DOMString) -> @mut HTMLCollection {
|
||||
self.createHTMLCollection(|elem|
|
||||
elem.get_attr("name").is_some() && eq_slice(elem.get_attr("name").unwrap(), null_str_as_empty(name)))
|
||||
elem.get_attr("name").is_some() && eq_slice(elem.get_attr("name").unwrap(), *name))
|
||||
}
|
||||
|
||||
pub fn createHTMLCollection(&self, callback: &fn(elem: &Element) -> bool) -> @mut HTMLCollection {
|
||||
|
|
|
@ -10,9 +10,9 @@ use dom::node::{AbstractNode, ScriptView, Node, DoctypeNodeTypeId};
|
|||
/// The `DOCTYPE` tag.
|
||||
pub struct DocumentType {
|
||||
node: Node<ScriptView>,
|
||||
name: ~str,
|
||||
public_id: Option<~str>,
|
||||
system_id: Option<~str>,
|
||||
name: DOMString,
|
||||
public_id: DOMString,
|
||||
system_id: DOMString,
|
||||
force_quirks: bool
|
||||
}
|
||||
|
||||
|
@ -26,8 +26,8 @@ impl DocumentType {
|
|||
DocumentType {
|
||||
node: Node::new(DoctypeNodeTypeId, document),
|
||||
name: name,
|
||||
public_id: public_id,
|
||||
system_id: system_id,
|
||||
public_id: public_id.unwrap_or(~""),
|
||||
system_id: system_id.unwrap_or(~""),
|
||||
force_quirks: force_quirks,
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ impl DocumentType {
|
|||
|
||||
impl DocumentType {
|
||||
pub fn Name(&self) -> DOMString {
|
||||
Some(self.name.clone())
|
||||
self.name.clone()
|
||||
}
|
||||
|
||||
pub fn PublicId(&self) -> DOMString {
|
||||
|
|
|
@ -154,7 +154,7 @@ impl<'self> Element {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn normalize_attr_name(&self, name: &DOMString) -> ~str {
|
||||
pub fn normalize_attr_name(&self, name: &Option<DOMString>) -> ~str {
|
||||
//FIXME: Throw for XML-invalid names
|
||||
let owner = self.node.owner_doc();
|
||||
if owner.document().doctype == document::HTML { // && self.namespace == Namespace::HTML
|
||||
|
@ -165,7 +165,7 @@ impl<'self> Element {
|
|||
}
|
||||
|
||||
pub fn get_attribute<'a>(&'a self,
|
||||
namespace_url: &DOMString,
|
||||
namespace_url: &Option<DOMString>,
|
||||
name: &str) -> Option<@mut Attr> {
|
||||
let namespace = Namespace::from_str(namespace_url);
|
||||
// FIXME: only case-insensitive in the HTML namespace (as opposed to SVG, etc.)
|
||||
|
@ -179,16 +179,16 @@ impl<'self> Element {
|
|||
|
||||
pub fn set_attr(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
raw_name: &DOMString,
|
||||
raw_value: &DOMString) -> ErrorResult {
|
||||
raw_name: &Option<DOMString>,
|
||||
raw_value: &Option<DOMString>) -> ErrorResult {
|
||||
self.set_attribute(abstract_self, namespace::Null, raw_name, raw_value)
|
||||
}
|
||||
|
||||
pub fn set_attribute(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
namespace: Namespace,
|
||||
raw_name: &DOMString,
|
||||
raw_value: &DOMString) -> ErrorResult {
|
||||
raw_name: &Option<DOMString>,
|
||||
raw_value: &Option<DOMString>) -> ErrorResult {
|
||||
//FIXME: Throw for XML-invalid names
|
||||
//FIXME: Throw for XMLNS-invalid names
|
||||
let name = null_str_as_empty(raw_name).to_ascii_lower();
|
||||
|
@ -246,7 +246,7 @@ impl<'self> Element {
|
|||
abstract_self: AbstractNode<ScriptView>,
|
||||
namespace: &Namespace,
|
||||
local_name: ~str,
|
||||
value: &DOMString) {
|
||||
value: &Option<DOMString>) {
|
||||
|
||||
if "style" == local_name && *namespace == namespace::Null {
|
||||
self.style_attribute = Some(style::parse_style_attribute(
|
||||
|
@ -261,12 +261,12 @@ impl<'self> Element {
|
|||
match abstract_self.type_id() {
|
||||
ElementNodeTypeId(HTMLImageElementTypeId) => {
|
||||
do abstract_self.with_mut_image_element |image| {
|
||||
image.AfterSetAttr(&Some(local_name.clone()), value);
|
||||
image.AfterSetAttr(&local_name, &null_str_as_empty(value));
|
||||
}
|
||||
}
|
||||
ElementNodeTypeId(HTMLIframeElementTypeId) => {
|
||||
do abstract_self.with_mut_iframe_element |iframe| {
|
||||
iframe.AfterSetAttr(&Some(local_name.clone()), value);
|
||||
iframe.AfterSetAttr(&local_name, &null_str_as_empty(value));
|
||||
}
|
||||
}
|
||||
_ => ()
|
||||
|
@ -281,26 +281,26 @@ impl<'self> Element {
|
|||
|
||||
impl Element {
|
||||
pub fn TagName(&self) -> DOMString {
|
||||
Some(self.tag_name.to_owned().to_ascii_upper())
|
||||
self.tag_name.to_owned().to_ascii_upper()
|
||||
}
|
||||
|
||||
pub fn Id(&self, _abstract_self: AbstractNode<ScriptView>) -> DOMString {
|
||||
match self.get_attr(&"id") {
|
||||
Some(x) => Some(x),
|
||||
None => Some(~"")
|
||||
Some(x) => x,
|
||||
None => ~""
|
||||
}
|
||||
}
|
||||
|
||||
pub fn SetId(&mut self, abstract_self: AbstractNode<ScriptView>, id: &DOMString) {
|
||||
self.set_attribute(abstract_self, namespace::Null, &Some(~"id"), id);
|
||||
self.set_attribute(abstract_self, namespace::Null, &Some(~"id"), &Some(id.clone()));
|
||||
}
|
||||
|
||||
pub fn GetAttribute(&self, name: &DOMString) -> DOMString {
|
||||
self.get_attr(null_str_as_empty_ref(name))
|
||||
pub fn GetAttribute(&self, name: &DOMString) -> Option<DOMString> {
|
||||
self.get_attr(*name).map(|s| s.to_owned())
|
||||
}
|
||||
|
||||
pub fn GetAttributeNS(&self, namespace: &DOMString, local_name: &DOMString) -> DOMString {
|
||||
self.get_attribute(namespace, null_str_as_empty_ref(local_name))
|
||||
pub fn GetAttributeNS(&self, namespace: &Option<DOMString>, local_name: &DOMString) -> Option<DOMString> {
|
||||
self.get_attribute(namespace, *local_name)
|
||||
.map(|attr| attr.value.clone())
|
||||
}
|
||||
|
||||
|
@ -308,16 +308,16 @@ impl Element {
|
|||
abstract_self: AbstractNode<ScriptView>,
|
||||
name: &DOMString,
|
||||
value: &DOMString) -> ErrorResult {
|
||||
self.set_attr(abstract_self, name, value);
|
||||
self.set_attr(abstract_self, &Some(name.clone()), &Some(value.clone()));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn SetAttributeNS(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
namespace_url: &DOMString,
|
||||
namespace_url: &Option<DOMString>,
|
||||
name: &DOMString,
|
||||
value: &DOMString) -> ErrorResult {
|
||||
let name_type = xml_name_type(name.to_str());
|
||||
let name_type = xml_name_type(*name);
|
||||
match name_type {
|
||||
InvalidXMLName => return Err(InvalidCharacter),
|
||||
Name => return Err(NamespaceError),
|
||||
|
@ -325,14 +325,14 @@ impl Element {
|
|||
}
|
||||
|
||||
let namespace = Namespace::from_str(namespace_url);
|
||||
self.set_attribute(abstract_self, namespace, name, value)
|
||||
self.set_attribute(abstract_self, namespace, &Some(name.clone()), &Some(value.clone()))
|
||||
}
|
||||
|
||||
pub fn RemoveAttribute(&self, _name: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn RemoveAttributeNS(&self, _namespace: &DOMString, _localname: &DOMString) -> ErrorResult {
|
||||
pub fn RemoveAttributeNS(&self, _namespace: &Option<DOMString>, _localname: &DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -340,7 +340,7 @@ impl Element {
|
|||
self.GetAttribute(name).is_some()
|
||||
}
|
||||
|
||||
pub fn HasAttributeNS(&self, namespace: &DOMString, local_name: &DOMString) -> bool {
|
||||
pub fn HasAttributeNS(&self, namespace: &Option<DOMString>, local_name: &DOMString) -> bool {
|
||||
self.GetAttributeNS(namespace, local_name).is_some()
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ impl Element {
|
|||
HTMLCollection::new(self.node.owner_doc().document().window, ~[])
|
||||
}
|
||||
|
||||
pub fn GetElementsByTagNameNS(&self, _namespace: &DOMString, _localname: &DOMString) -> Fallible<@mut HTMLCollection> {
|
||||
pub fn GetElementsByTagNameNS(&self, _namespace: &Option<DOMString>, _localname: &DOMString) -> Fallible<@mut HTMLCollection> {
|
||||
Ok(HTMLCollection::new(self.node.owner_doc().document().window, ~[]))
|
||||
}
|
||||
|
||||
|
@ -453,7 +453,7 @@ impl Element {
|
|||
}
|
||||
|
||||
pub fn GetInnerHTML(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
Ok(~"")
|
||||
}
|
||||
|
||||
pub fn SetInnerHTML(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
|
@ -461,7 +461,7 @@ impl Element {
|
|||
}
|
||||
|
||||
pub fn GetOuterHTML(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
Ok(~"")
|
||||
}
|
||||
|
||||
pub fn SetOuterHTML(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -6,7 +6,7 @@ use dom::eventtarget::AbstractEventTarget;
|
|||
use dom::window::Window;
|
||||
use dom::bindings::codegen::EventBinding;
|
||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, Fallible, null_str_as_word_null};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
|
||||
use dom::mouseevent::MouseEvent;
|
||||
use dom::uievent::UIEvent;
|
||||
|
||||
|
@ -182,7 +182,7 @@ impl Event {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
Some(self.type_.clone())
|
||||
self.type_.clone()
|
||||
}
|
||||
|
||||
pub fn GetTarget(&self) -> Option<AbstractEventTarget> {
|
||||
|
@ -228,7 +228,7 @@ impl Event {
|
|||
type_: &DOMString,
|
||||
bubbles: bool,
|
||||
cancelable: bool) -> ErrorResult {
|
||||
self.type_ = null_str_as_word_null(type_);
|
||||
self.type_ = type_.clone();
|
||||
self.cancelable = cancelable;
|
||||
self.bubbles = bubbles;
|
||||
self.initialized = true;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::utils::{Reflectable, Reflector, DOMString, Fallible};
|
||||
use dom::bindings::utils::{null_str_as_word_null, InvalidState};
|
||||
use dom::bindings::utils::{InvalidState};
|
||||
use dom::bindings::codegen::EventListenerBinding::EventListener;
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::event::AbstractEvent;
|
||||
|
@ -145,7 +145,7 @@ impl EventTarget {
|
|||
listener: Option<EventListener>,
|
||||
capture: bool) {
|
||||
for &listener in listener.iter() {
|
||||
let entry = self.handlers.find_or_insert_with(null_str_as_word_null(ty), |_| ~[]);
|
||||
let entry = self.handlers.find_or_insert_with(ty.clone(), |_| ~[]);
|
||||
let phase = if capture { Capturing } else { Bubbling };
|
||||
let new_entry = EventListenerEntry {
|
||||
phase: phase,
|
||||
|
@ -162,7 +162,7 @@ impl EventTarget {
|
|||
listener: Option<EventListener>,
|
||||
capture: bool) {
|
||||
for &listener in listener.iter() {
|
||||
let mut entry = self.handlers.find_mut(&null_str_as_word_null(ty));
|
||||
let mut entry = self.handlers.find_mut(ty);
|
||||
for entry in entry.mut_iter() {
|
||||
let phase = if capture { Capturing } else { Bubbling };
|
||||
let old_entry = EventListenerEntry {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||
use dom::bindings::utils::{DOMString, null_str_as_empty};
|
||||
use dom::bindings::utils::DOMString;
|
||||
use dom::bindings::codegen::FormDataBinding;
|
||||
use dom::blob::Blob;
|
||||
use dom::window::Window;
|
||||
|
@ -37,13 +37,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(Some(~"default"))
|
||||
name: filename.unwrap_or(~"default")
|
||||
};
|
||||
self.data.insert(null_str_as_empty(name), blob);
|
||||
self.data.insert(name.clone(), blob);
|
||||
}
|
||||
|
||||
pub fn Append_(&mut self, name: &DOMString, value: &DOMString) {
|
||||
self.data.insert(null_str_as_empty(name), StringData((*value).clone()));
|
||||
self.data.insert(name.clone(), StringData((*value).clone()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLAnchorElement {
|
|||
|
||||
impl HTMLAnchorElement {
|
||||
pub fn Href(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHref(&mut self, _href: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Download(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetDownload(&self, _download: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Ping(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetPing(&self, _ping: &DOMString) -> ErrorResult {
|
||||
|
@ -60,7 +60,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Rel(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetRel(&self, _rel: &DOMString) -> ErrorResult {
|
||||
|
@ -68,7 +68,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Hreflang(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHreflang(&self, _href_lang: &DOMString) -> ErrorResult {
|
||||
|
@ -76,7 +76,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
@ -84,7 +84,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Text(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
|
@ -92,7 +92,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Coords(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCoords(&mut self, _coords: &DOMString) -> ErrorResult {
|
||||
|
@ -100,7 +100,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Charset(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult {
|
||||
|
@ -108,7 +108,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -116,7 +116,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Rev(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetRev(&mut self, _rev: &DOMString) -> ErrorResult {
|
||||
|
@ -124,7 +124,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
|
||||
pub fn Shape(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetShape(&mut self, _shape: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLAppletElement {
|
|||
|
||||
impl HTMLAppletElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLAppletElement {
|
|||
}
|
||||
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlt(&self, _alt: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLAppletElement {
|
|||
}
|
||||
|
||||
pub fn Archive(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetArchive(&self, _archive: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLAppletElement {
|
|||
}
|
||||
|
||||
pub fn Code(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCode(&self, _code: &DOMString) -> ErrorResult {
|
||||
|
@ -60,7 +60,7 @@ impl HTMLAppletElement {
|
|||
}
|
||||
|
||||
pub fn CodeBase(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCodeBase(&self, _code_base: &DOMString) -> ErrorResult {
|
||||
|
@ -68,7 +68,7 @@ impl HTMLAppletElement {
|
|||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHeight(&self, _height: &DOMString) -> ErrorResult {
|
||||
|
@ -84,7 +84,7 @@ impl HTMLAppletElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -92,7 +92,7 @@ impl HTMLAppletElement {
|
|||
}
|
||||
|
||||
pub fn Object(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetObject(&mut self, _object: &DOMString) -> ErrorResult {
|
||||
|
@ -108,7 +108,7 @@ impl HTMLAppletElement {
|
|||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLAreaElement {
|
|||
|
||||
impl HTMLAreaElement {
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlt(&self, _alt: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLAreaElement {
|
|||
}
|
||||
|
||||
pub fn Coords(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCoords(&self, _coords: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLAreaElement {
|
|||
}
|
||||
|
||||
pub fn Shape(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetShape(&self, _shape: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLAreaElement {
|
|||
}
|
||||
|
||||
pub fn Href(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHref(&self, _href: &DOMString) -> ErrorResult {
|
||||
|
@ -60,7 +60,7 @@ impl HTMLAreaElement {
|
|||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult {
|
||||
|
@ -68,7 +68,7 @@ impl HTMLAreaElement {
|
|||
}
|
||||
|
||||
pub fn Download(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetDownload(&self, _download: &DOMString) -> ErrorResult {
|
||||
|
@ -76,7 +76,7 @@ impl HTMLAreaElement {
|
|||
}
|
||||
|
||||
pub fn Ping(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetPing(&self, _ping: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLBaseElement {
|
|||
|
||||
impl HTMLBaseElement {
|
||||
pub fn Href(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHref(&self, _href: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLBaseElement {
|
|||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetTarget(&self, _target: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLBodyElement {
|
|||
|
||||
impl HTMLBodyElement {
|
||||
pub fn Text(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLBodyElement {
|
|||
}
|
||||
|
||||
pub fn Link(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetLink(&self, _link: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLBodyElement {
|
|||
}
|
||||
|
||||
pub fn VLink(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetVLink(&self, _v_link: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLBodyElement {
|
|||
}
|
||||
|
||||
pub fn ALink(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetALink(&self, _a_link: &DOMString) -> ErrorResult {
|
||||
|
@ -60,7 +60,7 @@ impl HTMLBodyElement {
|
|||
}
|
||||
|
||||
pub fn BgColor(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
|
||||
|
@ -68,7 +68,7 @@ impl HTMLBodyElement {
|
|||
}
|
||||
|
||||
pub fn Background(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetBackground(&self, _background: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLBRElement {
|
|||
|
||||
impl HTMLBRElement {
|
||||
pub fn Clear(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetClear(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -49,7 +49,7 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
pub fn FormAction(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFormAction(&mut self, _formaction: &DOMString) -> ErrorResult {
|
||||
|
@ -57,7 +57,7 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
pub fn FormEnctype(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFormEnctype(&mut self, _formenctype: &DOMString) -> ErrorResult {
|
||||
|
@ -65,7 +65,7 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
pub fn FormMethod(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFormMethod(&mut self, _formmethod: &DOMString) -> ErrorResult {
|
||||
|
@ -81,7 +81,7 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
pub fn FormTarget(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFormTarget(&mut self, _formtarget: &DOMString) -> ErrorResult {
|
||||
|
@ -89,7 +89,7 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -97,7 +97,7 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
@ -105,7 +105,7 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
|
@ -128,7 +128,7 @@ impl HTMLButtonElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -55,7 +55,7 @@ impl HTMLCollection {
|
|||
self.Item(index)
|
||||
}
|
||||
|
||||
pub fn NamedGetter(&self, _cx: *JSContext, _name: &DOMString, _found: &mut bool) -> Fallible<*JSObject> {
|
||||
pub fn NamedGetter(&self, _cx: *JSContext, _name: &Option<DOMString>, _found: &mut bool) -> Fallible<*JSObject> {
|
||||
Ok(ptr::null())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLDataElement {
|
|||
|
||||
impl HTMLDataElement {
|
||||
pub fn Value(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLDivElement {
|
|||
|
||||
impl HTMLDivElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -36,7 +36,7 @@ impl HTMLDListElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -29,21 +29,21 @@ impl HTMLElement {
|
|||
|
||||
impl HTMLElement {
|
||||
pub fn Title(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetTitle(&mut self, _title: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn Lang(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetLang(&mut self, _lang: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn Dir(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetDir(&mut self, _dir: &DOMString) -> ErrorResult {
|
||||
|
@ -86,7 +86,7 @@ impl HTMLElement {
|
|||
}
|
||||
|
||||
pub fn AccessKey(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAccessKey(&self, _key: &DOMString) -> ErrorResult {
|
||||
|
@ -94,7 +94,7 @@ impl HTMLElement {
|
|||
}
|
||||
|
||||
pub fn AccessKeyLabel(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn Draggable(&self) -> bool {
|
||||
|
@ -106,7 +106,7 @@ impl HTMLElement {
|
|||
}
|
||||
|
||||
pub fn ContentEditable(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetContentEditable(&mut self, _val: &DOMString) -> ErrorResult {
|
||||
|
@ -126,7 +126,7 @@ impl HTMLElement {
|
|||
}
|
||||
|
||||
pub fn ClassName(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetClassName(&self, _class: &DOMString) {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLEmbedElement {
|
|||
|
||||
impl HTMLEmbedElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLEmbedElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLEmbedElement {
|
|||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLEmbedElement {
|
|||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult {
|
||||
|
@ -60,7 +60,7 @@ impl HTMLEmbedElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
@ -68,7 +68,7 @@ impl HTMLEmbedElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -42,7 +42,7 @@ impl HTMLFieldSetElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -50,7 +50,7 @@ impl HTMLFieldSetElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn Elements(&self) -> @mut HTMLCollection {
|
||||
|
@ -68,7 +68,7 @@ impl HTMLFieldSetElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLFontElement {
|
|||
|
||||
impl HTMLFontElement {
|
||||
pub fn Color(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetColor(&mut self, _color: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLFontElement {
|
|||
}
|
||||
|
||||
pub fn Face(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFace(&mut self, _face: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLFontElement {
|
|||
}
|
||||
|
||||
pub fn Size(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSize(&mut self, _size: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -29,7 +29,7 @@ impl HTMLFormElement {
|
|||
|
||||
impl HTMLFormElement {
|
||||
pub fn AcceptCharset(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAcceptCharset(&mut self, _accept_charset: &DOMString) -> ErrorResult {
|
||||
|
@ -37,7 +37,7 @@ impl HTMLFormElement {
|
|||
}
|
||||
|
||||
pub fn Action(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAction(&mut self, _action: &DOMString) -> ErrorResult {
|
||||
|
@ -45,7 +45,7 @@ impl HTMLFormElement {
|
|||
}
|
||||
|
||||
pub fn Autocomplete(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAutocomplete(&mut self, _autocomplete: &DOMString) -> ErrorResult {
|
||||
|
@ -53,7 +53,7 @@ impl HTMLFormElement {
|
|||
}
|
||||
|
||||
pub fn Enctype(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetEnctype(&mut self, _enctype: &DOMString) -> ErrorResult {
|
||||
|
@ -61,7 +61,7 @@ impl HTMLFormElement {
|
|||
}
|
||||
|
||||
pub fn Encoding(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetEncoding(&mut self, _encoding: &DOMString) -> ErrorResult {
|
||||
|
@ -69,7 +69,7 @@ impl HTMLFormElement {
|
|||
}
|
||||
|
||||
pub fn Method(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetMethod(&mut self, _method: &DOMString) -> ErrorResult {
|
||||
|
@ -77,7 +77,7 @@ impl HTMLFormElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -93,7 +93,7 @@ impl HTMLFormElement {
|
|||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetTarget(&mut self, _target: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -29,7 +29,7 @@ impl HTMLFrameElement {
|
|||
|
||||
impl HTMLFrameElement {
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -37,7 +37,7 @@ impl HTMLFrameElement {
|
|||
}
|
||||
|
||||
pub fn Scrolling(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetScrolling(&mut self, _scrolling: &DOMString) -> ErrorResult {
|
||||
|
@ -45,7 +45,7 @@ impl HTMLFrameElement {
|
|||
}
|
||||
|
||||
pub fn Src(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
|
@ -53,7 +53,7 @@ impl HTMLFrameElement {
|
|||
}
|
||||
|
||||
pub fn FrameBorder(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString) -> ErrorResult {
|
||||
|
@ -61,7 +61,7 @@ impl HTMLFrameElement {
|
|||
}
|
||||
|
||||
pub fn LongDesc(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult {
|
||||
|
@ -85,7 +85,7 @@ impl HTMLFrameElement {
|
|||
}
|
||||
|
||||
pub fn MarginHeight(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetMarginHeight(&mut self, _height: &DOMString) -> ErrorResult {
|
||||
|
@ -93,7 +93,7 @@ impl HTMLFrameElement {
|
|||
}
|
||||
|
||||
pub fn MarginWidth(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetMarginWidth(&mut self, _height: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLFrameSetElement {
|
|||
|
||||
impl HTMLFrameSetElement {
|
||||
pub fn Cols(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCols(&mut self, _cols: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLFrameSetElement {
|
|||
}
|
||||
|
||||
pub fn Rows(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetRows(&mut self, _rows: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -39,7 +39,7 @@ impl HTMLHeadingElement {
|
|||
|
||||
impl HTMLHeadingElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLHRElement {
|
|||
|
||||
impl HTMLHRElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLHRElement {
|
|||
}
|
||||
|
||||
pub fn Color(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetColor(&mut self, _color: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLHRElement {
|
|||
}
|
||||
|
||||
pub fn Size(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSize(&mut self, _size: &DOMString) -> ErrorResult {
|
||||
|
@ -60,7 +60,7 @@ impl HTMLHRElement {
|
|||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLHtmlElement {
|
|||
|
||||
impl HTMLHtmlElement {
|
||||
pub fn Version(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetVersion(&mut self, _version: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::HTMLIFrameElementBinding;
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::element::HTMLIframeElementTypeId;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
@ -78,7 +78,7 @@ impl HTMLIFrameElement {
|
|||
|
||||
impl HTMLIFrameElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
|
@ -86,7 +86,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn Srcdoc(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSrcdoc(&mut self, _srcdoc: &DOMString) -> ErrorResult {
|
||||
|
@ -94,7 +94,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -102,19 +102,20 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn Sandbox(&self, _abstract_self: AbstractNode<ScriptView>) -> DOMString {
|
||||
self.htmlelement.element.GetAttribute(&Some(~"sandbox"))
|
||||
match self.htmlelement.element.GetAttribute(&~"sandbox") {
|
||||
Some(s) => s.to_owned(),
|
||||
None => ~"",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn SetSandbox(&mut self, abstract_self: AbstractNode<ScriptView>, sandbox: &DOMString) {
|
||||
self.htmlelement.element.SetAttribute(abstract_self, &Some(~"sandbox"), sandbox);
|
||||
self.htmlelement.element.SetAttribute(abstract_self, &~"sandbox", sandbox);
|
||||
}
|
||||
|
||||
pub fn AfterSetAttr(&mut self, name: &DOMString, value: &DOMString) {
|
||||
let name = null_str_as_empty(name);
|
||||
if "sandbox" == name {
|
||||
if "sandbox" == *name {
|
||||
let mut modes = AllowNothing as u8;
|
||||
let words = null_str_as_empty(value);
|
||||
for word in words.split_iter(' ') {
|
||||
for word in value.split_iter(' ') {
|
||||
modes |= match word.to_ascii_lower().as_slice() {
|
||||
"allow-same-origin" => AllowSameOrigin,
|
||||
"allow-forms" => AllowForms,
|
||||
|
@ -138,7 +139,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
|
@ -146,7 +147,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult {
|
||||
|
@ -162,7 +163,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -170,7 +171,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn Scrolling(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetScrolling(&mut self, _scrolling: &DOMString) -> ErrorResult {
|
||||
|
@ -178,7 +179,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn FrameBorder(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString) -> ErrorResult {
|
||||
|
@ -186,7 +187,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn LongDesc(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult {
|
||||
|
@ -194,7 +195,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn MarginHeight(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetMarginHeight(&mut self, _marginheight: &DOMString) -> ErrorResult {
|
||||
|
@ -202,7 +203,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
|
||||
pub fn MarginWidth(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetMarginWidth(&mut self, _marginwidth: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::HTMLImageElementBinding;
|
||||
use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty};
|
||||
use dom::bindings::utils::{DOMString, ErrorResult};
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::element::HTMLImageElementTypeId;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
|
@ -58,8 +58,7 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn AfterSetAttr(&mut self, name: &DOMString, _value: &DOMString) {
|
||||
let name = null_str_as_empty(name);
|
||||
if "src" == name {
|
||||
if "src" == *name {
|
||||
let document = self.htmlelement.element.node.owner_doc();
|
||||
let window = document.document().window;
|
||||
let url = window.page.url.as_ref().map(|&(ref url, _)| url.clone());
|
||||
|
@ -68,7 +67,7 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlt(&mut self, _alt: &DOMString) -> ErrorResult {
|
||||
|
@ -76,7 +75,7 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn Src(&self, _abstract_self: AbstractNode<ScriptView>) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self,
|
||||
|
@ -85,12 +84,12 @@ impl HTMLImageElement {
|
|||
let node = &mut self.htmlelement.element;
|
||||
node.set_attr(abstract_self,
|
||||
&Some(~"src"),
|
||||
&Some(null_str_as_empty(src)));
|
||||
&Some(src.clone()));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn CrossOrigin(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
|
||||
|
@ -98,7 +97,7 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn UseMap(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetUseMap(&mut self, _use_map: &DOMString) -> ErrorResult {
|
||||
|
@ -168,7 +167,7 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -176,7 +175,7 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -200,7 +199,7 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn LongDesc(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetLongDesc(&mut self, _longdesc: &DOMString) -> ErrorResult {
|
||||
|
@ -208,7 +207,7 @@ impl HTMLImageElement {
|
|||
}
|
||||
|
||||
pub fn Border(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetBorder(&mut self, _border: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLInputElement {
|
|||
|
||||
impl HTMLInputElement {
|
||||
pub fn Accept(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAccept(&mut self, _accept: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Alt(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlt(&mut self, _alt: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Autocomplete(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAutocomplete(&mut self, _autocomple: &DOMString) -> ErrorResult {
|
||||
|
@ -83,7 +83,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn FormAction(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFormAction(&mut self, _form_action: &DOMString) -> ErrorResult {
|
||||
|
@ -91,7 +91,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn FormEnctype(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFormEnctype(&mut self, _form_enctype: &DOMString) -> ErrorResult {
|
||||
|
@ -99,7 +99,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn FormMethod(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFormMethod(&mut self, _form_method: &DOMString) -> ErrorResult {
|
||||
|
@ -115,7 +115,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn FormTarget(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFormTarget(&mut self, _form_target: &DOMString) -> ErrorResult {
|
||||
|
@ -138,7 +138,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn InputMode(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetInputMode(&mut self, _input_mode: &DOMString) -> ErrorResult {
|
||||
|
@ -146,7 +146,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Max(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetMax(&mut self, _max: &DOMString) -> ErrorResult {
|
||||
|
@ -162,7 +162,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Min(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetMin(&mut self, _min: &DOMString) -> ErrorResult {
|
||||
|
@ -178,7 +178,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -186,7 +186,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Pattern(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetPattern(&mut self, _pattern: &DOMString) -> ErrorResult {
|
||||
|
@ -194,7 +194,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Placeholder(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetPlaceholder(&mut self, _placeholder: &DOMString) -> ErrorResult {
|
||||
|
@ -226,7 +226,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Src(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
|
@ -234,7 +234,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Step(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetStep(&mut self, _step: &DOMString) -> ErrorResult {
|
||||
|
@ -242,7 +242,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
@ -250,7 +250,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn DefaultValue(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetDefaultValue(&mut self, _default_value: &DOMString) -> ErrorResult {
|
||||
|
@ -258,7 +258,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
|
@ -280,7 +280,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn GetValidationMessage(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
Ok(~"")
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
@ -310,7 +310,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn GetSelectionDirection(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
Ok(~"")
|
||||
}
|
||||
|
||||
pub fn SetSelectionDirection(&mut self, _selection_direction: &DOMString) -> ErrorResult {
|
||||
|
@ -318,7 +318,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -326,7 +326,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
pub fn UseMap(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetUseMap(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLLabelElement {
|
|||
|
||||
impl HTMLLabelElement {
|
||||
pub fn HtmlFor(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHtmlFor(&mut self, _html_for: &DOMString) {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLLegendElement {
|
|||
|
||||
impl HTMLLegendElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -36,7 +36,7 @@ impl HTMLLIElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -35,7 +35,7 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn Href(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHref(&mut self, _href: &DOMString) -> ErrorResult {
|
||||
|
@ -43,7 +43,7 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn CrossOrigin(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
|
||||
|
@ -51,7 +51,7 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn Rel(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetRel(&mut self, _rel: &DOMString) -> ErrorResult {
|
||||
|
@ -59,7 +59,7 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn Media(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult {
|
||||
|
@ -67,7 +67,7 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn Hreflang(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHreflang(&mut self, _href: &DOMString) -> ErrorResult {
|
||||
|
@ -75,7 +75,7 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
@ -83,7 +83,7 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn Charset(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult {
|
||||
|
@ -91,7 +91,7 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn Rev(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetRev(&mut self, _rev: &DOMString) -> ErrorResult {
|
||||
|
@ -99,7 +99,7 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn Target(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetTarget(&mut self, _target: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -29,7 +29,7 @@ impl HTMLMapElement {
|
|||
|
||||
impl HTMLMapElement {
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -21,7 +21,7 @@ impl HTMLMediaElement {
|
|||
|
||||
impl HTMLMediaElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
|
@ -29,11 +29,11 @@ impl HTMLMediaElement {
|
|||
}
|
||||
|
||||
pub fn CurrentSrc(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn CrossOrigin(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
|
||||
|
@ -41,7 +41,7 @@ impl HTMLMediaElement {
|
|||
}
|
||||
|
||||
pub fn Preload(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetPreload(&mut self, _preload: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLMediaElement {
|
|||
}
|
||||
|
||||
pub fn CanPlayType(&self, _type: &DOMString) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn ReadyState(&self) -> u16 {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLMetaElement {
|
|||
|
||||
impl HTMLMetaElement {
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLMetaElement {
|
|||
}
|
||||
|
||||
pub fn HttpEquiv(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHttpEquiv(&mut self, _http_equiv: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLMetaElement {
|
|||
}
|
||||
|
||||
pub fn Content(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetContent(&mut self, _content: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLMetaElement {
|
|||
}
|
||||
|
||||
pub fn Scheme(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetScheme(&mut self, _scheme: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLModElement {
|
|||
|
||||
impl HTMLModElement {
|
||||
pub fn Cite(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCite(&mut self, _cite: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLModElement {
|
|||
}
|
||||
|
||||
pub fn DateTime(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetDateTime(&mut self, _datetime: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -30,7 +30,7 @@ impl HTMLObjectElement {
|
|||
|
||||
impl HTMLObjectElement {
|
||||
pub fn Data(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetData(&mut self, _data: &DOMString) -> ErrorResult {
|
||||
|
@ -38,7 +38,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
@ -46,7 +46,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -54,7 +54,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn UseMap(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetUseMap(&mut self, _use_map: &DOMString) -> ErrorResult {
|
||||
|
@ -66,7 +66,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
|
@ -74,7 +74,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHeight(&mut self, _height: &DOMString) -> ErrorResult {
|
||||
|
@ -99,7 +99,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
@ -110,7 +110,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -118,7 +118,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Archive(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetArchive(&mut self, _archive: &DOMString) -> ErrorResult {
|
||||
|
@ -126,7 +126,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Code(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCode(&mut self, _code: &DOMString) -> ErrorResult {
|
||||
|
@ -150,7 +150,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Standby(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetStandby(&mut self, _standby: &DOMString) -> ErrorResult {
|
||||
|
@ -166,7 +166,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn CodeBase(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCodeBase(&mut self, _codebase: &DOMString) -> ErrorResult {
|
||||
|
@ -174,7 +174,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn CodeType(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCodeType(&mut self, _codetype: &DOMString) -> ErrorResult {
|
||||
|
@ -182,7 +182,7 @@ impl HTMLObjectElement {
|
|||
}
|
||||
|
||||
pub fn Border(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetBorder(&mut self, _border: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -44,7 +44,7 @@ impl HTMLOListElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -36,7 +36,7 @@ impl HTMLOptGroupElement {
|
|||
}
|
||||
|
||||
pub fn Label(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -40,7 +40,7 @@ impl HTMLOptionElement {
|
|||
}
|
||||
|
||||
pub fn Label(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult {
|
||||
|
@ -64,7 +64,7 @@ impl HTMLOptionElement {
|
|||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
|
@ -72,7 +72,7 @@ impl HTMLOptionElement {
|
|||
}
|
||||
|
||||
pub fn Text(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -33,7 +33,7 @@ impl HTMLOutputElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -41,11 +41,11 @@ impl HTMLOutputElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn DefaultValue(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetDefaultValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
|
@ -53,7 +53,7 @@ impl HTMLOutputElement {
|
|||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
|
@ -76,7 +76,7 @@ impl HTMLOutputElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLParagraphElement {
|
|||
|
||||
impl HTMLParagraphElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLParamElement {
|
|||
|
||||
impl HTMLParamElement {
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLParamElement {
|
|||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLParamElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLParamElement {
|
|||
}
|
||||
|
||||
pub fn ValueType(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValueType(&mut self, _value_type: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLQuoteElement {
|
|||
|
||||
impl HTMLQuoteElement {
|
||||
pub fn Cite(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCite(&self, _cite: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -29,7 +29,10 @@ impl HTMLScriptElement {
|
|||
|
||||
impl HTMLScriptElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
self.htmlelement.element.get_attr("src").map(|s| s.to_str())
|
||||
match self.htmlelement.element.get_attr("src") {
|
||||
Some(s) => s.to_owned(),
|
||||
None => ~""
|
||||
}
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
|
@ -37,7 +40,7 @@ impl HTMLScriptElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
@ -45,7 +48,7 @@ impl HTMLScriptElement {
|
|||
}
|
||||
|
||||
pub fn Charset(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCharset(&mut self, _charset: &DOMString) -> ErrorResult {
|
||||
|
@ -69,7 +72,7 @@ impl HTMLScriptElement {
|
|||
}
|
||||
|
||||
pub fn CrossOrigin(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCrossOrigin(&mut self, _cross_origin: &DOMString) -> ErrorResult {
|
||||
|
@ -77,7 +80,7 @@ impl HTMLScriptElement {
|
|||
}
|
||||
|
||||
pub fn Text(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
|
@ -85,7 +88,7 @@ impl HTMLScriptElement {
|
|||
}
|
||||
|
||||
pub fn Event(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetEvent(&mut self, _event: &DOMString) -> ErrorResult {
|
||||
|
@ -93,7 +96,7 @@ impl HTMLScriptElement {
|
|||
}
|
||||
|
||||
pub fn HtmlFor(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHtmlFor(&mut self, _html_for: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -57,7 +57,7 @@ impl HTMLSelectElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -81,7 +81,7 @@ impl HTMLSelectElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn Length(&self) -> u32 {
|
||||
|
@ -123,7 +123,7 @@ impl HTMLSelectElement {
|
|||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString) {
|
||||
|
@ -145,7 +145,7 @@ impl HTMLSelectElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValidationMessage(&mut self, _message: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLSourceElement {
|
|||
|
||||
impl HTMLSourceElement {
|
||||
pub fn Src(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLSourceElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLSourceElement {
|
|||
}
|
||||
|
||||
pub fn Media(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -35,7 +35,7 @@ impl HTMLStyleElement {
|
|||
}
|
||||
|
||||
pub fn Media(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetMedia(&mut self, _media: &DOMString) -> ErrorResult {
|
||||
|
@ -43,7 +43,7 @@ impl HTMLStyleElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLTableCaptionElement {
|
|||
|
||||
impl HTMLTableCaptionElement {
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -37,7 +37,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn Headers(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHeaders(&self, _headers: &DOMString) -> ErrorResult {
|
||||
|
@ -53,7 +53,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn Abbr(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAbbr(&self, _abbr: &DOMString) -> ErrorResult {
|
||||
|
@ -61,7 +61,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn Scope(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetScope(&self, _abbr: &DOMString) -> ErrorResult {
|
||||
|
@ -69,7 +69,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -77,7 +77,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn Axis(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAxis(&self, _axis: &DOMString) -> ErrorResult {
|
||||
|
@ -85,7 +85,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn Height(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetHeight(&self, _height: &DOMString) -> ErrorResult {
|
||||
|
@ -93,7 +93,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetWidth(&self, _width: &DOMString) -> ErrorResult {
|
||||
|
@ -101,7 +101,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn Ch(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCh(&self, _ch: &DOMString) -> ErrorResult {
|
||||
|
@ -109,7 +109,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn ChOff(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetChOff(&self, _ch_off: &DOMString) -> ErrorResult {
|
||||
|
@ -125,7 +125,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn VAlign(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetVAlign(&self, _valign: &DOMString) -> ErrorResult {
|
||||
|
@ -133,7 +133,7 @@ impl HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub fn BgColor(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -36,7 +36,7 @@ impl HTMLTableColElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLTableColElement {
|
|||
}
|
||||
|
||||
pub fn Ch(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCh(&mut self, _ch: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLTableColElement {
|
|||
}
|
||||
|
||||
pub fn ChOff(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetChOff(&mut self, _ch_off: &DOMString) -> ErrorResult {
|
||||
|
@ -60,7 +60,7 @@ impl HTMLTableColElement {
|
|||
}
|
||||
|
||||
pub fn VAlign(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetVAlign(&mut self, _v_align: &DOMString) -> ErrorResult {
|
||||
|
@ -68,7 +68,7 @@ impl HTMLTableColElement {
|
|||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetWidth(&mut self, _width: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -51,7 +51,7 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -59,7 +59,7 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
pub fn Border(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetBorder(&self, _border: &DOMString) -> ErrorResult {
|
||||
|
@ -67,7 +67,7 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
pub fn Frame(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetFrame(&self, _frame: &DOMString) -> ErrorResult {
|
||||
|
@ -75,7 +75,7 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
pub fn Rules(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetRules(&self, _rules: &DOMString) -> ErrorResult {
|
||||
|
@ -83,7 +83,7 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
pub fn Summary(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSummary(&self, _summary: &DOMString) -> ErrorResult {
|
||||
|
@ -91,7 +91,7 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
pub fn Width(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetWidth(&self, _width: &DOMString) -> ErrorResult {
|
||||
|
@ -99,7 +99,7 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
pub fn BgColor(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
|
||||
|
@ -107,7 +107,7 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
pub fn CellPadding(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCellPadding(&self, _cell_padding: &DOMString) -> ErrorResult {
|
||||
|
@ -115,7 +115,7 @@ impl HTMLTableElement {
|
|||
}
|
||||
|
||||
pub fn CellSpacing(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCellSpacing(&self, _cell_spacing: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -48,7 +48,7 @@ impl HTMLTableRowElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -56,7 +56,7 @@ impl HTMLTableRowElement {
|
|||
}
|
||||
|
||||
pub fn Ch(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCh(&self, _ch: &DOMString) -> ErrorResult {
|
||||
|
@ -64,7 +64,7 @@ impl HTMLTableRowElement {
|
|||
}
|
||||
|
||||
pub fn ChOff(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetChOff(&self, _ch_off: &DOMString) -> ErrorResult {
|
||||
|
@ -72,7 +72,7 @@ impl HTMLTableRowElement {
|
|||
}
|
||||
|
||||
pub fn VAlign(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetVAlign(&self, _v_align: &DOMString) -> ErrorResult {
|
||||
|
@ -80,7 +80,7 @@ impl HTMLTableRowElement {
|
|||
}
|
||||
|
||||
pub fn BgColor(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetBgColor(&self, _bg_color: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -32,7 +32,7 @@ impl HTMLTableSectionElement {
|
|||
}
|
||||
|
||||
pub fn Align(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetAlign(&mut self, _align: &DOMString) -> ErrorResult {
|
||||
|
@ -40,7 +40,7 @@ impl HTMLTableSectionElement {
|
|||
}
|
||||
|
||||
pub fn Ch(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetCh(&mut self, _ch: &DOMString) -> ErrorResult {
|
||||
|
@ -48,7 +48,7 @@ impl HTMLTableSectionElement {
|
|||
}
|
||||
|
||||
pub fn ChOff(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetChOff(&mut self, _ch_off: &DOMString) -> ErrorResult {
|
||||
|
@ -56,7 +56,7 @@ impl HTMLTableSectionElement {
|
|||
}
|
||||
|
||||
pub fn VAlign(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetVAlign(&mut self, _v_align: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -60,7 +60,7 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: &DOMString) -> ErrorResult {
|
||||
|
@ -68,7 +68,7 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
|
||||
pub fn Placeholder(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetPlaceholder(&mut self, _placeholder: &DOMString) -> ErrorResult {
|
||||
|
@ -100,7 +100,7 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
|
||||
pub fn Wrap(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetWrap(&mut self, _wrap: &DOMString) -> ErrorResult {
|
||||
|
@ -108,14 +108,14 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn DefaultValue(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetDefaultValue(&mut self, _default_value: &DOMString) -> ErrorResult {
|
||||
|
@ -123,7 +123,7 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: &DOMString) {
|
||||
|
@ -146,7 +146,7 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
|
@ -176,7 +176,7 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
|
||||
pub fn GetSelectionDirection(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
Ok(~"")
|
||||
}
|
||||
|
||||
pub fn SetSelectionDirection(&self, _selection_direction: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLTimeElement {
|
|||
|
||||
impl HTMLTimeElement {
|
||||
pub fn DateTime(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetDateTime(&mut self, _dateTime: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLTitleElement {
|
|||
|
||||
impl HTMLTitleElement {
|
||||
pub fn Text(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetText(&mut self, _text: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLTrackElement {
|
|||
|
||||
impl HTMLTrackElement {
|
||||
pub fn Kind(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetKind(&mut self, _kind: &DOMString) -> ErrorResult {
|
||||
|
@ -36,7 +36,7 @@ impl HTMLTrackElement {
|
|||
}
|
||||
|
||||
pub fn Src(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSrc(&mut self, _src: &DOMString) -> ErrorResult {
|
||||
|
@ -44,7 +44,7 @@ impl HTMLTrackElement {
|
|||
}
|
||||
|
||||
pub fn Srclang(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetSrclang(&mut self, _srclang: &DOMString) -> ErrorResult {
|
||||
|
@ -52,7 +52,7 @@ impl HTMLTrackElement {
|
|||
}
|
||||
|
||||
pub fn Label(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetLabel(&mut self, _label: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -36,7 +36,7 @@ impl HTMLUListElement {
|
|||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -52,7 +52,7 @@ impl HTMLVideoElement {
|
|||
}
|
||||
|
||||
pub fn Poster(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetPoster(&mut self, _poster: &DOMString) -> ErrorResult {
|
||||
|
|
|
@ -17,7 +17,7 @@ pub enum Namespace {
|
|||
}
|
||||
|
||||
impl Namespace {
|
||||
pub fn from_str(url: &DOMString) -> Namespace {
|
||||
pub fn from_str(url: &Option<DOMString>) -> Namespace {
|
||||
match null_str_as_empty_ref(url) {
|
||||
&"http://www.w3.org/1999/xhtml" => HTML,
|
||||
&"http://www.w3.org/XML/1998/namespace" => XML,
|
||||
|
@ -29,7 +29,7 @@ impl Namespace {
|
|||
ns => Other(ns.to_owned())
|
||||
}
|
||||
}
|
||||
pub fn to_str(&self) -> DOMString {
|
||||
pub fn to_str(&self) -> Option<DOMString> {
|
||||
match *self {
|
||||
Null => None,
|
||||
HTML => Some(~"http://www.w3.org/1999/xhtml"),
|
||||
|
|
|
@ -23,23 +23,23 @@ impl Navigator {
|
|||
}
|
||||
|
||||
pub fn DoNotTrack(&self) -> DOMString {
|
||||
Some(~"unspecified")
|
||||
~"unspecified"
|
||||
}
|
||||
|
||||
pub fn Vendor(&self) -> DOMString {
|
||||
Some(~"") // Like Gecko
|
||||
~"" // Like Gecko
|
||||
}
|
||||
|
||||
pub fn VendorSub(&self) -> DOMString {
|
||||
Some(~"") // Like Gecko
|
||||
~"" // Like Gecko
|
||||
}
|
||||
|
||||
pub fn Product(&self) -> DOMString {
|
||||
Some(~"Gecko") // This is supposed to be constant, see webidl.
|
||||
~"Gecko"
|
||||
}
|
||||
|
||||
pub fn ProductSub(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn CookieEnabled(&self) -> bool {
|
||||
|
@ -47,7 +47,7 @@ impl Navigator {
|
|||
}
|
||||
|
||||
pub fn GetBuildID(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
Ok(~"")
|
||||
}
|
||||
|
||||
pub fn JavaEnabled(&self) -> Fallible<bool> {
|
||||
|
@ -59,26 +59,26 @@ impl Navigator {
|
|||
}
|
||||
|
||||
pub fn AppName(&self) -> DOMString {
|
||||
Some(~"Netscape") // Like Gecko/Webkit
|
||||
~"Netscape" // Like Gecko/Webkit
|
||||
}
|
||||
|
||||
pub fn GetAppCodeName(&self) -> Fallible<DOMString> {
|
||||
Ok(Some(~"Mozilla")) // Like Gecko/Webkit
|
||||
Ok(~"Mozilla") // Like Gecko/Webkit
|
||||
}
|
||||
|
||||
pub fn GetAppVersion(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
Ok(~"")
|
||||
}
|
||||
|
||||
pub fn GetPlatform(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
Ok(~"")
|
||||
}
|
||||
|
||||
pub fn GetUserAgent(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
Ok(~"")
|
||||
}
|
||||
|
||||
pub fn GetLanguage(&self) -> DOMString {
|
||||
pub fn GetLanguage(&self) -> Option<DOMString> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
@ -562,10 +562,10 @@ impl Node<ScriptView> {
|
|||
}
|
||||
|
||||
pub fn NodeName(&self, abstract_self: AbstractNode<ScriptView>) -> DOMString {
|
||||
Some(match self.type_id {
|
||||
match self.type_id {
|
||||
ElementNodeTypeId(*) => {
|
||||
do abstract_self.with_imm_element |element| {
|
||||
element.TagName().expect("tagName should never be null")
|
||||
element.TagName()
|
||||
}
|
||||
}
|
||||
CommentNodeTypeId => ~"#comment",
|
||||
|
@ -577,10 +577,10 @@ impl Node<ScriptView> {
|
|||
},
|
||||
DocumentFragmentNodeTypeId => ~"#document-fragment",
|
||||
DocumentNodeTypeId(_) => ~"#document"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub fn GetBaseURI(&self) -> DOMString {
|
||||
pub fn GetBaseURI(&self) -> Option<DOMString> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -623,12 +623,12 @@ impl Node<ScriptView> {
|
|||
self.next_sibling
|
||||
}
|
||||
|
||||
pub fn GetNodeValue(&self, abstract_self: AbstractNode<ScriptView>) -> DOMString {
|
||||
pub fn GetNodeValue(&self, abstract_self: AbstractNode<ScriptView>) -> Option<DOMString> {
|
||||
match self.type_id {
|
||||
// ProcessingInstruction
|
||||
CommentNodeTypeId | TextNodeTypeId => {
|
||||
do abstract_self.with_imm_characterdata() |characterdata| {
|
||||
characterdata.Data()
|
||||
Some(characterdata.Data())
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
|
@ -637,19 +637,18 @@ impl Node<ScriptView> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn SetNodeValue(&mut self, _abstract_self: AbstractNode<ScriptView>, _val: &DOMString) -> ErrorResult {
|
||||
pub fn SetNodeValue(&mut self, _abstract_self: AbstractNode<ScriptView>, _val: &Option<DOMString>) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetTextContent(&self, abstract_self: AbstractNode<ScriptView>) -> DOMString {
|
||||
pub fn GetTextContent(&self, abstract_self: AbstractNode<ScriptView>) -> Option<DOMString> {
|
||||
match self.type_id {
|
||||
DocumentFragmentNodeTypeId | ElementNodeTypeId(*) => {
|
||||
let mut content = ~"";
|
||||
for node in abstract_self.traverse_preorder() {
|
||||
if node.is_text() {
|
||||
do node.with_imm_text() |text| {
|
||||
let s = text.element.Data();
|
||||
content = content + null_str_as_empty(&s);
|
||||
content = content + text.element.Data();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -657,7 +656,7 @@ impl Node<ScriptView> {
|
|||
}
|
||||
CommentNodeTypeId | TextNodeTypeId => {
|
||||
do abstract_self.with_imm_characterdata() |characterdata| {
|
||||
characterdata.Data()
|
||||
Some(characterdata.Data())
|
||||
}
|
||||
}
|
||||
DoctypeNodeTypeId | DocumentNodeTypeId(_) => {
|
||||
|
@ -939,18 +938,15 @@ impl Node<ScriptView> {
|
|||
|
||||
pub fn SetTextContent(&mut self,
|
||||
abstract_self: AbstractNode<ScriptView>,
|
||||
value: &DOMString) -> ErrorResult {
|
||||
let is_empty = match value {
|
||||
&Some(~"") | &None => true,
|
||||
_ => false
|
||||
};
|
||||
value: &Option<DOMString>) -> ErrorResult {
|
||||
let value = null_str_as_empty(value);
|
||||
match self.type_id {
|
||||
DocumentFragmentNodeTypeId | ElementNodeTypeId(*) => {
|
||||
let node = if is_empty {
|
||||
let node = if value.len() == 0 {
|
||||
None
|
||||
} else {
|
||||
let document = self.owner_doc();
|
||||
Some(document.document().CreateTextNode(document, value))
|
||||
Some(document.document().CreateTextNode(document, &value))
|
||||
};
|
||||
self.replace_all(abstract_self, node);
|
||||
}
|
||||
|
@ -958,7 +954,7 @@ impl Node<ScriptView> {
|
|||
self.wait_until_safe_to_modify_dom();
|
||||
|
||||
do abstract_self.with_mut_characterdata() |characterdata| {
|
||||
characterdata.data = null_str_as_empty(value);
|
||||
characterdata.data = value.clone();
|
||||
|
||||
// Notify the document that the content of this node is different
|
||||
let document = self.owner_doc();
|
||||
|
@ -1019,27 +1015,27 @@ impl Node<ScriptView> {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn LookupPrefix(&self, _prefix: &DOMString) -> DOMString {
|
||||
pub fn LookupPrefix(&self, _prefix: &Option<DOMString>) -> Option<DOMString> {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn LookupNamespaceURI(&self, _namespace: &DOMString) -> DOMString {
|
||||
pub fn LookupNamespaceURI(&self, _namespace: &Option<DOMString>) -> Option<DOMString> {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn IsDefaultNamespace(&self, _namespace: &DOMString) -> bool {
|
||||
pub fn IsDefaultNamespace(&self, _namespace: &Option<DOMString>) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn GetNamespaceURI(&self) -> DOMString {
|
||||
pub fn GetNamespaceURI(&self) -> Option<DOMString> {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn GetPrefix(&self) -> DOMString {
|
||||
pub fn GetPrefix(&self) -> Option<DOMString> {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn GetLocalName(&self) -> DOMString {
|
||||
pub fn GetLocalName(&self) -> Option<DOMString> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::TextBinding;
|
||||
use dom::bindings::utils::{DOMString, Fallible, null_str_as_empty};
|
||||
use dom::bindings::utils::{DOMString, Fallible};
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::node::{AbstractNode, ScriptView, Node, TextNodeTypeId};
|
||||
|
@ -27,7 +27,7 @@ impl Text {
|
|||
}
|
||||
|
||||
pub fn Constructor(owner: @mut Window, text: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
|
||||
Ok(Text::new(null_str_as_empty(text), owner.Document()))
|
||||
Ok(Text::new(text.clone(), owner.Document()))
|
||||
}
|
||||
|
||||
pub fn SplitText(&self, _offset: u32) -> Fallible<AbstractNode<ScriptView>> {
|
||||
|
@ -35,6 +35,6 @@ impl Text {
|
|||
}
|
||||
|
||||
pub fn GetWholeText(&self) -> Fallible<DOMString> {
|
||||
Ok(None)
|
||||
Ok(~"")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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::{Reflectable, Reflector};
|
||||
use dom::bindings::utils::{DOMString, null_str_as_empty, Traceable};
|
||||
use dom::bindings::utils::{Reflectable, Reflector, Traceable};
|
||||
use dom::bindings::utils::DOMString;
|
||||
use dom::document::AbstractDocument;
|
||||
use dom::eventtarget::{EventTarget, WindowTypeId};
|
||||
use dom::node::{AbstractNode, ScriptView};
|
||||
|
@ -74,7 +74,7 @@ pub struct TimerData {
|
|||
impl Window {
|
||||
pub fn Alert(&self, s: &DOMString) {
|
||||
// Right now, just print to the console
|
||||
println(format!("ALERT: {:s}", null_str_as_empty(s)));
|
||||
println(format!("ALERT: {:s}", *s));
|
||||
}
|
||||
|
||||
pub fn Close(&self) {
|
||||
|
@ -86,14 +86,14 @@ impl Window {
|
|||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&self, _name: &DOMString) {
|
||||
}
|
||||
|
||||
pub fn Status(&self) -> DOMString {
|
||||
None
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetStatus(&self, _status: &DOMString) {
|
||||
|
@ -127,7 +127,7 @@ impl Window {
|
|||
false
|
||||
}
|
||||
|
||||
pub fn Prompt(&self, _message: &DOMString, _default: &DOMString) -> DOMString {
|
||||
pub fn Prompt(&self, _message: &DOMString, _default: &DOMString) -> Option<DOMString> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
@ -772,7 +772,7 @@ impl ScriptTask {
|
|||
// "load" event as soon as we've finished executing all scripts parsed during
|
||||
// the initial load.
|
||||
let event = Event::new(window, HTMLEventTypeId);
|
||||
event.mut_event().InitEvent(&Some(~"load"), false, false);
|
||||
event.mut_event().InitEvent(&~"load", false, false);
|
||||
let doctarget = AbstractEventTarget::from_document(document);
|
||||
let wintarget = AbstractEventTarget::from_window(window);
|
||||
window.eventtarget.dispatch_event_with_target(wintarget, Some(doctarget), event);
|
||||
|
|
|
@ -18,9 +18,9 @@ is(nav.taintEnabled(), false);
|
|||
is(nav.appName, "Netscape");
|
||||
is(nav.appCodeName, "Mozilla");
|
||||
// todo
|
||||
is(nav.appVersion, null);
|
||||
is(nav.platform, null);
|
||||
is(nav.userAgent, null);
|
||||
is(nav.appVersion, "");
|
||||
is(nav.platform, "");
|
||||
is(nav.userAgent, "");
|
||||
is(nav.language, null);
|
||||
is(nav.onLine, true);
|
||||
finish();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue