Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2775143002: Implement frames() timing function (Closed)
Patch Set: Fix behaviour outside input range [0,1] Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 7 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
8 * Copyright (C) 2015 Google Inc. All rights reserved. 8 * Copyright (C) 2015 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 position == StepsTimingFunction::StepPosition::END); 1343 position == StepsTimingFunction::StepPosition::END);
1344 1344
1345 if (steps > 1) 1345 if (steps > 1)
1346 return CSSStepsTimingFunctionValue::Create(steps, position); 1346 return CSSStepsTimingFunctionValue::Create(steps, position);
1347 CSSValueID value_id = position == StepsTimingFunction::StepPosition::START 1347 CSSValueID value_id = position == StepsTimingFunction::StepPosition::START
1348 ? CSSValueStepStart 1348 ? CSSValueStepStart
1349 : CSSValueStepEnd; 1349 : CSSValueStepEnd;
1350 return CSSIdentifierValue::Create(value_id); 1350 return CSSIdentifierValue::Create(value_id);
1351 } 1351 }
1352 1352
1353 case TimingFunction::Type::FRAMES: {
1354 const FramesTimingFunction* frames_timing_function =
1355 ToFramesTimingFunction(timing_function);
1356 int frames = frames_timing_function->NumberOfFrames();
1357 return CSSFramesTimingFunctionValue::Create(frames);
1358 }
1359
1353 default: 1360 default:
1354 return CSSIdentifierValue::Create(CSSValueLinear); 1361 return CSSIdentifierValue::Create(CSSValueLinear);
1355 } 1362 }
1356 } 1363 }
1357 1364
1358 static CSSValue* ValueForAnimationTimingFunction( 1365 static CSSValue* ValueForAnimationTimingFunction(
1359 const CSSTimingData* timing_data) { 1366 const CSSTimingData* timing_data) {
1360 CSSValueList* list = CSSValueList::CreateCommaSeparated(); 1367 CSSValueList* list = CSSValueList::CreateCommaSeparated();
1361 if (timing_data) { 1368 if (timing_data) {
1362 for (size_t i = 0; i < timing_data->TimingFunctionList().size(); ++i) 1369 for (size_t i = 0; i < timing_data->TimingFunctionList().size(); ++i)
(...skipping 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after
3743 case CSSPropertyAll: 3750 case CSSPropertyAll:
3744 return nullptr; 3751 return nullptr;
3745 default: 3752 default:
3746 break; 3753 break;
3747 } 3754 }
3748 NOTREACHED(); 3755 NOTREACHED();
3749 return nullptr; 3756 return nullptr;
3750 } 3757 }
3751 3758
3752 } // namespace blink 3759 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698