style: Centralize specified url value handling, and refcount urls.

This commit is contained in:
Emilio Cobos Álvarez 2016-10-16 15:08:30 +02:00
parent 89c46369a2
commit 5f2e7af864
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
22 changed files with 267 additions and 187 deletions

View file

@ -120,11 +120,13 @@ impl nsStyleImage {
Image::Gradient(gradient) => {
self.set_gradient(gradient)
},
Image::Url(ref url, ref extra_data) if with_url => {
Image::Url(ref url) if with_url => {
let (ptr, len) = url.as_slice_components();
let extra_data = url.extra_data();
unsafe {
Gecko_SetUrlImageValue(self,
url.as_str().as_ptr(),
url.as_str().len() as u32,
ptr,
len as u32,
extra_data.base.get(),
extra_data.referrer.get(),
extra_data.principal.get());