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

Side by Side Diff: Source/core/svg/SVGLength.cpp

Issue 1225553002: CSSValue Immediates: Make CSSPrimitiveValue a container (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_1
Patch Set: Rebase Created 5 years, 4 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
« no previous file with comments | « Source/core/svg/SVGLength.h ('k') | Source/modules/canvas2d/CanvasRenderingContext2DState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 ASSERT(value->primitiveType() == CSSPrimitiveValue::CSS_PC); 323 ASSERT(value->primitiveType() == CSSPrimitiveValue::CSS_PC);
324 svgType = LengthTypePC; 324 svgType = LengthTypePC;
325 break; 325 break;
326 }; 326 };
327 327
328 RefPtrWillBeRawPtr<SVGLength> length = SVGLength::create(); 328 RefPtrWillBeRawPtr<SVGLength> length = SVGLength::create();
329 length->newValueSpecifiedUnits(svgType, value->getFloatValue()); 329 length->newValueSpecifiedUnits(svgType, value->getFloatValue());
330 return length.release(); 330 return length.release();
331 } 331 }
332 332
333 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> SVGLength::toCSSPrimitiveValue(PassRef PtrWillBeRawPtr<SVGLength> passLength) 333 CSSPrimitiveValue SVGLength::toCSSPrimitiveValue(PassRefPtrWillBeRawPtr<SVGLengt h> passLength)
334 { 334 {
335 RefPtrWillBeRawPtr<SVGLength> length = passLength; 335 RefPtrWillBeRawPtr<SVGLength> length = passLength;
336 336
337 CSSPrimitiveValue::UnitType cssType = CSSPrimitiveValue::CSS_UNKNOWN; 337 CSSPrimitiveValue::UnitType cssType = CSSPrimitiveValue::CSS_UNKNOWN;
338 switch (length->unitType()) { 338 switch (length->unitType()) {
339 case LengthTypeUnknown: 339 case LengthTypeUnknown:
340 break; 340 break;
341 case LengthTypeNumber: 341 case LengthTypeNumber:
342 cssType = CSSPrimitiveValue::CSS_NUMBER; 342 cssType = CSSPrimitiveValue::CSS_NUMBER;
343 break; 343 break;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 float SVGLength::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> toVal ue, SVGElement* contextElement) 485 float SVGLength::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> toVal ue, SVGElement* contextElement)
486 { 486 {
487 SVGLengthContext lengthContext(contextElement); 487 SVGLengthContext lengthContext(contextElement);
488 RefPtrWillBeRawPtr<SVGLength> toLength = toSVGLength(toValue); 488 RefPtrWillBeRawPtr<SVGLength> toLength = toSVGLength(toValue);
489 489
490 return fabsf(toLength->value(lengthContext) - value(lengthContext)); 490 return fabsf(toLength->value(lengthContext) - value(lengthContext));
491 } 491 }
492 492
493 } 493 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGLength.h ('k') | Source/modules/canvas2d/CanvasRenderingContext2DState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698