/* * Copyright (c) 2022, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #include #include namespace Web::SVG { JS_DEFINE_ALLOCATOR(SVGLength); JS::NonnullGCPtr SVGLength::create(JS::Realm& realm, u8 unit_type, float value) { return realm.heap().allocate(realm, realm, unit_type, value); } SVGLength::SVGLength(JS::Realm& realm, u8 unit_type, float value) : PlatformObject(realm) , m_unit_type(unit_type) , m_value(value) { } void SVGLength::initialize(JS::Realm& realm) { Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGLength")); } SVGLength::~SVGLength() = default; // https://www.w3.org/TR/SVG11/types.html#__svg__SVGLength__value WebIDL::ExceptionOr SVGLength::set_value(float value) { // FIXME: Raise an exception if this is read-only. m_value = value; return {}; } }