mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Auto merge of #10362 - amarant:10348-string-preferences, r=jdm
Issue #10348 Implement StringMozPreference, string preferences, WPT test I'm not exactly sure of the wanted semantics with boolean values. Fixes #10348. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10362) <!-- Reviewable:end -->
This commit is contained in:
commit
17ffc6cf71
4 changed files with 21 additions and 1 deletions
|
@ -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 {
|
||||
|
|
|
@ -400,4 +400,5 @@ interface TestBinding {
|
|||
static attribute boolean booleanAttributeStatic;
|
||||
static void receiveVoidStatic();
|
||||
boolean BooleanMozPreference(DOMString pref_name);
|
||||
DOMString StringMozPreference(DOMString pref_name);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue