OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 Adobe Systems Incorporated. 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 } | 107 } |
108 | 108 |
109 return cssValuePool().createValue(Pair::create(cssValuePool().createValue(si de), amount.release(), Pair::KeepIdenticalValues)); | 109 return cssValuePool().createValue(Pair::create(cssValuePool().createValue(si de), amount.release(), Pair::KeepIdenticalValues)); |
110 } | 110 } |
111 | 111 |
112 String CSSBasicShapeCircle::cssText() const | 112 String CSSBasicShapeCircle::cssText() const |
113 { | 113 { |
114 RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCX = buildSerializablePositi onOffset(m_centerX, CSSValueLeft); | 114 RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCX = buildSerializablePositi onOffset(m_centerX, CSSValueLeft); |
115 RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCY = buildSerializablePositi onOffset(m_centerY, CSSValueTop); | 115 RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCY = buildSerializablePositi onOffset(m_centerY, CSSValueTop); |
116 | 116 |
117 return buildCircleString(m_radius ? m_radius->cssText() : String(), | 117 String radius; |
118 if (m_radius && m_radius->getValueID() != CSSValueClosestSide) | |
eseidel
2014/05/28 22:08:10
This smells odd. Why is CSSValueClosestSide speci
| |
119 radius = m_radius->cssText(); | |
120 | |
121 return buildCircleString(radius, | |
118 serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->ge tPairValue()), | 122 serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->ge tPairValue()), |
119 serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->ge tPairValue()), | 123 serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->ge tPairValue()), |
120 m_referenceBox ? m_referenceBox->cssText() : String()); | 124 m_referenceBox ? m_referenceBox->cssText() : String()); |
121 } | 125 } |
122 | 126 |
123 bool CSSBasicShapeCircle::equals(const CSSBasicShape& shape) const | 127 bool CSSBasicShapeCircle::equals(const CSSBasicShape& shape) const |
124 { | 128 { |
125 if (shape.type() != CSSBasicShapeCircleType) | 129 if (shape.type() != CSSBasicShapeCircleType) |
126 return false; | 130 return false; |
127 | 131 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 result.append(box); | 177 result.append(box); |
174 } | 178 } |
175 return result.toString(); | 179 return result.toString(); |
176 } | 180 } |
177 | 181 |
178 String CSSBasicShapeEllipse::cssText() const | 182 String CSSBasicShapeEllipse::cssText() const |
179 { | 183 { |
180 RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCX = buildSerializablePositi onOffset(m_centerX, CSSValueLeft); | 184 RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCX = buildSerializablePositi onOffset(m_centerX, CSSValueLeft); |
181 RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCY = buildSerializablePositi onOffset(m_centerY, CSSValueTop); | 185 RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCY = buildSerializablePositi onOffset(m_centerY, CSSValueTop); |
182 | 186 |
183 return buildEllipseString(m_radiusX ? m_radiusX->cssText() : String(), | 187 String radiusX; |
184 m_radiusY ? m_radiusY->cssText() : String(), | 188 String radiusY; |
189 if (m_radiusX) { | |
190 bool shouldSerializeRadiusXValue = m_radiusX->getValueID() != CSSValueCl osestSide; | |
eseidel
2014/05/28 22:08:10
Here again. Magic constants = confused reader.
| |
191 bool shouldSerializeRadiusYValue = false; | |
192 | |
193 if (m_radiusY) { | |
194 shouldSerializeRadiusYValue = m_radiusY->getValueID() != CSSValueClo sestSide; | |
195 if (shouldSerializeRadiusYValue) | |
196 radiusY = m_radiusY->cssText(); | |
197 } | |
198 if (shouldSerializeRadiusXValue || (!shouldSerializeRadiusXValue && shou ldSerializeRadiusYValue)) | |
199 radiusX = m_radiusX->cssText(); | |
200 } | |
201 | |
202 return buildEllipseString(radiusX, radiusY, | |
185 serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->ge tPairValue()), | 203 serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->ge tPairValue()), |
186 serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->ge tPairValue()), | 204 serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->ge tPairValue()), |
187 m_referenceBox ? m_referenceBox->cssText() : String()); | 205 m_referenceBox ? m_referenceBox->cssText() : String()); |
188 } | 206 } |
189 | 207 |
190 bool CSSBasicShapeEllipse::equals(const CSSBasicShape& shape) const | 208 bool CSSBasicShapeEllipse::equals(const CSSBasicShape& shape) const |
191 { | 209 { |
192 if (shape.type() != CSSBasicShapeEllipseType) | 210 if (shape.type() != CSSBasicShapeEllipseType) |
193 return false; | 211 return false; |
194 | 212 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
425 visitor->trace(m_left); | 443 visitor->trace(m_left); |
426 visitor->trace(m_topLeftRadius); | 444 visitor->trace(m_topLeftRadius); |
427 visitor->trace(m_topRightRadius); | 445 visitor->trace(m_topRightRadius); |
428 visitor->trace(m_bottomRightRadius); | 446 visitor->trace(m_bottomRightRadius); |
429 visitor->trace(m_bottomLeftRadius); | 447 visitor->trace(m_bottomLeftRadius); |
430 CSSBasicShape::trace(visitor); | 448 CSSBasicShape::trace(visitor); |
431 } | 449 } |
432 | 450 |
433 } // namespace WebCore | 451 } // namespace WebCore |
434 | 452 |
OLD | NEW |