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

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: Try with 0.5 tolerance 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 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
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
OLDNEW
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-inset-rounded-different-writing-modes-right-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698