layout: Add support for table captions (#32657)

This adds initial support for table captions. To do this, the idea of
the table wrapper becomes a bit more concrete. Even so, the wrapper is
still reponsible for allocating space for the grid's border and padding,
as those properties are specified on the wrapper and not grid in CSS.

In order to account for this weirdness of HTML/CSS captions and grid are
now laid out and placed with a negative offset in the table wrapper
content rect.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2024-07-03 20:24:19 +02:00 committed by GitHub
parent f8e4ae6040
commit 959ffad99a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 551 additions and 322 deletions

View file

@ -215,14 +215,18 @@ impl BoxFragment {
)
}
pub fn padding_rect(&self) -> LogicalRect<Au> {
pub(crate) fn padding_rect(&self) -> LogicalRect<Au> {
self.content_rect.inflate(&self.padding)
}
pub fn border_rect(&self) -> LogicalRect<Au> {
pub(crate) fn border_rect(&self) -> LogicalRect<Au> {
self.padding_rect().inflate(&self.border)
}
pub(crate) fn margin_rect(&self) -> LogicalRect<Au> {
self.border_rect().inflate(&self.margin)
}
pub fn print(&self, tree: &mut PrintTree) {
tree.new_level(format!(
"Box\