Changeset 274383 in webkit


Ignore:
Timestamp:
Mar 13, 2021 2:57:21 AM (16 months ago)
Author:
graouts@webkit.org
Message:

Fix interpolation of orphans and widows CSS properties
https://bugs.webkit.org/show_bug.cgi?id=223124

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Import interpolation tests for orphans and widows. These tests pass completely
weith 44 PASS results compared to prior to the source changes.

  • web-platform-tests/css/css-break/animation/orphans-interpolation-expected.txt: Added.
  • web-platform-tests/css/css-break/animation/orphans-interpolation.html: Added.
  • web-platform-tests/css/css-break/animation/widows-interpolation-expected.txt: Added.
  • web-platform-tests/css/css-break/animation/widows-interpolation.html: Added.

Source/WebCore:

The orphans and widows properties must be positive integers, so we add a dedicated
wrapper for these properties.

Tests: imported/w3c/web-platform-tests/css/css-break/animation/orphans-interpolation.html

imported/w3c/web-platform-tests/css/css-break/animation/widows-interpolation.html

  • animation/CSSPropertyAnimation.cpp:

(WebCore::PositivePropertyWrapper::PositivePropertyWrapper):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

Location:
trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r274379 r274383  
     12021-03-12  Antoine Quint  <graouts@webkit.org>
     2
     3        Fix interpolation of orphans and widows CSS properties
     4        https://bugs.webkit.org/show_bug.cgi?id=223124
     5
     6        Reviewed by Darin Adler.
     7
     8        Import interpolation tests for orphans and widows. These tests pass completely
     9        weith 44 PASS results compared to prior to the source changes.
     10
     11        * web-platform-tests/css/css-break/animation/orphans-interpolation-expected.txt: Added.
     12        * web-platform-tests/css/css-break/animation/orphans-interpolation.html: Added.
     13        * web-platform-tests/css/css-break/animation/widows-interpolation-expected.txt: Added.
     14        * web-platform-tests/css/css-break/animation/widows-interpolation.html: Added.
     15
    1162021-03-13  Alexey Shvayka  <shvaikalesh@gmail.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r274382 r274383  
     12021-03-12  Antoine Quint  <graouts@webkit.org>
     2
     3        Fix interpolation of orphans and widows CSS properties
     4        https://bugs.webkit.org/show_bug.cgi?id=223124
     5
     6        Reviewed by Darin Adler.
     7
     8        The orphans and widows properties must be positive integers, so we add a dedicated
     9        wrapper for these properties.
     10
     11        Tests: imported/w3c/web-platform-tests/css/css-break/animation/orphans-interpolation.html
     12               imported/w3c/web-platform-tests/css/css-break/animation/widows-interpolation.html
     13
     14        * animation/CSSPropertyAnimation.cpp:
     15        (WebCore::PositivePropertyWrapper::PositivePropertyWrapper):
     16        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     17
    1182021-03-13  Fujii Hironori  <Hironori.Fujii@sony.com>
    219
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r274355 r274383  
    640640
    641641template <typename T>
     642class PositivePropertyWrapper final : public PropertyWrapper<T> {
     643    WTF_MAKE_FAST_ALLOCATED;
     644public:
     645    PositivePropertyWrapper(CSSPropertyID property, T (RenderStyle::*getter)() const, void (RenderStyle::*setter)(T))
     646        : PropertyWrapper<T>(property, getter, setter)
     647    {
     648    }
     649
     650private:
     651
     652    void blend(const CSSPropertyBlendingClient* client, RenderStyle* destination, const RenderStyle* from, const RenderStyle* to, double progress) const final
     653    {
     654        auto blendedValue = blendFunc(client, this->value(from), this->value(to), progress);
     655        (destination->*this->m_setter)(blendedValue > 1 ? blendedValue : 1);
     656    }
     657};
     658
     659template <typename T>
    642660class DiscretePropertyWrapper : public PropertyWrapperGetter<T> {
    643661    WTF_MAKE_FAST_ALLOCATED;
     
    19471965        new PropertyWrapper<float>(CSSPropertyWebkitBorderVerticalSpacing, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing),
    19481966        new AutoPropertyWrapper<int>(CSSPropertyZIndex, &RenderStyle::specifiedZIndex, &RenderStyle::setSpecifiedZIndex, &RenderStyle::hasAutoSpecifiedZIndex, &RenderStyle::setHasAutoSpecifiedZIndex),
    1949         new PropertyWrapper<unsigned short>(CSSPropertyOrphans, &RenderStyle::orphans, &RenderStyle::setOrphans),
    1950         new PropertyWrapper<unsigned short>(CSSPropertyWidows, &RenderStyle::widows, &RenderStyle::setWidows),
     1967        new PositivePropertyWrapper<unsigned short>(CSSPropertyOrphans, &RenderStyle::orphans, &RenderStyle::setOrphans),
     1968        new PositivePropertyWrapper<unsigned short>(CSSPropertyWidows, &RenderStyle::widows, &RenderStyle::setWidows),
    19511969        new LengthPropertyWrapper(CSSPropertyLineHeight, &RenderStyle::specifiedLineHeight, &RenderStyle::setLineHeight),
    19521970        new PropertyWrapper<float>(CSSPropertyOutlineOffset, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset),
Note: See TracChangeset for help on using the changeset viewer.