Make DOMString an alias for Option<~str>

Fixes #898.
This commit is contained in:
Keegan McAllister 2013-09-18 14:46:42 -07:00
parent 5be084a3b6
commit 68ddc6b4ab
69 changed files with 435 additions and 461 deletions

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::utils::{DOMString, null_string, ErrorResult, str};
use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty};
use dom::document::AbstractDocument;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView};
@ -60,40 +60,40 @@ impl HTMLIFrameElement {
impl HTMLIFrameElement {
pub fn Src(&self) -> DOMString {
null_string
None
}
pub fn SetSrc(&mut self, _src: &DOMString, _rv: &mut ErrorResult) {
}
pub fn Srcdoc(&self) -> DOMString {
null_string
None
}
pub fn SetSrcdoc(&mut self, _srcdoc: &DOMString, _rv: &mut ErrorResult) {
}
pub fn Name(&self) -> DOMString {
null_string
None
}
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
}
pub fn Sandbox(&self, _abstract_self: AbstractNode<ScriptView>) -> DOMString {
self.parent.parent.GetAttribute(&str(~"sandbox"))
self.parent.parent.GetAttribute(&Some(~"sandbox"))
}
pub fn SetSandbox(&mut self, abstract_self: AbstractNode<ScriptView>, sandbox: &DOMString) {
let mut rv = Ok(());
self.parent.parent.SetAttribute(abstract_self, &str(~"sandbox"), sandbox, &mut rv);
self.parent.parent.SetAttribute(abstract_self, &Some(~"sandbox"), sandbox, &mut rv);
}
pub fn AfterSetAttr(&mut self, name: &DOMString, value: &DOMString) {
let name = name.to_str();
let name = null_str_as_empty(name);
if "sandbox" == name {
let mut modes = AllowNothing as u8;
let words = value.to_str();
let words = null_str_as_empty(value);
for word in words.split_iter(' ') {
modes |= match word.to_ascii_lower().as_slice() {
"allow-same-origin" => AllowSameOrigin,
@ -117,14 +117,14 @@ impl HTMLIFrameElement {
}
pub fn Width(&self) -> DOMString {
null_string
None
}
pub fn SetWidth(&mut self, _width: &DOMString, _rv: &mut ErrorResult) {
}
pub fn Height(&self) -> DOMString {
null_string
None
}
pub fn SetHeight(&mut self, _height: &DOMString, _rv: &mut ErrorResult) {
@ -139,42 +139,42 @@ impl HTMLIFrameElement {
}
pub fn Align(&self) -> DOMString {
null_string
None
}
pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
}
pub fn Scrolling(&self) -> DOMString {
null_string
None
}
pub fn SetScrolling(&mut self, _scrolling: &DOMString, _rv: &mut ErrorResult) {
}
pub fn FrameBorder(&self) -> DOMString {
null_string
None
}
pub fn SetFrameBorder(&mut self, _frameborder: &DOMString, _rv: &mut ErrorResult) {
}
pub fn LongDesc(&self) -> DOMString {
null_string
None
}
pub fn SetLongDesc(&mut self, _longdesc: &DOMString, _rv: &mut ErrorResult) {
}
pub fn MarginHeight(&self) -> DOMString {
null_string
None
}
pub fn SetMarginHeight(&mut self, _marginheight: &DOMString, _rv: &mut ErrorResult) {
}
pub fn MarginWidth(&self) -> DOMString {
null_string
None
}
pub fn SetMarginWidth(&mut self, _marginwidth: &DOMString, _rv: &mut ErrorResult) {