mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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:
parent
e084d8e9d2
commit
5fe702fa2b
6 changed files with 60 additions and 5 deletions
|
@ -399,6 +399,7 @@ class Longhand(object):
|
|||
"BackgroundRepeat",
|
||||
"BorderImageRepeat",
|
||||
"BorderStyle",
|
||||
"table::CaptionSide",
|
||||
"Clear",
|
||||
"ColumnCount",
|
||||
"Contain",
|
||||
|
|
|
@ -26,12 +26,12 @@ ${helpers.single_keyword(
|
|||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
||||
${helpers.single_keyword(
|
||||
${helpers.predefined_type(
|
||||
"caption-side",
|
||||
"top bottom",
|
||||
"table::CaptionSide",
|
||||
"computed::table::CaptionSide::Top",
|
||||
needs_context=False,
|
||||
engines="gecko servo-2013",
|
||||
extra_gecko_values="right left top-outside bottom-outside",
|
||||
needs_conversion="True",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-tables/#propdef-caption-side",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
|
@ -46,5 +46,5 @@ ${helpers.predefined_type(
|
|||
animation_value_type="BorderSpacing",
|
||||
boxed=True,
|
||||
spec="https://drafts.csswg.org/css-tables/#propdef-border-spacing",
|
||||
servo_restyle_damage = "reflow",
|
||||
servo_restyle_damage="reflow",
|
||||
)}
|
||||
|
|
|
@ -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;
|
||||
|
|
7
components/style/values/computed/table.rs
Normal file
7
components/style/values/computed/table.rs
Normal 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;
|
|
@ -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;
|
||||
|
|
45
components/style/values/specified/table.rs
Normal file
45
components/style/values/specified/table.rs
Normal 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,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue