Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-05-22 20:41:42 +02:00
parent 7d1823563e
commit 9cf7df1f31

View file

@ -81,6 +81,16 @@ fn cross_fade_enabled() -> bool {
false
}
#[cfg(feature = "gecko")]
fn image_set_enabled() -> bool {
true
}
#[cfg(feature = "servo")]
fn image_set_enabled() -> bool {
false
}
impl SpecifiedValueInfo for Gradient {
const SUPPORTED_TYPES: u8 = CssType::GRADIENT;
@ -122,7 +132,9 @@ impl<Image, Resolution> SpecifiedValueInfo for generic::ImageSet<Image, Resoluti
const SUPPORTED_TYPES: u8 = 0;
fn collect_completion_keywords(f: KeywordsCollectFn) {
f(&["image-set"]);
if image_set_enabled() {
f(&["image-set"]);
}
}
}
@ -191,8 +203,10 @@ impl Image {
return Ok(generic::Image::Url(url));
}
if let Ok(is) = input.try_parse(|input| ImageSet::parse(context, input, cors_mode, only_url)) {
return Ok(generic::Image::ImageSet(Box::new(is)));
if image_set_enabled() {
if let Ok(is) = input.try_parse(|input| ImageSet::parse(context, input, cors_mode, only_url)) {
return Ok(generic::Image::ImageSet(Box::new(is)));
}
}
if only_url {