style: Allow C++ URLValue objects to be lazily created from Rust SpecifiedUrls.

This avoids having to support storing refcounted URLValue objects in shared memory,
which would be tricky.

Depends on D17183

Differential Revision: https://phabricator.services.mozilla.com/D17184
This commit is contained in:
Cameron McCormack 2019-03-30 00:15:53 +00:00 committed by Emilio Cobos Álvarez
parent b6b5ddda71
commit 7e7a9e2ec5
3 changed files with 126 additions and 26 deletions

View file

@ -123,14 +123,11 @@ impl nsStyleImage {
match image {
GenericImage::Gradient(boxed_gradient) => self.set_gradient(*boxed_gradient),
GenericImage::Url(ref url) => unsafe {
bindings::Gecko_SetLayerImageImageValue(self, (url.0).0.url_value.get());
bindings::Gecko_SetLayerImageImageValue(self, url.url_value_ptr())
},
GenericImage::Rect(ref image_rect) => {
unsafe {
bindings::Gecko_SetLayerImageImageValue(
self,
(image_rect.url.0).0.url_value.get(),
);
bindings::Gecko_SetLayerImageImageValue(self, image_rect.url.url_value_ptr());
bindings::Gecko_InitializeImageCropRect(self);
// Set CropRect