Skip to content

Commit 8859cc5

Browse files
committed
[css-shapes] remove box-sizing dependency, add box keywords to shape-outside
1 parent 6cdac25 commit 8859cc5

2 files changed

Lines changed: 41 additions & 15 deletions

File tree

css-shapes/Overview.html

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@ <h2 class="heading settled heading" data-level=3 id=basic-shapes-from-svg-syntax
379379
<a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>">&lt;length&gt;</a> and <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#percentage-value title="<percentage>">&lt;percentage&gt;</a> types.
380380
When using this syntax
381381
to define shapes,
382-
the relevant box is determined
383-
by the computed value of the
384-
<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-ui-3/#box-sizing0 title=box-sizing>box-sizing</a> property <a data-biblio-type=normative data-link-type=biblio href=#css3ui title=css3ui>[CSS3UI]</a>
382+
the relevant box is defined
383+
by each property that uses
384+
<a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> values.
385385
The coordinate system for the shape
386386
has its origin on the top-left corner of the
387387
relevant box with the x-axis
@@ -510,7 +510,7 @@ <h3 class="heading settled heading" data-level=3.1 id=supported-basic-shapes><sp
510510
<ul>
511511
<li><strong>closest-side</strong> uses the length from the center of the shape to the closest side of the relevant box.</li>
512512
<li><strong>farthest-side</strong> uses the length from the center of the shape to the farthest side of the relevant box.</li>
513-
<li><strong><dfn data-dfn-type=dfn data-noexport="" id=contain>contain<a class=self-link href=#contain></a></dfn></strong> uses the same value as closest-side for circle(). For ellipse the <strong>rx</strong> value uses the length from the center of the shape to the closest width side, and the <strong>ry</strong> value uses the length from the center of the shape to the closest height side</li>
513+
<li><strong>contain</strong> uses the same value as closest-side for circle(). For ellipse the <strong>rx</strong> value uses the length from the center of the shape to the closest width side, and the <strong>ry</strong> value uses the length from the center of the shape to the closest height side.</li>
514514
</ul>
515515
</dd>
516516

@@ -675,7 +675,7 @@ <h2 class="heading settled heading" data-level=5 id=declaring-shapes><span class
675675
<h3 class="heading settled heading" data-level=5.1 id=shape-outside-property><span class=secno>5.1 </span><span class=content>
676676
The <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> Property</span><a class=self-link href=#shape-outside-property></a></h3>
677677

678-
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-shape-outside>shape-outside<a class=self-link href=#propdef-shape-outside></a></dfn><tr><th>Value:<td>auto | <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> | <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a><tr><th>Initial:<td>auto<tr><th>Applies to:<td>floats<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>computed lengths for <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a>, the <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a> with its URI made absolute, otherwise as specified</table>
678+
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-shape-outside>shape-outside<a class=self-link href=#propdef-shape-outside></a></dfn><tr><th>Value:<td>auto | <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-backgrounds-4/#box title="<box>">&lt;box&gt;</a> | [<a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> || <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-backgrounds-4/#box title="<box>">&lt;box&gt;</a>] | <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a><tr><th>Initial:<td>auto<tr><th>Applies to:<td>floats<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>computed lengths for <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a>, the <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a> with its URI made absolute, otherwise as specified</table>
679679
<p> The values of this property have the following meanings:
680680

681681
<dl data-dfn-for=shape-outside data-dfn-type=value>
@@ -684,11 +684,23 @@ <h3 class="heading settled heading" data-level=5.1 id=shape-outside-property><sp
684684
The <span>float area</span> uses the margin box as normal.
685685
</dd>
686686

