2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2018-2021, Andreas Kling <andreas@ladybird.org>
|
2021-02-21 18:44:17 +02:00
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
2019-09-29 17:43:30 +02:00
|
|
|
#pragma once
|
|
|
|
|
2023-06-08 16:07:12 +01:00
|
|
|
#include <LibWeb/DOM/StyleElementUtils.h>
|
2020-07-26 15:08:16 +02:00
|
|
|
#include <LibWeb/HTML/HTMLElement.h>
|
2019-09-29 17:43:30 +02:00
|
|
|
|
2020-07-28 18:20:36 +02:00
|
|
|
namespace Web::HTML {
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2020-07-28 02:54:19 +01:00
|
|
|
class HTMLStyleElement final : public HTMLElement {
|
2022-08-28 13:42:07 +02:00
|
|
|
WEB_PLATFORM_OBJECT(HTMLStyleElement, HTMLElement);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(HTMLStyleElement);
|
2020-07-27 05:04:26 +01:00
|
|
|
|
2022-08-28 13:42:07 +02:00
|
|
|
public:
|
2019-09-29 17:43:30 +02:00
|
|
|
virtual ~HTMLStyleElement() override;
|
|
|
|
|
2025-01-27 01:16:33 +13:00
|
|
|
virtual void children_changed(ChildrenChangedMetadata const*) override;
|
2022-02-25 22:05:42 +01:00
|
|
|
virtual void inserted() override;
|
2025-01-23 17:37:18 +01:00
|
|
|
virtual void removed_from(Node* old_parent, Node& old_root) override;
|
2025-03-22 11:33:59 +00:00
|
|
|
virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_) override;
|
2019-09-29 17:43:30 +02:00
|
|
|
|
2024-06-22 11:12:44 +01:00
|
|
|
bool disabled();
|
|
|
|
void set_disabled(bool disabled);
|
|
|
|
|
2022-08-07 13:14:54 +02:00
|
|
|
CSS::CSSStyleSheet* sheet();
|
|
|
|
CSS::CSSStyleSheet const* sheet() const;
|
2021-10-01 00:13:56 +01:00
|
|
|
|
2025-04-20 11:31:57 +02:00
|
|
|
virtual bool contributes_a_script_blocking_style_sheet() const final;
|
|
|
|
|
2019-09-29 17:43:30 +02:00
|
|
|
private:
|
2022-08-28 13:42:07 +02:00
|
|
|
HTMLStyleElement(DOM::Document&, DOM::QualifiedName);
|
|
|
|
|
2024-08-23 10:42:35 +01:00
|
|
|
// ^DOM::Node
|
|
|
|
virtual bool is_html_style_element() const override { return true; }
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2022-08-28 13:42:07 +02:00
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
|
|
|
2023-06-08 16:07:12 +01:00
|
|
|
DOM::StyleElementUtils m_style_element_utils;
|
2019-09-29 17:43:30 +02:00
|
|
|
};
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2020-06-07 23:27:03 +02:00
|
|
|
}
|