Skip to content

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

Merged
tabatkins merged 2 commits into
w3c:masterfrom
nainar:remove_from
Oct 27, 2017
Merged

Remove references to CSSNumericValue.from() in the spec#480
tabatkins merged 2 commits into
w3c:masterfrom
nainar:remove_from

Conversation

@nainar
Copy link
Copy Markdown
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

Comment thread css-typed-om/Overview.bs Outdated
length1.toString(); // "42.0px"

var length2 = CSSNumericValue.from(42.0, "px");
var length2 = CSSNumericValue(CSS.px(42));
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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!

Comment thread css-typed-om/Overview.bs Outdated
length1.toString(); // "42.0px"

var length2 = CSSNumericValue.from(42.0, "px");
var length2 = CSS.px(42);
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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!

Comment thread css-typed-om/Overview.bs Outdated
length1.toString(); // "42.0px"

var length2 = CSSNumericValue.from(42.0, "px");
var length2 = CSS.px(42);
Copy link
Copy Markdown
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