Skip to content

Commit

Permalink
Stylo: Remove the second parameter(with_url) of nsStyleImage::set.
Browse files Browse the repository at this point in the history
  • Loading branch information
cku committed Apr 26, 2017
1 parent 5327959 commit 2f91276
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions components/style/gecko/conversions.rs
Expand Up @@ -101,12 +101,12 @@ impl From<nsStyleCoord_CalcValue> for LengthOrPercentage {

impl nsStyleImage {
/// Set a given Servo `Image` value into this `nsStyleImage`.
pub fn set(&mut self, image: Image, with_url: bool, cacheable: &mut bool) {
pub fn set(&mut self, image: Image, cacheable: &mut bool) {
match image {
Image::Gradient(gradient) => {
self.set_gradient(gradient)
},
Image::Url(ref url) if with_url => {
Image::Url(ref url) => {
unsafe {
Gecko_SetUrlImageValue(self, url.for_ffi());
// We unfortunately must make any url() value uncacheable, since
Expand All @@ -119,7 +119,7 @@ impl nsStyleImage {
*cacheable = false;
}
},
Image::ImageRect(ref image_rect) if with_url => {
Image::ImageRect(ref image_rect) => {
unsafe {
Gecko_SetUrlImageValue(self, image_rect.url.for_ffi());
Gecko_InitializeImageCropRect(self);
Expand All @@ -145,8 +145,7 @@ impl nsStyleImage {
unsafe {
Gecko_SetImageElement(self, element.as_ptr());
}
},
_ => (),
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -944,7 +944,7 @@ fn static_assert() {
}

if let Some(image) = v.0 {
self.gecko.mBorderImageSource.set(image, true, &mut false)
self.gecko.mBorderImageSource.set(image, &mut false)
}
}

Expand Down Expand Up @@ -2764,12 +2764,12 @@ fn static_assert() {
.mLayers.iter_mut()) {
% if shorthand == "background":
if let Some(image) = image.0 {
geckoimage.mImage.set(image, true, cacheable)
geckoimage.mImage.set(image, cacheable)
}
% else:
use properties::longhands::mask_image::single_value::computed_value::T;
match image {
T::Image(image) => geckoimage.mImage.set(image, true, cacheable),
T::Image(image) => geckoimage.mImage.set(image, cacheable),
_ => ()
}
% endif
Expand Down

0 comments on commit 2f91276

Please sign in to comment.