Commit 9562240c authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Commit Bot

Const-qualify SVGListPropertyHelper::Clone()

Should not mutate the object/list.

Change-Id: I3efe2e7726b2671b32ac7d9a0bc44b48621bcd69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480823Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#818055}
parent 7494dadd
...@@ -100,9 +100,9 @@ class SVGListPropertyHelper : public SVGListPropertyBase { ...@@ -100,9 +100,9 @@ class SVGListPropertyHelper : public SVGListPropertyBase {
SVGListPropertyBase::Replace(index, new_item); SVGListPropertyBase::Replace(index, new_item);
} }
virtual Derived* Clone() { virtual Derived* Clone() const {
auto* svg_list = MakeGarbageCollected<Derived>(); auto* svg_list = MakeGarbageCollected<Derived>();
svg_list->DeepCopy(static_cast<Derived*>(this)); svg_list->DeepCopy(To<Derived>(this));
return svg_list; return svg_list;
} }
......
...@@ -30,7 +30,7 @@ SVGLengthList::SVGLengthList(SVGLengthMode mode) : mode_(mode) {} ...@@ -30,7 +30,7 @@ SVGLengthList::SVGLengthList(SVGLengthMode mode) : mode_(mode) {}
SVGLengthList::~SVGLengthList() = default; SVGLengthList::~SVGLengthList() = default;
SVGLengthList* SVGLengthList::Clone() { SVGLengthList* SVGLengthList::Clone() const {
auto* ret = MakeGarbageCollected<SVGLengthList>(mode_); auto* ret = MakeGarbageCollected<SVGLengthList>(mode_);
ret->DeepCopy(this); ret->DeepCopy(this);
return ret; return ret;
......
...@@ -52,7 +52,7 @@ class SVGLengthList final ...@@ -52,7 +52,7 @@ class SVGLengthList final
// SVGPropertyBase: // SVGPropertyBase:
SVGPropertyBase* CloneForAnimation(const String&) const override; SVGPropertyBase* CloneForAnimation(const String&) const override;
SVGLengthList* Clone() override; SVGLengthList* Clone() const override;
SVGLengthMode UnitMode() const { return mode_; } SVGLengthMode UnitMode() const { return mode_; }
void Add(const SVGPropertyBase*, const SVGElement*) override; void Add(const SVGPropertyBase*, const SVGElement*) override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment