| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 case BasicShape::BasicShapeInsetType: { | 228 case BasicShape::BasicShapeInsetType: { |
| 229 const BasicShapeInset& inset = *static_cast<const BasicShapeInset*>(basi
cShape); | 229 const BasicShapeInset& inset = *static_cast<const BasicShapeInset*>(basi
cShape); |
| 230 float left = floatValueForLength(inset.left(), boxWidth); | 230 float left = floatValueForLength(inset.left(), boxWidth); |
| 231 float top = floatValueForLength(inset.top(), boxHeight); | 231 float top = floatValueForLength(inset.top(), boxHeight); |
| 232 float right = floatValueForLength(inset.right(), boxWidth); | 232 float right = floatValueForLength(inset.right(), boxWidth); |
| 233 float bottom = floatValueForLength(inset.bottom(), boxHeight); | 233 float bottom = floatValueForLength(inset.bottom(), boxHeight); |
| 234 FloatRect rect(left, top, std::max<float>(boxWidth - left - right, 0), s
td::max<float>(boxHeight - top - bottom, 0)); | 234 FloatRect rect(left, top, std::max<float>(boxWidth - left - right, 0), s
td::max<float>(boxHeight - top - bottom, 0)); |
| 235 FloatRect logicalRect = physicalRectToLogical(rect, logicalBoxSize.heigh
t(), writingMode); | 235 FloatRect logicalRect = physicalRectToLogical(rect, logicalBoxSize.heigh
t(), writingMode); |
| 236 | 236 |
| 237 FloatSize boxSize(boxWidth, boxHeight); | 237 FloatSize boxSize(boxWidth, boxHeight); |
| 238 FloatRoundedRect::Radii cornerRadii( | 238 FloatSize topLeftRadius = physicalSizeToLogical(floatSizeForLengthSize(i
nset.topLeftRadius(), boxSize), writingMode); |
| 239 floatSizeForLengthSize(inset.topLeftRadius(), boxSize), | 239 FloatSize topRightRadius = physicalSizeToLogical(floatSizeForLengthSize(
inset.topRightRadius(), boxSize), writingMode); |
| 240 floatSizeForLengthSize(inset.topRightRadius(), boxSize), | 240 FloatSize bottomLeftRadius = physicalSizeToLogical(floatSizeForLengthSiz
e(inset.bottomLeftRadius(), boxSize), writingMode); |
| 241 floatSizeForLengthSize(inset.bottomLeftRadius(), boxSize), | 241 FloatSize bottomRightRadius = physicalSizeToLogical(floatSizeForLengthSi
ze(inset.bottomRightRadius(), boxSize), writingMode); |
| 242 floatSizeForLengthSize(inset.bottomRightRadius(), boxSize)); | 242 FloatRoundedRect::Radii cornerRadii(topLeftRadius, topRightRadius, botto
mLeftRadius, bottomRightRadius); |
| 243 | 243 |
| 244 cornerRadii.scale(calcBorderRadiiConstraintScaleFor(logicalRect, cornerR
adii)); | 244 cornerRadii.scale(calcBorderRadiiConstraintScaleFor(logicalRect, cornerR
adii)); |
| 245 | 245 |
| 246 shape = createInsetShape(FloatRoundedRect(logicalRect, cornerRadii)); | 246 shape = createInsetShape(FloatRoundedRect(logicalRect, cornerRadii)); |
| 247 break; | 247 break; |
| 248 } | 248 } |
| 249 | 249 |
| 250 default: | 250 default: |
| 251 ASSERT_NOT_REACHED(); | 251 ASSERT_NOT_REACHED(); |
| 252 } | 252 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 FloatRoundedRect bounds(rect, roundedRect.radii()); | 306 FloatRoundedRect bounds(rect, roundedRect.radii()); |
| 307 OwnPtr<Shape> shape = createInsetShape(bounds); | 307 OwnPtr<Shape> shape = createInsetShape(bounds); |
| 308 shape->m_writingMode = writingMode; | 308 shape->m_writingMode = writingMode; |
| 309 shape->m_margin = floatValueForLength(margin, 0); | 309 shape->m_margin = floatValueForLength(margin, 0); |
| 310 shape->m_padding = floatValueForLength(padding, 0); | 310 shape->m_padding = floatValueForLength(padding, 0); |
| 311 | 311 |
| 312 return shape.release(); | 312 return shape.release(); |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace WebCore | 315 } // namespace WebCore |
| OLD | NEW |