687+
<dt><dfn class=css-code data-dfn-for=shape-outside data-dfn-type=value data-export="" id=valuedef-box><a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-backgrounds-4/#box title="<box>">&lt;box&gt;</a><a class=self-link href=#valuedef-box></a></dfn></dt>
688+
<dd>
689+
The shape is computed based on one of
690+
<span class=css data-link-type=maybe title=margin-box>margin-box</span>,
691+
<span class=css data-link-type=maybe title=border-box>border-box</span>,
692+
<span class=css data-link-type=maybe title=padding-box>padding-box</span> or
693+
<span class=css data-link-type=maybe title=content-box>content-box</span>
694+
which use their respective boxes
695+
including curvature from border-radius,
696+
similar to <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-4/#background-clip title=background-clip>background-clip</a> <a data-biblio-type=normative data-link-type=biblio href=#css3bg title=css3bg>[CSS3BG]</a>.
697+
</dd>
698+
687699
<dt><dfn class=css-code data-dfn-for=shape-outside data-dfn-type=value data-export="" id=valuedef-basic-shape><a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a><a class=self-link href=#valuedef-basic-shape></a></dfn></dt>
688700
<dd>
689701
The shape is computed based on the values of one
690702
of <a class=css data-link-type=maybe href=#funcdef-inset title=inset()>inset()</a>, <a class=css data-link-type=maybe href=#funcdef-circle title=circle()>circle()</a>, <a class=css data-link-type=maybe href=#funcdef-ellipse title=ellipse()>ellipse()</a>
691-
or <a class=css data-link-type=maybe href=#funcdef-polygon title=polygon()>polygon()</a>.
703+
or <a class=css data-link-type=maybe href=#funcdef-polygon title=polygon()>polygon()</a>. If a <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-backgrounds-4/#box title="<box>">&lt;box&gt;</a> is also supplied, this defines the relevant box for the <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> function. If <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-backgrounds-4/#box title="<box>">&lt;box&gt;</a> is not supplied, then the relevant box defaults to <span class=css data-link-type=maybe title=margin-box>margin-box</span>.
692704
</dd>
693705

694706
<dt><dfn class=css-code data-dfn-for=shape-outside data-dfn-type=value data-export="" id=valuedef-image><a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a><a class=self-link href=#valuedef-image></a></dfn></dt>
@@ -852,6 +864,7 @@ <h2 class="no-num heading settled heading" id=change-log><span class=content>
852864
<h3 class="no-num heading settled heading" id=20130620><span class=content>
853865
Since <a href=http://www.w3.org/TR/2013/WD-css-shapes-1-20130620/>June 20th 2013</a></span><a class=self-link href=#20130620></a></h3>
854866
<ul>
867+
<li>Remove box-sizing dependency, add relevant box keywords</li>
855868
<li>Changed circle() and ellipse() to use radial gradient syntax</li>
856869
<li>Postponed rectangle() to level 2</li>
857870
<li>Clarified shape-from-image sizing and positioning</li>
@@ -1022,7 +1035,7 @@ <h2 class="no-num no-ref heading settled heading" id=references><span class=cont
10221035

