ladybird/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h
Ali Mohammad Pur aeee98b3a1 AK+Everywhere: Remove the null state of DeprecatedString
This commit removes DeprecatedString's "null" state, and replaces all
its users with one of the following:
- A normal, empty DeprecatedString
- Optional<DeprecatedString>

Note that null states of DeprecatedFlyString/StringView/etc are *not*
affected by this commit. However, DeprecatedString::empty() is now
considered equal to a null StringView.
2023-10-13 18:33:21 +03:30

49 lines
1.5 KiB
C++

/*
* Copyright (c) 2020, the SerenityOS developers.
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Optional.h>
#include <LibWeb/ARIA/Roles.h>
#include <LibWeb/HTML/HTMLElement.h>
#include <LibWeb/HTML/ToggleTaskTracker.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::HTML {
class HTMLDetailsElement final : public HTMLElement {
WEB_PLATFORM_OBJECT(HTMLDetailsElement, HTMLElement);
public:
virtual ~HTMLDetailsElement() override;
// https://www.w3.org/TR/html-aria/#el-details
virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::group; }
private:
HTMLDetailsElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
virtual void children_changed() override;
virtual void attribute_changed(FlyString const& name, Optional<DeprecatedString> const& value) override;
void queue_a_details_toggle_event_task(String old_state, String new_state);
WebIDL::ExceptionOr<void> create_shadow_tree(JS::Realm&);
void update_shadow_tree_slots();
void update_shadow_tree_style();
// https://html.spec.whatwg.org/multipage/interactive-elements.html#details-toggle-task-tracker
Optional<ToggleTaskTracker> m_details_toggle_task_tracker;
JS::GCPtr<HTML::HTMLSlotElement> m_summary_slot;
JS::GCPtr<HTML::HTMLSlotElement> m_descendants_slot;
};
}