stylo: Use ServoBundledURI everywhere else, fix from_ffi to handle the error case

MozReview-Commit-ID: DHNKLm3y5Gv
This commit is contained in:
Manish Goregaokar 2017-03-12 21:08:29 -07:00 committed by Manish Goregaokar
parent 808ffffd1e
commit 77d7490d59
4 changed files with 41 additions and 62 deletions

View file

@ -106,26 +106,17 @@ impl nsStyleImage {
self.set_gradient(gradient)
},
Image::Url(ref url) if with_url => {
let (ptr, len) = match url.as_slice_components() {
Ok(value) | Err(value) => value
};
let extra_data = url.extra_data();
unsafe {
Gecko_SetUrlImageValue(self,
ptr,
len as u32,
extra_data.base.get(),
extra_data.referrer.get(),
extra_data.principal.get());
Gecko_SetUrlImageValue(self, url.for_ffi());
// 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
// structs don't like to be tracked by more than one document.
//
// FIXME(emilio): With the scoped TLS thing this is no longer
// true, remove this line in a follow-up!
*cacheable = false;
}
// 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
// structs don't like to be tracked by more than one document.
//
// FIXME(emilio): With the scoped TLS thing this is no longer
// true, remove this line in a follow-up!
*cacheable = false;
},
_ => (),
}