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

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: Merged patch into fresh branch (to avoid scary rebase) Created 6 years, 9 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 break; 472 break;
473 case CSSValueEaseOut: 473 case CSSValueEaseOut:
474 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: EaseOut); 474 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: EaseOut);
475 break; 475 break;
476 case CSSValueEaseInOut: 476 case CSSValueEaseInOut:
477 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: EaseInOut); 477 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: EaseInOut);
478 break; 478 break;
479 case CSSValueStepStart: 479 case CSSValueStepStart:
480 return StepsTimingFunction::preset(StepsTimingFunction::Start); 480 return StepsTimingFunction::preset(StepsTimingFunction::Start);
481 break; 481 break;
482 case CSSValueStepMiddle:
483 return StepsTimingFunction::preset(StepsTimingFunction::Middle);
484 break;
482 case CSSValueStepEnd: 485 case CSSValueStepEnd:
483 return StepsTimingFunction::preset(StepsTimingFunction::End); 486 return StepsTimingFunction::preset(StepsTimingFunction::End);
484 break; 487 break;
485 default: 488 default:
486 break; 489 break;
487 } 490 }
488 return nullptr; 491 return nullptr;
489 } 492 }
490 493
491 if (value->isCubicBezierTimingFunctionValue()) { 494 if (value->isCubicBezierTimingFunctionValue()) {
492 CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezie rTimingFunctionValue(value); 495 CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezie rTimingFunctionValue(value);
493 return CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubi cTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2()); 496 return CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubi cTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2());
494 } else if (value->isStepsTimingFunctionValue()) { 497 } else if (value->isStepsTimingFunctionValue()) {
495 CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunct ionValue(value); 498 CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunct ionValue(value);
496 return StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtStart()); 499 return StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtPosition());
497 } 500 }
498 501
499 return nullptr; 502 return nullptr;
500 } 503 }
501 504
502 void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSV alue* value) const 505 void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSV alue* value) const
503 { 506 {
504 RefPtr<TimingFunction> timingFunction = animationTimingFunction(value, true) ; 507 RefPtr<TimingFunction> timingFunction = animationTimingFunction(value, true) ;
505 if (timingFunction) 508 if (timingFunction) {
506 animation->setTimingFunction(timingFunction); 509 // Step middle timing functions are supported up to this point for use i n the Web Animations API,
510 // but should not be supported for CSS Animations and Transitions.
511 bool isStepMiddleFunction = (timingFunction->type() == TimingFunction::S tepsFunction) && (toStepsTimingFunction(*timingFunction).stepAtPosition() == Ste psTimingFunction::StepAtMiddle);
512 if (isStepMiddleFunction)
513 animation->setTimingFunction(CubicBezierTimingFunction::preset(Cubic BezierTimingFunction::Ease));
514 else
515 animation->setTimingFunction(timingFunction);
516 }
507 } 517 }
508 518
509 void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID p roperty, CSSValue* value, NinePieceImage& image) 519 void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID p roperty, CSSValue* value, NinePieceImage& image)
510 { 520 {
511 // If we're not a value list, then we are "none" and don't need to alter the empty image at all. 521 // If we're not a value list, then we are "none" and don't need to alter the empty image at all.
512 if (!value || !value->isValueList()) 522 if (!value || !value->isValueList())
513 return; 523 return;
514 524
515 // Retrieve the border image value. 525 // Retrieve the border image value.
516 CSSValueList* borderImage = toCSSValueList(value); 526 CSSValueList* borderImage = toCSSValueList(value);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 verticalRule = SpaceImageRule; 678 verticalRule = SpaceImageRule;
669 break; 679 break;
670 default: // CSSValueRepeat 680 default: // CSSValueRepeat
671 verticalRule = RepeatImageRule; 681 verticalRule = RepeatImageRule;
672 break; 682 break;
673 } 683 }
674 image.setVerticalRule(verticalRule); 684 image.setVerticalRule(verticalRule);
675 } 685 }
676 686
677 }; 687 };
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/platform/animation/TimingFunction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698