mirror of
https://github.com/servo/servo.git
synced 2025-06-29 19:43:39 +01:00
implement |quotes| property
MozReview-Commit-ID: 5eAaJGXSkob
This commit is contained in:
parent
17a46418dc
commit
bb736f41d3
2 changed files with 23 additions and 2 deletions
|
@ -1448,7 +1448,7 @@ fn static_assert() {
|
||||||
</%self:simple_image_array_property>
|
</%self:simple_image_array_property>
|
||||||
</%self:impl_trait>
|
</%self:impl_trait>
|
||||||
|
|
||||||
<%self:impl_trait style_struct_name="List" skip_longhands="list-style-type" skip_additionals="*">
|
<%self:impl_trait style_struct_name="List" skip_longhands="list-style-type quotes" skip_additionals="*">
|
||||||
|
|
||||||
${impl_keyword_setter("list_style_type", "__LIST_STYLE_TYPE__",
|
${impl_keyword_setter("list_style_type", "__LIST_STYLE_TYPE__",
|
||||||
data.longhands_by_name["list-style-type"].keyword)}
|
data.longhands_by_name["list-style-type"].keyword)}
|
||||||
|
@ -1458,6 +1458,27 @@ fn static_assert() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_quotes(&mut self, other: longhands::quotes::computed_value::T) {
|
||||||
|
use gecko_bindings::bindings::Gecko_NewStyleQuoteValues;
|
||||||
|
use gecko_bindings::sugar::refptr::UniqueRefPtr;
|
||||||
|
use nsstring::nsCString;
|
||||||
|
|
||||||
|
let mut refptr = unsafe {
|
||||||
|
UniqueRefPtr::from_addrefed(Gecko_NewStyleQuoteValues(other.0.len() as u32))
|
||||||
|
};
|
||||||
|
|
||||||
|
for (servo, gecko) in other.0.into_iter().zip(refptr.mQuotePairs.iter_mut()) {
|
||||||
|
gecko.first.assign_utf8(&nsCString::from(&*servo.0));
|
||||||
|
gecko.second.assign_utf8(&nsCString::from(&*servo.1));
|
||||||
|
}
|
||||||
|
|
||||||
|
unsafe { self.gecko.mQuotes.set_move(refptr.get()) }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn copy_quotes_from(&mut self, other: &Self) {
|
||||||
|
unsafe { self.gecko.mQuotes.set(&other.gecko.mQuotes); }
|
||||||
|
}
|
||||||
|
|
||||||
</%self:impl_trait>
|
</%self:impl_trait>
|
||||||
|
|
||||||
<%self:impl_trait style_struct_name="Effects"
|
<%self:impl_trait style_struct_name="Effects"
|
||||||
|
|
|
@ -104,7 +104,7 @@ ${helpers.single_keyword("list-style-type", """
|
||||||
}
|
}
|
||||||
</%helpers:longhand>
|
</%helpers:longhand>
|
||||||
|
|
||||||
<%helpers:longhand name="quotes" products="servo" animatable="False">
|
<%helpers:longhand name="quotes" animatable="False">
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use values::NoViewportPercentage;
|
use values::NoViewportPercentage;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue