Skip to content

Truly independent web browser

826 B
Raw Blame
/*
 * Copyright (c) 2018-2020, Andreas Kling <[email protected]>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibJS/Forward.h>
#include <LibWeb/DOM/CharacterData.h>
#include <LibWeb/Forward.h>

namespace Web::DOM {

class Comment final : public CharacterData {
    WEB_WRAPPABLE(Comment, CharacterData);
    GC_DECLARE_ALLOCATOR(Comment);

public:
    [[nodiscard]] static GC::Ref<Comment> create(Document&, Utf16String data);
    [[nodiscard]] static GC::Ref<Comment> create_for_constructor(JS::Object&, Utf16String data);
    virtual ~Comment() override = default;

    virtual Utf16FlyString node_name() const override { return "#comment"_utf16_fly_string; }

private:
    Comment(Document&, Utf16String);
};

template<>
inline bool Node::fast_is<Comment>() const { return is_comment(); }

}