Skip to content

Commit

Permalink
Stylo: Pass LayerImage's image_value to gecko.
Browse files Browse the repository at this point in the history
  • Loading branch information
cku committed May 15, 2017
1 parent 2fe55e8 commit f7e3c53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/style/gecko/conversions.rs
Expand Up @@ -10,7 +10,7 @@

use app_units::Au;
use gecko::values::{convert_rgba_to_nscolor, GeckoStyleCoordConvertible};
use gecko_bindings::bindings::{Gecko_CreateGradient, Gecko_SetGradientImageValue, Gecko_SetUrlImageValue};
use gecko_bindings::bindings::{Gecko_CreateGradient, Gecko_SetGradientImageValue, Gecko_SetLayerImageImageValue};
use gecko_bindings::bindings::{Gecko_InitializeImageCropRect, Gecko_SetImageElement};
use gecko_bindings::structs::{nsCSSUnit, nsStyleCoord_CalcValue, nsStyleImage};
use gecko_bindings::structs::{nsresult, SheetType};
Expand Down Expand Up @@ -144,7 +144,7 @@ impl nsStyleImage {
},
GenericImage::Url(ref url) => {
unsafe {
Gecko_SetUrlImageValue(self, url.for_ffi());
Gecko_SetLayerImageImageValue(self, url.image_value.clone().unwrap().get());
// We unfortunately must make any url() value uncacheable, since
// the applicable declarations cache is not per document, but
// global, and the imgRequestProxy objects we store in the style
Expand All @@ -157,7 +157,7 @@ impl nsStyleImage {
},
GenericImage::Rect(ref image_rect) => {
unsafe {
Gecko_SetUrlImageValue(self, image_rect.url.for_ffi());
Gecko_SetLayerImageImageValue(self, image_rect.url.image_value.clone().unwrap().get());
Gecko_InitializeImageCropRect(self);

// We unfortunately must make any url() value uncacheable, since
Expand Down
3 changes: 2 additions & 1 deletion ports/geckolib/glue.rs
Expand Up @@ -1845,7 +1845,8 @@ pub extern "C" fn Servo_DeclarationBlock_SetBackgroundImage(declarations:
let context = ParserContext::new(Origin::Author, url_data, &error_reporter,
Some(CssRuleType::Style), PARSING_MODE_DEFAULT,
QuirksMode::NoQuirks);
if let Ok(url) = SpecifiedUrl::parse_from_string(string.into(), &context) {
if let Ok(mut url) = SpecifiedUrl::parse_from_string(string.into(), &context) {
url.build_image_value();
let decl = PropertyDeclaration::BackgroundImage(BackgroundImage(
vec![Either::Second(Image::Url(url))]
));
Expand Down

0 comments on commit f7e3c53

Please sign in to comment.