OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 insetValue->setBottomRightRadius(CSSPrimitiveValue::create(inset->bottom
RightRadius())); | 169 insetValue->setBottomRightRadius(CSSPrimitiveValue::create(inset->bottom
RightRadius())); |
170 insetValue->setBottomLeftRadius(CSSPrimitiveValue::create(inset->bottomL
eftRadius())); | 170 insetValue->setBottomLeftRadius(CSSPrimitiveValue::create(inset->bottomL
eftRadius())); |
171 | 171 |
172 basicShapeValue = insetValue.release(); | 172 basicShapeValue = insetValue.release(); |
173 break; | 173 break; |
174 } | 174 } |
175 default: | 175 default: |
176 break; | 176 break; |
177 } | 177 } |
178 | 178 |
179 if (basicShape->layoutBox() != BoxMissing) | |
180 basicShapeValue->setLayoutBox(pool.createValue(basicShape->layoutBox()))
; | |
181 | |
182 return pool.createValue(basicShapeValue.release()); | 179 return pool.createValue(basicShapeValue.release()); |
183 } | 180 } |
184 | 181 |
185 static Length convertToLength(const StyleResolverState& state, CSSPrimitiveValue
* value) | 182 static Length convertToLength(const StyleResolverState& state, CSSPrimitiveValue
* value) |
186 { | 183 { |
187 if (!value) | 184 if (!value) |
188 return Length(0, Fixed); | 185 return Length(0, Fixed); |
189 return value->convertToLength<FixedConversion | PercentConversion>(state.css
ToLengthConversionData()); | 186 return value->convertToLength<FixedConversion | PercentConversion>(state.css
ToLengthConversionData()); |
190 } | 187 } |
191 | 188 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 rect->setBottomRightRadius(convertToLengthSize(state, rectValue->bottomR
ightRadius())); | 375 rect->setBottomRightRadius(convertToLengthSize(state, rectValue->bottomR
ightRadius())); |
379 rect->setBottomLeftRadius(convertToLengthSize(state, rectValue->bottomLe
ftRadius())); | 376 rect->setBottomLeftRadius(convertToLengthSize(state, rectValue->bottomLe
ftRadius())); |
380 | 377 |
381 basicShape = rect.release(); | 378 basicShape = rect.release(); |
382 break; | 379 break; |
383 } | 380 } |
384 default: | 381 default: |
385 break; | 382 break; |
386 } | 383 } |
387 | 384 |
388 if (basicShapeValue->layoutBox()) | |
389 basicShape->setLayoutBox(LayoutBox(*basicShapeValue->layoutBox())); | |
390 | |
391 return basicShape.release(); | 385 return basicShape.release(); |
392 } | 386 } |
393 | 387 |
394 FloatPoint floatPointForCenterCoordinate(const BasicShapeCenterCoordinate& cente
rX, const BasicShapeCenterCoordinate& centerY, FloatSize boxSize) | 388 FloatPoint floatPointForCenterCoordinate(const BasicShapeCenterCoordinate& cente
rX, const BasicShapeCenterCoordinate& centerY, FloatSize boxSize) |
395 { | 389 { |
396 FloatPoint p; | 390 FloatPoint p; |
397 float offset = floatValueForLength(centerX.length(), boxSize.width()); | 391 float offset = floatValueForLength(centerX.length(), boxSize.width()); |
398 p.setX(centerX.direction() == BasicShapeCenterCoordinate::TopLeft ? offset :
boxSize.width() - offset); | 392 p.setX(centerX.direction() == BasicShapeCenterCoordinate::TopLeft ? offset :
boxSize.width() - offset); |
399 offset = floatValueForLength(centerY.length(), boxSize.height()); | 393 offset = floatValueForLength(centerY.length(), boxSize.height()); |
400 p.setY(centerY.direction() == BasicShapeCenterCoordinate::TopLeft ? offset :
boxSize.height() - offset); | 394 p.setY(centerY.direction() == BasicShapeCenterCoordinate::TopLeft ? offset :
boxSize.height() - offset); |
401 return p; | 395 return p; |
402 } | 396 } |
403 | 397 |
404 } | 398 } |
OLD | NEW |