
Until now, we've internally thought of the CSS "display" property as a single-value property. In practice, "display" is a much more complex property that comes in a number of configurations. The most interesting one is the two-part format that describes the outside and inside behavior of a box. Switching our own internal representation towards this model will allow for much cleaner abstractions around layout and the various formatting contexts. Note that we don't *parse* two-part "display" yet, this is only about changing the internal representation of the property. Spec: https://drafts.csswg.org/css-display
30 lines
831 B
C++
30 lines
831 B
C++
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Layout/BlockBox.h>
|
|
|
|
namespace Web::Layout {
|
|
|
|
class TableCellBox final : public BlockBox {
|
|
public:
|
|
TableCellBox(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);
|
|
TableCellBox(DOM::Document&, DOM::Element*, CSS::ComputedValues);
|
|
virtual ~TableCellBox() override;
|
|
|
|
TableCellBox* next_cell() { return next_sibling_of_type<TableCellBox>(); }
|
|
const TableCellBox* next_cell() const { return next_sibling_of_type<TableCellBox>(); }
|
|
|
|
size_t colspan() const;
|
|
|
|
static CSS::Display static_display() { return CSS::Display { CSS::Display::Internal::TableCell }; }
|
|
|
|
private:
|
|
virtual float width_of_logical_containing_block() const override;
|
|
};
|
|
|
|
}
|