Bug 1342139 - Implement gecko bindings for will-change r?xidorn
MozReview-Commit-ID: KNhVz9vjXUl
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1106,16 +1106,36 @@ Gecko_EnsureStyleTransitionArrayLength(v
base->EnsureLengthAtLeast(aLen);
for (size_t i = oldLength; i < aLen; ++i) {
(*base)[i].SetInitialValues();
}
}
+void
+Gecko_ClearWillChange(nsStyleDisplay* aDisplay, size_t aLength)
+{
+ aDisplay->mWillChange.Clear();
+ aDisplay->mWillChange.SetCapacity(aLength);
+}
+
+void
+Gecko_AppendWillChange(nsStyleDisplay* aDisplay, nsIAtom* aAtom)
+{
+ aDisplay->mWillChange.AppendElement(aAtom);
+}
+
+void
+Gecko_CopyWillChangeFrom(nsStyleDisplay* aDest, nsStyleDisplay* aSrc)
+{
+ aDest->mWillChange.Clear();
+ aDest->mWillChange.AppendElements(aSrc->mWillChange);
+}
+
Keyframe*
Gecko_AnimationAppendKeyframe(RawGeckoKeyframeListBorrowedMut aKeyframes,
float aOffset,
const nsTimingFunction* aTimingFunction)
{
Keyframe* keyframe = aKeyframes->AppendElement();
keyframe->mOffset.emplace(aOffset);
if (aTimingFunction &&
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -292,16 +292,20 @@ void Gecko_CopyCounterResetsFrom(nsStyle
void Gecko_CopyCounterIncrementsFrom(nsStyleContent* content, const nsStyleContent* other);
void Gecko_EnsureImageLayersLength(nsStyleImageLayers* layers, size_t len,
nsStyleImageLayers::LayerType layer_type);
void Gecko_EnsureStyleAnimationArrayLength(void* array, size_t len);
void Gecko_EnsureStyleTransitionArrayLength(void* array, size_t len);
+void Gecko_ClearWillChange(nsStyleDisplay* display, size_t length);
+void Gecko_AppendWillChange(nsStyleDisplay* display, nsIAtom* atom);
+void Gecko_CopyWillChangeFrom(nsStyleDisplay* dest, nsStyleDisplay* src);
+
mozilla::Keyframe* Gecko_AnimationAppendKeyframe(RawGeckoKeyframeListBorrowedMut keyframes,
float offset,
const nsTimingFunction* timingFunction);
// Clean up pointer-based coordinates
void Gecko_ResetStyleCoord(nsStyleUnit* unit, nsStyleUnion* value);
// Set an nsStyleCoord to a computed `calc()` value