| OLD | NEW |
| 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 16 matching lines...) Expand all Loading... |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #ifndef CSSPrimitiveValueMappings_h | 30 #ifndef CSSPrimitiveValueMappings_h |
| 31 #define CSSPrimitiveValueMappings_h | 31 #define CSSPrimitiveValueMappings_h |
| 32 | 32 |
| 33 #include "CSSValueKeywords.h" | 33 #include "CSSValueKeywords.h" |
| 34 #include "core/css/CSSCalculationValue.h" | 34 #include "core/css/CSSCalculationValue.h" |
| 35 #include "core/css/CSSPrimitiveValue.h" | 35 #include "core/css/CSSPrimitiveValue.h" |
| 36 #include "core/css/CSSReflectionDirection.h" | 36 #include "core/css/CSSReflectionDirection.h" |
| 37 #include "core/platform/graphics/ColorSpace.h" | |
| 38 #include "core/platform/graphics/FontDescription.h" | 37 #include "core/platform/graphics/FontDescription.h" |
| 39 #include "core/platform/graphics/FontSmoothingMode.h" | 38 #include "core/platform/graphics/FontSmoothingMode.h" |
| 40 #include "core/platform/graphics/GraphicsTypes.h" | 39 #include "core/platform/graphics/GraphicsTypes.h" |
| 41 #include "core/platform/Length.h" | 40 #include "core/platform/Length.h" |
| 42 #include "core/platform/ThemeTypes.h" | 41 #include "core/platform/ThemeTypes.h" |
| 43 #include "core/platform/graphics/Path.h" | 42 #include "core/platform/graphics/Path.h" |
| 44 #include "core/platform/graphics/TextRenderingMode.h" | 43 #include "core/platform/graphics/TextRenderingMode.h" |
| 45 #include "core/platform/text/TextDirection.h" | 44 #include "core/platform/text/TextDirection.h" |
| 46 #include "core/platform/text/UnicodeBidi.h" | 45 #include "core/platform/text/UnicodeBidi.h" |
| 47 #include "core/platform/text/WritingMode.h" | 46 #include "core/platform/text/WritingMode.h" |
| (...skipping 3316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3364 case CSSValueOptimizelegibility: | 3363 case CSSValueOptimizelegibility: |
| 3365 return OptimizeLegibility; | 3364 return OptimizeLegibility; |
| 3366 case CSSValueGeometricprecision: | 3365 case CSSValueGeometricprecision: |
| 3367 return GeometricPrecision; | 3366 return GeometricPrecision; |
| 3368 } | 3367 } |
| 3369 | 3368 |
| 3370 ASSERT_NOT_REACHED(); | 3369 ASSERT_NOT_REACHED(); |
| 3371 return AutoTextRendering; | 3370 return AutoTextRendering; |
| 3372 } | 3371 } |
| 3373 | 3372 |
| 3374 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColorSpace space) | |
| 3375 : CSSValue(PrimitiveClass) | |
| 3376 { | |
| 3377 m_primitiveUnitType = CSS_IDENT; | |
| 3378 switch (space) { | |
| 3379 case ColorSpaceDeviceRGB: | |
| 3380 m_value.ident = CSSValueDefault; | |
| 3381 break; | |
| 3382 case ColorSpaceSRGB: | |
| 3383 m_value.ident = CSSValueSrgb; | |
| 3384 break; | |
| 3385 case ColorSpaceLinearRGB: | |
| 3386 // CSS color correction does not support linearRGB yet. | |
| 3387 ASSERT_NOT_REACHED(); | |
| 3388 m_value.ident = CSSValueDefault; | |
| 3389 break; | |
| 3390 } | |
| 3391 } | |
| 3392 | |
| 3393 template<> inline CSSPrimitiveValue::operator ColorSpace() const | |
| 3394 { | |
| 3395 switch (m_value.ident) { | |
| 3396 case CSSValueDefault: | |
| 3397 return ColorSpaceDeviceRGB; | |
| 3398 case CSSValueSrgb: | |
| 3399 return ColorSpaceSRGB; | |
| 3400 } | |
| 3401 | |
| 3402 ASSERT_NOT_REACHED(); | |
| 3403 return ColorSpaceDeviceRGB; | |
| 3404 } | |
| 3405 | |
| 3406 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Hyphens hyphens) | 3373 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Hyphens hyphens) |
| 3407 : CSSValue(PrimitiveClass) | 3374 : CSSValue(PrimitiveClass) |
| 3408 { | 3375 { |
| 3409 m_primitiveUnitType = CSS_IDENT; | 3376 m_primitiveUnitType = CSS_IDENT; |
| 3410 switch (hyphens) { | 3377 switch (hyphens) { |
| 3411 case HyphensNone: | 3378 case HyphensNone: |
| 3412 m_value.ident = CSSValueNone; | 3379 m_value.ident = CSSValueNone; |
| 3413 break; | 3380 break; |
| 3414 case HyphensManual: | 3381 case HyphensManual: |
| 3415 m_value.ident = CSSValueManual; | 3382 m_value.ident = CSSValueManual; |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4517 return TouchActionAuto; | 4484 return TouchActionAuto; |
| 4518 } | 4485 } |
| 4519 | 4486 |
| 4520 ASSERT_NOT_REACHED(); | 4487 ASSERT_NOT_REACHED(); |
| 4521 return TouchActionNone; | 4488 return TouchActionNone; |
| 4522 } | 4489 } |
| 4523 | 4490 |
| 4524 } | 4491 } |
| 4525 | 4492 |
| 4526 #endif | 4493 #endif |
| OLD | NEW |