Source/WebCore/ChangeLog

 12021-03-26 Tim Nguyen <ntim@apple.com>
 2
 3 Make the object-position CSS property animatable.
 4 https://bugs.webkit.org/show_bug.cgi?id=223568
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Tests will be added via WPT.
 9
 10 * animation/CSSPropertyAnimation.cpp:
 11 (WebCore::blendFunc):
 12 (WebCore::canInterpolateLengthPoints):
 13 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
 14
1152021-03-25 Cameron McCormack <heycam@apple.com>
216
317 Collapse newly adjacent anonymous table cells when a table cell is detached from between them.

Source/WebCore/animation/CSSPropertyAnimation.cpp

4848#include "FontTaggedSettings.h"
4949#include "GapLength.h"
5050#include "IdentityTransformOperation.h"
 51#include "LengthPoint.h"
5152#include "Logging.h"
5253#include "Matrix3DTransformOperation.h"
5354#include "MatrixTransformOperation.h"

@@static inline LengthSize blendFunc(const CSSPropertyBlendingClient* client, cons
113114 blendFunc(client, from.height, to.height, progress, ValueRangeNonNegative) };
114115}
115116
 117static inline LengthPoint blendFunc(const CSSPropertyBlendingClient*, const LengthPoint& from, const LengthPoint& to, double progress)
 118{
 119 return blend(from, to, progress);
 120}
 121
116122static inline ShadowStyle blendFunc(const CSSPropertyBlendingClient* client, ShadowStyle from, ShadowStyle to, double progress)
117123{
118124 if (from == to)

@@static bool canInterpolateLengthVariants(const GapLength& from, const GapLength&
759765 return canInterpolateLengths(from.length(), to.length(), isLengthPercentage);
760766}
761767
 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
762798template <typename T>
763799class LengthVariantPropertyWrapper final : public PropertyWrapperGetter<const T&> {
764800 WTF_MAKE_FAST_ALLOCATED;

@@CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap()
20512087 new FillLayersPropertyWrapper(CSSPropertyWebkitMaskPositionY, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
20522088 new FillLayersPropertyWrapper(CSSPropertyWebkitMaskSize, &RenderStyle::maskLayers, &RenderStyle::ensureMaskLayers),
20532089
 2090 new LengthPointPropertyWrapper(CSSPropertyObjectPosition, &RenderStyle::objectPosition, &RenderStyle::setObjectPosition),
 2091
20542092 new PropertyWrapper<float>(CSSPropertyFontSize, &RenderStyle::computedFontSize, &RenderStyle::setFontSize),
20552093 new PropertyWrapper<unsigned short>(CSSPropertyColumnRuleWidth, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth),
20562094 new LengthVariantPropertyWrapper<GapLength>(CSSPropertyColumnGap, &RenderStyle::columnGap, &RenderStyle::setColumnGap),