OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 switch (type) { | 106 switch (type) { |
107 case CSSPrimitiveValue::UnitType::Pixels: | 107 case CSSPrimitiveValue::UnitType::Pixels: |
108 if (!m_pixelValueCache[intValue]) | 108 if (!m_pixelValueCache[intValue]) |
109 m_pixelValueCache[intValue] = CSSPrimitiveValue::create(value, type) ; | 109 m_pixelValueCache[intValue] = CSSPrimitiveValue::create(value, type) ; |
110 return m_pixelValueCache[intValue]; | 110 return m_pixelValueCache[intValue]; |
111 case CSSPrimitiveValue::UnitType::Percentage: | 111 case CSSPrimitiveValue::UnitType::Percentage: |
112 if (!m_percentValueCache[intValue]) | 112 if (!m_percentValueCache[intValue]) |
113 m_percentValueCache[intValue] = CSSPrimitiveValue::create(value, typ e); | 113 m_percentValueCache[intValue] = CSSPrimitiveValue::create(value, typ e); |
114 return m_percentValueCache[intValue]; | 114 return m_percentValueCache[intValue]; |
115 case CSSPrimitiveValue::UnitType::Number: | 115 case CSSPrimitiveValue::UnitType::Number: |
116 case CSSPrimitiveValue::UnitType::Integer: | |
Timothy Loh
2015/10/29 02:38:05
This bit seems a bit weird, but I think it's okay
| |
116 if (!m_numberValueCache[intValue]) | 117 if (!m_numberValueCache[intValue]) |
117 m_numberValueCache[intValue] = CSSPrimitiveValue::create(value, type ); | 118 m_numberValueCache[intValue] = CSSPrimitiveValue::create(value, CSSP rimitiveValue::UnitType::Integer); |
118 return m_numberValueCache[intValue]; | 119 return m_numberValueCache[intValue]; |
119 default: | 120 default: |
120 return CSSPrimitiveValue::create(value, type); | 121 return CSSPrimitiveValue::create(value, type); |
121 } | 122 } |
122 } | 123 } |
123 | 124 |
124 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSValuePool::createValue(const Length & value, const ComputedStyle& style) | 125 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSValuePool::createValue(const Length & value, const ComputedStyle& style) |
125 { | 126 { |
126 return CSSPrimitiveValue::create(value, style.effectiveZoom()); | 127 return CSSPrimitiveValue::create(value, style.effectiveZoom()); |
127 } | 128 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 visitor->trace(m_colorBlack); | 165 visitor->trace(m_colorBlack); |
165 visitor->trace(m_pixelValueCache); | 166 visitor->trace(m_pixelValueCache); |
166 visitor->trace(m_percentValueCache); | 167 visitor->trace(m_percentValueCache); |
167 visitor->trace(m_numberValueCache); | 168 visitor->trace(m_numberValueCache); |
168 visitor->trace(m_fontFaceValueCache); | 169 visitor->trace(m_fontFaceValueCache); |
169 visitor->trace(m_fontFamilyValueCache); | 170 visitor->trace(m_fontFamilyValueCache); |
170 #endif | 171 #endif |
171 } | 172 } |
172 | 173 |
173 } | 174 } |
OLD | NEW |