aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/values/generics/grid.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-04-10 12:10:26 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-04-12 12:20:09 +0200
commita47dcb570713b44a9782024a29de1aba1e6726e4 (patch)
treec2fa9775cbf9c9e4fdbdeb21645b5372206dc997 /components/style/values/generics/grid.rs
parent6ac777ebf22e2d619f5ffe7a253b27b7d104ccf4 (diff)
downloadservo-a47dcb570713b44a9782024a29de1aba1e6726e4.tar.gz
servo-a47dcb570713b44a9782024a29de1aba1e6726e4.zip
style: Derive ToResolvedValue.
Differential Revision: https://phabricator.services.mozilla.com/D26783
Diffstat (limited to 'components/style/values/generics/grid.rs')
-rw-r--r--components/style/values/generics/grid.rs35
1 files changed, 28 insertions, 7 deletions
diff --git a/components/style/values/generics/grid.rs b/components/style/values/generics/grid.rs
index a3a94d3eaf5..17af16e5167 100644
--- a/components/style/values/generics/grid.rs
+++ b/components/style/values/generics/grid.rs
@@ -19,7 +19,15 @@ use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
///
/// <https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line>
#[derive(
- Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
+ Clone,
+ Debug,
+ Default,
+ MallocSizeOf,
+ PartialEq,
+ SpecifiedValueInfo,
+ ToComputedValue,
+ ToResolvedValue,
+ ToShmem,
)]
pub struct GridLine<Integer> {
/// Flag to check whether it's a `span` keyword.
@@ -164,6 +172,7 @@ impl Parse for GridLine<specified::Integer> {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
+ ToResolvedValue,
ToShmem,
)]
pub enum TrackKeyword {
@@ -185,6 +194,7 @@ pub enum TrackKeyword {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
+ ToResolvedValue,
ToShmem,
)]
pub enum TrackBreadth<L> {
@@ -211,7 +221,7 @@ impl<L> TrackBreadth<L> {
/// generic only to avoid code bloat. It only takes `<length-percentage>`
///
/// <https://drafts.csswg.org/css-grid/#typedef-track-size>
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToShmem)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToResolvedValue, ToShmem)]
pub enum TrackSize<L> {
/// A flexible `<track-breadth>`
Breadth(TrackBreadth<L>),
@@ -369,7 +379,7 @@ where
/// The initial argument of the `repeat` function.
///
/// <https://drafts.csswg.org/css-grid/#typedef-track-repeat>
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToShmem)]
+#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss, ToResolvedValue, ToShmem)]
pub enum RepeatCount<Integer> {
/// A positive integer. This is allowed only for `<track-repeat>` and `<fixed-repeat>`
Number(Integer),
@@ -404,7 +414,7 @@ impl Parse for RepeatCount<specified::Integer> {
///
/// It can also hold `repeat()` function parameters, which expands into the respective
/// values in its computed form.
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
#[css(function = "repeat")]
pub struct TrackRepeat<L, I> {
/// The number of times for the value to be repeated (could also be `auto-fit` or `auto-fill`)
@@ -501,6 +511,7 @@ impl<L: Clone> TrackRepeat<L, specified::Integer> {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
+ ToResolvedValue,
ToShmem,
)]
pub enum TrackListValue<LengthPercentage, Integer> {
@@ -513,7 +524,7 @@ pub enum TrackListValue<LengthPercentage, Integer> {
/// The type of a `<track-list>` as determined during parsing.
///
/// <https://drafts.csswg.org/css-grid/#typedef-track-list>
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToShmem)]
+#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)]
pub enum TrackListType {
/// [`<auto-track-list>`](https://drafts.csswg.org/css-grid/#typedef-auto-track-list)
///
@@ -535,7 +546,7 @@ pub enum TrackListType {
/// A grid `<track-list>` type.
///
/// <https://drafts.csswg.org/css-grid/#typedef-track-list>
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToShmem)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToShmem, ToResolvedValue)]
pub struct TrackList<LengthPercentage, Integer> {
/// The type of this `<track-list>` (auto, explicit or general).
///
@@ -609,7 +620,15 @@ impl<L: ToCss, I: ToCss> ToCss for TrackList<L, I> {
/// `subgrid [ <line-names> | repeat(<positive-integer> | auto-fill, <line-names>+) ]+`
/// Old spec: https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-line-name-list
#[derive(
- Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToShmem,
+ Clone,
+ Debug,
+ Default,
+ MallocSizeOf,
+ PartialEq,
+ SpecifiedValueInfo,
+ ToComputedValue,
+ ToResolvedValue,
+ ToShmem,
)]
pub struct LineNameList {
/// The optional `<line-name-list>`
@@ -724,6 +743,7 @@ impl ToCss for LineNameList {
SpecifiedValueInfo,
ToComputedValue,
ToCss,
+ ToResolvedValue,
ToShmem,
)]
pub enum GridTemplateComponent<L, I> {
@@ -733,6 +753,7 @@ pub enum GridTemplateComponent<L, I> {
TrackList(
#[animation(field_bound)]
#[compute(field_bound)]
+ #[resolve(field_bound)]
#[shmem(field_bound)]
TrackList<L, I>,
),