stylo: Add ServoBundledURI abstraction for use when setting css::URLValues

MozReview-Commit-ID: 4QKKzJ1DVYP
This commit is contained in:
Manish Goregaokar 2017-02-09 17:43:52 -08:00 committed by Manish Goregaokar
parent 47ebeaa95c
commit e965b4e345
6 changed files with 63 additions and 29 deletions

View file

@ -1322,18 +1322,9 @@ fn static_assert() {
match v {
Either::Second(_none) => debug_assert!(self.gecko.mBinding.mRawPtr.is_null()),
Either::First(ref url) => {
let extra_data = url.extra_data();
let (ptr, len) = match url.as_slice_components() {
Ok(value) => value,
Err(_) => (ptr::null(), 0),
};
unsafe {
Gecko_SetMozBinding(&mut self.gecko,
ptr,
len as u32,
extra_data.base.get(),
extra_data.referrer.get(),
extra_data.principal.get());
Gecko_SetMozBinding(&mut self.gecko, url.for_ffi());
}
}
}
@ -2066,17 +2057,9 @@ fn static_assert() {
}
}
Either::First(ref url) => {
let (ptr, len) = match url.as_slice_components() {
Ok(value) | Err(value) => value
};
let extra_data = url.extra_data();
unsafe {
Gecko_SetListStyleImage(&mut self.gecko,
ptr,
len as u32,
extra_data.base.get(),
extra_data.referrer.get(),
extra_data.principal.get());
url.for_ffi());
}
// We don't need to record this struct as uncacheable, like when setting
// background-image to a url() value, since only properties in reset structs