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

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::utils::{WrapperCache, BindingObject, CacheableWrapper};
use dom::bindings::utils::{DOMString, ErrorResult, str, null_string};
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::bindings::codegen::NavigatorBinding;
use script_task::{page_from_context};
@ -23,23 +23,23 @@ impl Navigator {
}
pub fn DoNotTrack(&self) -> DOMString {
str(~"unspecified")
Some(~"unspecified")
}
pub fn Vendor(&self) -> DOMString {
str(~"") // Like Gecko
Some(~"") // Like Gecko
}
pub fn VendorSub(&self) -> DOMString {
str(~"") // Like Gecko
Some(~"") // Like Gecko
}
pub fn Product(&self) -> DOMString {
str(~"Gecko") // This is supposed to be constant, see webidl.
Some(~"Gecko") // This is supposed to be constant, see webidl.
}
pub fn ProductSub(&self) -> DOMString {
null_string
None
}
pub fn CookieEnabled(&self) -> bool {
@ -47,7 +47,7 @@ impl Navigator {
}
pub fn GetBuildID(&self, _rv: &mut ErrorResult) -> DOMString {
null_string
None
}
pub fn JavaEnabled(&self, _rv: &mut ErrorResult) -> bool {
@ -59,27 +59,27 @@ impl Navigator {
}
pub fn AppName(&self) -> DOMString {
str(~"Netscape") // Like Gecko/Webkit
Some(~"Netscape") // Like Gecko/Webkit
}
pub fn GetAppCodeName(&self, _rv: &mut ErrorResult) -> DOMString {
str(~"Mozilla") // Like Gecko/Webkit
Some(~"Mozilla") // Like Gecko/Webkit
}
pub fn GetAppVersion(&self, _rv: &mut ErrorResult) -> DOMString {
null_string
None
}
pub fn GetPlatform(&self, _rv: &mut ErrorResult) -> DOMString {
null_string
None
}
pub fn GetUserAgent(&self, _rv: &mut ErrorResult) -> DOMString {
null_string
None
}
pub fn GetLanguage(&self) -> DOMString {
null_string
None
}
pub fn OnLine(&self) -> bool {
@ -105,4 +105,4 @@ impl BindingObject for Navigator {
Some((*page).frame.get_ref().window as @mut CacheableWrapper)
}
}
}
}