mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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:
parent
f8e4ae6040
commit
959ffad99a
76 changed files with 551 additions and 322 deletions
|
@ -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\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue