mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
stylo: Use ServoBundledURI everywhere else, fix from_ffi to handle the error case
MozReview-Commit-ID: DHNKLm3y5Gv
This commit is contained in:
parent
808ffffd1e
commit
77d7490d59
4 changed files with 41 additions and 62 deletions
|
@ -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;
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue