mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Box gradients and rects in Image. r=xidorn
Gradients and rects are rare, and large. Image is much smaller with them boxed. This is part of of the fix for Gecko bug 1397614 <https://bugzilla.mozilla.org/show_bug.cgi?id=1397614>
This commit is contained in:
parent
91b748ec22
commit
26b39241f9
4 changed files with 65 additions and 13 deletions
|
@ -138,7 +138,7 @@ impl Parse for Image {
|
|||
return Ok(GenericImage::Url(url));
|
||||
}
|
||||
if let Ok(gradient) = input.try(|i| Gradient::parse(context, i)) {
|
||||
return Ok(GenericImage::Gradient(gradient));
|
||||
return Ok(GenericImage::Gradient(Box::new(gradient)));
|
||||
}
|
||||
#[cfg(feature = "servo")]
|
||||
{
|
||||
|
@ -151,7 +151,7 @@ impl Parse for Image {
|
|||
{
|
||||
image_rect.url.build_image_value();
|
||||
}
|
||||
return Ok(GenericImage::Rect(image_rect));
|
||||
return Ok(GenericImage::Rect(Box::new(image_rect)));
|
||||
}
|
||||
Ok(GenericImage::Element(Image::parse_element(input)?))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue