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

Side by Side Diff: Source/core/css/BasicShapeFunctions.cpp

Issue 115253003: Layout support for new circle shape syntax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update virtual/legacy-animations-engine/animations/interpolation/shape-outside-expected.txt Created 7 years 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } 314 }
315 default: 315 default:
316 break; 316 break;
317 } 317 }
318 318
319 if (basicShapeValue->layoutBox()) 319 if (basicShapeValue->layoutBox())
320 basicShape->setLayoutBox(LayoutBox(*basicShapeValue->layoutBox())); 320 basicShape->setLayoutBox(LayoutBox(*basicShapeValue->layoutBox()));
321 321
322 return basicShape.release(); 322 return basicShape.release();
323 } 323 }
324
325 float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate& center, fl oat boxDimension)
326 {
327 float offset = floatValueForLength(center.length(), boxDimension);
328 switch (center.keyword()) {
329 case BasicShapeCenterCoordinate::None:
330 return offset;
331 case BasicShapeCenterCoordinate::Top:
332 case BasicShapeCenterCoordinate::Left:
333 return offset;
334 case BasicShapeCenterCoordinate::Bottom:
335 case BasicShapeCenterCoordinate::Right:
336 return boxDimension - offset;
337 }
338
339 ASSERT_NOT_REACHED();
340 return 0;
324 } 341 }
342
343 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698