mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Define Gecko CounterStyle and FontFaceRule clone functions.
This commit is contained in:
parent
3616b8f0c3
commit
78ce522eed
5 changed files with 60 additions and 2 deletions
|
@ -150,6 +150,18 @@ impl ToNsCssValue for FontDisplay {
|
|||
}
|
||||
}
|
||||
|
||||
impl FontFaceRule {
|
||||
/// Ask Gecko to deep clone the nsCSSFontFaceRule, and then construct
|
||||
/// a FontFaceRule object from it.
|
||||
pub fn deep_clone_from_gecko(&self) -> FontFaceRule {
|
||||
let result = unsafe {
|
||||
UniqueRefPtr::from_addrefed(
|
||||
bindings::Gecko_CSSFontFaceRule_Clone(self.get()))
|
||||
};
|
||||
result.get()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<FontFaceRuleData> for FontFaceRule {
|
||||
fn from(data: FontFaceRuleData) -> FontFaceRule {
|
||||
let mut result = unsafe {
|
||||
|
@ -176,6 +188,18 @@ impl ToCssWithGuard for FontFaceRule {
|
|||
/// A @counter-style rule
|
||||
pub type CounterStyleRule = RefPtr<nsCSSCounterStyleRule>;
|
||||
|
||||
impl CounterStyleRule {
|
||||
/// Ask Gecko to deep clone the nsCSSCounterStyleRule, and then construct
|
||||
/// a CounterStyleRule object from it.
|
||||
pub fn deep_clone_from_gecko(&self) -> CounterStyleRule {
|
||||
let result = unsafe {
|
||||
UniqueRefPtr::from_addrefed(
|
||||
bindings::Gecko_CSSCounterStyle_Clone(self.get()))
|
||||
};
|
||||
result.get()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<counter_style::CounterStyleRuleData> for CounterStyleRule {
|
||||
fn from(data: counter_style::CounterStyleRuleData) -> CounterStyleRule {
|
||||
let mut result = unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue