style: Move caption-side outside of mako.

Make it an enum class, etc.

Differential Revision: https://phabricator.services.mozilla.com/D103978
This commit is contained in:
Emilio Cobos Álvarez 2021-02-07 12:33:45 +00:00
parent e084d8e9d2
commit 5fe702fa2b
6 changed files with 60 additions and 5 deletions

View file

@ -125,6 +125,7 @@ pub mod position;
pub mod rect;
pub mod resolution;
pub mod svg;
pub mod table;
pub mod text;
pub mod time;
pub mod transform;

View file

@ -0,0 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Computed types for CSS values related to tables.
pub use super::specified::table::CaptionSide;

View file

@ -129,6 +129,7 @@ pub mod resolution;
pub mod source_size_list;
pub mod svg;
pub mod svg_path;
pub mod table;
pub mod text;
pub mod time;
pub mod transform;

View file

@ -0,0 +1,45 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Specified types for CSS values related to tables.
/// Specified values for the `caption-side` property.
///
/// Note that despite having "physical" names, these are actually interpreted
/// according to the table's writing-mode: Top and Bottom are treated as
/// block-start and -end respectively, and Left and Right are treated as
/// line-start and -end.
///
/// https://drafts.csswg.org/css-tables/#propdef-caption-side
#[allow(missing_docs)]
#[derive(
Clone,
Copy,
Debug,
Eq,
FromPrimitive,
MallocSizeOf,
Ord,
Parse,
PartialEq,
PartialOrd,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(u8)]
pub enum CaptionSide {
Top,
Bottom,
#[cfg(feature = "gecko")]
Right,
#[cfg(feature = "gecko")]
Left,
#[cfg(feature = "gecko")]
TopOutside,
#[cfg(feature = "gecko")]
BottomOutside,
}