ladybird/Userland/Libraries/LibWeb/Layout/TableWrapper.h
Aliaksandr Kalenik 709fe01f52 LibWeb: Override width calculation for table wrappers
Introduce `TableWrapper` type so table wrappers could be
distinguished from block containers and override width
calculation for table wrappers (CSS 2.2 spec, section 17.5.2)
 inside BFCs in the way that their width should be equal to
width of table box they wrap.
2023-01-14 19:22:08 +01:00

28 lines
664 B
C++

/*
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Layout/BlockContainer.h>
namespace Web::Layout {
class TableWrapper : public BlockContainer {
JS_CELL(TableWrapper, BlockContainer);
public:
TableWrapper(DOM::Document&, DOM::Node*, NonnullRefPtr<CSS::StyleProperties>);
TableWrapper(DOM::Document&, DOM::Node*, CSS::ComputedValues);
virtual ~TableWrapper() override;
private:
virtual bool is_table_wrapper() const final { return true; }
};
template<>
inline bool Node::fast_is<TableWrapper>() const { return is_table_wrapper(); }
}