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

Shorthand with variable reference should not have extra whitespace after colon for serialization #15422

Closed
wants to merge 1 commit into from

Conversation

@mdevlamynck
Copy link
Contributor

mdevlamynck commented Feb 7, 2017

Fixes #15295. Tell me if anything is wrong with the tests, I'm not sure I created them correctly.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #15295.

  • There are tests for these changes


This change is Reviewable

@highfive
Copy link

highfive commented Feb 7, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/declaration_block.rs
  • @emilio: components/style/properties/declaration_block.rs
@highfive
Copy link

highfive commented Feb 7, 2017

warning Warning warning

  • These commits include an empty title element (<title></title>). Consider adding appropriate metadata.
@bors-servo
Copy link
Contributor

bors-servo commented Feb 7, 2017

The latest upstream changes (presumably #15405) made this pull request unmergeable. Please resolve the merge conflicts.

&AppendableValue::Declaration(decl) => {
if !decl.value_is_unparsed() {
// for normal parsed values, add a space between key: and value
try!(write!(dest, " "));
}
},
&AppendableValue::DeclarationsForShorthand(..) => try!(write!(dest, " "))
&AppendableValue::DeclarationsForShorthand(..) => try!(write!(dest, " ")),
_ => {},

This comment has been minimized.

@emilio

emilio Feb 7, 2017

Member

Instead of a wildcard, let's do &AppendableValue::Css(..) => {}, so if new AppendableValue kinds are added it's not forgotten here.

Copy link
Member

emilio left a comment

Looks good! Mostly nits and needs a rebase, thanks for working on this! :)

test(function() {
var elem = document.getElementById('longhand-whitespace');

assert_equals(elem.style.cssText, 'font-size: var(--a);');

This comment has been minimized.

@emilio

emilio Feb 7, 2017

Member

Please use spaces instead of tabs for indentation.

@@ -0,0 +1,34 @@
<!doctype html>
<meta charset="utf-8">
<title></title>

This comment has been minimized.

@emilio

emilio Feb 7, 2017

Member

Let's add a descriptive title here.

@@ -9804,6 +9804,11 @@
{}
]
],
"mozilla/referrer-policy/generic/subresource/mozresource.pyc": [

This comment has been minimized.

@mdevlamynck

mdevlamynck Feb 8, 2017

Author Contributor

Are those changes normal after a ./mach update-manifest? They seem to make the travis build fail.

@mdevlamynck
Copy link
Contributor Author

mdevlamynck commented Feb 8, 2017

Fixed nits and rebase done ;)

I'm just not sure of the changes to tests/wpt/mozilla/meta/MANIFEST.json, they appeared after a ./mach update-manifest I used to solve conflicts in tests/wpt/metadata/MANIFEST.json during the rebase.

@jdm
Copy link
Member

jdm commented Feb 8, 2017

That looks like a new problem; go ahead and remove the pyc entries manually and we'll sort that out separately.

@canova
Copy link
Member

canova commented Feb 11, 2017

r? @emilio

@highfive highfive assigned emilio and unassigned metajack Feb 11, 2017
@@ -0,0 +1,34 @@
<!doctype html>
<meta charset="utf-8">
<title>CSSO - Serialize is consistent with whitespace.</title>

This comment has been minimized.

@canova

canova Feb 11, 2017

Member

little nit: this should be CSSOM :)

This comment has been minimized.

@emilio

emilio Feb 11, 2017

Member

Yes, please fix this.

var elem = document.getElementById('longhand');

assert_equals(elem.style.cssText, 'font-size:var(--a);');
}, "Longhand without withspace doesn't had one")

This comment has been minimized.

@emilio

emilio Feb 12, 2017

Member

Let's write this as "Longhand with variables preserves original serialization: without whitespace", and so on.

You have a few typos here too, please replace "withspace" with "whitespace".

Thanks!

}
},
&AppendableValue::DeclarationsForShorthand(..) => try!(write!(dest, " "))
if !decl.value_is_unparsed() {

This comment has been minimized.

@emilio

emilio Feb 12, 2017

Member

Please indent this to four spaces as it was.

@bors-servo
Copy link
Contributor

bors-servo commented Feb 24, 2017

The latest upstream changes (presumably #15685) made this pull request unmergeable. Please resolve the merge conflicts.

@jdm
Copy link
Member

jdm commented Feb 24, 2017

@emilio Review ping.

…ter colon for serialization
@jdm
Copy link
Member

jdm commented Mar 24, 2017

@emilio This has been sitting for almost a month :(

@emilio
Copy link
Member

emilio commented Mar 25, 2017

Ouch, sorry for the lag here :(.

Looks good, though it needs a manifest update. I'll take care of it landing it as soon as I have a more stable internet connection if @mdevlamynck doesn't get to it first.

Thanks for the patch @mdevlamynck, sorry again :/

@jdm
Copy link
Member

jdm commented Mar 25, 2017

Note: the manifest update can be accomplished with ./mach update-manifest, then committing and squashing the result.

@emilio
Copy link
Member

emilio commented Mar 26, 2017

Closed in favor of #16135, thanks for doing this!

@emilio emilio closed this Mar 26, 2017
bors-servo added a commit that referenced this pull request Mar 26, 2017
Shorthand with variable reference should not have extra whitespace after colon for serialization.

This is #15422 + a manifest update. Fixes  #15295.

<!-- 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/16135)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Mar 26, 2017
Shorthand with variable reference should not have extra whitespace after colon for serialization.

This is #15422 + a manifest update. Fixes  #15295.

<!-- 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/16135)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Mar 26, 2017
Shorthand with variable reference should not have extra whitespace after colon for serialization.

This is #15422 + a manifest update. Fixes  #15295.

<!-- 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/16135)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Mar 29, 2017
Shorthand with variable reference should not have extra whitespace after colon for serialization.

This is #15422 + a manifest update. Fixes  #15295.

<!-- 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/16135)
<!-- Reviewable:end -->
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 30, 2017
…ve extra whitespace after colon for serialization (from emilio:shorthand-reference-variable); r=upsuper

This is servo/servo#15422 + a manifest update. Fixes  #15295.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3a3f258f33d7f1c18645df95d3ca72879a770266

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : ce5ef6e91c6f473be4e90d149f33a17757d49d06
Manishearth pushed a commit to Manishearth/gecko-dev that referenced this pull request Apr 5, 2017
…ve extra whitespace after colon for serialization (from emilio:shorthand-reference-variable); r=upsuper

This is servo/servo#15422 + a manifest update. Fixes  #15295.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3a3f258f33d7f1c18645df95d3ca72879a770266
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
…ve extra whitespace after colon for serialization (from emilio:shorthand-reference-variable); r=upsuper

This is servo/servo#15422 + a manifest update. Fixes  #15295.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3a3f258f33d7f1c18645df95d3ca72879a770266

UltraBlame original commit: d5e22d9308739ad39e78908a09c68cf9812ad1c1
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
…ve extra whitespace after colon for serialization (from emilio:shorthand-reference-variable); r=upsuper

This is servo/servo#15422 + a manifest update. Fixes  #15295.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3a3f258f33d7f1c18645df95d3ca72879a770266

UltraBlame original commit: d5e22d9308739ad39e78908a09c68cf9812ad1c1
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
…ve extra whitespace after colon for serialization (from emilio:shorthand-reference-variable); r=upsuper

This is servo/servo#15422 + a manifest update. Fixes  #15295.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3a3f258f33d7f1c18645df95d3ca72879a770266

UltraBlame original commit: d5e22d9308739ad39e78908a09c68cf9812ad1c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

7 participants
You can’t perform that action at this time.