1197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch// Copyright 2014 The Chromium Authors. All rights reserved.
2197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch// Use of this source code is governed by a BSD-style license that can be
3197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch// found in the LICENSE file.
4197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
5197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#ifndef SVGPropertyHelper_h
6197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#define SVGPropertyHelper_h
7197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
8197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "bindings/core/v8/ExceptionStatePlaceholder.h"
9197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#include "core/svg/properties/SVGProperty.h"
10197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
11c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink {
12197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
13197021e6b966cfb06891637935ef33fff06433d1Ben Murdochtemplate<typename Derived>
14197021e6b966cfb06891637935ef33fff06433d1Ben Murdochclass SVGPropertyHelper : public SVGPropertyBase {
15197021e6b966cfb06891637935ef33fff06433d1Ben Murdochpublic:
16197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    SVGPropertyHelper()
17197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        : SVGPropertyBase(Derived::classType())
18197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    {
19197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    }
20197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
21197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    virtual PassRefPtr<SVGPropertyBase> cloneForAnimation(const String& value) const
22197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    {
23197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RefPtr<Derived> property = Derived::create();
24197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        property->setValueAsString(value, IGNORE_EXCEPTION);
25197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        return property.release();
26197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    }
27197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch};
28197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
29197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch}
30197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
31197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch#endif // SVGPropertyHelper_h
32