Remove references to CSSNumericValue.from() in the spec#480
Merged
Conversation
tabatkins
requested changes
Oct 18, 2017
| length1.toString(); // "42.0px" | ||
|
|
||
| var length2 = CSSNumericValue.from(42.0, "px"); | ||
| var length2 = CSSNumericValue(CSS.px(42)); |
Member
There was a problem hiding this comment.
No CSSNumericValue() wrapper—CSS.px() already returns a CSSNumericValue.
nainar
commented
Oct 26, 2017
Contributor
Author
nainar
left a comment
There was a problem hiding this comment.
tabatkins@ made the changes, PTAL? Thanks!
tabatkins
requested changes
Oct 26, 2017
| length1.toString(); // "42.0px" | ||
|
|
||
| var length2 = CSSNumericValue.from(42.0, "px"); | ||
| var length2 = CSS.px(42); |
Member
There was a problem hiding this comment.
The 42.0 here was significant - the point is to illustrate that we don't preserve the source formatting (and so, in this case, it outputs as an integer "42px", rather than "42.0px" like the previous example).
nainar
commented
Oct 27, 2017
Contributor
Author
nainar
left a comment
There was a problem hiding this comment.
tabatkins@, PTAL? Thanks!
| length1.toString(); // "42.0px" | ||
|
|
||
| var length2 = CSSNumericValue.from(42.0, "px"); | ||
| var length2 = CSS.px(42); |
tabatkins
approved these changes
Oct 27, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
git branching magic - couldn't seem to merge these two pull requests. (due to a change in the branch name)
Adding Tab's comments on the previous patch here:
"from wasn't turned into to; from was the more generic factory function. It was replaced by parse in the first instance, and the CSSUnitValue constructor in the second instance (or CSS.px())."
Closing the other PR