blob: 2a268304cecb751ae675b71f1a105e2cb0b8cd94 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/*
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/SVG/SVGLength.h>
namespace Web::SVG {
JS::NonnullGCPtr<SVGLength> SVGLength::create(JS::Realm& realm, u8 unit_type, float value)
{
return realm.heap().allocate<SVGLength>(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)
{
set_prototype(&Bindings::cached_web_prototype(realm, "SVGLength"));
}
SVGLength::~SVGLength() = default;
// https://www.w3.org/TR/SVG11/types.html#__svg__SVGLength__value
WebIDL::ExceptionOr<void> SVGLength::set_value(float value)
{
// FIXME: Raise an exception if this <length> is read-only.
m_value = value;
return {};
}
}
|