Auto merge of #17692 - canaltinova:grid-pls, r=wafflespeanut

stylo: Fix grid-template serialization in grid shorthand

Because of some unnecessary checks, it wasn't able to serialize the '40px / none' value properly before. That will fix one failure on `test_value_storage.html`

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17692)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-12 14:38:14 -07:00 committed by GitHub
commit 5585ff2c44

View file

@ -495,11 +495,9 @@
}) })
} }
/// Returns true if every sub property value of `grid` shorthand is initial.
impl<'a> LonghandsToSerialize<'a> { impl<'a> LonghandsToSerialize<'a> {
fn is_initial(&self) -> bool { /// Returns true if other sub properties except template-{rows,columns} are initial.
*self.grid_template_rows == GridTemplateComponent::None && fn is_grid_template(&self) -> bool {
*self.grid_template_columns == GridTemplateComponent::None &&
*self.grid_template_areas == Either::Second(None_) && *self.grid_template_areas == Either::Second(None_) &&
*self.grid_auto_rows == TrackSize::default() && *self.grid_auto_rows == TrackSize::default() &&
*self.grid_auto_columns == TrackSize::default() && *self.grid_auto_columns == TrackSize::default() &&
@ -512,7 +510,7 @@
if *self.grid_template_areas != Either::Second(None_) || if *self.grid_template_areas != Either::Second(None_) ||
(*self.grid_template_rows != GridTemplateComponent::None && (*self.grid_template_rows != GridTemplateComponent::None &&
*self.grid_template_columns != GridTemplateComponent::None) || *self.grid_template_columns != GridTemplateComponent::None) ||
self.is_initial() { self.is_grid_template() {
return super::grid_template::serialize_grid_template(self.grid_template_rows, return super::grid_template::serialize_grid_template(self.grid_template_rows,
self.grid_template_columns, self.grid_template_columns,
self.grid_template_areas, dest); self.grid_template_areas, dest);