File tree 6 files changed +39
-3
lines changed
LayoutTests/virtual/stable/animations-unprefixed
6 files changed +39
-3
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < script src ="../../../resources/testharness.js "> </ script >
3
+ < script src ="../../../resources/testharnessreport.js "> </ script >
4
+
5
+ < style >
6
+ # target {
7
+ transition-timing-function : frames (4 );
8
+ animation-timing-function : frames (4 );
9
+ }
10
+ </ style >
11
+
12
+ < div id ="target "> </ div >
13
+
14
+ < script >
15
+ test ( function ( ) {
16
+ assert_equals ( getComputedStyle ( target ) . transitionTimingFunction , 'ease' ) ;
17
+ assert_equals ( getComputedStyle ( target ) . animationTimingFunction , 'ease' ) ;
18
+ } , 'The frames() timing function is still experimental and should not be exposed to stable.' ) ;
19
+ </ script >
Original file line number Diff line number Diff line change 27
27
#define CSSTimingFunctionValue_h
28
28
29
29
#include " core/css/CSSValue.h"
30
+ #include " platform/RuntimeEnabledFeatures.h"
30
31
#include " platform/animation/TimingFunction.h"
31
32
#include " platform/wtf/PassRefPtr.h"
32
33
@@ -124,7 +125,9 @@ class CSSFramesTimingFunctionValue : public CSSValue {
124
125
125
126
private:
126
127
CSSFramesTimingFunctionValue (int frames)
127
- : CSSValue(kFramesTimingFunctionClass ), frames_(frames) {}
128
+ : CSSValue(kFramesTimingFunctionClass ), frames_(frames) {
129
+ DCHECK (RuntimeEnabledFeatures::FramesTimingFunctionEnabled ());
130
+ }
128
131
129
132
int frames_;
130
133
};
Original file line number Diff line number Diff line change @@ -396,8 +396,10 @@ static CSSValue* ConsumeAnimationTimingFunction(CSSParserTokenRange& range) {
396
396
CSSValueID function = range.Peek ().FunctionId ();
397
397
if (function == CSSValueSteps)
398
398
return ConsumeSteps (range);
399
- if (function == CSSValueFrames)
399
+ if (RuntimeEnabledFeatures::FramesTimingFunctionEnabled () &&
400
+ function == CSSValueFrames) {
400
401
return ConsumeFrames (range);
402
+ }
401
403
if (function == CSSValueCubicBezier)
402
404
return ConsumeCubicBezier (range);
403
405
return nullptr ;
Original file line number Diff line number Diff line change 460
460
settable_from_internals : true ,
461
461
status : "experimental" ,
462
462
} ,
463
+ {
464
+ name : "FramesTimingFunction" ,
465
+ status : "experimental" ,
466
+ } ,
463
467
{
464
468
name : "FrameTimingSupport" ,
465
469
status : "experimental" ,
Original file line number Diff line number Diff line change 27
27
28
28
#include " cc/animation/timing_function.h"
29
29
#include " platform/PlatformExport.h"
30
+ #include " platform/RuntimeEnabledFeatures.h"
30
31
#include " platform/wtf/Assertions.h"
31
32
#include " platform/wtf/PassRefPtr.h"
32
33
#include " platform/wtf/RefCounted.h"
@@ -214,7 +215,9 @@ class PLATFORM_EXPORT FramesTimingFunction final : public TimingFunction {
214
215
private:
215
216
FramesTimingFunction (int frames)
216
217
: TimingFunction(Type::FRAMES),
217
- frames_ (cc::FramesTimingFunction::Create(frames)) {}
218
+ frames_ (cc::FramesTimingFunction::Create(frames)) {
219
+ DCHECK (RuntimeEnabledFeatures::FramesTimingFunctionEnabled ());
220
+ }
218
221
219
222
std::unique_ptr<cc::FramesTimingFunction> frames_;
220
223
};
Original file line number Diff line number Diff line change 32
32
33
33
#include < sstream>
34
34
#include < string>
35
+ #include " platform/RuntimeEnabledFeatures.h"
35
36
#include " platform/wtf/text/WTFString.h"
36
37
#include " testing/gmock/include/gmock/gmock.h"
37
38
#include " testing/gtest/include/gtest/gtest.h"
@@ -51,6 +52,10 @@ namespace {
51
52
52
53
class TimingFunctionTest : public ::testing::Test {
53
54
public:
55
+ TimingFunctionTest () {
56
+ RuntimeEnabledFeatures::SetFramesTimingFunctionEnabled (true );
57
+ }
58
+
54
59
void NotEqualHelperLoop (
55
60
Vector<std::pair<std::string, RefPtr<TimingFunction>>>& v) {
56
61
for (size_t i = 0 ; i < v.size (); ++i) {
You can’t perform that action at this time.
0 commit comments