Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: Source/core/rendering/shapes/Shape.cpp

Issue 196723010: [CSS Shapes] inset corner radii are not flipped for vertical writing modes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 shape = createInsetShape(FloatRoundedRect(logicalRect, cornerRadii)); 244 shape = createInsetShape(FloatRoundedRect(logicalRect, cornerRadii));
245 break; 245 break;
246 } 246 }
247 247
248 default: 248 default:
249 ASSERT_NOT_REACHED(); 249 ASSERT_NOT_REACHED();
250 } 250 }
251 251
252 shape->m_writingMode = writingMode; 252 shape->m_writingMode = writingMode;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 FloatRoundedRect bounds(rect, roundedRect.radii()); 304 FloatRoundedRect bounds(rect, roundedRect.radii());
305 OwnPtr<Shape> shape = createInsetShape(bounds); 305 OwnPtr<Shape> shape = createInsetShape(bounds);
306 shape->m_writingMode = writingMode; 306 shape->m_writingMode = writingMode;
307 shape->m_margin = floatValueForLength(margin, 0); 307 shape->m_margin = floatValueForLength(margin, 0);
308 shape->m_padding = floatValueForLength(padding, 0); 308 shape->m_padding = floatValueForLength(padding, 0);
309 309
310 return shape.release(); 310 return shape.release();
311 } 311 }
312 312
313 } // namespace WebCore 313 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698