Skip to content

Remove references to CSSNumericValue.from() in the spec #480

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

Merged
merged 2 commits into from
Oct 27, 2017

Conversation

nainar
Copy link
Contributor

@nainar nainar commented Oct 15, 2017

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

length1.toString(); // "42.0px"

var length2 = CSSNumericValue.from(42.0, "px");
var length2 = CSSNumericValue(CSS.px(42));
Copy link
Member

Choose a reason for hiding this comment

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

No CSSNumericValue() wrapper—CSS.px() already returns a CSSNumericValue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

@nainar nainar left a comment

Choose a reason for hiding this comment

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

tabatkins@ made the changes, PTAL? Thanks!

length1.toString(); // "42.0px"

var length2 = CSSNumericValue.from(42.0, "px");
var length2 = CSS.px(42);
Copy link
Member

Choose a reason for hiding this comment

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

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

@nainar nainar left a comment

Choose a reason for hiding this comment

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

tabatkins@, PTAL? Thanks!

length1.toString(); // "42.0px"

var length2 = CSSNumericValue.from(42.0, "px");
var length2 = CSS.px(42);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@tabatkins tabatkins merged commit ad7644f into w3c:master Oct 27, 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.

2 participants