Changeset 274939 in webkit
- Timestamp:
- Mar 24, 2021 8:14:55 AM (16 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-text/animations/tab-size-interpolation-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-text/animations/tab-size-interpolation.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/CSSPropertyAnimation.cpp (modified) (4 diffs)
-
Source/WebCore/platform/graphics/TabSize.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r274936 r274939 1 2021-03-24 Antoine Quint <graouts@webkit.org> 2 3 Support animation of the tab-size CSS property 4 https://bugs.webkit.org/show_bug.cgi?id=223688 5 6 Reviewed by Antti Koivisto. 7 8 Import the tab-size interpolation test with its 196 tests passing. 9 10 * web-platform-tests/css/css-text/animations/tab-size-interpolation-expected.txt: Added. 11 * web-platform-tests/css/css-text/animations/tab-size-interpolation.html: Added. 12 1 13 2021-03-24 Chris Lord <clord@igalia.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r274933 r274939 1 2021-03-24 Antoine Quint <graouts@webkit.org> 2 3 Support animation of the tab-size CSS property 4 https://bugs.webkit.org/show_bug.cgi?id=223688 5 6 Reviewed by Antti Koivisto. 7 8 Test: imported/w3c/web-platform-tests/css/css-text/animations/tab-size-interpolation.html 9 10 * animation/CSSPropertyAnimation.cpp: 11 (WebCore::blendFunc): 12 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): 13 * platform/graphics/TabSize.h: 14 (WebCore::TabSize::value const): 15 (WebCore::TabSize::operator bool const): 16 1 17 2021-03-24 Rob Buis <rbuis@igalia.com> 2 18 -
trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp
r274415 r274939 58 58 #include "StylePropertyShorthand.h" 59 59 #include "StyleResolver.h" 60 #include "TabSize.h" 60 61 #include <algorithm> 61 62 #include <memory> … … 99 100 return progress < 0.5 ? from : to; 100 101 return blend(from.length(), to.length(), progress, ValueRangeNonNegative); 102 } 103 104 static inline TabSize blendFunc(const CSSPropertyBlendingClient*, const TabSize& from, const TabSize& to, double progress) 105 { 106 auto blendedValue = blend(from.value(), to.value(), progress); 107 return { blendedValue < 0 ? 0 : blendedValue, from.isSpaces() ? SpaceValueType : LengthValueType }; 101 108 } 102 109 … … 1856 1863 }; 1857 1864 1865 class TabSizePropertyWrapper final : public PropertyWrapper<const TabSize&> { 1866 WTF_MAKE_FAST_ALLOCATED; 1867 public: 1868 TabSizePropertyWrapper() 1869 : PropertyWrapper<const TabSize&>(CSSPropertyTabSize, &RenderStyle::tabSize, &RenderStyle::setTabSize) 1870 { 1871 } 1872 1873 private: 1874 bool canInterpolate(const RenderStyle* from, const RenderStyle* to) const final 1875 { 1876 return value(from).isSpaces() == value(to).isSpaces(); 1877 } 1878 1879 void blend(const CSSPropertyBlendingClient* client, RenderStyle* destination, const RenderStyle* from, const RenderStyle* to, double progress) const final 1880 { 1881 if (!canInterpolate(from, to)) 1882 (destination->*m_setter)(progress ? value(to) : value(from)); 1883 else 1884 PropertyWrapper::blend(client, destination, from, to, progress); 1885 } 1886 }; 1887 1858 1888 class PropertyWrapperAspectRatio final : public AnimationPropertyWrapperBase { 1859 1889 WTF_MAKE_FAST_ALLOCATED; … … 2118 2148 new NonNegativeFloatPropertyWrapper(CSSPropertyFlexShrink, &RenderStyle::flexShrink, &RenderStyle::setFlexShrink), 2119 2149 new PropertyWrapper<int>(CSSPropertyOrder, &RenderStyle::order, &RenderStyle::setOrder), 2150 2151 new TabSizePropertyWrapper, 2120 2152 2121 2153 // FIXME: The following properties are currently not animatable but should be: -
trunk/Source/WebCore/platform/graphics/TabSize.h
r246193 r274939 54 54 } 55 55 56 operator bool() const { return m_value; } 56 float value() const 57 { 58 return m_value; 59 } 60 61 operator bool() const { return value(); } 57 62 58 63 float m_value;
Note: See TracChangeset
for help on using the changeset viewer.