Skip to content

Commit fb983bf

Browse files
committed
[css-line-grid] add normative text for line snap examples
1 parent 84f853d commit fb983bf

2 files changed

Lines changed: 48 additions & 4 deletions

File tree

css-line-grid/Overview.html

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
</p>
7777
<h1 class="p-name no-ref" id=title>CSS Line Grid Module Level 1</h1>
7878
<h2 class="no-num no-toc no-ref heading settled" id=subtitle><span class=content>Editor’s Draft,
79-
<span class=dt-updated><span class=value-title title=20141015>15 October 2014</span></span></span></h2>
79+
<span class=dt-updated><span class=value-title title=20141016>16 October 2014</span></span></span></h2>
8080
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-line-grid/>http://dev.w3.org/csswg/css-line-grid/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-line-grid-1/>http://www.w3.org/TR/css-line-grid-1/</a><dt>Previous Versions:<dd><a href=http://www.w3.org/TR/2014/WD-css-line-grid-1-20140916/ rel=previous>http://www.w3.org/TR/2014/WD-css-line-grid-1-20140916/</a><dt>Feedback:<dd><span><a href="mailto:www-style@w3.org?subject=[css-line-grid] feedback">www-style@w3.org</a> with subject line “<kbd>[css-line-grid] <var>… message topic …</var></kbd>” (<a href=http://lists.w3.org/Archives/Public/www-style/ rel=discussion>archives</a>)</span><dt>Editors:<dd><div class="p-author h-card vcard"><a class="p-name fn u-url url" href=http://fantasai.inkedblade.net/contact>Elika Etemad</a> (<span class="p-org org">Invited Expert</span>)</div><dd><div class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:kojiishi@gluesoft.co.jp>Koji Ishii</a> (<span class="p-org org">Invited Expert</span>)</div><dd><div class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:stearns@adobe.com>Alan Stearns</a> (<span class="p-org org">Adobe Systems, Inc.</span>)</div></dl></div>
8181
<div data-fill-with=warning></div>
8282
<p class=copyright data-fill-with=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a> © 2014 <a href=http://www.w3.org/><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href=http://www.csail.mit.edu/><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href=http://www.ercim.eu/><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href=http://www.keio.ac.jp/>Keio</a>, <a href=http://ev.buaa.edu.cn/>Beihang</a>), All Rights Reserved. W3C <a href=http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer>liability</a>, <a href=http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks>trademark</a> and <a href=http://www.w3.org/Consortium/Legal/copyright-documents>document use</a> rules apply.
@@ -299,7 +299,7 @@ <h3 class="heading settled" data-level=1.3 id=values><span class=secno>1.3. </sp
299299
<h2 class="heading settled" data-level=2 id=line-grid><span class=secno>2. </span><span class=content>
300300
Defining a Line Grid: the <a class=property data-link-type=propdesc href=#propdef-line-grid title=line-grid>line-grid</a> property</span><a class=self-link href=#line-grid></a></h2>
301301

302-
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-line-grid>line-grid<a class=self-link href=#propdef-line-grid></a></dfn><tr><th>Value:<td class=prod>match-parent <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> create<tr><th>Initial:<td>match-parent<tr><th>Applies to:<td>block, flex and grid containers<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified<tr><th>Percentages:<td>N/A<tr><th>Animatable:<td>no</table>
302+
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-line-grid>line-grid<a class=self-link href=#propdef-line-grid></a></dfn><tr><th>Value:<td class=prod>match-parent <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> create<tr><th>Initial:<td>match-parent<tr><th>Applies to:<td>block, flex and grid containers<tr><th>Inherited:<td>no<tr><th>Percentages:<td>N/A<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified<tr><th>Animatable:<td>no</table>
303303

304304
<p>Specifies whether this box creates
305305
a new baseline grid for its descendants
@@ -365,7 +365,7 @@ <h2 class="heading settled" data-level=3 id=grid-snapping><span class=secno>3. <
365365
<h3 class="heading settled" data-level=3.1 id=line-snap><span class=secno>3.1. </span><span class=content>
366366
Snapping Line Boxes: the <a class=property data-link-type=propdesc href=#propdef-line-snap title=line-snap>line-snap</a> property</span><a class=self-link href=#line-snap></a></h3>
367367

368-
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-line-snap>line-snap<a class=self-link href=#propdef-line-snap></a></dfn><tr><th>Value:<td class=prod>none <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> baseline <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> contain<tr><th>Initial:<td>none<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>yes<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified<tr><th>Percentages:<td>N/A<tr><th>Animatable:<td>no</table>
368+
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-line-snap>line-snap<a class=self-link href=#propdef-line-snap></a></dfn><tr><th>Value:<td class=prod>none <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> baseline <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> contain<tr><th>Initial:<td>none<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>yes<tr><th>Percentages:<td>N/A<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified<tr><th>Animatable:<td>no</table>
369369

370370
<p>This property applies to all the line boxes
371371
directly contained by the element,
@@ -404,6 +404,28 @@ <h3 class="heading settled" data-level=3.1 id=line-snap><span class=secno>3.1. <
404404
<a href=http://dev.w3.org/csswg/css-inline/#text-under-edge>text-under-edge</a> baseline.
405405
</dl>
406406

407+
<p>An element can have additional block layout constraints
408+
(such as centering or <a class=property data-link-type=propdesc href=#propdef-box-snap title=box-snap>box-snap</a>)
409+
that can complicate line snapping.
410+
In these cases, follow these steps:</p>
411+
412+
<ul>
413+
<li>
414+
Line snap as if the layout constraint does not apply
415+
</li>
416+
<li>
417+
Apply the layout constraint to the block
418+
</li>
419+
<li>
420+
Adjust exactly one line box shift
421+
or space at the beginning or end of the block
422+
such that all of the snapping lines meet the line grid
423+
while maintaining the block layout constraint.
424+
The single adjustment chosen must be
425+
the smallest shift needed to achieve the result.
426+
</li>
427+
</ul>
428+
407429
<p>In some cases lines of equal line height
408430
will not align perfectly to a baseline grid:
409431
this happens, for example,
@@ -590,7 +612,7 @@ <h3 class="heading settled" data-level=3.2 id=box-snap><span class=secno>3.2. </
590612
but snaps to before if it’s the first block in a fragment container,
591613
and snaps to after if it’s the last block in a fragment container.</p>
592614

593-
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-box-snap>box-snap<a class=self-link href=#propdef-box-snap></a></dfn><tr><th>Value:<td class=prod>none <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> block-start <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> block-end <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> center <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> first-baseline <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> last-baseline<tr><th>Initial:<td>none<tr><th>Applies to:<td>block-level boxes and internal table elements except table cells<tr><th>Inherited:<td>yes<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified<tr><th>Percentages:<td>N/A<tr><th>Animatable:<td>no</table>
615+
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-box-snap>box-snap<a class=self-link href=#propdef-box-snap></a></dfn><tr><th>Value:<td class=prod>none <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> block-start <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> block-end <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> center <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> first-baseline <a class=prod-punc data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> last-baseline<tr><th>Initial:<td>none<tr><th>Applies to:<td>block-level boxes and internal table elements except table cells<tr><th>Inherited:<td>yes<tr><th>Percentages:<td>N/A<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified<tr><th>Animatable:<td>no</table>
594616

595617
<p>Specifies how the block is snapped to the baseline grid.</p>
596618

css-line-grid/Overview.src.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,28 @@ <h3 id='line-snap'>
325325
<a href="http://dev.w3.org/csswg/css-inline/#text-under-edge">text-under-edge</a> baseline.
326326
</dl>
327327

328+
An element can have additional block layout constraints
329+
(such as centering or 'box-snap')
330+
that can complicate line snapping.
331+
In these cases, follow these steps:
332+
333+
<ul>
334+
<li>
335+
Line snap as if the layout constraint does not apply
336+
</li>
337+
<li>
338+
Apply the layout constraint to the block
339+
</li>
340+
<li>
341+
Adjust exactly one line box shift
342+
or space at the beginning or end of the block
343+
such that all of the snapping lines meet the line grid
344+
while maintaining the block layout constraint.
345+
The single adjustment chosen must be
346+
the smallest shift needed to achieve the result.
347+
</li>
348+
</ul>
349+
328350
In some cases lines of equal line height
329351
will not align perfectly to a baseline grid:
330352
this happens, for example,

0 commit comments

Comments
 (0)