Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stylo: Add grid-gap shorthand #16081

Merged
merged 1 commit into from Mar 22, 2017
Merged

Conversation

methyl
Copy link
Contributor

@methyl methyl commented Mar 22, 2017

  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors

Should I add any tests?


This change is Reviewable

@highfive
Copy link

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/shorthand/position.mako.rs
  • @emilio: components/style/properties/shorthand/position.mako.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 22, 2017
@highfive
Copy link

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!

@bholley
Copy link
Contributor

bholley commented Mar 22, 2017

r? @Manishearth

@highfive highfive assigned Manishearth and unassigned asajeffrey Mar 22, 2017
@bholley
Copy link
Contributor

bholley commented Mar 22, 2017

or @wafflespeanut

Thanks a ton for helping out with this stuff @methyl! This work is critical to helping us ship Servo in Firefox this year.


pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
let row_gap = grid_row_gap::parse(context, input)?;
let column_gap = grid_column_gap::parse(context, input).unwrap_or(row_gap.clone());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use input.try(); otherwise the cursor won't reset after a failed parse.

impl<'a> ToCss for LonghandsToSerialize<'a> {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
self.grid_row_gap.to_css(dest)?;
dest.write_str(" ")?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you should skip these two steps if the column gap is the same. check what firefox does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the change, although I've been looking around and can't get any idea what's the usecase of ToCss so I can confirm with Firefox behavior.

@methyl
Copy link
Contributor Author

methyl commented Mar 22, 2017

@Manishearth I think build fails because gaps are declared for gecko, so it won't get registered as longhand. Not sure what to do in this case

@Manishearth
Copy link
Member

put product="gecko" on the shorthand declaration

@Manishearth
Copy link
Member

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit c331376 has been approved by Manishearth

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Mar 22, 2017
@wafflespeanut
Copy link
Contributor

@bors-servo r-

Needs squash.

@wafflespeanut wafflespeanut added S-needs-squash Some (or all) of the commits in the PR should be combined. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Mar 22, 2017
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 22, 2017
@wafflespeanut
Copy link
Contributor

Thanks!

@bors-servo r=Manishearth

@bors-servo
Copy link
Contributor

📌 Commit 6eba653 has been approved by Manishearth

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-squash Some (or all) of the commits in the PR should be combined. labels Mar 22, 2017
@bors-servo
Copy link
Contributor

⌛ Testing commit 6eba653 with merge 4715d3c...

bors-servo pushed a commit that referenced this pull request Mar 22, 2017
Stylo: Add grid-gap shorthand

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

Should I add any tests?

<!-- 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/16081)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: Manishearth
Pushing 4715d3c to master...

@bors-servo bors-servo merged commit 6eba653 into servo:master Mar 22, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants