Changeset 274391 in webkit
- Timestamp:
- Mar 13, 2021 12:00:21 PM (16 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/computed-clip-with-auto-rect-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/CSSPropertyAnimation.cpp (modified) (4 diffs)
-
Source/WebCore/css/CSSComputedStyleDeclaration.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r274390 r274391 1 2021-03-13 Antoine Quint <graouts@webkit.org> 2 3 Fix interpolation of clip CSS property 4 https://bugs.webkit.org/show_bug.cgi?id=223126 5 6 Reviewed by Antti Koivisto. 7 8 Rebase a test that used the old, incorrect computed value for "clip" with 9 four "auto" values. 10 11 * fast/css/computed-clip-with-auto-rect-expected.txt: 12 1 13 2021-03-13 Peng Liu <peng.liu6@apple.com> 2 14 -
trunk/LayoutTests/fast/css/computed-clip-with-auto-rect-expected.txt
r180441 r274391 1 rect(auto, auto, auto, auto) 1 auto 2 2 3 3 rect(5px, auto, auto, auto) … … 5 5 rect(auto, 5px, auto, auto) 6 6 7 rect(auto, auto, 5px, auto) 7 auto 8 8 9 rect(auto, auto, auto, 5px) 9 auto 10 10 11 11 rect(5px, auto, 5px, auto) -
trunk/LayoutTests/imported/w3c/ChangeLog
r274389 r274391 1 2021-03-13 Antoine Quint <graouts@webkit.org> 2 3 Fix interpolation of clip CSS property 4 https://bugs.webkit.org/show_bug.cgi?id=223126 5 6 Reviewed by Antti Koivisto. 7 8 Import interpolation tests for clip. These tests pass completely 9 with 42 PASS results compared to prior to the source changes. 10 11 * web-platform-tests/css/css-masking/animations/clip-interpolation-expected.txt: Added. 12 * web-platform-tests/css/css-masking/animations/clip-interpolation.html: Added. 13 1 14 2021-03-13 Rob Buis <rbuis@igalia.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r274390 r274391 1 2021-03-13 Antoine Quint <graouts@webkit.org> 2 3 Fix interpolation of clip CSS property 4 https://bugs.webkit.org/show_bug.cgi?id=223126 5 6 Reviewed by Antti Koivisto. 7 8 Test: imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation.html 9 10 While we already had support for interpolating the clip property, we had a couple of small 11 issues to fix to pass the entire WPT test dedicated to testing that feature: 12 13 1. we must allow negative values 14 2. we must serialize the value to "auto" if all four values are "auto" 15 16 * animation/CSSPropertyAnimation.cpp: 17 (WebCore::blendFunc): 18 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): 19 * css/CSSComputedStyleDeclaration.cpp: 20 (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): 21 1 22 2021-03-13 Peng Liu <peng.liu6@apple.com> 2 23 -
trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp
r274383 r274391 387 387 } 388 388 389 static inline LengthBox blendFunc(const CSSPropertyBlendingClient* anim, const LengthBox& from, const LengthBox& to, double progress )390 { 391 LengthBox result(blendFunc(anim, from.top(), to.top(), progress, ValueRangeNonNegative),392 blendFunc(anim, from.right(), to.right(), progress, ValueRangeNonNegative),393 blendFunc(anim, from.bottom(), to.bottom(), progress, ValueRangeNonNegative),394 blendFunc(anim, from.left(), to.left(), progress, ValueRangeNonNegative));389 static inline LengthBox blendFunc(const CSSPropertyBlendingClient* anim, const LengthBox& from, const LengthBox& to, double progress, ValueRange valueRange = ValueRangeNonNegative) 390 { 391 LengthBox result(blendFunc(anim, from.top(), to.top(), progress, valueRange), 392 blendFunc(anim, from.right(), to.right(), progress, valueRange), 393 blendFunc(anim, from.bottom(), to.bottom(), progress, valueRange), 394 blendFunc(anim, from.left(), to.left(), progress, valueRange)); 395 395 396 396 return result; … … 791 791 public: 792 792 enum class Flags { 793 IsLengthPercentage = 1 << 0, 794 UsesFillKeyword = 1 << 1, 793 IsLengthPercentage = 1 << 0, 794 UsesFillKeyword = 1 << 1, 795 AllowsNegativeValues = 1 << 2, 795 796 }; 796 797 LengthBoxPropertyWrapper(CSSPropertyID prop, const LengthBox& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(LengthBox&&), OptionSet<Flags> flags = { }) … … 819 820 if (m_flags.contains(Flags::UsesFillKeyword)) 820 821 dst->setBorderImageSliceFill((!progress || canInterpolate(a, b) ? a : b)->borderImage().fill()); 821 (dst->*m_setter)(blendFunc(anim, this->value(a), this->value(b), progress)); 822 auto valueRange = m_flags.contains(Flags::AllowsNegativeValues) ? ValueRangeAll : ValueRangeNonNegative; 823 (dst->*m_setter)(blendFunc(anim, this->value(a), this->value(b), progress, valueRange)); 822 824 } 823 825 … … 1987 1989 new PropertyWrapper<float>(CSSPropertyZoom, &RenderStyle::zoom, &RenderStyle::setZoomWithoutReturnValue), 1988 1990 1989 new LengthBoxPropertyWrapper(CSSPropertyClip, &RenderStyle::clip, &RenderStyle::setClip ),1991 new LengthBoxPropertyWrapper(CSSPropertyClip, &RenderStyle::clip, &RenderStyle::setClip, { LengthBoxPropertyWrapper::Flags::AllowsNegativeValues }), 1990 1992 1991 1993 new AcceleratedPropertyWrapper<float>(CSSPropertyOpacity, &RenderStyle::opacity, &RenderStyle::setOpacity), -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r273688 r274391 3579 3579 if (!style.hasClip()) 3580 3580 return cssValuePool.createIdentifierValue(CSSValueAuto); 3581 if (style.clip().top().isAuto() && style.clip().right().isAuto() 3582 && style.clip().top().isAuto() && style.clip().right().isAuto()) 3583 return cssValuePool.createIdentifierValue(CSSValueAuto); 3584 3581 3585 auto rect = Rect::create(); 3582 3586 rect->setTop(autoOrZoomAdjustedValue(style.clip().top(), style));
Note: See TracChangeset
for help on using the changeset viewer.