Skip to content

Truly independent web browser

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

#pragma once

#include <LibWeb/HTML/HTMLElement.h>

namespace Web::HTML {

class HTMLBRElement final : public HTMLElement {
    WEB_WRAPPABLE(HTMLBRElement, HTMLElement);
    GC_DECLARE_ALLOCATOR(HTMLBRElement);

public:
    virtual ~HTMLBRElement() override;

    virtual CSS::ElementBoxKind box_kind() const override;
    virtual bool is_presentational_hint(Utf16FlyString const&) const override;
    virtual void apply_presentational_hints(Vector<CSS::StyleProperty>&) const override;
    // Whether this <br> renders an empty line, i.e. nothing else renders between the start of its line and the <br>
    // itself. Such a <br> hosts a caret position on its parent, at its child index.
    bool represents_empty_line(Layout::BegunRead const& read) const;

private:
    virtual bool is_html_br_element() const override { return true; }

    HTMLBRElement(DOM::Document&, DOM::QualifiedName);
};

}

namespace Web::DOM {

template<>
inline bool Node::fast_is<HTML::HTMLBRElement>() const { return is_html_br_element(); }

}