Issue #10348 Implement StringMozPreference, string preferences, WPT tests

I'm not exactly sure of the wanted semantics with boolean values.
This commit is contained in:
Arnaud Marant 2016-04-02 13:05:04 +02:00
parent d35ae3beb7
commit 95c077af46
4 changed files with 21 additions and 1 deletions

View file

@ -490,6 +490,9 @@ impl TestBindingMethods for TestBinding {
fn BooleanMozPreference(&self, pref_name: DOMString) -> bool {
get_pref(pref_name.as_ref()).as_boolean().unwrap_or(false)
}
fn StringMozPreference(&self, pref_name: DOMString) -> DOMString {
get_pref(pref_name.as_ref()).as_string().map(|s| DOMString::from(s)).unwrap_or_else(|| DOMString::new())
}
}
impl TestBinding {