Coverage Report

Created: 2026-07-25 07:46

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/serenity/Userland/Libraries/LibWeb/DOM/Slot.h
Line
Count
Source
1
/*
2
 * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
3
 *
4
 * SPDX-License-Identifier: BSD-2-Clause
5
 */
6
7
#pragma once
8
9
#include <AK/String.h>
10
#include <LibWeb/DOM/Slottable.h>
11
12
namespace Web::DOM {
13
14
// https://dom.spec.whatwg.org/#concept-slot
15
class Slot {
16
public:
17
    virtual ~Slot();
18
19
0
    String const& slot_name() const { return m_name; } // Not called `name` to distinguish from `Element::name`.
20
0
    void set_slot_name(String name) { m_name = move(name); }
21
22
0
    ReadonlySpan<DOM::Slottable> assigned_nodes_internal() const { return m_assigned_nodes; }
23
0
    void set_assigned_nodes(Vector<DOM::Slottable> assigned_nodes) { m_assigned_nodes = move(assigned_nodes); }
24
25
protected:
26
    void visit_edges(JS::Cell::Visitor&);
27
28
private:
29
    // https://dom.spec.whatwg.org/#slot-name
30
    String m_name;
31
32
    // https://dom.spec.whatwg.org/#slot-assigned-nodes
33
    Vector<Slottable> m_assigned_nodes;
34
};
35
36
}