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

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

Issue 293113007: Simplify animation/transition parsing slightly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 if (primitiveValue->getValueID() == CSSValueNone) 389 if (primitiveValue->getValueID() == CSSValueNone)
390 return CSSTransitionData::TransitionProperty(CSSTransitionData::Transiti onNone); 390 return CSSTransitionData::TransitionProperty(CSSTransitionData::Transiti onNone);
391 return CSSTransitionData::TransitionProperty(primitiveValue->getPropertyID() ); 391 return CSSTransitionData::TransitionProperty(primitiveValue->getPropertyID() );
392 } 392 }
393 393
394 PassRefPtr<TimingFunction> CSSToStyleMap::mapAnimationTimingFunction(CSSValue* v alue, bool allowStepMiddle) 394 PassRefPtr<TimingFunction> CSSToStyleMap::mapAnimationTimingFunction(CSSValue* v alue, bool allowStepMiddle)
395 { 395 {
396 // FIXME: We should probably only call into this function with a valid 396 // FIXME: We should probably only call into this function with a valid
397 // single timing function value which isn't initial or inherit. We can 397 // single timing function value which isn't initial or inherit. We can
398 // currently get into here with initial since the parser expands unset 398 // currently get into here with initial since the parser expands unset
399 // properties in shorthands to initial and we can get into here with a 399 // properties in shorthands to initial.
400 // value list via the EffectInput/TimingInput code paths.
401 400
402 if (value->isPrimitiveValue()) { 401 if (value->isPrimitiveValue()) {
403 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 402 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
404 switch (primitiveValue->getValueID()) { 403 switch (primitiveValue->getValueID()) {
405 case CSSValueLinear: 404 case CSSValueLinear:
406 return LinearTimingFunction::shared(); 405 return LinearTimingFunction::shared();
407 case CSSValueEase: 406 case CSSValueEase:
408 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: Ease); 407 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: Ease);
409 case CSSValueEaseIn: 408 case CSSValueEaseIn:
410 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: EaseIn); 409 return CubicBezierTimingFunction::preset(CubicBezierTimingFunction:: EaseIn);
(...skipping 13 matching lines...) Expand all
424 ASSERT_NOT_REACHED(); 423 ASSERT_NOT_REACHED();
425 return CSSTimingData::initialTimingFunction(); 424 return CSSTimingData::initialTimingFunction();
426 } 425 }
427 } 426 }
428 427
429 if (value->isCubicBezierTimingFunctionValue()) { 428 if (value->isCubicBezierTimingFunctionValue()) {
430 CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezie rTimingFunctionValue(value); 429 CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezie rTimingFunctionValue(value);
431 return CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubi cTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2()); 430 return CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubi cTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2());
432 } 431 }
433 432
434 if (!value->isStepsTimingFunctionValue()) 433 if (value->isInitialValue())
435 return CSSTimingData::initialTimingFunction(); 434 return CSSTimingData::initialTimingFunction();
436 435
437 CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunctionV alue(value); 436 CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunctionV alue(value);
438 if (stepsTimingFunction->stepAtPosition() == StepsTimingFunction::StepAtMidd le && !allowStepMiddle) 437 if (stepsTimingFunction->stepAtPosition() == StepsTimingFunction::StepAtMidd le && !allowStepMiddle)
439 return CSSTimingData::initialTimingFunction(); 438 return CSSTimingData::initialTimingFunction();
440 return StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), ste psTimingFunction->stepAtPosition()); 439 return StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), ste psTimingFunction->stepAtPosition());
441 } 440 }
442 441
443 void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID p roperty, CSSValue* value, NinePieceImage& image) 442 void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID p roperty, CSSValue* value, NinePieceImage& image)
444 { 443 {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 verticalRule = SpaceImageRule; 601 verticalRule = SpaceImageRule;
603 break; 602 break;
604 default: // CSSValueRepeat 603 default: // CSSValueRepeat
605 verticalRule = RepeatImageRule; 604 verticalRule = RepeatImageRule;
606 break; 605 break;
607 } 606 }
608 image.setVerticalRule(verticalRule); 607 image.setVerticalRule(verticalRule);
609 } 608 }
610 609
611 }; 610 };
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698