mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Integrate font-variation-settings descriptor with stylo
This commit is contained in:
parent
4c3f1756da
commit
6ffa888dd6
6 changed files with 82 additions and 18 deletions
|
@ -205,6 +205,11 @@ impl nsCSSValue {
|
|||
self.set_int_internal(value.into(), nsCSSUnit::eCSSUnit_Enumerated);
|
||||
}
|
||||
|
||||
/// Set to a number value
|
||||
pub fn set_number(&mut self, number: f32) {
|
||||
unsafe { bindings::Gecko_CSSValue_SetFloat(self, number, nsCSSUnit::eCSSUnit_Number) }
|
||||
}
|
||||
|
||||
/// Set to a url value
|
||||
pub fn set_url(&mut self, url: &SpecifiedUrl) {
|
||||
unsafe { bindings::Gecko_CSSValue_SetURL(self, url.for_ffi()) }
|
||||
|
@ -408,3 +413,11 @@ pub trait ToNsCssValue {
|
|||
/// Convert
|
||||
fn convert(self, nscssvalue: &mut nsCSSValue);
|
||||
}
|
||||
|
||||
impl<T: ToNsCssValue> From<T> for nsCSSValue {
|
||||
fn from(value: T) -> nsCSSValue {
|
||||
let mut result = nsCSSValue::null();
|
||||
value.convert(&mut result);
|
||||
result
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue