768static bool canInterpolateLengthPoints(const LengthPoint& from, const LengthPoint& to)
769{
770 bool isLengthPercentage = true;
771 return canInterpolateLengths(from.x(), to.x(), isLengthPercentage)
772 && canInterpolateLengths(from.y(), to.y(), isLengthPercentage);
773}
774
775class LengthPointPropertyWrapper final : public PropertyWrapperGetter<LengthPoint> {
776 WTF_MAKE_FAST_ALLOCATED;
777public:
778 LengthPointPropertyWrapper(CSSPropertyID property, LengthPoint (RenderStyle::*getter)() const, void (RenderStyle::*setter)(LengthPoint&&))
779 : PropertyWrapperGetter<LengthPoint>(property, getter)
780 , m_setter(setter)
781 {
782 }
783
784private:
785 bool canInterpolate(const RenderStyle* from, const RenderStyle* to) const final
786 {
787 return canInterpolateLengthPoints(value(from), value(to));
788 }
789
790 void blend(const CSSPropertyBlendingClient* client, RenderStyle* destination, const RenderStyle* from, const RenderStyle* to, double progress) const final
791 {
792 (destination->*m_setter)(blendFunc(client, value(from), value(to), progress));
793 }
794
795 void (RenderStyle::*m_setter)(LengthPoint&&);
796};
797