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

[css-values] Adding new units: en, cap, bs/hs; m/dm/mu, dd/cc, thm/mdl, dot, yd/ft/hd, sx/tx/twip, ax/ay/bx/by/cx/cy; tip/tap/mark/pad/span/sole; moa/soa, pi, perm; min/h, now/mom, beat/blink, jif; bpm #848

Closed
wants to merge 20 commits into from

Conversation

Crissov
Copy link
Contributor

@Crissov Crissov commented Jan 1, 2017

My git-fu isn’t strong enough yet to split this nicely into separate pull requests.

Length units

Viewport-relative length units

Relative length units

Absolute length units

Anthropometric/physiological length units

Angle units

Duration units

Frequency units

  • Add the classic bpm unit.

@Crissov Crissov changed the title [css-values] Add several new units [css-values] Adding new units: en, cap, bs/hs; m/dm/mu, dd/cc, thm/mdl, dot, yd/ft/hd, sx/tx/twip, ax/ay/bx/by/cx/cy; tip/tap/mark/pad/span/sole; moa/soa, pi, perm; min/h, now/mom, beat/blink, jif; bpm Jan 1, 2017
@fantasai
Copy link
Collaborator

fantasai commented Jan 3, 2017

Please do not issue pull requests for significant changes. These changes need to be discussed and approved by the CSSWG before any text is added to the spec, and pull requests are not an appropriate place for that.

@fantasai fantasai closed this Jan 3, 2017
Copy link
Contributor Author

@Crissov Crissov left a comment

Choose a reason for hiding this comment

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

description and links to existing issues

@@ -942,20 +953,38 @@ Font-relative lengths: the ''em'', ''ex'', ''ch'', ''ic'', ''rem'' units</h4>
will be 20% greater than the computed font size inherited by <code>h1</code> elements.
</div>

<dt><dfn id="rem" lt="rem">rem unit</dfn>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved rem next to em

the glyph for the lowercase "o" extends below the baseline, and
subtract that value from the top of its bounding box. In the cases
where it is impossible or impractical to determine the x-height,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Line reflow

a value of 0.5em must be assumed.

<dt><dfn id="cap" lt="cap">cap unit</dfn>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new unit cap, discussed in #315, #660 and #661

@@ -978,27 +1007,62 @@ Font-relative lengths: the ''em'', ''ex'', ''ch'', ''ic'', ''rem'' units</h4>
(i.e. 'writing-mode' is ''vertical-rl'' or ''vertical-lr''
and 'text-orientation' is ''text-orientation/upright'').

<dt><dfn id="ic" lt="ic">ic unit</dfn>
<dt><dfn id="en" lt="en">en unit</dfn>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new unit en, was once supported by Gecko, mentioned in #315

(in the few fonts with proportional fullwidth glyphs, an approximation)
of a single <a href="http://unicode.org/reports/tr11/#Definitions">fullwidth</a> glyph’s <a>advance measure</a>,
thus allowing measurements based on an expected glyph count.

In the cases where it is impossible or impractical to determine the ideographic advance measure,
it must be assumed to be 1em.

<dt><dfn id="rem" lt="rem">rem unit</dfn>
<dt><dfn id="bs" lt="bs">bs unit</dfn>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Two new units for stroke widths, text mostly copied from em, mentioned in #239 and #459, proposed in #838.

@@ -2273,7 +2609,35 @@ Changes</h2>
Changes since <a href="http://www.w3.org/TR/css-values-3/">Level 3</a>:

<ul>
<li>Added the ''vi'', ''vb'', and ''ic'' units.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tracking all proposed changes, line by line for maintainability, with Github issue IDs and grouping inside comments

@@ -2287,4 +2651,10 @@ Security and Privacy Considerations</h2>
This specification defines units that expose the user's screen size
and default font size,
but both are trivially observable from JS,
so they do not constitutate a new privacy risk.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Starting to add new considerations for proposed units. Most of them are just as safe as existing ones.

<tr><th><dfn id="pt">pt</dfn>
<td>points
<td>1pt = 1/72th of 1in
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use notation valid inside calc() instead of a mix of English and code notation

<tr><th><dfn id="mdl">mdl</dfn>
<!--nn, mod, ftm "metric foot"-->
<td>modules
<td>1mdl = 300mm = 12thm
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New unit dot or emu for the greatest common denominator of the smallest units supported by CSS(3). Mentioned in #315.

@@ -1609,11 +1937,12 @@ Type Checking</h4>

<li>
At ''*'',
check that at least one side is <<number>>.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

<<integer>> is a subset of <<number>>, but mentioning it explicitly should make the next line less surprising.

@Crissov
Copy link
Contributor Author

Crissov commented Jan 3, 2017

@fantasai I agree that “these changes need to be discussed and approved by the CSSWG”, but I thought that, since pull requests are really just a special type of issue on Github, they were the “appropriate place for that”. Editors like you could just remove the parts the WG rejected.

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

2 participants