mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
LibWeb: Add IDL definition for SVGScriptElement
It does not currently handle any of the actual scripting, but this should at least allow us to create an instance of the element. The test being added here isn't actually testing much, but before the previous commit we used to crash parsing the page due to a TODO().
This commit is contained in:
parent
60c32f39a1
commit
07b332e17c
9 changed files with 78 additions and 0 deletions
34
Userland/Libraries/LibWeb/SVG/SVGScriptElement.h
Normal file
34
Userland/Libraries/LibWeb/SVG/SVGScriptElement.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/SVG/SVGElement.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
||||
// https://www.w3.org/TR/SVG/interact.html#InterfaceSVGScriptElement
|
||||
class SVGScriptElement : public SVGElement {
|
||||
WEB_PLATFORM_OBJECT(SVGScriptElement, SVGElement);
|
||||
|
||||
public:
|
||||
protected:
|
||||
SVGScriptElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
private:
|
||||
virtual bool is_svg_script_element() const final { return true; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
template<>
|
||||
inline bool Node::fast_is<SVG::SVGScriptElement>() const { return is_svg_script_element(); }
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue