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

Side by Side Diff: Source/core/css/resolver/CSSToStyleMap.cpp

Issue 149363002: Web Animations API: Implement step-middle and steps(x, middle) timing functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix TimingFunctionTestHelperTest Created 6 years, 10 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 break; 468 break;
469 case CSSValueEaseOut: 469 case CSSValueEaseOut:
470 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: EaseOut); 470 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: EaseOut);
471 break; 471 break;
472 case CSSValueEaseInOut: 472 case CSSValueEaseInOut:
473 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: EaseInOut); 473 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: EaseInOut);
474 break; 474 break;
475 case CSSValueStepStart: 475 case CSSValueStepStart:
476 return StepsTimingFunction::preset(StepsTimingFunction::Start); 476 return StepsTimingFunction::preset(StepsTimingFunction::Start);
477 break; 477 break;
478 case CSSValueStepMiddle:
479 return StepsTimingFunction::preset(StepsTimingFunction::Middle);
480 break;
478 case CSSValueStepEnd: 481 case CSSValueStepEnd:
479 return StepsTimingFunction::preset(StepsTimingFunction::End); 482 return StepsTimingFunction::preset(StepsTimingFunction::End);
480 break; 483 break;
481 default: 484 default:
482 break; 485 break;
483 } 486 }
484 return 0; 487 return 0;
485 } 488 }
486 489
487 if (value->isCubicBezierTimingFunctionValue()) { 490 if (value->isCubicBezierTimingFunctionValue()) {
488 CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezie rTimingFunctionValue(value); 491 CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezie rTimingFunctionValue(value);
489 return CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubi cTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2()); 492 return CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubi cTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2());
490 } else if (value->isStepsTimingFunctionValue()) { 493 } else if (value->isStepsTimingFunctionValue()) {
491 CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunct ionValue(value); 494 CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunct ionValue(value);
492 return StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtStart()); 495 return StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtPosition());
493 } 496 }
494 497
495 return 0; 498 return 0;
496 } 499 }
497 500
498 void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSV alue* value) const 501 void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSV alue* value) const
499 { 502 {
500 RefPtr<TimingFunction> timingFunction = animationTimingFunction(value, true) ; 503 RefPtr<TimingFunction> timingFunction = animationTimingFunction(value, true) ;
501 if (timingFunction) 504 if (timingFunction) {
502 animation->setTimingFunction(timingFunction); 505 bool isStepMiddleFunction = (timingFunction->type() == TimingFunction::S tepsFunction) && (toStepsTimingFunction(*timingFunction).stepAtPosition() == Ste psTimingFunction::StepAtMiddle);
506 if (!isStepMiddleFunction)
dstockwell 2014/02/24 04:58:40 need a fixme about why
rjwright 2014/02/24 11:17:46 Done as comment. Do you want it to be a fixme?
507 animation->setTimingFunction(timingFunction);
508 }
503 } 509 }
504 510
505 void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID p roperty, CSSValue* value, NinePieceImage& image) 511 void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID p roperty, CSSValue* value, NinePieceImage& image)
506 { 512 {
507 // If we're not a value list, then we are "none" and don't need to alter the empty image at all. 513 // If we're not a value list, then we are "none" and don't need to alter the empty image at all.
508 if (!value || !value->isValueList()) 514 if (!value || !value->isValueList())
509 return; 515 return;
510 516
511 // Retrieve the border image value. 517 // Retrieve the border image value.
512 CSSValueList* borderImage = toCSSValueList(value); 518 CSSValueList* borderImage = toCSSValueList(value);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 verticalRule = SpaceImageRule; 670 verticalRule = SpaceImageRule;
665 break; 671 break;
666 default: // CSSValueRepeat 672 default: // CSSValueRepeat
667 verticalRule = RepeatImageRule; 673 verticalRule = RepeatImageRule;
668 break; 674 break;
669 } 675 }
670 image.setVerticalRule(verticalRule); 676 image.setVerticalRule(verticalRule);
671 } 677 }
672 678
673 }; 679 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698