|
63 | 63 | </p> |
64 | 64 | <h1 class="p-name no-ref" id=title>CSS Shapes Module Level 1</h1> |
65 | 65 | <h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft, |
66 | | - <span class=dt-updated><span class=value-title title=20140204>4 February 2014</span></span></span></h2> |
| 66 | + <span class=dt-updated><span class=value-title title=20140205>5 February 2014</span></span></span></h2> |
67 | 67 | <div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-shapes/>http://dev.w3.org/csswg/css-shapes/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-shapes/>http://www.w3.org/TR/css-shapes/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-shapes/>http://dev.w3.org/csswg/css-shapes/</a> |
68 | 68 | <dt>Feedback:</dt> |
69 | 69 | <dd><a href="mailto:www-style@w3.org?subject=%5Bcss-shapes%5D%20feedback">www-style@w3.org</a> |
@@ -604,14 +604,76 @@ <h3 class="heading settled heading" data-level=3.3 id=basic-shape-serialization> |
604 | 604 | serialize as per their individual grammars, |
605 | 605 | in the order the grammars are written in, |
606 | 606 | avoiding calc() expressions where possible, |
| 607 | + avoiding calc() transformations, |
607 | 608 | omitting components when possible without changing the meaning, |
608 | 609 | joining space-separated tokens with a single space, |
609 | 610 | and following each serialized comma with a single space. |
610 | 611 |
|
611 | 612 | <p> The <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>"><position></a> values in <a class=css data-link-type=maybe href=#funcdef-ellipse title=ellipse()>ellipse()</a> and <a class=css data-link-type=maybe href=#funcdef-circle title=circle()>circle()</a> |
612 | 613 | serialize to their 2- and 4-value forms only, |
| 614 | + normalized to their computed values (as above), |
613 | 615 | preferring the 2-value form |
614 | | - when it can be expressed without calc(). |
| 616 | + when it can be expressed without calc(), |
| 617 | + preferring left and top origins, |
| 618 | + and preferring 0% over a zero length. |
| 619 | + |
| 620 | +<div class=example> |
| 621 | + |
| 622 | + |
| 623 | +<p> Normalizing <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>"><position></a> to its computed value (and omitting components such as zero length offsets) means that keywords without an offset turn into percentages. |
| 624 | + |
| 625 | + <pre><code class=css> |
| 626 | + circle(at left bottom) |
| 627 | + |
| 628 | + serializes as "circle(at 0% 100%)" |
| 629 | +</code></pre> |
| 630 | +<p> Omitting components means that some default values do not show up in the serialization. But since <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>"><position></a> always uses the 2- or 4-value form, a default <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>"><position></a> is not omitted. |
| 631 | + |
| 632 | + <pre><code class=css> |
| 633 | + circle(closest-side at center) |
| 634 | + |
| 635 | + serializes as "circle(at 50% 50%)" |
| 636 | +</code></pre> |
| 637 | +<p> Using grammar order means that <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>"><position></a> values always give horizontal components first, then vertical. |
| 638 | + |
| 639 | + <pre><code class=css> |
| 640 | + circle(at bottom left) |
| 641 | + |
| 642 | + serializes as "circle(at 0% 100%)" |
| 643 | +</code></pre> |
| 644 | +<p> Avoiding calc() expressions means that some <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>"><position></a> values that could be simplified to the 2-value form must be serialized in 4-value form instead. |
| 645 | + |
| 646 | + <pre><code class=css> |
| 647 | + circle(at right 5% bottom 10px) |
| 648 | + |
| 649 | + serializes as "circle(at right 5% bottom 10px)" |
| 650 | + |
| 651 | + not as "circle(at 95% calc(100% - 10px))" |
| 652 | +</code></pre> |
| 653 | +<p> Avoiding calc() transformations means that if a specified (or computed) calc() must stay in calc() form, it will be used as-is, not reformulated with a different origin or reduced. |
| 654 | + |
| 655 | + <pre><code class=css> |
| 656 | + bottom calc(10% + 5px) |
| 657 | + |
| 658 | + serializes as "bottom calc(10% + 5px)" |
| 659 | + |
| 660 | + not as "top calc(90% - 5px)" or "calc(90% - 5px)" |
| 661 | +</code></pre> |
| 662 | +<p> Preferring 0% over a zero length comes up when you must supply an omitted offset. |
| 663 | + |
| 664 | + <pre><code class=css> |
| 665 | + circle(at right 5px top) |
| 666 | + |
| 667 | + serializes as "circle(at right 5px top 0%)" |
| 668 | +</code></pre> |
| 669 | +<p> Preferring left and top origins means that some percentage offsets will normalize to those origins (when calc can be avoided). |
| 670 | + |
| 671 | + <pre><code class=css> |
| 672 | + circle(at right 5% top) |
| 673 | + |
| 674 | + serializes as "circle(at 95% 0%)" |
| 675 | +</code></pre> |
| 676 | +</div> |
615 | 677 |
|
616 | 678 | <h3 class="heading settled heading" data-level=3.4 id=basic-shape-interpolation><span class=secno>3.4 </span><span class=content> |
617 | 679 | Interpolation of Basic Shapes</span><a class=self-link href=#basic-shape-interpolation></a></h3> |
|
0 commit comments