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

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

Issue 1455153003: Fix animation of 'color' w/ currentColor for SVG 'fill' and 'stroke' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split Created 4 years, 12 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) 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.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 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 bool applyToFill = mode == ApplyToFillMode; 86 bool applyToFill = mode == ApplyToFillMode;
87 SVGPaintType paintType = applyToFill ? svgStyle.fillPaintType() : svgStyle.s trokePaintType(); 87 SVGPaintType paintType = applyToFill ? svgStyle.fillPaintType() : svgStyle.s trokePaintType();
88 ASSERT(paintType != SVG_PAINTTYPE_NONE); 88 ASSERT(paintType != SVG_PAINTTYPE_NONE);
89 89
90 Color color; 90 Color color;
91 bool hasColor = false; 91 bool hasColor = false;
92 switch (paintType) { 92 switch (paintType) {
93 case SVG_PAINTTYPE_CURRENTCOLOR: 93 case SVG_PAINTTYPE_CURRENTCOLOR:
94 case SVG_PAINTTYPE_URI_CURRENTCOLOR:
95 // The keyword `currentcolor` takes its value from the value of the `col or` property on the same element.
96 color = style.visitedDependentColor(CSSPropertyColor);
97 hasColor = true;
98 break;
94 case SVG_PAINTTYPE_RGBCOLOR: 99 case SVG_PAINTTYPE_RGBCOLOR:
95 case SVG_PAINTTYPE_URI_CURRENTCOLOR:
96 case SVG_PAINTTYPE_URI_RGBCOLOR: 100 case SVG_PAINTTYPE_URI_RGBCOLOR:
97 color = applyToFill ? svgStyle.fillPaintColor() : svgStyle.strokePaintCo lor(); 101 color = applyToFill ? svgStyle.fillPaintColor() : svgStyle.strokePaintCo lor();
98 hasColor = true; 102 hasColor = true;
99 default: 103 default:
100 break; 104 break;
101 } 105 }
102 106
103 if (style.insideLink() == InsideVisitedLink) { 107 if (style.insideLink() == InsideVisitedLink) {
104 // FIXME: This code doesn't support the uri component of the visited lin k paint, https://bugs.webkit.org/show_bug.cgi?id=70006 108 // FIXME: This code doesn't support the uri component of the visited lin k paint, https://bugs.webkit.org/show_bug.cgi?id=70006
105 SVGPaintType visitedPaintType = applyToFill ? svgStyle.visitedLinkFillPa intType() : svgStyle.visitedLinkStrokePaintType(); 109 SVGPaintType visitedPaintType = applyToFill ? svgStyle.visitedLinkFillPa intType() : svgStyle.visitedLinkStrokePaintType();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 LayoutSVGResourcePaintServer::~LayoutSVGResourcePaintServer() 175 LayoutSVGResourcePaintServer::~LayoutSVGResourcePaintServer()
172 { 176 {
173 } 177 }
174 178
175 SVGPaintDescription LayoutSVGResourcePaintServer::requestPaintDescription(const LayoutObject& layoutObject, const ComputedStyle& style, LayoutSVGResourceMode re sourceMode) 179 SVGPaintDescription LayoutSVGResourcePaintServer::requestPaintDescription(const LayoutObject& layoutObject, const ComputedStyle& style, LayoutSVGResourceMode re sourceMode)
176 { 180 {
177 return requestPaint(layoutObject, style, resourceMode); 181 return requestPaint(layoutObject, style, resourceMode);
178 } 182 }
179 183
180 } 184 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/core/style/SVGComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698