Skip to main content

style/values/specified/
table.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5//! Specified types for CSS values related to tables.
6use crate::derives::*;
7
8/// Specified values for the `caption-side` property.
9///
10/// Note that despite having "physical" names, these are actually interpreted
11/// according to the table's writing-mode: Top and Bottom are treated as
12/// block-start and -end respectively.
13///
14/// https://drafts.csswg.org/css-tables/#propdef-caption-side
15#[allow(missing_docs)]
16#[derive(
17    Clone,
18    Copy,
19    Debug,
20    Eq,
21    FromPrimitive,
22    MallocSizeOf,
23    Ord,
24    Parse,
25    PartialEq,
26    PartialOrd,
27    SpecifiedValueInfo,
28    ToComputedValue,
29    ToCss,
30    ToResolvedValue,
31    ToShmem,
32    ToTyped,
33)]
34#[repr(u8)]
35pub enum CaptionSide {
36    Top,
37    Bottom,
38}
39
40/// https://drafts.csswg.org/css-tables/#propdef-border-collapse
41#[allow(missing_docs)]
42#[derive(
43    Clone,
44    Copy,
45    Debug,
46    Deserialize,
47    Eq,
48    FromPrimitive,
49    Hash,
50    MallocSizeOf,
51    Parse,
52    PartialEq,
53    Serialize,
54    SpecifiedValueInfo,
55    ToComputedValue,
56    ToCss,
57    ToResolvedValue,
58    ToShmem,
59    ToTyped,
60)]
61#[repr(u8)]
62pub enum BorderCollapse {
63    Separate,
64    Collapse,
65}
66
67/// https://drafts.csswg.org/css-tables/#propdef-empty-cells
68#[allow(missing_docs)]
69#[derive(
70    Clone,
71    Copy,
72    Debug,
73    Deserialize,
74    Eq,
75    FromPrimitive,
76    Hash,
77    MallocSizeOf,
78    Parse,
79    PartialEq,
80    Serialize,
81    SpecifiedValueInfo,
82    ToComputedValue,
83    ToCss,
84    ToResolvedValue,
85    ToShmem,
86    ToTyped,
87)]
88#[repr(u8)]
89pub enum EmptyCells {
90    Show,
91    Hide,
92}
93
94/// https://drafts.csswg.org/css-tables/#propdef-table-layout
95#[allow(missing_docs)]
96#[derive(
97    Clone,
98    Copy,
99    Debug,
100    Deserialize,
101    Eq,
102    FromPrimitive,
103    Hash,
104    MallocSizeOf,
105    Parse,
106    PartialEq,
107    Serialize,
108    SpecifiedValueInfo,
109    ToComputedValue,
110    ToCss,
111    ToResolvedValue,
112    ToShmem,
113    ToTyped,
114)]
115#[repr(u8)]
116pub enum TableLayout {
117    Auto,
118    Fixed,
119}