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

Side by Side Diff: Source/core/css/CSSPrimitiveValueMappings.h

Issue 22482004: Add support for the object-fit CSS property. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Oops, sorry! Forgot to update UseCounter.cpp Created 7 years, 4 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) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 3341 matching lines...) Expand 10 before | Expand all | Expand 10 after
3352 case CSSValueNone: 3352 case CSSValueNone:
3353 return FontDescription::NoneKerning; 3353 return FontDescription::NoneKerning;
3354 default: 3354 default:
3355 break; 3355 break;
3356 } 3356 }
3357 3357
3358 ASSERT_NOT_REACHED(); 3358 ASSERT_NOT_REACHED();
3359 return FontDescription::AutoKerning; 3359 return FontDescription::AutoKerning;
3360 } 3360 }
3361 3361
3362 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EObjectFit e)
3363 : CSSValue(PrimitiveClass)
3364 {
3365 m_primitiveUnitType = CSS_VALUE_ID;
3366 switch (e) {
3367 case ObjectFitFill:
3368 m_value.valueID = CSSValueFill;
3369 break;
3370 case ObjectFitContain:
3371 m_value.valueID = CSSValueContain;
3372 break;
3373 case ObjectFitCover:
3374 m_value.valueID = CSSValueCover;
3375 break;
3376 case ObjectFitNone:
3377 m_value.valueID = CSSValueNone;
3378 break;
3379 case ObjectFitScaleDown:
3380 m_value.valueID = CSSValueScaleDown;
3381 break;
3382 }
3383 }
3384
3385 template<> inline CSSPrimitiveValue::operator EObjectFit() const
3386 {
3387 switch (m_value.valueID) {
3388 case CSSValueFill:
3389 return ObjectFitFill;
3390 case CSSValueContain:
3391 return ObjectFitContain;
3392 case CSSValueCover:
3393 return ObjectFitCover;
3394 case CSSValueNone:
3395 return ObjectFitNone;
3396 case CSSValueScaleDown:
3397 return ObjectFitScaleDown;
3398 default:
3399 ASSERT_NOT_REACHED();
3400 return ObjectFitFill;
3401 }
3402 }
3403
3362 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmoothingMode smoothi ng) 3404 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmoothingMode smoothi ng)
3363 : CSSValue(PrimitiveClass) 3405 : CSSValue(PrimitiveClass)
3364 { 3406 {
3365 m_primitiveUnitType = CSS_VALUE_ID; 3407 m_primitiveUnitType = CSS_VALUE_ID;
3366 switch (smoothing) { 3408 switch (smoothing) {
3367 case AutoSmoothing: 3409 case AutoSmoothing:
3368 m_value.valueID = CSSValueAuto; 3410 m_value.valueID = CSSValueAuto;
3369 return; 3411 return;
3370 case NoSmoothing: 3412 case NoSmoothing:
3371 m_value.valueID = CSSValueNone; 3413 m_value.valueID = CSSValueNone;
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after
4744 break; 4786 break;
4745 } 4787 }
4746 4788
4747 ASSERT_NOT_REACHED(); 4789 ASSERT_NOT_REACHED();
4748 return TouchActionNone; 4790 return TouchActionNone;
4749 } 4791 }
4750 4792
4751 } 4793 }
4752 4794
4753 #endif 4795 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698