mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Further changes required by Servo
This commit is contained in:
parent
7d1823563e
commit
9cf7df1f31
1 changed files with 17 additions and 3 deletions
|
@ -81,6 +81,16 @@ fn cross_fade_enabled() -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "gecko")]
|
||||||
|
fn image_set_enabled() -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "servo")]
|
||||||
|
fn image_set_enabled() -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
impl SpecifiedValueInfo for Gradient {
|
impl SpecifiedValueInfo for Gradient {
|
||||||
const SUPPORTED_TYPES: u8 = CssType::GRADIENT;
|
const SUPPORTED_TYPES: u8 = CssType::GRADIENT;
|
||||||
|
|
||||||
|
@ -122,9 +132,11 @@ impl<Image, Resolution> SpecifiedValueInfo for generic::ImageSet<Image, Resoluti
|
||||||
const SUPPORTED_TYPES: u8 = 0;
|
const SUPPORTED_TYPES: u8 = 0;
|
||||||
|
|
||||||
fn collect_completion_keywords(f: KeywordsCollectFn) {
|
fn collect_completion_keywords(f: KeywordsCollectFn) {
|
||||||
|
if image_set_enabled() {
|
||||||
f(&["image-set"]);
|
f(&["image-set"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A specified gradient line direction.
|
/// A specified gradient line direction.
|
||||||
///
|
///
|
||||||
|
@ -191,9 +203,11 @@ impl Image {
|
||||||
return Ok(generic::Image::Url(url));
|
return Ok(generic::Image::Url(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if image_set_enabled() {
|
||||||
if let Ok(is) = input.try_parse(|input| ImageSet::parse(context, input, cors_mode, only_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)));
|
return Ok(generic::Image::ImageSet(Box::new(is)));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if only_url {
|
if only_url {
|
||||||
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
|
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue