Bug 1341761 - stylo: Add -moz-element support r?xidorn
MozReview-Commit-ID: I9gxAoFJH9C
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -980,16 +980,22 @@ void
Gecko_SetUrlImageValue(nsStyleImage* aImage, ServoBundledURI aURI)
{
RefPtr<nsStyleImageRequest> req =
CreateStyleImageRequest(nsStyleImageRequest::Mode::Track, aURI);
aImage->SetImageRequest(req.forget());
}
void
+Gecko_SetImageElement(nsStyleImage* aImage, nsIAtom* aAtom) {
+ MOZ_ASSERT(aImage);
+ aImage->SetElementId(do_AddRef(aAtom));
+}
+
+void
Gecko_CopyImageValueFrom(nsStyleImage* aImage, const nsStyleImage* aOther)
{
MOZ_ASSERT(aImage);
MOZ_ASSERT(aOther);
*aImage = *aOther;
}
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -221,21 +221,21 @@ void Gecko_FontFamilyList_AppendNamed(Fo
void Gecko_FontFamilyList_AppendGeneric(FontFamilyList* list, FontFamilyType familyType);
void Gecko_CopyFontFamilyFrom(nsFont* dst, const nsFont* src);
// Counter style.
void Gecko_SetListStyleType(nsStyleList* style_struct, uint32_t type);
void Gecko_CopyListStyleTypeFrom(nsStyleList* dst, const nsStyleList* src);
// background-image style.
-// TODO: support element() and -moz-image()
void Gecko_SetNullImageValue(nsStyleImage* image);
void Gecko_SetGradientImageValue(nsStyleImage* image, nsStyleGradient* gradient);
void Gecko_SetUrlImageValue(nsStyleImage* image,
ServoBundledURI uri);
+void Gecko_SetImageElement(nsStyleImage* image, nsIAtom* atom);
void Gecko_CopyImageValueFrom(nsStyleImage* image, const nsStyleImage* other);
void Gecko_InitializeImageCropRect(nsStyleImage* image);
nsStyleGradient* Gecko_CreateGradient(uint8_t shape,
uint8_t size,
bool repeating,
bool legacy_syntax,
uint32_t stops);