BreakNode.h 702 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/HTML/HTMLBRElement.h>
  8. #include <LibWeb/Layout/Node.h>
  9. namespace Web::Layout {
  10. class BreakNode final : public NodeWithStyleAndBoxModelMetrics {
  11. public:
  12. BreakNode(DOM::Document&, HTML::HTMLBRElement&, NonnullRefPtr<CSS::StyleProperties>);
  13. virtual ~BreakNode() override;
  14. const HTML::HTMLBRElement& dom_node() const { return verify_cast<HTML::HTMLBRElement>(*Node::dom_node()); }
  15. private:
  16. virtual bool is_break_node() const final { return true; }
  17. };
  18. template<>
  19. inline bool Node::fast_is<BreakNode>() const { return is_break_node(); }
  20. }