Skip to content

Commit

Permalink
[css2] Make line-height:normal match implementations
Browse files Browse the repository at this point in the history
Includes a "MAY" allowing UAs to use different font metrics for
line-height:normal vs other values. This should be clarified later and
turned into a MUST one way or the other to make sure all browsers
agree, but for now it seems that at least Gecko may need this (See
#1802 (comment))

Closes #1802
  • Loading branch information
frivoal committed Nov 16, 2017
1 parent a3c7617 commit b55a734
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
6 changes: 3 additions & 3 deletions css2/indexlist.html
Expand Up @@ -370,7 +370,7 @@ <H1 id="q0">Appendix I. Index</H1>
<li>definition of, <a href="visufx.html#value-def-left" title="&lt;left&gt;, definition of" class="index-def"><strong>1</strong></a>
</ul>
<li>'left', <a href="visuren.html#propdef-left" title="'left'" class="index-def"><strong>1</strong></a>
<li>&lt;length&gt;, <a href="colors.html#x9" title="&lt;length&gt;" class="index-inst"><span>1</span></a>, <a href="text.html#x1" title="&lt;length&gt;" class="index-inst"><span>2</span></a>, <a href="text.html#x10" title="&lt;length&gt;" class="index-inst"><span>3</span></a>, <a href="text.html#x7" title="&lt;length&gt;" class="index-inst"><span>4</span></a>, <a href="visudet.html#x11" title="&lt;length&gt;" class="index-inst"><span>5</span></a>, <a href="visudet.html#x15" title="&lt;length&gt;" class="index-inst"><span>6</span></a>, <a href="visudet.html#x19" title="&lt;length&gt;" class="index-inst"><span>7</span></a>, <a href="visudet.html#x24" title="&lt;length&gt;" class="index-inst"><span>8</span></a>, <a href="visudet.html#x4" title="&lt;length&gt;" class="index-inst"><span>9</span></a>, <a href="visudet.html#x8" title="&lt;length&gt;" class="index-inst"><span>10</span></a>
<li>&lt;length&gt;, <a href="colors.html#x9" title="&lt;length&gt;" class="index-inst"><span>1</span></a>, <a href="text.html#x1" title="&lt;length&gt;" class="index-inst"><span>2</span></a>, <a href="text.html#x10" title="&lt;length&gt;" class="index-inst"><span>3</span></a>, <a href="text.html#x7" title="&lt;length&gt;" class="index-inst"><span>4</span></a>, <a href="visudet.html#x11" title="&lt;length&gt;" class="index-inst"><span>5</span></a>, <a href="visudet.html#x15" title="&lt;length&gt;" class="index-inst"><span>6</span></a>, <a href="visudet.html#x18" title="&lt;length&gt;" class="index-inst"><span>7</span></a>, <a href="visudet.html#x23" title="&lt;length&gt;" class="index-inst"><span>8</span></a>, <a href="visudet.html#x24" title="&lt;length&gt;" class="index-inst"><span>9</span></a>, <a href="visudet.html#x4" title="&lt;length&gt;" class="index-inst"><span>10</span></a>, <a href="visudet.html#x8" title="&lt;length&gt;" class="index-inst"><span>11</span></a>
<ul class="index">
<li>definition of, <a href="syndata.html#value-def-length" title="&lt;length&gt;, definition of" class="index-def"><strong>1</strong></a>
</ul>
Expand Down Expand Up @@ -435,7 +435,7 @@ <H1 id="q0">Appendix I. Index</H1>
<li>as display value, <a href="visuren.html#x22" title="'none', as display value" class="index-def"><strong>1</strong></a>
</ul>
<li>normal, <a href="generate.html#x10" title="normal" class="index-inst"><span>1</span></a>
<li>&lt;number&gt;, <a href="aural.html#x11" title="&lt;number&gt;" class="index-inst"><span>1</span></a>, <a href="aural.html#x32" title="&lt;number&gt;" class="index-inst"><span>2</span></a>, <a href="aural.html#x39" title="&lt;number&gt;" class="index-inst"><span>3</span></a>, <a href="aural.html#x4" title="&lt;number&gt;" class="index-inst"><span>4</span></a>, <a href="aural.html#x41" title="&lt;number&gt;" class="index-inst"><span>5</span></a>, <a href="aural.html#x43" title="&lt;number&gt;" class="index-inst"><span>6</span></a>, <a href="aural.html#x6" title="&lt;number&gt;" class="index-inst"><span>7</span></a>, <a href="aural.html#x8" title="&lt;number&gt;" class="index-inst"><span>8</span></a>, <a href="syndata.html#x43" title="&lt;number&gt;" class="index-inst"><span>9</span></a>, <a href="visudet.html#x18" title="&lt;number&gt;" class="index-inst"><span>10</span></a>, <a href="visudet.html#x20" title="&lt;number&gt;" class="index-inst"><span>11</span></a>
<li>&lt;number&gt;, <a href="aural.html#x11" title="&lt;number&gt;" class="index-inst"><span>1</span></a>, <a href="aural.html#x32" title="&lt;number&gt;" class="index-inst"><span>2</span></a>, <a href="aural.html#x39" title="&lt;number&gt;" class="index-inst"><span>3</span></a>, <a href="aural.html#x4" title="&lt;number&gt;" class="index-inst"><span>4</span></a>, <a href="aural.html#x41" title="&lt;number&gt;" class="index-inst"><span>5</span></a>, <a href="aural.html#x43" title="&lt;number&gt;" class="index-inst"><span>6</span></a>, <a href="aural.html#x6" title="&lt;number&gt;" class="index-inst"><span>7</span></a>, <a href="aural.html#x8" title="&lt;number&gt;" class="index-inst"><span>8</span></a>, <a href="syndata.html#x43" title="&lt;number&gt;" class="index-inst"><span>9</span></a>, <a href="visudet.html#x19" title="&lt;number&gt;" class="index-inst"><span>10</span></a>
<ul class="index">
<li>definition of, <a href="syndata.html#value-def-number" title="&lt;number&gt;, definition of" class="index-def"><strong>1</strong></a>
</ul>
Expand Down Expand Up @@ -485,7 +485,7 @@ <H1 id="q0">Appendix I. Index</H1>
<li>'pause', <a href="aural.html#propdef-pause" title="'pause'" class="index-def"><strong>1</strong></a>
<li>'pause-after', <a href="aural.html#propdef-pause-after" title="'pause-after'" class="index-def"><strong>1</strong></a>
<li>'pause-before', <a href="aural.html#propdef-pause-before" title="'pause-before'" class="index-def"><strong>1</strong></a>
<li>&lt;percentage&gt;, <a href="aural.html#x12" title="&lt;percentage&gt;" class="index-inst"><span>1</span></a>, <a href="aural.html#x17" title="&lt;percentage&gt;" class="index-inst"><span>2</span></a>, <a href="colors.html#x8" title="&lt;percentage&gt;" class="index-inst"><span>3</span></a>, <a href="text.html#x2" title="&lt;percentage&gt;" class="index-inst"><span>4</span></a>, <a href="visudet.html#x12" title="&lt;percentage&gt;" class="index-inst"><span>5</span></a>, <a href="visudet.html#x16" title="&lt;percentage&gt;" class="index-inst"><span>6</span></a>, <a href="visudet.html#x21" title="&lt;percentage&gt;" class="index-inst"><span>7</span></a>, <a href="visudet.html#x23" title="&lt;percentage&gt;" class="index-inst"><span>8</span></a>, <a href="visudet.html#x5" title="&lt;percentage&gt;" class="index-inst"><span>9</span></a>, <a href="visudet.html#x9" title="&lt;percentage&gt;" class="index-inst"><span>10</span></a>
<li>&lt;percentage&gt;, <a href="aural.html#x12" title="&lt;percentage&gt;" class="index-inst"><span>1</span></a>, <a href="aural.html#x17" title="&lt;percentage&gt;" class="index-inst"><span>2</span></a>, <a href="colors.html#x8" title="&lt;percentage&gt;" class="index-inst"><span>3</span></a>, <a href="text.html#x2" title="&lt;percentage&gt;" class="index-inst"><span>4</span></a>, <a href="visudet.html#x12" title="&lt;percentage&gt;" class="index-inst"><span>5</span></a>, <a href="visudet.html#x16" title="&lt;percentage&gt;" class="index-inst"><span>6</span></a>, <a href="visudet.html#x20" title="&lt;percentage&gt;" class="index-inst"><span>7</span></a>, <a href="visudet.html#x22" title="&lt;percentage&gt;" class="index-inst"><span>8</span></a>, <a href="visudet.html#x5" title="&lt;percentage&gt;" class="index-inst"><span>9</span></a>, <a href="visudet.html#x9" title="&lt;percentage&gt;" class="index-inst"><span>10</span></a>
<ul class="index">
<li>definition of, <a href="syndata.html#value-def-percentage" title="&lt;percentage&gt;, definition of" class="index-def"><strong>1</strong></a>
</ul>
Expand Down
35 changes: 18 additions & 17 deletions css2/visudet.html
Expand Up @@ -1435,6 +1435,16 @@ <h3>10.8.1 <a name="leading">Leading and half-leading</a></h3>

<p id="inline-box-height">Boxes of child elements do not influence this height.

<p>When the value of the <a href="" class="noxref"><span class="propinst-line-heigh">'line-height'</span></a> property
is 'normal',
the height of the inline box encloses all glyphs, going from the highest <var>A</var> to the deepest <var>D</var>.

<p>User Agents may use different sets of font metrics when determining <var>A</var> and <var>D</var>
depending on whether the <a href="" class="noxref"><span class="propinst-line-heigh">'line-height'</span></a> property
is 'normal' or some other value,
for instance taking external leading metrics into account
only in the 'normal' case.

<p>Although margins, borders, and padding of non-replaced elements do
not enter into the line box calculation, they are still rendered
around inline boxes. This means that if the height specified by <a href="visudet.html#propdef-line-height" class="noxref"><span
Expand Down Expand Up @@ -1494,29 +1504,25 @@ <h3>10.8.1 <a name="leading">Leading and half-leading</a></h3>

<dl>
<dt><strong>normal</strong> </dt>
<dd>Tells user agents to set the used
value to a "reasonable" value based on the font of the element. The
value has the same meaning as <span class="index-inst"
title="&lt;number&gt;" id="x18"><a href="syndata.html#value-def-number" class="noxref"><span
class="value-inst-number">&lt;number&gt;</span></a></span>. We recommend a
used value for 'normal' between 1.0 to 1.2. The <a
href="cascade.html#computed-value">computed value</a> is 'normal'.
<dd>Tells user agents to determine the height of the inline box
automatically based on font metrics.
See above for details.
</dd>
<dt><span class="index-inst" title="&lt;length&gt;" id="x19"><a href="syndata.html#value-def-length" class="noxref"><span
<dt><span class="index-inst" title="&lt;length&gt;" id="x18"><a href="syndata.html#value-def-length" class="noxref"><span
class="value-inst-length"><strong>&lt;length&gt;</strong></span></a></span>
</dt>
<dd>The specified length is used in the calculation of the line box
height. Negative values are illegal.
</dd>
<dt><span class="index-inst" title="&lt;number&gt;" id="x20"><a href="syndata.html#value-def-number" class="noxref"><span
<dt><span class="index-inst" title="&lt;number&gt;" id="x19"><a href="syndata.html#value-def-number" class="noxref"><span
class="value-inst-number"><strong>&lt;number&gt;</strong></span></a></span>
</dt>
<dd>The used value of the property is this number multiplied by the
element's font size. Negative values are illegal. The <a
href="cascade.html#computed-value">computed value</a> is the same as
the specified value.
</dd>
<dt><span class="index-inst" title="&lt;percentage&gt;" id="x21"><a href="syndata.html#value-def-percentage" class="noxref"><span
<dt><span class="index-inst" title="&lt;percentage&gt;" id="x20"><a href="syndata.html#value-def-percentage" class="noxref"><span
class="value-inst-percentage"><strong>&lt;percentage&gt;</strong></span></a></span>
</dt>
<dd>The <a href="cascade.html#computed-value">computed value</a> of the
Expand All @@ -1535,11 +1541,6 @@ <h3>10.8.1 <a name="leading">Leading and half-leading</a></h3>
</pre>
</div>

<p>When an element contains text that is rendered
in more than one font, user agents may determine the 'normal' <a href="visudet.html#propdef-line-height" class="noxref"><span
class="propinst-line-height">'line-height'</span></a> value according to
the largest font size.
</p>
<p class=note><em><strong>Note.</strong> When there is only one value of <a href="visudet.html#propdef-line-height" class="noxref"><span
class="propinst-line-height">'line-height'</span></a> (other than 'normal') for all inline
boxes in a block container box and they all use the same first available font (and
Expand Down Expand Up @@ -1609,14 +1610,14 @@ <h3>10.8.1 <a name="leading">Leading and half-leading</a></h3>
<dd>Align the bottom of the box with the bottom of the parent's
content area (see <a
href="#inline-non-replaced">10.6.1</a>).</dd>
<dt><span class="index-inst" title="&lt;percentage&gt;" id="x23"><a href="syndata.html#value-def-percentage" class="noxref"><span
<dt><span class="index-inst" title="&lt;percentage&gt;" id="x22"><a href="syndata.html#value-def-percentage" class="noxref"><span
class="value-inst-percentage"><strong>&lt;percentage&gt;
</strong></span></a></span></dt>
<dd>Raise (positive value) or lower (negative value) the box
by this distance (a percentage of the <a href="visudet.html#propdef-line-height" class="noxref"><span
class="propinst-line-height">'line-height'</span></a> value).
The value '0%' means the same as 'baseline'.</dd>
<dt><span class="index-inst" title="&lt;length&gt;" id="x24"><a href="syndata.html#value-def-length" class="noxref"><span
<dt><span class="index-inst" title="&lt;length&gt;" id="x23"><a href="syndata.html#value-def-length" class="noxref"><span
class="value-inst-length"><strong>&lt;length&gt;
</strong></span></a></span></dt>
<dd>Raise (positive value) or lower (negative value) the box
Expand Down
25 changes: 13 additions & 12 deletions css2/visudet.src
Expand Up @@ -1339,6 +1339,16 @@ do not impact the height or baseline of the inline box.

<p id="inline-box-height">Boxes of child elements do not influence this height.

<p>When the value of the <span class="propinst-line-heigh">'line-height'</span> property
is 'normal',
the height of the inline box encloses all glyphs, going from the highest <var>A</var> to the deepest <var>D</var>.

<p>User Agents may use different sets of font metrics when determining <var>A</var> and <var>D</var>
depending on whether the <span class="propinst-line-heigh">'line-height'</span> property
is 'normal' or some other value,
for instance taking external leading metrics into account
only in the 'normal' case.

<p>Although margins, borders, and padding of non-replaced elements do
not enter into the line box calculation, they are still rendered
around inline boxes. This means that if the height specified by <span
Expand Down Expand Up @@ -1387,13 +1397,9 @@ height.

<dl>
<dt><strong>normal</strong> </dt>
<dd>Tells user agents to set the used
value to a "reasonable" value based on the font of the element. The
value has the same meaning as <span class="index-inst"
title="&lt;number&gt;"><span
class="value-inst-number">&lt;number&gt;</span></span>. We recommend a
used value for 'normal' between 1.0 to 1.2. The <a
href="cascade.html#computed-value">computed value</a> is 'normal'.
<dd>Tells user agents to determine the height of the inline box
automatically based on font metrics.
See above for details.
</dd>
<dt><span class="index-inst" title="&lt;length&gt;"><span
class="value-inst-length"><strong>&lt;length&gt;</strong></span></span>
Expand Down Expand Up @@ -1428,11 +1434,6 @@ div { line-height: 120%; font-size: 10pt } /* percentage */
</pre>
</div>

<p>When an element contains text that is rendered
in more than one font, user agents may determine the 'normal' <span
class="propinst-line-height">'line-height'</span> value according to
the largest font size.
</p>
<p class=note><em><strong>Note.</strong> When there is only one value of <span
class="propinst-line-height">'line-height'</span> (other than 'normal') for all inline
boxes in a block container box and they all use the same first available font (and
Expand Down

0 comments on commit b55a734

Please sign in to comment.