TableBox.h 855 B

1234567891011121314151617181920212223242526272829303132333435
  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/Layout/Box.h>
  8. namespace Web::Layout {
  9. class TableBox final : public Layout::Box {
  10. JS_CELL(TableBox, Box);
  11. public:
  12. TableBox(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);
  13. TableBox(DOM::Document&, DOM::Element*, CSS::ComputedValues);
  14. virtual ~TableBox() override;
  15. static CSS::Display static_display(bool inline_outside)
  16. {
  17. if (inline_outside)
  18. return CSS::Display::from_short(CSS::Display::Short::InlineTable);
  19. return CSS::Display::from_short(CSS::Display::Short::Table);
  20. }
  21. private:
  22. virtual bool is_table() const override { return true; }
  23. };
  24. template<>
  25. inline bool Node::fast_is<TableBox>() const { return is_table(); }
  26. }