aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/fragment_tree/base_fragment.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-07-03 20:24:19 +0200
committerGitHub <noreply@github.com>2024-07-03 18:24:19 +0000
commit959ffad99a57f5f8f0554fed0983317577ae8290 (patch)
treeb39a61902cdb8d2bf648b27469ea69dbdcb5aed4 /components/layout_2020/fragment_tree/base_fragment.rs
parentf8e4ae60401358ac6adaa480e63c587f9f8293a2 (diff)
downloadservo-959ffad99a57f5f8f0554fed0983317577ae8290.tar.gz
servo-959ffad99a57f5f8f0554fed0983317577ae8290.zip
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>
Diffstat (limited to 'components/layout_2020/fragment_tree/base_fragment.rs')
-rw-r--r--components/layout_2020/fragment_tree/base_fragment.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/components/layout_2020/fragment_tree/base_fragment.rs b/components/layout_2020/fragment_tree/base_fragment.rs
index dacc082581d..a40174cf05e 100644
--- a/components/layout_2020/fragment_tree/base_fragment.rs
+++ b/components/layout_2020/fragment_tree/base_fragment.rs
@@ -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;
}
}