Bug 1371115 - Part 12: implements nsStyleImage type properties animatable. r=hiro,r=birtles
In this patch, implements following properties:
* background-image
* border-image-source
* mask-image
MozReview-Commit-ID: 30RdO0fMNr8
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1529,16 +1529,37 @@ Gecko_CreateGradient(uint8_t aShape,
for (uint32_t i = 0; i < aStopCount; i++) {
result->mStops.AppendElement(dummyStop);
}
return result;
}
+const mozilla::css::URLValueData*
+Gecko_GetURLValue(const nsStyleImage* aImage)
+{
+ MOZ_ASSERT(aImage && aImage->GetType() == eStyleImageType_Image);
+ return aImage->GetURLValue();
+}
+
+nsIAtom*
+Gecko_GetImageElement(const nsStyleImage* aImage)
+{
+ MOZ_ASSERT(aImage && aImage->GetType() == eStyleImageType_Element);
+ return const_cast<nsIAtom*>(aImage->GetElementId());
+}
+
+const nsStyleGradient*
+Gecko_GetGradientImageValue(const nsStyleImage* aImage)
+{
+ MOZ_ASSERT(aImage && aImage->GetType() == eStyleImageType_Gradient);
+ return aImage->GetGradientData();
+}
+
void
Gecko_SetListStyleImageNone(nsStyleList* aList)
{
aList->mListStyleImage = nullptr;
}
void
Gecko_SetListStyleImageImageValue(nsStyleList* aList,
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -318,16 +318,20 @@ void Gecko_InitializeImageCropRect(nsSty
nsStyleGradient* Gecko_CreateGradient(uint8_t shape,
uint8_t size,
bool repeating,
bool legacy_syntax,
bool moz_legacy_syntax,
uint32_t stops);
+const mozilla::css::URLValueData* Gecko_GetURLValue(const nsStyleImage* image);
+nsIAtom* Gecko_GetImageElement(const nsStyleImage* image);
+const nsStyleGradient* Gecko_GetGradientImageValue(const nsStyleImage* image);
+
// list-style-image style.
void Gecko_SetListStyleImageNone(nsStyleList* style_struct);
void Gecko_SetListStyleImageImageValue(nsStyleList* style_struct,
mozilla::css::ImageValue* aImageValue);
void Gecko_CopyListStyleImageFrom(nsStyleList* dest, const nsStyleList* src);
// cursor style.
void Gecko_SetCursorArrayLength(nsStyleUserInterface* ui, size_t len);
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -326,16 +326,17 @@ raw-lines = [
"type nsACString_internal = nsACString;",
"type nsAString_internal = nsAString;",
]
whitelist-functions = ["Servo_.*", "Gecko_.*"]
structs-types = [
"mozilla::css::GridTemplateAreasValue",
"mozilla::css::ImageValue",
"mozilla::css::URLValue",
+ "mozilla::css::URLValueData",
"mozilla::MallocSizeOf",
"mozilla::Side",
"nsIContent",
"nsIDocument",
"nsIDocument_DocumentTheme",
"RawGeckoAnimationPropertySegment",
"RawGeckoComputedTiming",
"RawGeckoCSSPropertyIDList",