mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibWeb: Stub out SVGTransform
This commit is contained in:
parent
ce11a34fc6
commit
a6a40a5bc6
Notes:
sideshowbarker
2024-07-17 18:49:10 +09:00
Author: https://github.com/MacDue
Commit: a6a40a5bc6
Pull-request: https://github.com/SerenityOS/serenity/pull/23793
Reviewed-by: https://github.com/shannonbooth
6 changed files with 86 additions and 0 deletions
|
@ -68,6 +68,7 @@ static bool is_platform_object(Type const& type)
|
|||
"ReadableStream"sv,
|
||||
"Request"sv,
|
||||
"Selection"sv,
|
||||
"SVGTransform"sv,
|
||||
"Table"sv,
|
||||
"Text"sv,
|
||||
"TextMetrics"sv,
|
||||
|
|
|
@ -622,6 +622,7 @@ set(SOURCES
|
|||
SVG/SVGTextPathElement.cpp
|
||||
SVG/SVGTextPositioningElement.cpp
|
||||
SVG/SVGTitleElement.cpp
|
||||
SVG/SVGTransform.cpp
|
||||
SVG/SVGTSpanElement.cpp
|
||||
SVG/SVGUseElement.cpp
|
||||
SVG/TagNames.cpp
|
||||
|
|
30
Userland/Libraries/LibWeb/SVG/SVGTransform.cpp
Normal file
30
Userland/Libraries/LibWeb/SVG/SVGTransform.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright (c) 2024, MacDue <macdue@dueutil.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/SVG/SVGTransform.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(SVGTransform);
|
||||
|
||||
JS::NonnullGCPtr<SVGTransform> SVGTransform::create(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<SVGTransform>(realm, realm);
|
||||
}
|
||||
|
||||
SVGTransform::SVGTransform(JS::Realm& realm)
|
||||
: PlatformObject(realm) {};
|
||||
|
||||
SVGTransform::~SVGTransform() = default;
|
||||
|
||||
void SVGTransform::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTransform);
|
||||
}
|
||||
|
||||
}
|
29
Userland/Libraries/LibWeb/SVG/SVGTransform.h
Normal file
29
Userland/Libraries/LibWeb/SVG/SVGTransform.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2024, MacDue <macdue@dueutil.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
||||
// FIXME: This class is just a stub.
|
||||
// https://svgwg.org/svg2-draft/single-page.html#coords-InterfaceSVGTransform
|
||||
class SVGTransform final : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(SVGTransform, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(SVGTransform);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static JS::NonnullGCPtr<SVGTransform> create(JS::Realm& realm);
|
||||
virtual ~SVGTransform() override;
|
||||
|
||||
private:
|
||||
SVGTransform(JS::Realm& realm);
|
||||
|
||||
virtual void initialize(JS::Realm& realm) override;
|
||||
};
|
||||
|
||||
}
|
24
Userland/Libraries/LibWeb/SVG/SVGTransform.idl
Normal file
24
Userland/Libraries/LibWeb/SVG/SVGTransform.idl
Normal file
|
@ -0,0 +1,24 @@
|
|||
// https://svgwg.org/svg2-draft/single-page.html#coords-InterfaceSVGTransform
|
||||
[Exposed=Window]
|
||||
interface SVGTransform {
|
||||
|
||||
// Transform Types
|
||||
const unsigned short SVG_TRANSFORM_UNKNOWN = 0;
|
||||
const unsigned short SVG_TRANSFORM_MATRIX = 1;
|
||||
const unsigned short SVG_TRANSFORM_TRANSLATE = 2;
|
||||
const unsigned short SVG_TRANSFORM_SCALE = 3;
|
||||
const unsigned short SVG_TRANSFORM_ROTATE = 4;
|
||||
const unsigned short SVG_TRANSFORM_SKEWX = 5;
|
||||
const unsigned short SVG_TRANSFORM_SKEWY = 6;
|
||||
|
||||
// FIXME: readonly attribute unsigned short type;
|
||||
// FIXME: [SameObject] readonly attribute DOMMatrix matrix;
|
||||
// FIXME: readonly attribute float angle;
|
||||
|
||||
// FIXME: undefined setMatrix(optional DOMMatrix2DInit matrix = {});
|
||||
// FIXME: undefined setTranslate(float tx, float ty);
|
||||
// FIXME: undefined setScale(float sx, float sy);
|
||||
// FIXME: undefined setRotate(float angle, float cx, float cy);
|
||||
// FIXME: undefined setSkewX(float angle);
|
||||
// FIXME: undefined setSkewY(float angle);
|
||||
};
|
|
@ -269,6 +269,7 @@ libweb_js_bindings(SVG/SVGTextElement)
|
|||
libweb_js_bindings(SVG/SVGTextPathElement)
|
||||
libweb_js_bindings(SVG/SVGTextPositioningElement)
|
||||
libweb_js_bindings(SVG/SVGTitleElement)
|
||||
libweb_js_bindings(SVG/SVGTransform)
|
||||
libweb_js_bindings(SVG/SVGTSpanElement)
|
||||
libweb_js_bindings(SVG/SVGUseElement)
|
||||
libweb_js_bindings(Selection/Selection)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue