Skip to content

Commit d9f39ed

Browse files
committed
[css-ruby] Clean up / fix errors in intra-ruby white space rules.
--HG-- extra : rebase_source : 1f4e9c65cec99fb9cb0387d7c2df02c09d750b3e
1 parent 9684cbe commit d9f39ed

2 files changed

Lines changed: 110 additions & 99 deletions

File tree

css-ruby/Overview.html

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,8 @@ <h3 class="heading settled heading" data-level=2.2 id=box-fixup><span class=secn
351351
Missing parts of the structure are implied through the anonymous box generation rules
352352
<a href=http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes>similar to those used to normalize tables</a>. <a data-biblio-type=normative data-link-type=biblio href=#biblio-css21 title=biblio-css21>[CSS21]</a>
353353

354-
<dl>
355-
<style scoped>
356-
dt { counter-increment: box-fixup; }
357-
dt::before { content: counter(box-fixup) ". "; }
358-
</style>
359-
360-
<dt id=anon-gen-inlinize><a class=self-link href=#anon-gen-inlinize></a>Inlinize Block-level Boxes
361-
<dd>
354+
<ol>
355+
<li id=anon-gen-inlinize><a class=self-link href=#anon-gen-inlinize></a><strong>Inlinize block-level boxes:</strong>
362356
Any in-flow block-level boxes directly contained by a
363357
<a data-link-type=dfn href=#ruby-container title="ruby container">ruby container</a>,
364358
<a data-link-type=dfn href=#ruby-base-container-box title="ruby base container">ruby base container</a>,
@@ -374,32 +368,34 @@ <h3 class="heading settled heading" data-level=2.2 id=box-fixup><span class=secn
374368
This computation occurs after any intermediary anonymous-box fixup
375369
(such as that required by internal table elements).
376370

377-
<dt id=anony-gen-trim-space><a class=self-link href=#anony-gen-trim-space></a>Trim leading/trailing white space
378-
<dd>
371+
<li id=anony-gen-trim-space><a class=self-link href=#anony-gen-trim-space></a><strong>Trim leading/trailing white space:</strong>
379372
Any white space within a ruby structure is discarded
380373
at the beginning and end of
381374
a <a data-link-type=dfn href=#ruby-container title="ruby container">ruby container</a>, <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation container">ruby annotation container</a>, or <a data-link-type=dfn href=#ruby-base-container-box title="ruby base container">ruby base container</a>.
382375

383-
<dt id=anon-gen-bare-inlines><a class=self-link href=#anon-gen-bare-inlines></a>Wrap misparented inline-level content
384-
<dd>
376+
<li id=anon-gen-bare-inlines><a class=self-link href=#anon-gen-bare-inlines></a><strong>Wrap misparented inline-level content:</strong>
385377
Any consecutive sequence of text and inline-level boxes
386378
directly parented by a <a data-link-type=dfn href=#ruby-container title="ruby container">ruby container</a> or <a data-link-type=dfn href=#ruby-base-container-box title="ruby base container">ruby base container</a>
387379
is wrapped in an anonymous <a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a>.
388380
Similarly, any consecutive sequence of text and inline-level boxes
389381
directly parented by a <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation container">ruby annotation container</a>
390382
is wrapped in an anonymous <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a>.
391383

392-
<dt id=anon-gen-discard-space><a class=self-link href=#anon-gen-discard-space></a>Remove inter-level white space
393-
<dd>
394-
Any anonymous <a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a> containing only white space that
395-
both immediately follows a box of type A
396-
and is immediately followed by at box of its corresponding type B
397-
as defined in the table below
398-
is removed, as if it had <a class=css data-link-type=propdesc href=#propdef-display title=display>display: none</a>.
384+
<p>However, if the anonymous box so constructed contains only <i data-link-type=dfn title="white space">white space</i>,
385+
it is considered <dfn data-dfn-type=dfn data-noexport="" id=intra-ruby-white-space>intra-ruby white space<a class=self-link href=#intra-ruby-white-space></a></dfn>
386+
and is either discarded as <a data-link-type=dfn href=#inter-level-white-space title="inter-level white space">inter-level white space</a>
387+
or preserved as <a data-link-type=dfn href=#intra-level-white-space title="intra-level white space">intra-level white space</a>
388+
as described below.</p>
389+
390+
<li id=anon-gen-discard-space><a class=self-link href=#anon-gen-discard-space></a><strong>Remove inter-level white space:</strong>
391+
Any <a data-link-type=dfn href=#intra-ruby-white-space title="intra-ruby white space">intra-ruby white space</a>
392+
whose immediately adjacent siblings match one of the patterns below
393+
is <dfn data-dfn-type=dfn data-noexport="" id=inter-level-white-space>inter-level white space<a class=self-link href=#inter-level-white-space></a></dfn>
394+
and is removed, as if it had <a class=css data-link-type=propdesc href=#propdef-display title=display>display: none</a>.
399395
<table class=data>
400396
<thead>
401-
<tr><th>A
402-
<th>B
397+
<tr><th>Previous box
398+
<th>Next box
403399
<tbody>
404400
<tr><td><a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a> or <a data-link-type=dfn href=#ruby-base-container-box title="ruby base container">ruby base container</a>
405401
<td><a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a> or <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation container">ruby annotation container</a>
@@ -411,28 +407,36 @@ <h3 class="heading settled heading" data-level=2.2 id=box-fixup><span class=secn
411407
<td><a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a>
412408
</table>
413409

414-
<dt id=anon-gen-interpret-space><a class=self-link href=#anon-gen-interpret-space></a>Interpret intra-level white space
415-
<dd>
416-
<ul>
417-
<li>Any anonymous <a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a> containing only white space that
418-
both immediately follows a <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a> or <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation container">ruby annotation container</a>
419-
and is immediately followed by a <a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a> or <a data-link-type=dfn href=#ruby-base-container-box title="ruby base container">ruby base container</a>
420-
is labelled as <dfn data-dfn-type=dfn data-noexport="" id=inter-segment-white-space>inter-segment white space<a class=self-link href=#inter-segment-white-space></a></dfn>
421-
(and treated specially for pairing and layout, see below).
422-
423-
<li>Any anonymous <a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a> containing only white space that is
424-
both immediately follows and is immediately followed by a <a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a>
425-
is labelled as <dfn data-dfn-type=dfn data-noexport="" id=inter-base-white-space>inter-base white space<a class=self-link href=#inter-base-white-space></a></dfn>
426-
(and treated specially for pairing and layout, see below).
427-
428-
<li>Any anonymous <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a> containing only white space that is
429-
both immediately follows and is immediately followed by a <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a>
430-
is labelled as <dfn data-dfn-type=dfn data-noexport="" id=inter-annotation-white-space>inter-annotation white space<a class=self-link href=#inter-annotation-white-space></a></dfn>
431-
(and treated specially for pairing and layout, see below).
432-
</ul>
433-
434-
<dt id=anon-gen-anon-containers><a class=self-link href=#anon-gen-anon-containers></a>Generate anonymous level containers
435-
<dd>
410+
<li id=anon-gen-interpret-space><a class=self-link href=#anon-gen-interpret-space></a><strong>Interpret intra-level white space:</strong>
411+
Any <a data-link-type=dfn href=#intra-ruby-white-space title="intra-ruby white space">intra-ruby white space</a>
412+
whose immediately adjacent siblings match one of the patterns below
413+
is assigned the box type and subtype defined in the table below:
414+
<table class=data>
415+
<colgroup span=2></colgroup>
416+
<colgroup span=2></colgroup>
417+
<thead>
418+
<tr><th>Previous box
419+
<th>Next box
420+
<th>Box type
421+
<th>Subtype
422+
<tbody>
423+
<tr><td><a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a>
424+
<td><a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a>
425+
<td><a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a>
426+
<td><dfn data-dfn-type=dfn data-noexport="" id=inter-base-white-space>inter-base white space<a class=self-link href=#inter-base-white-space></a></dfn>
427+
<tr><td><a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a>
428+
<td><a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a>
429+
<td><a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a>
430+
<td><dfn data-dfn-type=dfn data-noexport="" id=inter-annotation-white-space>inter-annotation white space<a class=self-link href=#inter-annotation-white-space></a></dfn>
431+
<tr><td><a data-link-type=dfn href=#ruby-annotation-box title="ruby annotation">ruby annotation</a> or <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation container">ruby annotation container</a>
432+
<td><a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a> or <a data-link-type=dfn href=#ruby-base-container-box title="ruby base container">ruby base container</a>
433+
<td><a data-link-type=dfn href=#ruby-base-box title="ruby base">ruby base</a>
434+
<td><dfn data-dfn-type=dfn data-noexport="" id=inter-segment-white-space>inter-segment white space<a class=self-link href=#inter-segment-white-space></a></dfn>
435+
</table>
436+
The <dfn data-dfn-type=dfn data-noexport="" id=intra-level-white-space>intra-level white space<a class=self-link href=#intra-level-white-space></a></dfn> boxes defined above are
437+
treated specially for pairing and layout. See below.
438+
439+
<li id=anon-gen-anon-containers><a class=self-link href=#anon-gen-anon-containers></a><strong>Generate anonymous level containers:</strong>
436440
Any consecutive sequence of <a data-link-type=dfn href=#ruby-base-box title="ruby bases">ruby bases</a> and <a data-link-type=dfn href=#inter-base-white-space title="inter-base white space">inter-base white space</a>
437441
(and not <a data-link-type=dfn href=#inter-segment-white-space title="inter-segment white space">inter-segment white space</a>)
438442
not parented by a <a data-link-type=dfn href=#ruby-base-container-box title="ruby base container">ruby base container</a>
@@ -441,19 +445,17 @@ <h3 class="heading settled heading" data-level=2.2 id=box-fixup><span class=secn
441445
not parented by a <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation container">ruby annotation container</a>
442446
is wrapped in an anonymous <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation container">ruby annotation container</a>.
443447

444-
<dt id=anon-gen-anon-ruby><a class=self-link href=#anon-gen-anon-ruby></a>Generate anonymous ruby containers
445-
<dd>
448+
<li id=anon-gen-anon-ruby><a class=self-link href=#anon-gen-anon-ruby></a><strong>Generate anonymous ruby containers</strong>:
446449
A sequence of <a data-link-type=dfn href=#ruby-base-container-box title="ruby base containers">ruby base containers</a>, <a data-link-type=dfn href=#ruby-annotation-container-box title="ruby annotation containers">ruby annotation containers</a>, and/or <a data-link-type=dfn href=#inter-segment-white-space title="inter-segment white space">inter-segment white space</a>
447450
not parented by a <a data-link-type=dfn href=#ruby-container title="ruby container">ruby container</a>
448451
is wrapped in an anonymous <a data-link-type=dfn href=#ruby-container title="ruby container">ruby container</a>.
449452

450-
<dt id=anon-gen-unbreak><a class=self-link href=#anon-gen-unbreak></a>Suppress line breaks
451-
<dd>
453+
<li id=anon-gen-unbreak><a class=self-link href=#anon-gen-unbreak></a><strong>Suppress line breaks:</strong>
452454
Convert all forced line breaks inside <a data-link-type=dfn href=#ruby-annotation-box title="ruby annotations">ruby annotations</a> (regardless of <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-text-3/#propdef-white-space title=white-space>white-space</a> value)
453455
as defined for <i data-link-type=dfn title=collapsible>collapsible</i> segment breaks in <a href=http://www.w3.org/TR/css-text-3/#line-break-transform>CSS Text Level 3 § 4.1.2</a>.
454456
<p class=issue id=issue-8af70305><a class=self-link href=#issue-8af70305></a>The goal of this is to simplify the layout model by suppressing any line breaks within ruby annotations.
455457
Alternatively we could try to define some kind of acceptable behavior for them.
456-
</dl>
458+
</ol>
457459

458460
<p class=issue id=issue-f2086090><a class=self-link href=#issue-f2086090></a>Make this into an example:
459461
<img src=http://lists.w3.org/Archives/Public/www-archive/2014Jun/att-0027/PastedGraphic-1.png style="display: block; width: 100%">
@@ -462,7 +464,9 @@ <h3 class="heading settled heading" data-level=2.2 id=box-fixup><span class=secn
462464
and the UA can start to associate bases with their annotations.
463465

464466
<p class=note>
465-
Note that the UA is not required to create any of these anonymous boxes in its internal structures,
467+
Note that the UA is not required to create any of these anonymous boxes
468+
(or the anonymous empty <a data-link-type=dfn href=#intra-level-white-space title="intra-level white space">intra-level white space</a> boxes in the pairing section)
469+
in its internal structures,
466470
as long as pairing and layout behaves as if they existed.
467471

468472
<h4 class="heading settled heading" data-level=2.2.1 id=block-ruby><span class=secno>2.2.1 </span><span class=content>
@@ -1525,7 +1529,10 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
15251529
<li>inter-annotation white space, <a href=#inter-annotation-white-space title="section 2.2">2.2</a>
15261530
<li>inter-base white space, <a href=#inter-base-white-space title="section 2.2">2.2</a>
15271531
<li>inter-character, <a href=#valdef-ruby-position.inter-character title="section 3.1">3.1</a>
1532+
<li>inter-level white space, <a href=#inter-level-white-space title="section 2.2">2.2</a>
15281533
<li>inter-segment white space, <a href=#inter-segment-white-space title="section 2.2">2.2</a>
1534+
<li>intra-level white space, <a href=#intra-level-white-space title="section 2.2">2.2</a>
1535+
<li>intra-ruby white space, <a href=#intra-ruby-white-space title="section 2.2">2.2</a>
15291536
<li>left, <a href=#valdef-ruby-position.left title="section 3.1">3.1</a>
15301537
<li>level, <a href=#annotation-level title="section 2.3">2.3</a>
15311538
<li>over, <a href=#valdef-ruby-position.over title="section 3.1">3.1</a>

0 commit comments

Comments
 (0)