Skip to content

Commit

Permalink
Bug 1519958 - Improve stack size of grid templates and re-enable styl…
Browse files Browse the repository at this point in the history
…e struct size assertions disabled in the previous patch. r=boris

This re-enables the assertion which was disabled on the previous patch by doing
a bit of boxing around.

Differential Revision: https://phabricator.services.mozilla.com/D36599
  • Loading branch information
emilio committed Aug 15, 2019
1 parent 3e39998 commit 708ce04
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
7 changes: 5 additions & 2 deletions components/style/properties/shorthands/position.mako.rs
Expand Up @@ -353,8 +353,11 @@
GenericGridTemplateComponent::None
};

Ok((GenericGridTemplateComponent::TrackList(template_rows),
template_cols, GridTemplateAreas::Areas(TemplateAreasArc(Arc::new(template_areas)))))
Ok((
GenericGridTemplateComponent::TrackList(Box::new(template_rows)),
template_cols,
GridTemplateAreas::Areas(TemplateAreasArc(Arc::new(template_areas)))
))
} else {
let mut template_rows = GridTemplateComponent::parse(context, input)?;
if let GenericGridTemplateComponent::TrackList(ref mut list) = template_rows {
Expand Down
4 changes: 2 additions & 2 deletions components/style/values/generics/grid.rs
Expand Up @@ -710,12 +710,12 @@ pub enum GenericGridTemplateComponent<L, I> {
#[compute(field_bound)]
#[resolve(field_bound)]
#[shmem(field_bound)]
GenericTrackList<L, I>,
Box<GenericTrackList<L, I>>,
),
/// A `subgrid <line-name-list>?`
/// TODO: Support animations for this after subgrid is addressed in [grid-2] spec.
#[animation(error)]
Subgrid(LineNameList),
Subgrid(Box<LineNameList>),
}

pub use self::GenericGridTemplateComponent as GridTemplateComponent;
Expand Down
5 changes: 3 additions & 2 deletions components/style/values/specified/grid.rs
Expand Up @@ -321,10 +321,11 @@ impl GridTemplateComponent<LengthPercentage, Integer> {
) -> Result<Self, ParseError<'i>> {
if allow_grid_template_subgrids() {
if let Ok(t) = input.try(|i| LineNameList::parse(context, i)) {
return Ok(GridTemplateComponent::Subgrid(t));
return Ok(GridTemplateComponent::Subgrid(Box::new(t)));
}
}

TrackList::parse(context, input).map(GridTemplateComponent::TrackList)
let track_list = TrackList::parse(context, input)?;
Ok(GridTemplateComponent::TrackList(Box::new(track_list)))
}
}

0 comments on commit 708ce04

Please sign in to comment.