Add support for the frames() timing function
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jan 2018 13:26:50 +0000 (13:26 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jan 2018 13:26:50 +0000 (13:26 +0000)
commitf805475fcac0391754ff335ec763096d309b6085
treec90e2a35db7162460d034ae38d5203ed489537ad
parent4c8b89220d7c7d6ebb5e5cd119415f35b7778b53
Add support for the frames() timing function
https://bugs.webkit.org/show_bug.cgi?id=181585
<rdar://problem/36463317>

Reviewed by Dean.

Source/WebCore:

Implement the frames() timing function as specified in the CSS Timing Functions Level 1
specification, specifically https://www.w3.org/TR/css-timing-1/#frames-timing-functions.
A frames timing function is a type of timing function that divides the input time into a
specified number of intervals of equal length.

Test: transitions/frames-timing-function.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSFramesTimingFunctionValue::customCSSText const):
(WebCore::CSSFramesTimingFunctionValue::equals const):
* css/CSSTimingFunctionValue.h:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isFramesTimingFunctionValue const):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSteps):
(WebCore::consumeFrames):
(WebCore::consumeAnimationTimingFunction):
* platform/animation/TimingFunction.cpp:
(WebCore::operator<<):
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
(WebCore::TimingFunction::isFramesTimingFunction const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::animationHasFramesTimingFunction):
(WebCore::GraphicsLayerCA::animationCanBeAccelerated const):

Source/WebKit:

Add the ability to endode and decode the frames() timing function.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FramesTimingFunction>::encode):
(IPC::ArgumentCoder<FramesTimingFunction>::decode):
* Shared/WebCoreArgumentCoders.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::PlatformCAAnimationRemote::Properties::encode const):
(WebKit::PlatformCAAnimationRemote::Properties::decode):

LayoutTests:

Add a new test that checks that the frames() timing function applies as expected
and expand an existing test to check that the frames() timing function is parsed
correctly. We also mark progressions in imported WPT tests.

* imported/w3c/web-platform-tests/css-timing-1/frames-timing-functions-output-expected.txt:
* imported/w3c/web-platform-tests/css-timing-1/frames-timing-functions-syntax-expected.txt:
* transitions/frames-timing-function-expected.txt: Added.
* transitions/frames-timing-function.html: Added.
* transitions/transitions-parsing-expected.txt:
* transitions/transitions-parsing.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css-timing-1/frames-timing-functions-output-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css-timing-1/frames-timing-functions-syntax-expected.txt
LayoutTests/transitions/frames-timing-function-expected.txt [new file with mode: 0644]
LayoutTests/transitions/frames-timing-function.html [new file with mode: 0644]
LayoutTests/transitions/transitions-parsing-expected.txt
LayoutTests/transitions/transitions-parsing.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSTimingFunctionValue.cpp
Source/WebCore/css/CSSTimingFunctionValue.h
Source/WebCore/css/CSSToStyleMap.cpp
Source/WebCore/css/CSSValue.cpp
Source/WebCore/css/CSSValue.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/platform/animation/TimingFunction.cpp
Source/WebCore/platform/animation/TimingFunction.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/Shared/WebCoreArgumentCoders.h
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm