2024-10-29 11:07:02 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
#include <LibGC/Ptr.h>
|
2024-10-29 11:07:02 +01:00
|
|
|
#include <LibJS/Heap/Cell.h>
|
|
|
|
#include <LibWeb/HTML/DOMStringMap.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
template<typename ElementBase>
|
|
|
|
class HTMLOrSVGElement {
|
|
|
|
public:
|
2024-11-15 04:01:23 +13:00
|
|
|
[[nodiscard]] GC::Ref<DOMStringMap> dataset();
|
2024-10-29 11:07:02 +01:00
|
|
|
|
2025-02-04 13:01:46 +01:00
|
|
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#dom-noncedelement-nonce
|
2024-12-02 16:01:19 +00:00
|
|
|
String const& nonce() const { return m_cryptographic_nonce; }
|
2024-10-29 13:27:01 +01:00
|
|
|
void set_nonce(String const& nonce) { m_cryptographic_nonce = nonce; }
|
|
|
|
|
2024-10-29 11:07:02 +01:00
|
|
|
void focus();
|
|
|
|
void blur();
|
|
|
|
|
|
|
|
protected:
|
2024-11-14 08:14:16 -05:00
|
|
|
void attribute_changed(FlyString const&, Optional<String> const&, Optional<String> const&, Optional<FlyString> const&);
|
2025-01-11 17:37:08 +00:00
|
|
|
WebIDL::ExceptionOr<void> cloned(DOM::Node&, bool) const;
|
2024-10-29 13:27:01 +01:00
|
|
|
void inserted();
|
2024-10-29 11:07:02 +01:00
|
|
|
void visit_edges(JS::Cell::Visitor&);
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/dom.html#dom-dataset-dev
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ptr<DOMStringMap> m_dataset;
|
2024-10-29 11:07:02 +01:00
|
|
|
|
2025-02-04 13:01:46 +01:00
|
|
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cryptographicnonce
|
2024-10-29 13:27:01 +01:00
|
|
|
String m_cryptographic_nonce;
|
2024-10-29 11:07:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|