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

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

Issue 2478233002: Make 'transform' a presentation attribute on SVG elements (Closed)
Patch Set: Updated expectations Created 4 years, 1 month 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) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 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) 2008 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 LinearGradientAttributes& attributes, 98 LinearGradientAttributes& attributes,
99 bool isLinear = true) { 99 bool isLinear = true) {
100 if (!attributes.hasSpreadMethod() && element->spreadMethod()->isSpecified()) 100 if (!attributes.hasSpreadMethod() && element->spreadMethod()->isSpecified())
101 attributes.setSpreadMethod( 101 attributes.setSpreadMethod(
102 element->spreadMethod()->currentValue()->enumValue()); 102 element->spreadMethod()->currentValue()->enumValue());
103 103
104 if (!attributes.hasGradientUnits() && element->gradientUnits()->isSpecified()) 104 if (!attributes.hasGradientUnits() && element->gradientUnits()->isSpecified())
105 attributes.setGradientUnits( 105 attributes.setGradientUnits(
106 element->gradientUnits()->currentValue()->enumValue()); 106 element->gradientUnits()->currentValue()->enumValue());
107 107
108 if (!attributes.hasGradientTransform() && 108 if (!attributes.hasGradientTransform() && element->hasTransform())
109 element->gradientTransform()->isSpecified()) { 109 attributes.setGradientTransform(element->calculateTransform());
110 AffineTransform transform;
111 element->gradientTransform()->currentValue()->concatenate(transform);
112 attributes.setGradientTransform(transform);
113 }
114 110
115 if (!attributes.hasStops()) { 111 if (!attributes.hasStops()) {
116 const Vector<Gradient::ColorStop>& stops(element->buildStops()); 112 const Vector<Gradient::ColorStop>& stops(element->buildStops());
117 if (!stops.isEmpty()) 113 if (!stops.isEmpty())
118 attributes.setStops(stops); 114 attributes.setStops(stops);
119 } 115 }
120 116
121 if (isLinear) { 117 if (isLinear) {
122 SVGLinearGradientElement* linear = toSVGLinearGradientElement(element); 118 SVGLinearGradientElement* linear = toSVGLinearGradientElement(element);
123 119
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 169 }
174 170
175 bool SVGLinearGradientElement::selfHasRelativeLengths() const { 171 bool SVGLinearGradientElement::selfHasRelativeLengths() const {
176 return m_x1->currentValue()->isRelative() || 172 return m_x1->currentValue()->isRelative() ||
177 m_y1->currentValue()->isRelative() || 173 m_y1->currentValue()->isRelative() ||
178 m_x2->currentValue()->isRelative() || 174 m_x2->currentValue()->isRelative() ||
179 m_y2->currentValue()->isRelative(); 175 m_y2->currentValue()->isRelative();
180 } 176 }
181 177
182 } // namespace blink 178 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698