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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp

Issue 2753013004: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text
Patch Set: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text Created 3 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) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 void SVGLayoutSupport::applyStrokeStyleToStrokeData(StrokeData& strokeData, 448 void SVGLayoutSupport::applyStrokeStyleToStrokeData(StrokeData& strokeData,
449 const ComputedStyle& style, 449 const ComputedStyle& style,
450 const LayoutObject& object, 450 const LayoutObject& object,
451 float dashScaleFactor) { 451 float dashScaleFactor) {
452 ASSERT(object.node()); 452 ASSERT(object.node());
453 ASSERT(object.node()->isSVGElement()); 453 ASSERT(object.node()->isSVGElement());
454 454
455 const SVGComputedStyle& svgStyle = style.svgStyle(); 455 const SVGComputedStyle& svgStyle = style.svgStyle();
456 456
457 SVGLengthContext lengthContext(toSVGElement(object.node())); 457 SVGLengthContext lengthContext(toSVGElement(object.node()));
458 strokeData.setThickness(lengthContext.valueForLength(svgStyle.strokeWidth())); 458 strokeData.setThickness(lengthContext.valueForLength(style.strokeWidth()));
459 strokeData.setLineCap(svgStyle.capStyle()); 459 strokeData.setLineCap(style.capStyle());
460 strokeData.setLineJoin(svgStyle.joinStyle()); 460 strokeData.setLineJoin(style.joinStyle());
461 strokeData.setMiterLimit(svgStyle.strokeMiterLimit()); 461 strokeData.setMiterLimit(svgStyle.strokeMiterLimit());
462 462
463 DashArray dashArray = 463 DashArray dashArray =
464 resolveSVGDashArray(*svgStyle.strokeDashArray(), style, lengthContext); 464 resolveSVGDashArray(*svgStyle.strokeDashArray(), style, lengthContext);
465 float dashOffset = 465 float dashOffset =
466 lengthContext.valueForLength(svgStyle.strokeDashOffset(), style); 466 lengthContext.valueForLength(svgStyle.strokeDashOffset(), style);
467 // Apply scaling from 'pathLength'. 467 // Apply scaling from 'pathLength'.
468 if (dashScaleFactor != 1) { 468 if (dashScaleFactor != 1) {
469 ASSERT(dashScaleFactor >= 0); 469 ASSERT(dashScaleFactor >= 0);
470 dashOffset *= dashScaleFactor; 470 dashOffset *= dashScaleFactor;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 } 609 }
610 610
611 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText( 611 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText(
612 LayoutObject* layoutObject, 612 LayoutObject* layoutObject,
613 const FloatPoint& point) { 613 const FloatPoint& point) {
614 return searchTreeForFindClosestLayoutSVGText(layoutObject, point) 614 return searchTreeForFindClosestLayoutSVGText(layoutObject, point)
615 .candidateLayoutObject; 615 .candidateLayoutObject;
616 } 616 }
617 617
618 } // namespace blink 618 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698