FieldSetBox.h 941 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2024, Kostya Farber <kostya.farber@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Forward.h>
  8. #include <LibWeb/Layout/BlockContainer.h>
  9. namespace Web::Layout {
  10. class FieldSetBox final : public BlockContainer {
  11. GC_CELL(FieldSetBox, BlockContainer);
  12. GC_DECLARE_ALLOCATOR(FieldSetBox);
  13. public:
  14. FieldSetBox(DOM::Document&, DOM::Element&, CSS::StyleProperties);
  15. virtual ~FieldSetBox() override;
  16. DOM::Element& dom_node() { return static_cast<DOM::Element&>(*BlockContainer::dom_node()); }
  17. DOM::Element const& dom_node() const { return static_cast<DOM::Element const&>(*BlockContainer::dom_node()); }
  18. void layout_legend() const;
  19. private:
  20. bool has_rendered_legend() const;
  21. virtual bool is_fieldset_box() const final
  22. {
  23. return true;
  24. }
  25. };
  26. template<>
  27. inline bool Node::fast_is<FieldSetBox>() const { return is_fieldset_box(); }
  28. }