10231036
<h3 class="no-num no-ref heading settled heading" id=normative><span class=content>
10241037
Normative References</span><a class=self-link href=#normative></a></h3>
1025-
<div data-fill-with=normative-references><dl><dt id=css21 title=CSS21><a class=self-link href=#css21></a>[CSS21]<dd>Bert Bos; et al. <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607>Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. W3C Recommendation. URL: <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607>http://www.w3.org/TR/2011/REC-CSS2-20110607</a><dt id=css3box title=CSS3BOX><a class=self-link href=#css3box></a>[CSS3BOX]<dd>Bert Bos. <a href=http://www.w3.org/TR/2007/WD-css3-box-20070809>CSS basic box model</a>. 9 August 2007. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2007/WD-css3-box-20070809>http://www.w3.org/TR/2007/WD-css3-box-20070809</a><dt id=css3ui title=CSS3UI><a class=self-link href=#css3ui></a>[CSS3UI]<dd>Tantek Çelik. <a href=http://www.w3.org/TR/2012/WD-css3-ui-20120117/>CSS Basic User Interface Module Level 3 (CSS3 UI)</a>. 17 January 2012. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/WD-css3-ui-20120117/>http://www.w3.org/TR/2012/WD-css3-ui-20120117/</a><dt id=css3val title=CSS3VAL><a class=self-link href=#css3val></a>[CSS3VAL]<dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a href=http://www.w3.org/TR/2013/CR-css3-values-20130730/>CSS Values and Units Module Level 3</a>. 30 July 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-css3-values-20130730/>http://www.w3.org/TR/2013/CR-css3-values-20130730/</a><dt id=html5 title=HTML5><a class=self-link href=#html5></a>[HTML5]<dd>Robin Berjon; et al. <a href=http://www.w3.org/TR/2013/CR-html5-20130806/>HTML5</a>. 6 August 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-html5-20130806/>http://www.w3.org/TR/2013/CR-html5-20130806/</a><dt id=rfc2119 title=RFC2119><a class=self-link href=#rfc2119></a>[RFC2119]<dd>S. Bradner. <a href=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <a href=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a></dl></div>
1038+
<div data-fill-with=normative-references><dl><dt id=css21 title=CSS21><a class=self-link href=#css21></a>[CSS21]<dd>Bert Bos; et al. <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607>Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. W3C Recommendation. URL: <a href=http://www.w3.org/TR/2011/REC-CSS2-20110607>http://www.w3.org/TR/2011/REC-CSS2-20110607</a><dt id=css3bg title=CSS3BG><a class=self-link href=#css3bg></a>[CSS3BG]<dd>Bert Bos; Elika J. Etemad; Brad Kemper. <a href=http://www.w3.org/TR/2012/CR-css3-background-20120724/>CSS Backgrounds and Borders Module Level 3</a>. 24 July 2012. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2012/CR-css3-background-20120724/>http://www.w3.org/TR/2012/CR-css3-background-20120724/</a><dt id=css3box title=CSS3BOX><a class=self-link href=#css3box></a>[CSS3BOX]<dd>Bert Bos. <a href=http://www.w3.org/TR/2007/WD-css3-box-20070809>CSS basic box model</a>. 9 August 2007. W3C Working Draft. (Work in progress.) URL: <a href=http://www.w3.org/TR/2007/WD-css3-box-20070809>http://www.w3.org/TR/2007/WD-css3-box-20070809</a><dt id=css3val title=CSS3VAL><a class=self-link href=#css3val></a>[CSS3VAL]<dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a href=http://www.w3.org/TR/2013/CR-css3-values-20130730/>CSS Values and Units Module Level 3</a>. 30 July 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-css3-values-20130730/>http://www.w3.org/TR/2013/CR-css3-values-20130730/</a><dt id=html5 title=HTML5><a class=self-link href=#html5></a>[HTML5]<dd>Robin Berjon; et al. <a href=http://www.w3.org/TR/2013/CR-html5-20130806/>HTML5</a>. 6 August 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a href=http://www.w3.org/TR/2013/CR-html5-20130806/>http://www.w3.org/TR/2013/CR-html5-20130806/</a><dt id=rfc2119 title=RFC2119><a class=self-link href=#rfc2119></a>[RFC2119]<dd>S. Bradner. <a href=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <a href=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a></dl></div>
10261039

