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

Side by Side Diff: Source/core/layout/svg/SVGLayoutTreeAsText.cpp

Issue 983103003: Use Length for the stroke-width property in SVGLayoutStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: lengthSetterForProperty Created 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
3 * (C) 2005 Rob Buis <buis@kde.org> 3 * (C) 2005 Rob Buis <buis@kde.org>
4 * (C) 2006 Alexander Kellett <lypanov@kde.org> 4 * (C) 2006 Alexander Kellett <lypanov@kde.org>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 ASSERT(shape.element()); 282 ASSERT(shape.element());
283 283
284 SVGPaintDescription strokePaintDescription = LayoutSVGResourcePaintServe r::requestPaintDescription(shape, shape.styleRef(), ApplyToStrokeMode); 284 SVGPaintDescription strokePaintDescription = LayoutSVGResourcePaintServe r::requestPaintDescription(shape, shape.styleRef(), ApplyToStrokeMode);
285 if (strokePaintDescription.isValid) { 285 if (strokePaintDescription.isValid) {
286 TextStreamSeparator s(" "); 286 TextStreamSeparator s(" ");
287 ts << " [stroke={" << s; 287 ts << " [stroke={" << s;
288 writeSVGPaintingResource(ts, strokePaintDescription); 288 writeSVGPaintingResource(ts, strokePaintDescription);
289 289
290 SVGLengthContext lengthContext(shape.element()); 290 SVGLengthContext lengthContext(shape.element());
291 double dashOffset = lengthContext.valueForLength(svgStyle.strokeDash Offset(), style); 291 double dashOffset = lengthContext.valueForLength(svgStyle.strokeDash Offset(), style);
292 double strokeWidth = svgStyle.strokeWidth()->value(lengthContext); 292 double strokeWidth = lengthContext.valueForLength(svgStyle.strokeWid th());
293 DashArray dashArray = SVGLayoutSupport::resolveSVGDashArray(*svgStyl e.strokeDashArray(), style, lengthContext); 293 DashArray dashArray = SVGLayoutSupport::resolveSVGDashArray(*svgStyl e.strokeDashArray(), style, lengthContext);
294 294
295 writeIfNotDefault(ts, "opacity", svgStyle.strokeOpacity(), 1.0f); 295 writeIfNotDefault(ts, "opacity", svgStyle.strokeOpacity(), 1.0f);
296 writeIfNotDefault(ts, "stroke width", strokeWidth, 1.0); 296 writeIfNotDefault(ts, "stroke width", strokeWidth, 1.0);
297 writeIfNotDefault(ts, "miter limit", svgStyle.strokeMiterLimit(), 4. 0f); 297 writeIfNotDefault(ts, "miter limit", svgStyle.strokeMiterLimit(), 4. 0f);
298 writeIfNotDefault(ts, "line cap", svgStyle.capStyle(), ButtCap); 298 writeIfNotDefault(ts, "line cap", svgStyle.capStyle(), ButtCap);
299 writeIfNotDefault(ts, "line join", svgStyle.joinStyle(), MiterJoin); 299 writeIfNotDefault(ts, "line join", svgStyle.joinStyle(), MiterJoin);
300 writeIfNotDefault(ts, "dash offset", dashOffset, 0.0); 300 writeIfNotDefault(ts, "dash offset", dashOffset, 0.0);
301 if (!dashArray.isEmpty()) 301 if (!dashArray.isEmpty())
302 writeNameValuePair(ts, "dash array", dashArray); 302 writeNameValuePair(ts, "dash array", dashArray);
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 ts << " "; 669 ts << " ";
670 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); 670 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource());
671 ts << " "; 671 ts << " ";
672 writeStandardPrefix(ts, *filter, 0); 672 writeStandardPrefix(ts, *filter, 0);
673 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; 673 ts << " " << filter->resourceBoundingBox(&renderer) << "\n";
674 } 674 }
675 } 675 }
676 } 676 }
677 677
678 } // namespace blink 678 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/svg/SVGLayoutSupport.cpp ('k') | Source/core/layout/svg/SVGTextLayoutEngineBaseline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698