mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Add binding for setting pair value of nsCSSValue.
This commit is contained in:
parent
3ea2f3a16c
commit
fdb29e15a4
2 changed files with 12 additions and 6 deletions
|
@ -180,14 +180,14 @@ impl ToNsCssValue for counter_style::System {
|
||||||
let mut b = nsCSSValue::null();
|
let mut b = nsCSSValue::null();
|
||||||
a.set_enum(structs::NS_STYLE_COUNTER_SYSTEM_FIXED as i32);
|
a.set_enum(structs::NS_STYLE_COUNTER_SYSTEM_FIXED as i32);
|
||||||
b.set_integer(first_symbol_value.unwrap_or(1));
|
b.set_integer(first_symbol_value.unwrap_or(1));
|
||||||
//nscssvalue.set_pair(a, b); // FIXME: add bindings for nsCSSValue::SetPairValue
|
nscssvalue.set_pair(&a, &b);
|
||||||
}
|
}
|
||||||
Extends(ref other) => {
|
Extends(ref other) => {
|
||||||
let mut a = nsCSSValue::null();
|
let mut a = nsCSSValue::null();
|
||||||
let mut b = nsCSSValue::null();
|
let mut b = nsCSSValue::null();
|
||||||
a.set_enum(structs::NS_STYLE_COUNTER_SYSTEM_EXTENDS as i32);
|
a.set_enum(structs::NS_STYLE_COUNTER_SYSTEM_EXTENDS as i32);
|
||||||
b.set_string_from_atom(&other.0);
|
b.set_string_from_atom(&other.0);
|
||||||
//nscssvalue.set_pair(a, b); // FIXME: add bindings for nsCSSValue::SetPairValue
|
nscssvalue.set_pair(&a, &b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ impl ToNsCssValue for counter_style::Negative {
|
||||||
let mut b = nsCSSValue::null();
|
let mut b = nsCSSValue::null();
|
||||||
a.set_from(&self.0);
|
a.set_from(&self.0);
|
||||||
b.set_from(second);
|
b.set_from(second);
|
||||||
//nscssvalue.set_pair(a, b); // FIXME: add bindings for nsCSSValue::SetPairValue
|
nscssvalue.set_pair(&a, &b);
|
||||||
} else {
|
} else {
|
||||||
nscssvalue.set_from(&self.0)
|
nscssvalue.set_from(&self.0)
|
||||||
}
|
}
|
||||||
|
@ -240,13 +240,12 @@ impl ToNsCssValue for counter_style::Ranges {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToNsCssValue for counter_style::Pad {
|
impl ToNsCssValue for counter_style::Pad {
|
||||||
fn convert(&self, _nscssvalue: &mut nsCSSValue) {
|
fn convert(&self, nscssvalue: &mut nsCSSValue) {
|
||||||
let mut min_length = nsCSSValue::null();
|
let mut min_length = nsCSSValue::null();
|
||||||
let mut pad_with = nsCSSValue::null();
|
let mut pad_with = nsCSSValue::null();
|
||||||
min_length.set_integer(self.0 as i32);
|
min_length.set_integer(self.0 as i32);
|
||||||
pad_with.set_from(&self.1);
|
pad_with.set_from(&self.1);
|
||||||
// FIXME: add bindings for nsCSSValue::SetPairValue
|
nscssvalue.set_pair(&min_length, &pad_with);
|
||||||
//nscssvalue.set_pair(min_length, pad_with);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -213,6 +213,13 @@ impl nsCSSValue {
|
||||||
*self.mValue.mFloat.as_mut() = value;
|
*self.mValue.mFloat.as_mut() = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set to a pair value
|
||||||
|
///
|
||||||
|
/// This is only supported on the main thread.
|
||||||
|
pub fn set_pair(&mut self, x: &nsCSSValue, y: &nsCSSValue) {
|
||||||
|
unsafe { bindings::Gecko_CSSValue_SetPair(self, x, y) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for nsCSSValue {
|
impl Drop for nsCSSValue {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue