[css-ruby] Try to improve parens generation

Tue, 18 Jun 2013 23:29:25 +0900

author
fantasai <fantasai.cvs@inkedblade.net>
date
Tue, 18 Jun 2013 23:29:25 +0900
changeset 8498
cc638536b160
parent 8497
0a74bdd0d743
child 8499
9979d267d8ed

[css-ruby] Try to improve parens generation

css-ruby/Overview.html file | annotate | diff | comparison | revisions
css-ruby/Overview.src.html file | annotate | diff | comparison | revisions
     1.1 --- a/css-ruby/Overview.html	Tue Jun 18 22:59:49 2013 +0900
     1.2 +++ b/css-ruby/Overview.html	Tue Jun 18 23:29:25 2013 +0900
     1.3 @@ -1364,24 +1364,25 @@
     1.4      <p>Unfortunately, because Selectors cannot match against text nodes, it's
     1.5       not possible with CSS to express rules that will automatically and
     1.6       correctly add parentheses to unparenthesized ruby annotations in HTML.
     1.7 -     However, an author rigorously using <code>&lt;rtc&gt;</code> elements
     1.8 -     around all annotations can use CSS Level 2 generated content <a
     1.9 -     href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> to generate
    1.10 -     parentheses:
    1.11 +     (This is because HTML ruby allows implying the <a
    1.12 +     href="#ruby-base"><i>ruby base</i></a> from raw text, without a
    1.13 +     corresponding element.) However, these rules will handle cases where
    1.14 +     either <code>&lt;rb&gt;</code> or <code>&lt;rtc&gt;</code> is used
    1.15 +     rigorously.
    1.16  
    1.17      <pre>
    1.18 +<!--	-->/* Parens around &lt;rtc> */
    1.19  <!--	-->rtc::before { content: "("; }
    1.20 -<!--	-->rtc::after { content: ")"; }</pre>
    1.21 +<!--	-->rtc::after  { content: ")"; }
    1.22  
    1.23 -    <p>Alternatively, an author rigorously using both <code>&lt;rb&gt;</code>
    1.24 -     and <code>&lt;rt&gt;</code> elements but no <code>&lt;rtc&gt;</code>
    1.25 -     elements can use these rules instead:
    1.26 +<!--	-->/* Parens before first &lt;rt> not inside &lt;rtc> */
    1.27 +<!--	-->rb  + rt::before,
    1.28 +<!--	-->rtc + rt::before { content: "("; }
    1.29  
    1.30 -    <pre>
    1.31 -<!--	-->rb + rt::before { content: "("; }
    1.32 -<!--	-->rt:last-child::after, rt + rb::before { content: ")"; }</pre>
    1.33 -
    1.34 -    <p class=Issue>Try to make these smarter somehow?
    1.35 +<!--	-->/* Parens after &lt;rt> not inside &lt;rtc> */
    1.36 +<!--	-->rb ~ rt:last-child::after,
    1.37 +<!--	-->rt + rb::before  { content: ")"; }
    1.38 +<!--	-->rt + rtc::before { content: ")("; }</pre>
    1.39  
    1.40      <h2 id=glossary><span class=secno>4. </span> Glossary</h2>
    1.41  
     2.1 --- a/css-ruby/Overview.src.html	Tue Jun 18 22:59:49 2013 +0900
     2.2 +++ b/css-ruby/Overview.src.html	Tue Jun 18 23:29:25 2013 +0900
     2.3 @@ -1009,21 +1009,23 @@
     2.4  	<p>Unfortunately, because Selectors cannot match against text nodes,
     2.5  	it's not possible with CSS to express rules that will automatically and correctly
     2.6  	add parentheses to unparenthesized ruby annotations in HTML.
     2.7 -	However, an author rigorously using <code>&lt;rtc&gt;</code> elements
     2.8 -	around all annotations
     2.9 -	can use CSS Level 2 generated content [[!CSS21]] to generate parentheses:
    2.10 +	(This is because HTML ruby allows implying the <i>ruby base</i> from raw text, without a corresponding element.)
    2.11 +	However, these rules will handle cases where either <code>&lt;rb&gt;</code>
    2.12 +	or <code>&lt;rtc&gt;</code> is used rigorously.
    2.13 +
    2.14  	<pre>
    2.15 +<!--	-->/* Parens around &lt;rtc> */
    2.16  <!--	-->rtc::before { content: "("; }
    2.17 -<!--	-->rtc::after { content: ")"; }</pre>
    2.18 +<!--	-->rtc::after  { content: ")"; }
    2.19  
    2.20 -	<p>Alternatively, an author rigorously using
    2.21 -	both <code>&lt;rb&gt;</code> and <code>&lt;rt&gt;</code> elements but no <code>&lt;rtc&gt;</code> elements
    2.22 -	can use these rules instead:
    2.23 -	<pre>
    2.24 -<!--	-->rb + rt::before { content: "("; }
    2.25 -<!--	-->rt:last-child::after, rt + rb::before { content: ")"; }</pre>
    2.26 +<!--	-->/* Parens before first &lt;rt> not inside &lt;rtc> */
    2.27 +<!--	-->rb  + rt::before,
    2.28 +<!--	-->rtc + rt::before { content: "("; }
    2.29  
    2.30 -  <p class="Issue">Try to make these smarter somehow?</p>
    2.31 +<!--	-->/* Parens after &lt;rt> not inside &lt;rtc> */
    2.32 +<!--	-->rb ~ rt:last-child::after,
    2.33 +<!--	-->rt + rb::before  { content: ")"; }
    2.34 +<!--	-->rt + rtc::before { content: ")("; }</pre>
    2.35  
    2.36  <h2 id="glossary">
    2.37  Glossary</h2>

mercurial