10271040
<h3 class="no-num no-ref heading settled heading" id=informative><span class=content>
10281041
Informative References</span><a class=self-link href=#informative></a></h3>
@@ -1034,8 +1047,8 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
10341047
<li>auto, <a href=#valuedef-auto title="section 5.1">5.1</a>
10351048
<li>&lt;basic-shape&gt;<ul><li>(type), <a href=#typedef-basic-shape title="section 3">3</a>
10361049
<li>value for shape-outside, <a href=#valuedef-basic-shape title="section 5.1">5.1</a>
1037-
</ul><li>circle(), <a href=#funcdef-circle title="section 3.1">3.1</a>
1038-
<li>contain, <a href=#contain title="section 3.1">3.1</a>
1050+
</ul><li>&lt;box&gt;, <a href=#valuedef-box title="section 5.1">5.1</a>
1051+
<li>circle(), <a href=#funcdef-circle title="section 3.1">3.1</a>
10391052
<li>ellipse(), <a href=#funcdef-ellipse title="section 3.1">3.1</a>
10401053
<li>&lt;fill-rule&gt;, <a href=#typedef-fill-rule title="section 3.1">3.1</a>
10411054
<li>Float area, <a href=#float-area title="section 1.3">1.3</a>
@@ -1056,7 +1069,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
10561069
<h2 class="no-num no-ref heading settled heading" id=property-index><span class=content>
10571070
Property index</span><a class=self-link href=#property-index></a></h2>
10581071
<div data-fill-with=property-index><table class="proptable data"><thead><tr><th scope=col>Name<th scope=col>Value<th scope=col>Initial<th scope=col>Applies to<th scope=col>Inh.<th scope=col>%ages<th scope=col>Media<th scope=col>Computed value<tbody>
1059-
<tr><th scope=row><a data-property="">shape-outside</a><td>auto | &lt;basic-shape&gt; | &lt;image&gt;<td>auto<td>floats<td>no<td><td>visual<td>computed lengths for &lt;basic-shape&gt;, the &lt;image&gt; with its URI made absolute, otherwise as specified
1072+
<tr><th scope=row><a data-property="">shape-outside</a><td>auto | &lt;box&gt; | [&lt;basic-shape&gt; || &lt;box&gt;] | &lt;image&gt;<td>auto<td>floats<td>no<td><td>visual<td>computed lengths for &lt;basic-shape&gt;, the &lt;image&gt; with its URI made absolute, otherwise as specified
10601073
<tr><th scope=row><a data-property="">shape-image-threshold</a><td>&lt;number&gt;<td>0.0<td>floats<td>no<td><td>visual<td>The same as the specified value after clipping the &lt;number&gt; to the range [0.0,1.0]
10611074
<tr><th scope=row><a data-property="">shape-margin</a><td>&lt;length&gt; | &lt;percentage&gt;<td>0<td>floats<td>no<td><td>visual<td>the absolute length</table></div>
10621075

css-shapes/Overview.src.html

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ <h2 id="basic-shapes-from-svg-syntax">
262262
<<length>> and <<percentage>> types.
263263
When using this syntax
264264
to define shapes,
265-
the relevant box is determined
266-
by the computed value of the
267-
'box-sizing' property [[!CSS3UI]]
265+
the relevant box is defined
266+
by each property that uses
267+
<<basic-shape>> values.
268268
The coordinate system for the shape
269269
has its origin on the top-left corner of the
270270
relevant box with the x-axis
@@ -562,7 +562,7 @@ <h3 id="shape-outside-property">
562562

563563
<pre class='propdef'>
564564
Name: shape-outside
565-
Value: auto | <<basic-shape>> | <<image>>
565+
Value: auto | <<box>> | [<<basic-shape>> || <<box>>] | <<image>>
566566
Initial: auto
567567
Applies To: floats
568568
Inherited: no
@@ -578,11 +578,23 @@ <h3 id="shape-outside-property">
578578
The <span>float area</span> uses the margin box as normal.
579579
</dd>
580580

581+
<dt><dfn><<box>></dfn></dt>
582+
<dd>
583+
The shape is computed based on one of
584+
''margin-box'',
585+
''border-box'',
586+
''padding-box'' or
587+
''content-box''
588+
which use their respective boxes
589+
including curvature from border-radius,
590+
similar to 'background-clip' [[!CSS3BG]].
591+
</dd>
592+
581593
<dt><dfn><<basic-shape>></dfn></dt>
582594
<dd>
583595
The shape is computed based on the values of one
584596
of ''inset()'', ''circle()'', ''ellipse()''
585-
or ''polygon()''.
597+
or ''polygon()''. If a <<box>> is also supplied, this defines the relevant box for the <<basic-shape>> function. If <<box>> is not supplied, then the relevant box defaults to ''margin-box''.
586598
</dd>
587599

588600
<dt><dfn><<image>></dfn></dt>
@@ -769,6 +781,7 @@ <h2 class="no-num" id="change-log">
769781
<h3 class="no-num" id="20130620">
770782
Since <a href="http://www.w3.org/TR/2013/WD-css-shapes-1-20130620/">June 20th 2013</a></h3>
771783
<ul>
784+
<li>Remove box-sizing dependency, add relevant box keywords</li>
772785
<li>Changed circle() and ellipse() to use radial gradient syntax</li>
773786
<li>Postponed rectangle() to level 2</li>
774787
<li>Clarified shape-from-image sizing and positioning</li>

0 commit comments

Comments
 (0)