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

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

Issue 25497002: Generate toCSSFooValue() for CSS child values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/CSSPrimitiveValue.h ('k') | Source/core/css/CSSTransformValue.h » ('j') | 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 { 301 {
302 EMaskSourceType type = FillLayer::initialFillMaskSourceType(layer->type()); 302 EMaskSourceType type = FillLayer::initialFillMaskSourceType(layer->type());
303 if (value->isInitialValue()) { 303 if (value->isInitialValue()) {
304 layer->setMaskSourceType(type); 304 layer->setMaskSourceType(type);
305 return; 305 return;
306 } 306 }
307 307
308 if (!value->isPrimitiveValue()) 308 if (!value->isPrimitiveValue())
309 return; 309 return;
310 310
311 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 311 switch (toCSSPrimitiveValue(value)->getValueID()) {
312 switch (primitiveValue->getValueID()) {
313 case CSSValueAlpha: 312 case CSSValueAlpha:
314 type = MaskAlpha; 313 type = MaskAlpha;
315 break; 314 break;
316 case CSSValueLuminance: 315 case CSSValueLuminance:
317 type = MaskLuminance; 316 type = MaskLuminance;
318 break; 317 break;
319 case CSSValueAuto: 318 case CSSValueAuto:
320 break; 319 break;
321 default: 320 default:
322 ASSERT_NOT_REACHED(); 321 ASSERT_NOT_REACHED();
323 } 322 }
324 323
325 layer->setMaskSourceType(type); 324 layer->setMaskSourceType(type);
326 } 325 }
327 326
328 void CSSToStyleMap::mapAnimationDelay(CSSAnimationData* animation, CSSValue* val ue) const 327 void CSSToStyleMap::mapAnimationDelay(CSSAnimationData* animation, CSSValue* val ue) const
329 { 328 {
330 if (value->isInitialValue()) { 329 if (value->isInitialValue()) {
331 animation->setDelay(CSSAnimationData::initialAnimationDelay()); 330 animation->setDelay(CSSAnimationData::initialAnimationDelay());
332 return; 331 return;
333 } 332 }
334 333
335 if (!value->isPrimitiveValue()) 334 if (!value->isPrimitiveValue())
336 return; 335 return;
337 336
338 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 337 animation->setDelay(toCSSPrimitiveValue(value)->computeTime<double, CSSPrimi tiveValue::Seconds>());
339 animation->setDelay(primitiveValue->computeTime<double, CSSPrimitiveValue::S econds>());
340 } 338 }
341 339
342 void CSSToStyleMap::mapAnimationDirection(CSSAnimationData* layer, CSSValue* val ue) const 340 void CSSToStyleMap::mapAnimationDirection(CSSAnimationData* layer, CSSValue* val ue) const
343 { 341 {
344 if (value->isInitialValue()) { 342 if (value->isInitialValue()) {
345 layer->setDirection(CSSAnimationData::initialAnimationDirection()); 343 layer->setDirection(CSSAnimationData::initialAnimationDirection());
346 return; 344 return;
347 } 345 }
348 346
349 if (!value->isPrimitiveValue()) 347 if (!value->isPrimitiveValue())
350 return; 348 return;
351 349
352 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 350 switch (toCSSPrimitiveValue(value)->getValueID()) {
353 switch (primitiveValue->getValueID()) {
354 case CSSValueNormal: 351 case CSSValueNormal:
355 layer->setDirection(CSSAnimationData::AnimationDirectionNormal); 352 layer->setDirection(CSSAnimationData::AnimationDirectionNormal);
356 break; 353 break;
357 case CSSValueAlternate: 354 case CSSValueAlternate:
358 layer->setDirection(CSSAnimationData::AnimationDirectionAlternate); 355 layer->setDirection(CSSAnimationData::AnimationDirectionAlternate);
359 break; 356 break;
360 case CSSValueReverse: 357 case CSSValueReverse:
361 layer->setDirection(CSSAnimationData::AnimationDirectionReverse); 358 layer->setDirection(CSSAnimationData::AnimationDirectionReverse);
362 break; 359 break;
363 case CSSValueAlternateReverse: 360 case CSSValueAlternateReverse:
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 verticalRule = SpaceImageRule; 706 verticalRule = SpaceImageRule;
710 break; 707 break;
711 default: // CSSValueRepeat 708 default: // CSSValueRepeat
712 verticalRule = RepeatImageRule; 709 verticalRule = RepeatImageRule;
713 break; 710 break;
714 } 711 }
715 image.setVerticalRule(verticalRule); 712 image.setVerticalRule(verticalRule);
716 } 713 }
717 714
718 }; 715 };
OLDNEW
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/CSSTransformValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698