1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

LibWeb: Add support for HTMLOrSVGElement.dataset

This commit is contained in:
Luke Wilde 2021-09-26 15:24:41 +01:00 committed by Andreas Kling
parent 37347cbcb6
commit f6b24a72ee
12 changed files with 259 additions and 1 deletions

View file

@ -10,6 +10,7 @@ namespace Web::SVG {
SVGElement::SVGElement(DOM::Document& document, QualifiedName qualified_name)
: Element(document, move(qualified_name))
, m_dataset(HTML::DOMStringMap::create(*this))
{
}

View file

@ -7,6 +7,7 @@
#pragma once
#include <LibWeb/DOM/Element.h>
#include <LibWeb/HTML/DOMStringMap.h>
namespace Web::SVG {
@ -16,8 +17,12 @@ public:
virtual bool requires_svg_container() const override { return true; }
NonnullRefPtr<HTML::DOMStringMap> dataset() const { return m_dataset; }
protected:
SVGElement(DOM::Document&, QualifiedName);
NonnullRefPtr<HTML::DOMStringMap> m_dataset;
};
}

View file

@ -1,3 +1,4 @@
interface SVGElement : Element {
// FIXME: This should come from a HTMLOrSVGElement mixin
[SameObject] readonly attribute DOMStringMap dataset;
};