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
|
@ -85,22 +85,23 @@ bitflags! {
|
|||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
pub(crate) struct FragmentFlags: u8 {
|
||||
/// Whether or not the node that created this fragment is a `<body>` element on an HTML document.
|
||||
const IS_BODY_ELEMENT_OF_HTML_ELEMENT_ROOT = 0b00000001;
|
||||
const IS_BODY_ELEMENT_OF_HTML_ELEMENT_ROOT = 1 << 0;
|
||||
/// Whether or not the node that created this Fragment is a `<br>` element.
|
||||
const IS_BR_ELEMENT = 0b00000010;
|
||||
const IS_BR_ELEMENT = 1 << 1;
|
||||
/// Whether or not the node that created was a `<table>`, `<th>` or
|
||||
/// `<td>` element. Note that this does *not* include elements with
|
||||
/// `display: table` or `display: table-cell`.
|
||||
const IS_TABLE_TH_OR_TD_ELEMENT = 0b00000100;
|
||||
const IS_TABLE_TH_OR_TD_ELEMENT = 1 << 2;
|
||||
/// Whether or not this Fragment was created to contain a replaced element or is
|
||||
/// a replaced element.
|
||||
const IS_REPLACED = 0b00001000;
|
||||
const IS_REPLACED = 1 << 3;
|
||||
/// Whether or not this Fragment was created to contain a list item marker
|
||||
/// with a used value of `list-style-position: outside`.
|
||||
const IS_OUTSIDE_LIST_ITEM_MARKER = 0b00010000;
|
||||
/// Avoid painting the fragment, this is used for empty table cells when 'empty-cells' is 'hide'.
|
||||
/// This flag doesn't avoid hit-testing.
|
||||
const DO_NOT_PAINT = 0b00100000;
|
||||
const IS_OUTSIDE_LIST_ITEM_MARKER = 1 << 4;
|
||||
/// Avoid painting the borders, backgrounds, and drop shadow for this fragment, this is used
|
||||
/// for empty table cells when 'empty-cells' is 'hide' and also table wrappers. This flag
|
||||
/// doesn't avoid hit-testing nor does it prevent the painting outlines.
|
||||
const DO_NOT_PAINT = 1 << 5;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue