mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #16620 - CJKu:bug-1341703, r=heycam,manishearth
Bug 1341703 - Support border-image with url() <!-- Please describe your changes on the following line: --> Gecko 1341703 should be land immediately after this PR been merged. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16620) <!-- Reviewable:end -->
This commit is contained in:
commit
18c72ac28d
2 changed files with 7 additions and 10 deletions
|
@ -101,12 +101,12 @@ impl From<nsStyleCoord_CalcValue> for LengthOrPercentage {
|
|||
|
||||
impl nsStyleImage {
|
||||
/// Set a given Servo `Image` value into this `nsStyleImage`.
|
||||
pub fn set(&mut self, image: Image, with_url: bool, cacheable: &mut bool) {
|
||||
pub fn set(&mut self, image: Image, cacheable: &mut bool) {
|
||||
match image {
|
||||
Image::Gradient(gradient) => {
|
||||
self.set_gradient(gradient)
|
||||
},
|
||||
Image::Url(ref url) if with_url => {
|
||||
Image::Url(ref url) => {
|
||||
unsafe {
|
||||
Gecko_SetUrlImageValue(self, url.for_ffi());
|
||||
// We unfortunately must make any url() value uncacheable, since
|
||||
|
@ -119,7 +119,7 @@ impl nsStyleImage {
|
|||
*cacheable = false;
|
||||
}
|
||||
},
|
||||
Image::ImageRect(ref image_rect) if with_url => {
|
||||
Image::ImageRect(ref image_rect) => {
|
||||
unsafe {
|
||||
Gecko_SetUrlImageValue(self, image_rect.url.for_ffi());
|
||||
Gecko_InitializeImageCropRect(self);
|
||||
|
@ -145,8 +145,7 @@ impl nsStyleImage {
|
|||
unsafe {
|
||||
Gecko_SetImageElement(self, element.as_ptr());
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -944,9 +944,7 @@ fn static_assert() {
|
|||
}
|
||||
|
||||
if let Some(image) = v.0 {
|
||||
// TODO: We need to make border-image-source match with background-image
|
||||
// until then we are setting with_url to false
|
||||
self.gecko.mBorderImageSource.set(image, false, &mut false)
|
||||
self.gecko.mBorderImageSource.set(image, &mut false)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2766,12 +2764,12 @@ fn static_assert() {
|
|||
.mLayers.iter_mut()) {
|
||||
% if shorthand == "background":
|
||||
if let Some(image) = image.0 {
|
||||
geckoimage.mImage.set(image, true, cacheable)
|
||||
geckoimage.mImage.set(image, cacheable)
|
||||
}
|
||||
% else:
|
||||
use properties::longhands::mask_image::single_value::computed_value::T;
|
||||
match image {
|
||||
T::Image(image) => geckoimage.mImage.set(image, true, cacheable),
|
||||
T::Image(image) => geckoimage.mImage.set(image, cacheable),
|
||||
_ => ()
|
||||
}
|
||||
% endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue