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

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

Issue 2001453002: Set ComputedStyle on Node and use that in buildOwnLayout() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@storage
Patch Set: Created 4 years, 5 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) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007, 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 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 26 matching lines...) Expand all
37 SVGElement::trace(visitor); 37 SVGElement::trace(visitor);
38 } 38 }
39 39
40 DEFINE_NODE_FACTORY(SVGStopElement) 40 DEFINE_NODE_FACTORY(SVGStopElement)
41 41
42 void SVGStopElement::svgAttributeChanged(const QualifiedName& attrName) 42 void SVGStopElement::svgAttributeChanged(const QualifiedName& attrName)
43 { 43 {
44 if (attrName == SVGNames::offsetAttr) { 44 if (attrName == SVGNames::offsetAttr) {
45 SVGElement::InvalidationGuard invalidationGuard(this); 45 SVGElement::InvalidationGuard invalidationGuard(this);
46 46
47 if (layoutObject()) 47 if (hasLayoutObject())
48 markForLayoutAndParentResourceInvalidation(layoutObject()); 48 markForLayoutAndParentResourceInvalidation(layoutObject());
49 return; 49 return;
50 } 50 }
51 51
52 SVGElement::svgAttributeChanged(attrName); 52 SVGElement::svgAttributeChanged(attrName);
53 } 53 }
54 54
55 LayoutObject* SVGStopElement::createLayoutObject(const ComputedStyle&) 55 LayoutObject* SVGStopElement::createLayoutObject(const ComputedStyle&)
56 { 56 {
57 return new LayoutSVGGradientStop(this); 57 return new LayoutSVGGradientStop(this);
(...skipping 11 matching lines...) Expand all
69 // which the layoutObject or style is null. This entire class is scheduled f or removal (Bug WK 86941) 69 // which the layoutObject or style is null. This entire class is scheduled f or removal (Bug WK 86941)
70 // and we will tolerate this null check until then. 70 // and we will tolerate this null check until then.
71 if (!style) 71 if (!style)
72 return Color(Color::transparent); // Transparent black. 72 return Color(Color::transparent); // Transparent black.
73 73
74 const SVGComputedStyle& svgStyle = style->svgStyle(); 74 const SVGComputedStyle& svgStyle = style->svgStyle();
75 return svgStyle.stopColor().combineWithAlpha(svgStyle.stopOpacity()); 75 return svgStyle.stopColor().combineWithAlpha(svgStyle.stopOpacity());
76 } 76 }
77 77
78 } // namespace blink 78 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698