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

Unified Diff: third_party/WebKit/Source/core/svg/SVGAnimatedLength.h

Issue 1901673003: Improve default value handling for SVGSVGElement.width/height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak old test. Created 4 years, 8 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
Index: third_party/WebKit/Source/core/svg/SVGAnimatedLength.h
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedLength.h b/third_party/WebKit/Source/core/svg/SVGAnimatedLength.h
index ff630307bf83bc7d4480ba028e8d260a36a61c0b..a992ba7e7db92c26445b6112cd8b1a2a0ebc5359 100644
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedLength.h
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedLength.h
@@ -40,19 +40,23 @@ namespace blink {
class SVGAnimatedLength : public SVGAnimatedProperty<SVGLength>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
- static SVGAnimatedLength* create(SVGElement* contextElement, const QualifiedName& attributeName, SVGLength* initialValue)
+ static SVGAnimatedLength* create(SVGElement* contextElement, const QualifiedName& attributeName, SVGLength* initialValue, const char* defaultValue = nullptr)
{
- return new SVGAnimatedLength(contextElement, attributeName, initialValue);
+ return new SVGAnimatedLength(contextElement, attributeName, initialValue, defaultValue);
}
+ void setDefaultValue();
void setDefaultValueAsString(const String&);
SVGParsingError setBaseValueAsString(const String&) override;
protected:
- SVGAnimatedLength(SVGElement* contextElement, const QualifiedName& attributeName, SVGLength* initialValue)
+ SVGAnimatedLength(SVGElement* contextElement, const QualifiedName& attributeName, SVGLength* initialValue, const char* defaultValue = nullptr)
: SVGAnimatedProperty<SVGLength>(contextElement, attributeName, initialValue)
+ , m_defaultValue(defaultValue)
{
}
+
+ const char* m_defaultValue;
pdr. 2016/04/18 21:25:14 This seems like a memory regression since it costs
pdr. 2016/04/18 21:36:23 Adding a little more info... I am wondering if we
fs 2016/04/18 21:55:07 We could probably fix it by a crutch in parseAttri
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698