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

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

Issue 2775143002: Implement frames() timing function (Closed)
Patch Set: 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 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 position == StepsTimingFunction::StepPosition::END); 1324 position == StepsTimingFunction::StepPosition::END);
1325 1325
1326 if (steps > 1) 1326 if (steps > 1)
1327 return CSSStepsTimingFunctionValue::create(steps, position); 1327 return CSSStepsTimingFunctionValue::create(steps, position);
1328 CSSValueID valueId = position == StepsTimingFunction::StepPosition::START 1328 CSSValueID valueId = position == StepsTimingFunction::StepPosition::START
1329 ? CSSValueStepStart 1329 ? CSSValueStepStart
1330 : CSSValueStepEnd; 1330 : CSSValueStepEnd;
1331 return CSSIdentifierValue::create(valueId); 1331 return CSSIdentifierValue::create(valueId);
1332 } 1332 }
1333 1333
1334 case TimingFunction::Type::FRAMES: {
1335 const FramesTimingFunction* framesTimingFunction =
1336 toFramesTimingFunction(timingFunction);
1337 int frames = framesTimingFunction->numberOfFrames();
1338 return CSSFramesTimingFunctionValue::create(frames);
1339 }
1340
1334 default: 1341 default:
1335 return CSSIdentifierValue::create(CSSValueLinear); 1342 return CSSIdentifierValue::create(CSSValueLinear);
1336 } 1343 }
1337 } 1344 }
1338 1345
1339 static CSSValue* valueForAnimationTimingFunction( 1346 static CSSValue* valueForAnimationTimingFunction(
1340 const CSSTimingData* timingData) { 1347 const CSSTimingData* timingData) {
1341 CSSValueList* list = CSSValueList::createCommaSeparated(); 1348 CSSValueList* list = CSSValueList::createCommaSeparated();
1342 if (timingData) { 1349 if (timingData) {
1343 for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i) 1350 for (size_t i = 0; i < timingData->timingFunctionList().size(); ++i)
(...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after
3691 case CSSPropertyAll: 3698 case CSSPropertyAll:
3692 return nullptr; 3699 return nullptr;
3693 default: 3700 default:
3694 break; 3701 break;
3695 } 3702 }
3696 ASSERT_NOT_REACHED(); 3703 ASSERT_NOT_REACHED();
3697 return nullptr; 3704 return nullptr;
3698 } 3705 }
3699 3706
3700 } // namespace blink 3707 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698