Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-09-23 19:40:33 +02:00 committed by Martin Robinson
parent 2fb319ede2
commit 601de9049c

View file

@ -170,10 +170,12 @@ impl SupportsCondition {
input.slice_from(pos).to_owned()
)))
},
#[cfg(feature = "gecko")]
"font-format" if static_prefs::pref!("layout.css.font-tech.enabled") => {
let kw = FontFaceSourceFormatKeyword::parse(input)?;
Ok(SupportsCondition::FontFormat(kw))
},
#[cfg(feature = "gecko")]
"font-tech" if static_prefs::pref!("layout.css.font-tech.enabled") => {
let flag = FontFaceSourceTechFlags::parse_one(input)?;
Ok(SupportsCondition::FontTech(flag))
@ -244,11 +246,13 @@ fn eval_moz_bool_pref(name: &CStr, cx: &ParserContext) -> bool {
unsafe { bindings::Gecko_GetBoolPrefValue(name.as_ptr()) }
}
#[cfg(feature = "gecko")]
fn eval_font_format(kw: &FontFaceSourceFormatKeyword) -> bool {
use crate::gecko_bindings::bindings;
unsafe { bindings::Gecko_IsFontFormatSupported(*kw) }
}
#[cfg(feature = "gecko")]
fn eval_font_tech(flag: &FontFaceSourceTechFlags) -> bool {
use crate::gecko_bindings::bindings;
unsafe { bindings::Gecko_IsFontTechSupported(*flag) }
@ -259,6 +263,16 @@ fn eval_moz_bool_pref(_: &CStr, _: &ParserContext) -> bool {
false
}
#[cfg(feature = "servo")]
fn eval_font_format(_: &FontFaceSourceFormatKeyword) -> bool {
false
}
#[cfg(feature = "servo")]
fn eval_font_tech(_: &FontFaceSourceTechFlags) -> bool {
false
}
/// supports_condition | declaration
/// <https://drafts.csswg.org/css-conditional/#dom-css-supports-conditiontext-conditiontext>
pub fn parse_condition_or_declaration<'i, 't>(