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

Unified Diff: Source/core/svg/GradientAttributes.h

Issue 423093014: [SVG2] Make transform, gradientTransform and patternTransform presentation attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline for mac/win Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/svg/transforms/translate-without-units-expected.svg ('k') | Source/core/svg/SVGElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/GradientAttributes.h
diff --git a/Source/core/svg/GradientAttributes.h b/Source/core/svg/GradientAttributes.h
index ceaccf9016653decea22405e7045bc315bf8ffe8..a005b7edf7612d8d70158eb6017a5e55727cf504 100644
--- a/Source/core/svg/GradientAttributes.h
+++ b/Source/core/svg/GradientAttributes.h
@@ -52,6 +52,21 @@ struct GradientAttributes {
m_gradientUnitsSet = true;
}
+ void setGradientTransformFromStyle(SVGGradientElement* element)
+ {
+ AffineTransform transform;
+ bool hasTransform = element->getStyleTransform(transform);
+
+ // If CSS property was set, use that, otherwise fallback to attribute (if set).
+ if (!hasTransform && element->gradientTransform()->isSpecified()) {
+ element->gradientTransform()->currentValue()->concatenate(transform);
+ hasTransform = true;
+ }
+
+ if (hasTransform)
+ setGradientTransform(transform);
+ }
+
void setGradientTransform(const AffineTransform& value)
{
m_gradientTransform = value;
« no previous file with comments | « LayoutTests/svg/transforms/translate-without-units-expected.svg ('k') | Source/core/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698