Auto merge of #16319 - canaltinova:element, r=upsuper

stylo: Add -moz-element support

Implemented -moz-element for background property.
r=upsuper

---
<!-- 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
- [X] These changes fix #15443 and [Bug 1341761](https://bugzilla.mozilla.org/show_bug.cgi?id=1341761)

<!-- 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/16319)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-04-10 14:08:04 -05:00 committed by GitHub
commit 3620e755a9
5 changed files with 64 additions and 4 deletions

View file

@ -11,7 +11,7 @@
use app_units::Au;
use gecko::values::{convert_rgba_to_nscolor, GeckoStyleCoordConvertible};
use gecko_bindings::bindings::{Gecko_CreateGradient, Gecko_SetGradientImageValue, Gecko_SetUrlImageValue};
use gecko_bindings::bindings::Gecko_InitializeImageCropRect;
use gecko_bindings::bindings::{Gecko_InitializeImageCropRect, Gecko_SetImageElement};
use gecko_bindings::structs::{nsStyleCoord_CalcValue, nsStyleImage};
use gecko_bindings::structs::{nsresult, SheetType};
use gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordDataMut};
@ -141,6 +141,11 @@ impl nsStyleImage {
image_rect.left.to_gecko_style_coord(&mut rect.data_at_mut(3));
}
}
Image::Element(ref element) => {
unsafe {
Gecko_SetImageElement(self, element.as_ptr());
}
},
_ => (),
}
}