css3-exclusions/Exclusions.src.html

Thu, 13 Sep 2012 13:30:16 -0700

author
Alan Stearns <stearns@adobe.com>
date
Thu, 13 Sep 2012 13:30:16 -0700
changeset 6708
d238b1e9c4ac
parent 6654
2b98ef0e3cc6
child 6803
9d57ffc5916f
permissions
-rwxr-xr-x

[css3-exclusions] re-word issue 1

rossen@4115 1 <!DOCTYPE html public '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
rossen@3643 2 <html lang="en">
rossen@3643 3 <head profile="http://www.w3.org/2006/03/hcard">
rossen@3643 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
vhardy@4057 5 <title>CSS Exclusions and Shapes Module Level 3</title>
vhardy@5555 6 <link rel="stylesheet" type="text/css" href="../shared/style/default.css" />
vhardy@2780 7
vhardy@3659 8
rossen@3643 9 <style type="text/css">
rossen@3643 10 .singleImgExample {
rossen@3643 11 display: block;
rossen@3643 12 margin: auto;
rossen@3643 13 }
rossen@3643 14
rossen@3643 15 .example-table {
rossen@3643 16 table-layout: fixed;
rossen@3643 17 width: 100%;
rossen@3643 18 }
rossen@3643 19
rossen@3643 20 .example-table tr td img {
rossen@3643 21 width: 90%;
rossen@3643 22 }
vhardy@5555 23 </style>
vhardy@5555 24
vhardy@5555 25 <link rel="stylesheet" type="text/css"
vhardy@5555 26 href="http://www.w3.org/StyleSheets/TR/W3C-ED.css">
vhardy@5555 27
vhardy@5555 28 <link rel="stylesheet" type="text/css"
vhardy@5555 29 href="../shared/style/issues.css">
vhardy@2780 30
vhardy@5555 31 <link id="st" href="../shared/style/alternate-spec-style.css" rel="stylesheet"
vhardy@5555 32 type="text/css" title="alternate spec style">
vhardy@5555 33
vhardy@4045 34
vhardy@2780 35 </head>
rossen@3643 36 <body>
vhardy@3659 37 <div id="div-head" class="head">
vhardy@4680 38 <p><a href="http://www.w3.org/"><img id="mobile-logo" alt="W3C" height="53" src=
vhardy@4680 39 "http://www.w3.org/2008/site/images/logo-w3c-mobile-lg" width="90"></a>
vhardy@4680 40
vhardy@4680 41
vhardy@4680 42 <!--begin-logo-->
vhardy@4680 43
vhardy@4680 44 <p><a href="http://www.w3.org/"><img id="logo" alt="W3C" height="48" src=
vhardy@4680 45 "http://www.w3.org/Icons/w3c_home" width="72"></a> <!--end-logo--></p>
bert@4110 46 <h1 id="css-exclusions-module">CSS Exclusions and Shapes Module Level 3</h1>
rossen@3643 47 <h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
rossen@3643 48 <dl>
rossen@3643 49 <dt>This version:</dt>
bert@4110 50 <dd><a href="http://dev.w3.org/csswg/css3-exclusions/">http://dev.w3.org/csswg/css3-exclusions/</a></dd>
bert@4110 51 <!--<dd><a href="[VERSION]">http://www.w3.org/TR/[YEAR]/WD-css3-exclusions-[CDATE]/</a></dd>-->
rossen@4263 52
rossen@3643 53 <dt>Latest version:</dt>
bert@4110 54 <dd><a href="http://www.w3.org/TR/[SHORTNAME]/">http://www.w3.org/TR/[SHORTNAME]/</a></dd>
rossen@4263 55
rossen@4263 56 <dt>Editor's Draft:</dt>
rossen@4263 57 <dd><a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a>
rossen@4263 58
rossen@3643 59 <dt>Previous version:</dt>
rossen@3643 60 <dd>None</dd>
rossen@4263 61
rossen@3643 62 <dt>Editors:</dt>
rossen@3643 63 <dd class="vcard"><span class="fn">Vincent Hardy</span>, <span class="org">Adobe Systems, Inc.</span>, <span class="email">vhardy@adobe.com</span></dd>
rossen@3643 64 <dd class="vcard"><span class="fn">Rossen Atanassov</span>, <span class="org">Microsoft Corporation</span>, <span class="email">ratan@microsoft.com</span></dd>
stearns@5629 65 <dd class="vcard"><span class="fn">Alan Stearns</span>, <span class="org">Adobe Systems, Inc.</span>, <span class="email">stearns@adobe.com</span></dd>
rossen@4263 66
rossen@4263 67 <dt>Issues List:</dt>
stearns@5632 68 <dd><a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;product=CSS&amp;component=Exclusions&amp;resolution=---&amp;cmdtype=doit">in Bugzilla</a></dd>
rossen@4263 69
rossen@4263 70 <dt>Discussion:</dt>
vhardy@4680 71 <dd><a href="http://lists.w3.org/Archives/Public/www-style/">www-style@w3.org</a> with subject line "<code>[css3-exclusions] message topic</code>"
rossen@4263 72
rossen@3643 73 </dl>
rossen@3643 74 <!--copyright-->
rossen@3643 75 <hr title="Separator for header">
rossen@3643 76 </div>
vhardy@2780 77
rossen@3643 78 <h2 class="no-num no-toc" id="abstract">Abstract</h2>
rossen@3734 79
vhardy@5214 80
rossen@3643 81 <p>
vhardy@5457 82 CSS Exclusions define arbitrary areas around which <a href="http://www.w3.org/TR/CSS2/visuren.html#inline-boxes">inline content</a> ([[!CSS21]]) content can flow.
vhardy@5214 83 CSS Exclusions can be defined on any CSS block-level elements. CSS
vhardy@5214 84 Exclusions extend the notion of content wrapping previously limited to
vhardy@5214 85 floats.</p>
vhardy@5214 86
vhardy@5214 87 <p>CSS Shapes control the geometric shapes used for wrapping inline flow
vhardy@5214 88 content outside or inside an element. CSS Shapes can be applied to any
vhardy@5214 89 element. A circle shape on a float will cause inline content to wrap around
vhardy@5214 90 the circle shape instead of the float's bounding box.</p>
vhardy@5214 91
vhardy@5214 92 <p>Combining CSS Exclusions and CSS Shapes allows sophisticated layouts,
vhardy@5214 93 allowing interactions between shapes in complex positioning schemes.</p>
vhardy@5214 94
rossen@3643 95 <h2 class="no-num no-toc" id="status">Status of this document</h2>
rossen@3643 96 <!--status-->
rossen@3643 97
rossen@3643 98 <h2 class="no-num no-toc" id="contents">Table of contents</h2>
rossen@3643 99 <!--toc-->
vhardy@2780 100
rossen@3643 101 <h2 id="intro">Introduction</h2>
rossen@3643 102 <p><em>This section is not normative.</em></p>
rossen@3643 103 <p>
vhardy@3659 104 The exclusions section of this specification defines features that allow inline flow
vhardy@3659 105 content to wrap around outside the <span>exclusion area</span> of elements.
rossen@3643 106 </p>
rossen@3643 107 <p>
vhardy@3659 108 The shapes section of the specification defines properties to control the geometry of
vhardy@3659 109 an element's <span>exclusion area</span> as well as the geometry used for wrapping
vhardy@3659 110 an element's inline flow content.
rossen@3643 111 </p>
vhardy@2780 112
vhardy@3659 113 <h2 id="definitions">Definitions</h2>
vhardy@3659 114
vhardy@5125 115 <dfn>Exclusion box</dfn>
vhardy@3659 116
rossen@3643 117 <p>
vhardy@5214 118 A <a href="http://www.w3.org/TR/css3-box/">box</a> ([[!CSS3BOX]]) that defines an <span>exclusion area</span> for other boxes. The 'wrap-flow'
vhardy@5125 119 property is used to make an element's generated box an exclusion box. An exclusion box contributes
rossen@3716 120 its <span>exclusion area</span> to its <a href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">
vhardy@5412 121 containing block's</a> <span>wrapping context</span>. An element with a 'float'
vhardy@5412 122 computed value other than 'none' does not become an exclusion.
vhardy@3659 123 </p>
vhardy@3659 124
vhardy@3659 125 <dfn>Exclusion area</dfn>
rossen@4463 126 <div class="issue-marker" data-bug_id="15087" data-bug_status="NEW">
vhardy@5750 127 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15087">Issue-15087</a>
rossen@4463 128 <div class="issue-details">
rossen@4463 129 <p class="short-desc">Interaction of floats and exclusions (Howcome's questions)</p>
rossen@4463 130 </div>
rossen@4463 131 </div>
rossen@3643 132 <p>
ratan@5922 133 The area used for excluding inline flow content around an exclusion box. The
stearns@6339 134 <span>exclusion area</span> is equivalent to the <a href="http://www.w3.org/TR/CSS2/box.html#box-dimensions">
vhardy@5412 135 border box</a>.
vhardy@5214 136 This specification's
stearns@6341 137 'shape-outside' property
stearns@6341 138 can be used to define arbitrary,
stearns@6341 139 non-rectangular <span>exclusion areas</span>.
vhardy@3659 140 </p>
vhardy@3659 141
vhardy@5412 142 <dfn>Float area</dfn>
vhardy@5412 143
vhardy@5412 144 <p>
vhardy@5412 145 The area used for excluding inline flow content around a float element. By default, the
vhardy@5488 146 float area is the float element's
vhardy@5488 147 <a href="http://www.w3.org/TR/CSS2/box.html#box-dimensions">margin box</a>.
vhardy@5412 148 This specification's
vhardy@5412 149 'shape-outside' property can be used to define arbitrary, non-rectangular float
vhardy@5412 150 areas.
vhardy@5412 151 </p>
vhardy@5412 152
vhardy@5488 153 <dfn>Exclusion element</dfn>
vhardy@5488 154
vhardy@5488 155 <p>An block-level element which is not a float and generates an <span>exclusion box</span>.
vhardy@5488 156 An element generates an exclusion box when its 'wrap-flow' property's computed value is not 'auto'.
vhardy@5488 157 </p>
vhardy@5488 158
vhardy@5412 159
vhardy@3659 160 <dfn>Wrapping context</dfn>
rossen@4463 161 <div class="issue-marker" data-bug_id="15086" data-bug_status="NEW">
vhardy@5750 162 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15086">Issue-15086</a>
rossen@4463 163 <div class="issue-details">
rossen@4463 164 <p class="short-desc">should the wrapping context be generic and include floats?</p>
rossen@4463 165 </div>
rossen@4463 166 </div>
vhardy@3659 167
vhardy@3659 168 <p>
vhardy@5488 169 The <span>wrapping context</span> of a box is a collection of <span>exclusion areas</span>
vhardy@5488 170 contributed by its associated <span>exclusion boxes</span>. During layout,
vhardy@5412 171 a box wraps its inline flow content in the area that corresponds to the subtraction of
vhardy@5488 172 its <span>wrapping context</span> from its own <span>content area</span>.
vhardy@3659 173 </p>
vhardy@3659 174
vhardy@3659 175 <p>
vhardy@5125 176 A box inherits its
vhardy@3707 177 <a href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">containing block's</a>
vhardy@5488 178 <span>wrapping context</span> unless it specifically
vhardy@3659 179 resets it using the 'wrap-through' property.
vhardy@3659 180 </p>
vhardy@3659 181
vhardy@3659 182 <dfn>Content area</dfn>
vhardy@3659 183 <p>
vhardy@5125 184 The area used for layout of the inline flow content of a box. By default the
vhardy@3659 185 area is equivalent to the <a href="http://www.w3.org/TR/CSS2/box.html#box-dimensions">content box</a>.
vhardy@3659 186 This specification's 'shape-inside' property can define arbitrary, non-rectangular content areas.
vhardy@3659 187 </p>
stearns@5636 188
stearns@5636 189 <div class="issue-marker" data-bug_id="15089" data-bug_status="NEW">
vhardy@5750 190 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15089">Issue-15089</a>
stearns@5636 191 <div class="issue-details">
stearns@5636 192 <p class="short-desc">shrink-to-fit circle / shape</p>
stearns@5636 193 </div>
stearns@5636 194 </div>
vhardy@3659 195
vhardy@3659 196 <dfn title="outside-inside">Outside and inside</dfn>
vhardy@3659 197
vhardy@3659 198 <p>
rossen@3716 199 In this specification, 'outside' refers to DOM content that is not a descendant of an element
rossen@3716 200 while 'inside' refers to the element's descendants.
vhardy@3659 201 </p>
vhardy@3659 202
vhardy@3659 203 <h2 id="exclusions">Exclusions</h2>
vhardy@3659 204 <p>
stearns@6339 205 Exclusion elements define <span>exclusion areas</span> that contribute to their containing block's
vhardy@5412 206 <span>wrapping context</span>. As a consequence, exclusions impact the layout of their
vhardy@5412 207 containing block's descendants.
vhardy@3659 208 <p>
vhardy@5412 209
vhardy@3659 210 <p>
vhardy@5412 211 Elements layout their inline content in their <span>content area</span> and wrap around the
stearns@6339 212 <span>exclusion areas</span> in their associated <span>wrapping context</span>. If the element is itself an exclusion, it
vhardy@3659 213 does not wrap around its own exclusion shape and the impact of other exclusions on other
vhardy@3659 214 exclusions is controlled by the 'z-index' property as explained in the
vhardy@3659 215 <a href="#exclusions-order">exclusions order</a> section.
vhardy@3659 216 </p>
vhardy@5412 217 The <a href="#shapes">shape properties</a> can be used to change the shape of
vhardy@5412 218 <span>exclusion areas</span>.
rossen@3643 219 </p>
vhardy@2780 220
vhardy@3659 221 <h3 id="declaring-exclusions">Declaring exclusions</h3>
rossen@3655 222 <p>
vhardy@3659 223 An element becomes an exclusion when its 'wrap-flow' property has a computed value other than
vhardy@3659 224 'auto'.
rossen@3655 225 </p>
rossen@3655 226
vhardy@3659 227 <h4 id="wrap-flow-property">The 'wrap-flow' property</h4>
rossen@3643 228 <table class="propdef">
rossen@3643 229 <tr>
rossen@3643 230 <th>Name:</th>
rossen@3643 231 <td><dfn title="'wrap-flow'">wrap-flow</dfn></td>
rossen@3643 232 </tr>
rossen@3643 233 <tr>
rossen@3643 234 <th>Value:</th>
ratan@5884 235 <td><var>auto</var> | <var>both</var> | <var>start</var> | <var>end</var> | <var>minimum</var> | <var>maximum</var> | <var>clear</var></td>
rossen@3643 236 </tr>
rossen@3643 237 <tr>
rossen@3643 238 <th>Initial:</th>
rossen@3643 239 <td>auto</td>
rossen@3643 240 </tr>
rossen@3643 241 <tr>
rossen@3643 242 <th>Applies to:</th>
vhardy@5488 243 <td>block-level elements.</td>
rossen@3643 244 </tr>
rossen@3643 245 <tr>
rossen@3643 246 <th>Inherited:</th>
rossen@3643 247 <td>no</td>
rossen@3643 248 </tr>
rossen@3643 249 <tr>
rossen@3643 250 <th>Percentages:</th>
rossen@3643 251 <td>N/A</td>
rossen@3643 252 </tr>
rossen@3643 253 <tr>
rossen@3643 254 <th>Media:</th>
rossen@3643 255 <td>visual</td>
rossen@3643 256 </tr>
rossen@3643 257 <tr>
rossen@3643 258 <th>Computed&nbsp;value:</th>
vhardy@5488 259 <td>as specified except for element's whose 'float' computed value is not
vhardy@5488 260 <code class="css">none</code>, in which case the computed value is 'auto'.</td>
rossen@3643 261 </tr>
rossen@3643 262 </table>
stearns@5636 263
stearns@5636 264 <div class="issue-marker" data-bug_id="16437" data-bug_status="ASSIGNED">
vhardy@5750 265 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16437">Issue-16437</a>
stearns@5636 266 <div class="issue-details">
stearns@5636 267 <p class="short-desc">Consistent use of start/end/top/bottom</p>
stearns@5636 268 </div>
stearns@5636 269 </div>
stearns@5636 270
rossen@3643 271 <p>The values of this property have the following meanings:</p>
rossen@3643 272 <dl>
rossen@3643 273 <dt><dfn title="'wrap-flow'!!'auto'">auto</dfn></dt>
rossen@3643 274 <dd>
vhardy@5214 275 No exclusion is created. Inline flow content interacts with the element as usual.
vhardy@5488 276 In particular, if the element is a
vhardy@5488 277 <a href="http://www.w3.org/TR/CSS2/visuren.html#floats">float</a> (see [[CSS21]]), the
vhardy@5488 278 behavior is unchanged.
rossen@3643 279 </dd>
rossen@3643 280 <dt><dfn title="'wrap-flow'!!'both'">both</dfn></dt>
rossen@3643 281 <dd>
vhardy@3659 282 Inline flow content can flow on all sides of the exclusion.
rossen@3643 283 </dd>
rossen@3884 284 <dt><dfn title="'wrap-flow'!!'start'">start</dfn></dt>
rossen@3643 285 <dd>
stearns@6339 286 Inline flow content can flow before the start edge of the <span>exclusion area</span> but
vhardy@5214 287 must leave the area after the end edge of the exclusion empty.
rossen@3643 288 </dd>
rossen@3884 289 <dt><dfn title="'wrap-flow'!!'end'">end</dfn></dt>
rossen@3643 290 <dd>
stearns@6339 291 Inline flow content can flow after the end edge of the <span>exclusion area</span> but
vhardy@5214 292 must leave the area before the start edge of the exclusion empty.
rossen@3643 293 </dd>
ratan@5884 294 <dt><dfn title="'wrap-flow'!!'minimum'">minimum</dfn></dt>
ratan@5884 295 <dd>
ratan@5884 296 Inline flow content can flow on the edge of the exclusion with the smallest
ratan@5884 297 available space within its containing block, and must leave the other edge
ratan@5884 298 of the exclusion empty.
ratan@5884 299 </dd>
rossen@3643 300 <dt><dfn title="'wrap-flow'!!'maximum'">maximum</dfn></dt>
rossen@3643 301 <dd>
vhardy@5214 302 Inline flow content can flow on the edge of the exclusion with the largest
ratan@5884 303 available space within its containing block, and must leave the other edge
ratan@5884 304 of the exclusion empty.
rossen@3643 305 </dd>
rossen@3643 306 <dt><dfn title="'wrap-flow'!!'clear'">clear</dfn></dt>
rossen@3643 307 <dd>
vhardy@5214 308 Inline flow content can only flow on top and bottom edges of the exclusion
vhardy@5214 309 and must leave the areas before the start and after the end edges of the
vhardy@5214 310 exclusion empty.
rossen@3643 311 </dd>
rossen@3643 312 </dl>
rossen@3655 313
vhardy@3659 314 <p>
vhardy@5412 315 If the property's computed value is 'auto', the element does not become an
vhardy@5412 316 <span>exclusion</span>.
vhardy@3659 317 </p>
vhardy@3659 318 <p>
ratan@5884 319 Otherwise, a computed 'wrap-flow' property value of 'both', 'start', 'end', 'minimum',
ratan@5884 320 'maximum' or 'clear' on an element makes that element an <span>exclusion element</a>.
ratan@5884 321 It's <span>exclusion shape</span> is contributed to its containing block's
ratan@5884 322 <span>wrapping context</span>, causing the containing block's descendants to wrap around
stearns@6339 323 its <span>exclusion area</span>.
vhardy@3659 324 </p>
vhardy@5495 325
vhardy@5495 326 <p>An <span>exclusion element</span> establishes a
vhardy@5495 327 new <a href="">block formatting context</a> (see [[!CSS21]]) for its content.</p>
rossen@3655 328
vhardy@3707 329 <div class="figure">
vhardy@4057 330 <img alt="General illustration showing how exclusions combine" src="images/exclusions-illustration.png" width="70%" />
vhardy@3707 331 <p class="caption">Combining exclusions</p>
vhardy@3707 332 </div>
vhardy@3707 333
rossen@4463 334 <p>
rossen@4463 335 The above figure illustrates how exclusions are combined. The outermost box represents
rossen@4463 336 an element's content box. The A, B, C and D darker gray boxes represent exclusions
vhardy@5488 337 in the element's <span>wrapping context</span>. A, B, C and D have their respective 'wrap-flow'
rossen@4463 338 set to 'both', 'start', 'end' and 'clear' respectively. The lighter gray areas show
rossen@4463 339 the additional areas that are excluded for inline layout as a result of the 'wrap-flow'
rossen@4463 340 value. For example, the area to the right of 'B' cannot be used for inline layout
rossen@4463 341 because the 'wrap-flow' for 'B' is 'start'.
rossen@4463 342 </p>
rossen@4463 343 <p>
vhardy@5457 344 The background 'blue' area shows what areas are available for the element's inline content layout.
rossen@4463 345 All areas represented with a light or dark shade of gray are not available for inline
rossen@4463 346 content layout.
rossen@4463 347 </p>
rossen@4463 348
stearns@5636 349 <div class="issue-marker wrapper">
rossen@4463 350 <div class="issue-marker" data-bug_id="15084" data-bug_status="NEW">
vhardy@5750 351 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15084">Issue-15084</a>
rossen@4463 352 <div class="issue-details">
rossen@4463 353 <p class="short-desc">Fluidity of the layout with respect to different amounts of content</p>
rossen@4463 354 </div>
rossen@4463 355 </div>
stearns@5636 356 </div>
vhardy@4045 357
rossen@3643 358 <div class="example">
rossen@3643 359 <p>
stearns@6358 360 The 'wrap-flow' property values applied to exclusions as grid items.
rossen@3643 361 </p>
vhardy@3659 362 <code class="html"><pre>
vhardy@5412 363
vhardy@5412 364 &lt;div id="grid"&gt;
stearns@6358 365 &lt;div id="top-right" class="exclusion"&gt;&lt;/div&gt;
stearns@6358 366 &lt;div id="bottom-left" class="exclusion"&gt;&lt;/div&gt;
vhardy@5412 367 &lt;div id="content"&gt;Lorem ipsum…&lt;/div&gt;
vhardy@5412 368 &lt;/div&gt;
vhardy@5412 369
rossen@3643 370 &lt;style type="text/css"&gt;
vhardy@5412 371 #grid {
vhardy@5622 372 width: 30em;
vhardy@5622 373 height: 30em;
vhardy@5412 374 display: grid;
stearns@6358 375 grid-columns: 25% 25% 25% 25%;
stearns@6358 376 grid-rows: 25% 25% 25% 25%;
stearns@6358 377
stearns@6358 378 #top-right {
stearns@6358 379 grid-column: 3;
stearns@6358 380 grid-row: 2;
vhardy@5412 381 }
vhardy@5412 382
stearns@6358 383 #bottom-left {
vhardy@5412 384 grid-column: 2;
stearns@6358 385 grid-row: 3;
stearns@6358 386 }
stearns@6358 387
stearns@6358 388 .exclusion {
vhardy@5412 389 wrap-flow: &lt;see below&gt;
vhardy@5412 390 }
vhardy@5412 391
vhardy@5412 392 #content {
vhardy@5412 393 grid-row: 1;
stearns@6358 394 grid-row-span: 4;
vhardy@5412 395 grid-column: 1;
stearns@6358 396 grid-column-span: 4;
vhardy@5412 397 }
rossen@3643 398 &lt;/style&gt;
vhardy@3659 399 </pre></code>
vhardy@5622 400 <p>The following figures illustrate the visual rendering for different values
vhardy@5622 401 of the 'wrap-flow' property. The gray grid lines are marking the grid cells. and the
vhardy@5622 402 blue area is the exclusion box (positioned by the grid).</p>
rossen@3643 403 <table class="example-table">
rossen@3643 404 <tr>
stearns@6359 405 <td><code class="html">.exclusion{ wrap-flow: auto; }</code></td>
stearns@6359 406 <td><code class="html">.exclusion{ wrap-flow: both; }</code></td>
rossen@3643 407 </tr>
rossen@3643 408 <tr>
rossen@3643 409 <td><img src="images/exclusion_wrap_side_auto.png" alt="Example rendering for wrap-side: auto" /></td>
rossen@3643 410 <td><img src="images/exclusion_wrap_side_both.png" alt="Example rendering for wrap-side: both" /></td>
rossen@3643 411 </tr>
rossen@3643 412 <tr>
stearns@6359 413 <td><code class="html">.exclusion{ wrap-flow: start; }</code></td>
stearns@6359 414 <td><code class="html">.exclusion{ wrap-flow: end; }</code></td>
rossen@3643 415 </tr>
rossen@3643 416 <tr>
rossen@3884 417 <td><img src="images/exclusion_wrap_side_left.png" alt="Example rendering for wrap-side: start" /></td>
rossen@3884 418 <td><img src="images/exclusion_wrap_side_right.png" alt="Example rendering for wrap-side: end" /></td>
rossen@3643 419 </tr>
rossen@3643 420 <tr>
stearns@6359 421 <td><code class="html">.exclusion{ wrap-flow: minimum; }</code></td>
stearns@6359 422 <td><code class="html">.exclusion{ wrap-flow: maximum; }</code></td>
rossen@3643 423 </tr>
rossen@3643 424 <tr>
ratan@5886 425 <td><img src="images/exclusion_wrap_side_minimum.png" alt="Example rendering for wrap-side: minimum" /></td>
vhardy@5622 426 <td><img src="images/exclusion_wrap_side_maximum.png" alt="Example rendering for wrap-side: maximum" /></td>
ratan@5886 427 </tr>
ratan@5886 428 <tr>
stearns@6359 429 <td><code class="html">.exclusion{ wrap-flow: clear; }</code></td>
ratan@5886 430 <td></td>
ratan@5886 431 </tr>
ratan@5886 432 <tr>
ratan@5886 433 <td><img src="images/exclusion_wrap_side_clear.png" alt="Example rendering for wrap-side: clear" /></td>
ratan@5886 434 <td></td>
rossen@3643 435 </tr>
rossen@3643 436 </table>
rossen@3643 437 </div>
vhardy@5622 438
rossen@3643 439 <!-- End section "wrap-flow Property" -->
rossen@3643 440 <!-- End section "Declaring Exclusions" -->
vhardy@3659 441
vhardy@5412 442 <h3 id="scope-and-effect-of-exclusions">Scope and effect of exclusions</h3>
rossen@3643 443 <p>
stearns@6341 444 An <span>exclusion</span> affects
stearns@6341 445 the inline flow content descended
stearns@6341 446 from the exclusion's containing block
stearns@6341 447 (defined in <a href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">
stearns@6341 448 CSS 2.1 10.1</a>)
stearns@6341 449 and that of all descendant elements
stearns@6341 450 of the same containing block.
stearns@6341 451 All inline flow content
stearns@6341 452 inside the containing block
stearns@6341 453 of the exclusions is affected.
stearns@6341 454 To stop the effect of exclusions
stearns@6341 455 defined outside an element,
stearns@6341 456 the 'wrap-through' property can be used
stearns@6341 457 (see the <a href="#propagation-of-exclusions">propagation of exclusions</a>
vhardy@5412 458 section below).
vhardy@5412 459 </p>
vhardy@5412 460
vhardy@5412 461 <p>
stearns@6341 462 As a reminder,
stearns@6341 463 for exclusions with 'position:fixed',
stearns@6341 464 the containing block is that
stearns@6341 465 of the root element.
rossen@3643 466 </p>
vhardy@3731 467
vhardy@3731 468 <!-- End section "Scope and Effect of Exclusions" -->
rossen@3643 469
rossen@3643 470 <h3 id="propagation-of-exclusions">Propagation of Exclusions</h3>
rossen@3643 471 <p>
vhardy@3659 472 By default, an element inherits its parent <span>wrapping context</span>. In other words
vhardy@3659 473 it is subject to the exclusions defined <span title="outside-inside">outside</sapn> the element.
rossen@3643 474 </p>
vhardy@3659 475 <p>Setting the 'wrap-through' property to 'none' prevents an element from inheriting its parent
vhardy@5488 476 <span>wrapping context</span>. In other words, exclusions defined 'outside' the element, have not effect
vhardy@3659 477 on the element's children layout.
vhardy@3659 478 </p>
vhardy@3659 479 <div class="note">
vhardy@3659 480 Exclusions defined by an element's descendants still contribute to their containing block's
vhardy@3659 481 <span>wrapping context</span>. If that containing block is a child of an element with 'wrap-through'
vhardy@3659 482 set to none, or the element itself, then exclusion still have an effect on the children of that
vhardy@3659 483 containing block element.
vhardy@3659 484 </div>
vhardy@2780 485
rossen@3643 486 <h4 id="wrap-through-property">The 'wrap-through' Property</h4>
vhardy@4045 487
rossen@4463 488 <div class="issue-marker" data-bug_id="15085" data-bug_status="NEW">
vhardy@5750 489 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15085">Issue-15085</a>
rossen@4463 490 <div class="issue-details">
rossen@4463 491 <p class="short-desc">do we need wrap-through?</p>
rossen@4463 492 </div>
rossen@4463 493 </div>
vhardy@4045 494
rossen@3643 495 <table class="propdef">
rossen@3643 496 <tr>
rossen@3643 497 <th>Name:</th>
rossen@3643 498 <td><dfn title="'wrap-through'">wrap-through</dfn></td>
rossen@3643 499 </tr>
rossen@3643 500 <tr>
rossen@3643 501 <th>Value:</th>
rossen@3643 502 <td><var>wrap</var> | <var>none</var></td>
rossen@3643 503 </tr>
rossen@3643 504 <tr>
rossen@3643 505 <th>Initial:</th>
rossen@3643 506 <td>wrap</td>
rossen@3643 507 </tr>
rossen@3643 508 <tr>
rossen@3643 509 <th>Applies to:</th>
rossen@3643 510 <td>block-level elements</td>
rossen@3643 511 </tr>
rossen@3643 512 <tr>
rossen@3643 513 <th>Inherited:</th>
rossen@3643 514 <td>no</td>
rossen@3643 515 </tr>
rossen@3643 516 <tr>
rossen@3643 517 <th>Percentages:</th>
rossen@3643 518 <td>N/A</td>
rossen@3643 519 </tr>
rossen@3643 520 <tr>
rossen@3643 521 <th>Media:</th>
rossen@3643 522 <td>visual</td>
rossen@3643 523 </tr>
rossen@3643 524 <tr>
rossen@3643 525 <th>Computed&nbsp;value:</th>
rossen@3643 526 <td>as specified</td>
rossen@3643 527 </tr>
rossen@3643 528 </table>
vhardy@2780 529
rossen@3643 530 <p>The values of this property have the following meanings:</p>
rossen@3643 531 <dl>
rossen@3643 532 <dt><dfn title="'wrap-through'!!'wrap'">wrap</dfn></dt>
rossen@3643 533 <dd>
vhardy@3659 534 The element inherits its parent node's <span>wrapping context</span>. Its descendant
vhardy@3659 535 inline content wraps around exclusions defined <span title="outside-inside">outside</span>
vhardy@3659 536 the element.
rossen@3643 537 </dd>
rossen@3643 538 </dl>
rossen@3643 539 <dl>
rossen@3643 540 <dt><dfn title="'wrap-through'!!'none'">none</dfn></dt>
rossen@3643 541 <dd>
vhardy@3659 542 The element does not inherit its parent node's <span>wrapping context</span>. Its
vhardy@3659 543 descendants are only subject to exclusion shapes defined <span title="outside-inside">inside</span>
vhardy@3659 544 the element.
rossen@3643 545 </dd>
rossen@3643 546 </dl>
rossen@3643 547 <div class="example">
rossen@3643 548 <p>
rossen@3655 549 Using the 'wrap-through' property to control the effect of exclusions.
rossen@3643 550 </p>
rossen@3643 551 <pre><code class="html">
vhardy@5412 552
vhardy@5412 553 &lt;style type="text/css"&gt;
vhardy@5412 554 #grid {
vhardy@5412 555 display: grid;
vhardy@5412 556 grid-columns: 25% 50% 25%;
vhardy@5412 557 grid-rows: 25% 25% 25% 25%;
vhardy@5412 558 }
vhardy@5412 559
vhardy@5412 560 #exclusion {
vhardy@5412 561 grid-row: 2;
vhardy@5412 562 grid-row-span: 2;
vhardy@5412 563 grid-column: 2;
vhardy@5412 564 wrap-flow: &lt;see below&gt;
vhardy@5412 565 }
vhardy@5412 566
vhardy@5412 567 #rowA, #rowB {
vhardy@5412 568 grid-row-span: 2;
vhardy@5412 569 grid-column: 1;
vhardy@5412 570 grid-column-span: 3;
vhardy@5412 571 }
vhardy@5412 572
vhardy@5412 573 #rowA {
vhardy@5412 574 grid-row: 1;
vhardy@5412 575 }
vhardy@5412 576
vhardy@5412 577 #rowB {
vhardy@5412 578 grid-row: 3;
vhardy@5412 579 }
vhardy@5412 580 &lt;/style&gt;
vhardy@5412 581
rossen@3643 582 &lt;style type="text/css"&gt;
rossen@3643 583 .exclusion {
rossen@3643 584 wrap-flow: both;
rossen@3643 585 position: absolute;
vhardy@5412 586 left: 20%;
vhardy@5412 587 top: 20%;
vhardy@5412 588 width: 50%;
vhardy@5412 589 height: 50%;
rossen@3643 590 background-color: rgba(220, 230, 242, 0.5);
rossen@3643 591 }
rossen@3643 592 &lt;/style&gt;
vhardy@2780 593
vhardy@5412 594 &lt;div id="grid"&gt;
rossen@3643 595 &lt;div class=”exclusion”&gt;&lt;/div&gt;
vhardy@5412 596 &lt;div id="rowA" style=”wrap-through: wrap;”&gt; Lorem ipsum dolor sit amet...&lt;/div&gt;
vhardy@5412 597 &lt;div id="rowB" style=”wrap-through: none;”&gt; Lorem ipsum dolor sit amet...&lt;/div&gt;
rossen@3643 598 &lt;/div&gt;
rossen@3643 599 </code></pre>
vhardy@2780 600
rossen@3716 601 <img class="singleImgExample" src="images/exclusion_wrap_through.png" alt="Example rendering of wrap-through: wrap | none" style="max-width:40%"/>
rossen@3643 602 </div>
rossen@3643 603 <!-- End section "wrap-through property" -->
vhardy@3707 604
stearns@6601 605 <!-- removed as wrap-margin and wrap-padding changed to shape-margin and shape-padding
vhardy@3707 606
rossen@3643 607 <h4 id="wrap-shorthand-property">The 'wrap' Shorthand Property</h4>
rossen@3643 608 <table class="propdef">
rossen@3643 609 <tr>
rossen@3643 610 <th>Name:</th>
rossen@3643 611 <td><dfn title="'wrap'">wrap</dfn></td>
rossen@3643 612 </tr>
rossen@3643 613 <tr>
rossen@3643 614 <th>Value:</th>
rossen@3643 615 <td><var>&lt;wrap-flow&gt;</var> || <var>&lt;wrap-margin&gt;</var> [ / <var>&lt;wrap-padding&gt;</var>]</td>
rossen@3643 616 </tr>
rossen@3643 617 <tr>
rossen@3643 618 <th>Initial:</th>
rossen@3643 619 <td>see individual properties</td>
rossen@3643 620 </tr>
rossen@3643 621 <tr>
rossen@3643 622 <th>Applies to:</th>
rossen@3643 623 <td>block-level elements</td>
rossen@3643 624 </tr>
rossen@3643 625 <tr>
rossen@3643 626 <th>Inherited:</th>
rossen@3643 627 <td>no</td>
rossen@3643 628 </tr>
rossen@3643 629 <tr>
rossen@3643 630 <th>Percentages:</th>
rossen@3643 631 <td>N/A</td>
rossen@3643 632 </tr>
rossen@3643 633 <tr>
rossen@3643 634 <th>Media:</th>
rossen@3643 635 <td>visual</td>
rossen@3643 636 </tr>
rossen@3643 637 <tr>
rossen@3643 638 <th>Computed&nbsp;value:</th>
rossen@3643 639 <td>see individual properties</td>
rossen@3643 640 </tr>
rossen@3643 641 </table>
rossen@3643 642 <p>
rossen@3655 643 The 'wrap' property is a shorthand property for setting the exclusions properties
rossen@3643 644 at the same place in the style sheet.
rossen@3643 645 </p>
stearns@6601 646 -->
rossen@3643 647 <!-- End section "wrap shorthand property" -->
rossen@3643 648 <!-- End section "Propagation of Exclusions" -->
rossen@3643 649
vhardy@3659 650 <h3 id="exclusions-order">Exclusions order</h3>
rossen@3643 651 <p>
rossen@3716 652 Exclusions follow the painting order (See [[!CSS21]] Appendix E). Exclusions are
rossen@3716 653 applied in reverse to the document order in which they are defined. The last exclusion
rossen@3716 654 appears on top of all other exclusion, thus it affects the inline flow content of
rossen@3716 655 all other preceding exclusions or elements descendant of the same containing block.
vhardy@5488 656 The 'z-index' property can be used to change the ordering of
vhardy@5622 657 <a href="http://www.w3.org/TR/CSS2/visuren.html#choose-position">positioned</a> exclusion
vhardy@5488 658 boxes (see [[!CSS21]]). Statically positioned exclusions are not affected by the
vhardy@5488 659 'z-index' property and thus follow the painting order.
rossen@3643 660 </p>
stearns@5636 661
stearns@5636 662 <div class="issue-marker" data-bug_id="16474" data-bug_status="NEW">
vhardy@5750 663 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16474">Issue-16474</a>
stearns@5636 664 <div class="issue-details">
stearns@5636 665 <p class="short-desc">Improve Example 3 about exclusion order</p>
stearns@5636 666 </div>
stearns@5636 667 </div>
stearns@5636 668
rossen@3643 669 <div class="example">
rossen@3655 670 <p>Ordering of exclusions.</p>
rossen@3643 671 <pre><code class="html">
rossen@3643 672 &lt;style type="text/css"&gt;
rossen@3643 673 .exclusion {
rossen@3643 674 wrap-flow: both;
rossen@3643 675 position: absolute;
rossen@3643 676 width: 50%;
rossen@4361 677 height: auto;
rossen@3643 678 }
rossen@3643 679 &lt;/style&gt;
vhardy@2780 680
rossen@3643 681 &lt;div class=”exclusion” style=”top: 0px; left: 0px;”&gt;
rossen@3643 682 Lorem ipsum dolor sit amet...
rossen@3643 683 &lt;/div&gt;
rossen@3643 684 &lt;div id="orderedExclusion" class=”exclusion” style=”top: 25%; left: 25%;”&gt;
rossen@3643 685 Lorem ipsum dolor sit amet...
rossen@3643 686 &lt;/div&gt;
rossen@3643 687 &lt;div class=”exclusion” style=”top: 50%; left: 50%;”&gt;
rossen@3643 688 Lorem ipsum dolor sit amet...
rossen@3643 689 &lt;/div&gt;
rossen@3643 690 </code></pre>
vhardy@2780 691
rossen@3643 692 <table class="example-table">
rossen@3643 693 <tr>
rossen@3643 694 <td style="width:50%"><code class="html">#orderedExclusion{ z-index: auto; }</code></td>
rossen@3643 695 <td style="width:50%"><code class="html">#orderedExclusion{ z-index: 1; }</code></td>
rossen@3643 696 </tr>
rossen@3643 697 <tr>
rossen@3643 698 <td><img class="singleImgExample" src="images/exclusion_ordering.png" alt="Example rendering of default exclusion ordering." /></td>
rossen@3643 699 <td><img class="singleImgExample" src="images/exclusion_ordering_z_order.png" alt="Example rendering of default exclusion ordering." /></td>
rossen@3643 700 </tr>
rossen@3643 701 </table>
vhardy@2780 702
rossen@3643 703 </div>
rossen@3643 704 <!-- End section "Order of Exclusions" -->
rossen@4463 705
stearns@5628 706 <div class="issue-marker wrapper">
rossen@4463 707 <div class="issue-marker" data-bug_id="15183" data-bug_status="NEW">
vhardy@5750 708 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15183">Issue-15183</a>
rossen@4463 709 <div class="issue-details">
rossen@4463 710 <p class="short-desc">Is the CSS exclusions processing model incorrect?</p>
rossen@4463 711 </div>
stearns@6708 712 </div>
stearns@6708 713 </div>
rossen@4116 714
stearns@6708 715 <div class="issue">
stearns@6708 716
stearns@6708 717 <p>The current draft provides a model for exclusions
stearns@6708 718 without a collision-avoidance model.
stearns@6708 719 The existing exclusion model in CSS uses floats,
stearns@6708 720 which have both exclusion and collision-avoidance behavior.
stearns@6708 721 Concerns have been raised that allowing exclusions
stearns@6708 722 without collision avoidance could be harmful,
stearns@6708 723 particularly with absolutely-positioned elements.
stearns@6708 724 Three options should be considered:<p>
stearns@6708 725 <ol>
stearns@6708 726 <li>Allow exclusions in positioning schemes
stearns@6708 727 with no collision avoidance.</li>
stearns@6708 728 <li>Disallow exclusions in positioning schemes
stearns@6708 729 with no collision avoidance.</li>
stearns@6708 730 <li>Define collision-avoidance behavior
stearns@6708 731 for positioning schemes without it,
stearns@6708 732 and use this behavior by default with exclusions.</li>
stearns@6708 733 <ol>
stearns@6708 734 </div>
stearns@6708 735
stearns@6708 736 <div class="issue-marker wrapper">
rossen@4463 737 <div class="issue-marker" data-bug_id="15083" data-bug_status="NEW">
vhardy@5750 738 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15083">Issue-15083</a>
rossen@4463 739 <div class="issue-details">
rossen@4463 740 <p class="short-desc">Concerns over Error accumulation vs. performance</p>
rossen@4463 741 </div>
rossen@4116 742 </div>
stearns@5628 743 </div>
vhardy@3659 744
vhardy@4473 745 <h3 id="exclusions-processing-model">Processing model</h3>
vhardy@5412 746
vhardy@5412 747 <h4 id="exclusions-processing-model-description">Description</h4>
vhardy@5412 748
vhardy@5412 749 <p>Applying exclusions is a two-step process:</p>
vhardy@5412 750
vhardy@5412 751 <ul>
vhardy@5488 752 <li><strong>Step 1</strong>: resolve exclusion boxes belonging to each <span>wrapping context</span></li>
stearns@6097 753 <li><strong>Step 2</strong>: resolve <span>wrapping context</span>s and lay out each containing block in turn:
vhardy@5412 754 <ul>
vhardy@5488 755 <li><strong>Step 2-A</strong>: resolve the position and size of exclusion boxes</li>
stearns@6339 756 <li><strong>Step 2-B</strong>: lay out containing block, wrapping around <span>exclusion areas</span></li>
vhardy@5412 757 </ul>
vhardy@5412 758 </li>
vhardy@5412 759 </ul>
vhardy@5412 760
vhardy@5488 761 <h4 id="step-1-resolve-exclusion-boxes-belonging-to-each-wrapping-context">Step 1: resolve exclusion boxes belonging to each <span>wrapping context</span></h4>
vhardy@5412 762
vhardy@5412 763 <p>In this step, the user agent determines which <a href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">containing block</a> each
vhardy@5412 764 <span>exclusion area</span> belongs to. This is a simple step, based on the
vhardy@5412 765 definition of containing blocks and elements with a computed value for 'wrap-flow'
vhardy@5488 766 that is not <code class="css">auto</code>.</p>
vhardy@5412 767
stearns@6097 768 <h4 id="step-2-resolve-wrapping-contexts-layout-containing-blocks">Step 2: resolve wrapping contexts and lay out containing blocks</h4>
vhardy@4473 769
vhardy@5412 770 <p>In this step, starting from the
vhardy@5488 771 top of the <a href="http://www.w3.org/TR/CSS2/visuren.html#z-index">rendering tree</a> (see [[!CSS21]]),
vhardy@5488 772 the the agent processes each containing block in two sub-steps.</p>
vhardy@5412 773
vhardy@5488 774 <h4 id="step-2-A-resolve-exclusions-position-and-size">Step 2-A: resolve the position and size of exclusion boxes</h4>
vhardy@5412 775
stearns@6097 776 <p>Resolving the position and size
stearns@6097 777 of <span>exclusion boxes</span>
stearns@6097 778 in the <span>wrapping context</span>
stearns@6097 779 may or may not require a layout.
stearns@6097 780 For example,
stearns@6097 781 if an <span>exclusion box</span>
stearns@6097 782 is absolutely positioned and sized,
stearns@6097 783 a layout may not be needed
stearns@6097 784 to resolve its position and size.
stearns@6097 785 In other situations,
stearns@6097 786 laying out the containing block's content is required.</p>
vhardy@5412 787
stearns@6097 788 <p>When a layout is required,
stearns@6097 789 it is carried out
stearns@6097 790 without applying any <span>exclusion area</span>.
stearns@6097 791 In other words,
stearns@6097 792 the containing block is laid out
stearns@6097 793 without a <span>wrapping context</span>. </p>
vhardy@5412 794
vhardy@5412 795 <p>Step 2-A yields a position and size
stearns@6097 796 for all <span>exclusion boxes</span>
stearns@6097 797 in the <span>wrapping context</span>.
stearns@6097 798 Each exclusion box is processed in turn,
stearns@6097 799 starting from the top-most,
stearns@6097 800 and each <span>exclusion area</span>
stearns@6097 801 is computed and contributed
stearns@6097 802 to the <a href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">containing block's</a>
stearns@6097 803 <span>wrapping context</span>. </p>
vhardy@5412 804
stearns@6097 805 <p>Scrolling is ignored in this step
stearns@6097 806 when resolving the position and size
stearns@6097 807 of 'position:fixed' <span>exclusion boxes</span>.</p>
stearns@6097 808
stearns@6097 809 <p>Once the <a href="http://www.w3.org/TR/CSS2/visudet.html#containing-block-details">containing block's</a>
stearns@6097 810 <span>wrapping context</span> is computed,
stearns@6097 811 all <span>exclusion boxes</span>
stearns@6097 812 in that <span>wrapping context</span>
stearns@6097 813 are removed from the normal flow.</p>
stearns@6097 814
stearns@6097 815 <h4 id="step-2-B-layout-containing-block-applying-wrapping">Step 2-B: lay out containing block applying wrapping</h4>
vhardy@5412 816
stearns@6097 817 <p>Finally, the content
stearns@6097 818 of the containing block is laid out,
stearns@6097 819 with the inline content wrapping around
stearns@6097 820 the <span>wrapping content</span>'s
stearns@6097 821 <span>exclusion areas</span>
stearns@6097 822 (which may be different
stearns@6097 823 from the <span>exclusion box</span>
vhardy@5488 824 because of the 'shape-outside' property).</p>
vhardy@5488 825
vhardy@5488 826 <p>When the containing block itself is an <span>exclusion box</span>, then
stearns@5633 827 rules on <a href="#exclusions-order">exclusions order</a> define which exclusions
vhardy@5488 828 affect the inline and descendant content of the box.</p>
vhardy@5412 829
vhardy@4473 830 <h4 id="exclusions-processing-model-example">Example</h4>
vhardy@4473 831
vhardy@4473 832 <p>This section illustrates the exclusions processing model with an example. It is meant
vhardy@4473 833 to be simple. Yet, it contains enough complexity to address the issues of
vhardy@4473 834 layout dependencies and re-layout.</p>
vhardy@4473 835
vhardy@4473 836
vhardy@4473 837 <p>The code snippet in the following example has two exclusions affecting
vhardy@5125 838 the document's inline content.</p>
vhardy@4473 839
vhardy@4473 840 <div class="example">
vhardy@5488 841 <pre class="html">&lt;html&gt;
vhardy@5622 842 &lt;style&gt;
vhardy@5622 843 #d1 {
vhardy@5622 844 position:relative;
vhardy@5622 845 height: auto;
vhardy@5622 846 color: #46A4E9;
vhardy@5622 847 border: 1px solid gray;
vhardy@5622 848 }
vhardy@5622 849
vhardy@5622 850 #e1 {
stearns@6450 851 wrap-flow: both;
vhardy@5622 852 position: absolute;
vhardy@5622 853 left: 50%;
vhardy@5622 854 top: 50%;
vhardy@5622 855 width: 40%;
vhardy@5622 856 height: 40%;
vhardy@5622 857 border: 1px solid red;
vhardy@5622 858 margin-left: -20%;
vhardy@5622 859 margin-top: -20%;
vhardy@5622 860 }
vhardy@5622 861
vhardy@5622 862 #d2 {
vhardy@5622 863 position: static;
vhardy@5622 864 width: 100%;
vhardy@5622 865 height: auto;
vhardy@5622 866 color: #808080;
vhardy@5622 867 }
vhardy@5622 868
vhardy@5622 869 #e2 {
stearns@6450 870 wrap-flow: both;
vhardy@5622 871 position: absolute;
vhardy@5622 872 right: 5ex;
vhardy@5622 873 top: 1em;
vhardy@5622 874 width: 12ex;
vhardy@5622 875 height: 10em;
vhardy@5622 876 border: 1px solid lime;
vhardy@5622 877 }
vhardy@5622 878 &lt;/style&gt;
vhardy@5622 879 &lt;body&gt;
vhardy@5622 880 &lt;div id="d1"&gt;
vhardy@5622 881 Lorem ipsusm ...
vhardy@5622 882 &lt;p id="e1"&gt;&lt/p&gt;
vhardy@5622 883 &lt;/div&gt;
vhardy@5622 884 &lt;div id="d2"&gt;
vhardy@5622 885 Lorem ipsusm ...
vhardy@5622 886 &lt;p id="e2" &gt;&lt/p&gt;
vhardy@5622 887 &lt;/div&gt;
vhardy@5622 888 &lt;/body&gt;
vhardy@5488 889 &lt;/html&gt;</pre>
vhardy@4473 890 </div>
vhardy@5118 891 <p>The following figures illustrate:</p>
vhardy@5118 892
vhardy@5118 893 <ul>
vhardy@5118 894 <li>the document's DOM tree</li>
vhardy@5125 895 <li>the layout tree of generated block boxes</p>
vhardy@5118 896 </ul>
vhardy@5118 897
vhardy@4473 898 <div class="figure">
stearns@5632 899 <img src="images/processing-model-example-dom.svg" width="200"
stearns@5632 900 alt="DOM tree nodes"/>
vhardy@5118 901 <p class="caption">DOM tree</p>
vhardy@4473 902 </div>
vhardy@4473 903
vhardy@4473 904 <div class="figure">
stearns@5632 905 <img src="images/processing-model-example-layout-tree.svg" width="350"
stearns@5632 906 alt="Layout tree boxes"/>
vhardy@5125 907 <p class="caption">Layout tree of generated block boxes</p>
vhardy@4473 908 </div>
vhardy@4473 909
vhardy@5488 910 <h5>Step 1: resolve exclusion boxes belonging to each <span>wrapping context</span></h5>
vhardy@5412 911
vhardy@4473 912 <p>The figures illustrate how the boxes corresponding to the element sometimes
vhardy@4473 913 have a different containment hierarchy in the layout tree than in the DOM tree.
vhardy@5118 914 For example, the box generated by <code class="idl">e1</code> is positioned in
vhardy@5488 915 its containing block's box, which is the <code class="idl">d1-box</code>, because
vhardy@4473 916 <code class="idl">e1</code> is absolutely positioned and <code class="idl">d1</code>
vhardy@4473 917 is relatively positioned. However, while <code class="idl">e2</code> is also absolutely
vhardy@4473 918 positioned, its containing block is the initial containing block (ICB). See the
vhardy@4473 919 section 10.1 of the CSS 2.1 specification ([[!CSS21]]) for details.</p>
vhardy@4473 920
vhardy@5118 921 <p>As a result of the computation of containing blocks for the tree, the boxes belonging
vhardy@5488 922 to the <span>wrapping context</span>s of all the elements can be determined:</p>
vhardy@4473 923
vhardy@4473 924 <ul>
vhardy@5488 925 <li>The <span>wrapping context</span> for the html element contains the <code class="idl">e2</code> box: WC-1 (Wrapping Context 1)</li>
vhardy@5488 926 <li>The <span>wrapping context</span> for the body element inherits the html element's <span>wrapping context</span>: WC-1</li>
vhardy@5488 927 <li>The <span>wrapping context</span> for <code class="idl">d1</code> inherits the body element's
vhardy@5488 928 <span>wrapping context</span> and adds the <code class="idl">e1-box</code> to it. So the wrapping
vhardy@5488 929 context is made of both the <code class="idl">e1-box</code> and the
vhardy@5488 930 <code class="idl">e2-box</code>: WC-2</li>
vhardy@5488 931 <li>The <span>wrapping context</span> for <code class="idl">d2</code> inherits the body element's
vhardy@5488 932 <span>wrapping context</span>: WC-1</li>
vhardy@4473 933 </ul>
vhardy@4473 934
stearns@6097 935 <h5>Step 2: resolve wrapping contexts and lay out containing blocks</h5>
vhardy@5118 936
vhardy@5118 937 <p>In this step, each containing block is processed in turn. For each containing block,
vhardy@5118 938 we (conceptually) go through two phases:</p>
vhardy@5118 939 <ol>
vhardy@5488 940 <li>resolve the <span>wrapping context</span>: resolve the position and size of its exclusions</li>
stearns@6097 941 <li>lay out the containing block</li>
vhardy@5118 942 </ol>
vhardy@5118 943
vhardy@5118 944 <p>In our example, this breaks down to:</p>
vhardy@5118 945 <ol>
vhardy@5125 946 <li>resolve the position and size of the exclusions belonging to WC-1: RWC-1 (Resolved Wrapping Context 1).</li>
stearns@6097 947 <li>lay out the initial containing block (i.e., lay out its content):
vhardy@5118 948 <ol>
vhardy@5488 949 <li>resolve the html element's <span>wrapping context</span>: RWC-1</li>
stearns@6097 950 <li>lay out the html element:
vhardy@5118 951 <ol>
vhardy@5488 952 <li>resolve the body element's <span>wrapping context</span>: RWC-1</li>
stearns@6097 953 <li>lay out the body element:
vhardy@5118 954 <ol>
vhardy@5488 955 <li>resolve the <code class="idl">d1</code> element's <span>wrapping context</span>: RWC-2</li>
stearns@6097 956 <li>lay out the <code class="idl">d1</code> element</li>
vhardy@5488 957 <li>resolve the <code class="idl">d2</code> element's <span>wrapping context</span>: RWC-1</li>
stearns@6097 958 <li>lay out the <code class="idl">d2</code> element</li>
vhardy@5118 959 </ol>
vhardy@5118 960 </li>
vhardy@5118 961 </ol>
vhardy@5118 962 </li>
vhardy@5118 963 </ol>
vhardy@5118 964 </li>
vhardy@5118 965 </ol>
vhardy@5118 966
vhardy@5125 967 <h6>Resolving RWC-1</h6>
vhardy@5118 968
vhardy@5488 969 <p>The top-most <span>wrapping context</span> in the layout tree contains the <code class="idl">e2</code>
vhardy@5125 970 exclusion. Its position and size needs to be resolved. In general, computing an
vhardy@5118 971 exclusion's position and size may or may not require laying out other content.
vhardy@5125 972 In our example, no content needs to be laid out to resolve the <code class="idl">e2</code>
vhardy@5125 973 exclusion's position because it is absolutely positioned and its size can be resolved
vhardy@5125 974 without layout either. At this point, RWC-1 is resolved and can be used when
vhardy@5125 975 laying inline content out.</p>
vhardy@4473 976
vhardy@5125 977 <h6>Resolving RWC-2</h6>
vhardy@5118 978
vhardy@5118 979 <p>The process is similar: the position of the
vhardy@5459 980 <code class="idl">e1</code> exclusion needs to be resolved. Again, resolving the exclusion's
vhardy@5118 981 position and size may require processing the containing block (d1 here).
vhardy@5118 982 It is the case here because the size and position of
vhardy@5118 983 <code class="idl">e1</code> depend on resolving the percentage lengths. The percentages are relative
vhardy@5118 984 to the size of
vhardy@5125 985 <code class="idl">d1</code>'s box. As a result, in order to resolve
vhardy@5118 986 a size for <code class="idl">d1</code>'s box, a first layout of <code class="idl">d1</code>
vhardy@5488 987 is done without any <span>wrapping context</span> (i.e., no exclusions applied). The layout yields a
vhardy@5118 988 position and size for <code class="idl">e1</code>'s box.
vhardy@4473 989 </p>
vhardy@5118 990 <p>At this point, RWC-2 is resolved because the position and size of both
vhardy@5125 991 e1 and e2 are resolved.</p>
vhardy@4473 992
vhardy@5488 993 <p class="note">The important aspect of the above processing example is that once an element's <span>wrapping context</span>
vhardy@5125 994 is resolved (by resolving its exclusions' position and size), the position and size of the
vhardy@5412 995 exclusions are not re-processed if the element's size changes between the layout that may be done
vhardy@5488 996 without considering any <span>wrapping context</span> (as for RWC-2) and the layout done with the resolved <span>wrapping context</span>.
vhardy@5488 997 This is what breaks the possible circular dependency between the resolution of <span>wrapping context</span>s
vhardy@5118 998 and the layout of containing blocks.</p>
vhardy@4473 999
vhardy@5412 1000 <h3 id="floats-and-exclusions">Floats and exclusions</h3>
vhardy@5412 1001
vhardy@5412 1002 <h4 id="floats-and-exclusions-similarities">Similarities</h4>
vhardy@5412 1003
vhardy@5412 1004 <p>There are similarities between floats an exclusions in that inline content wraps around floats
stearns@6339 1005 and also wraps around <span>exclusion areas</span>. However, there are very significant differences.</p>
vhardy@5412 1006
vhardy@5412 1007 <h4 id="floats-and-exclusions-differences">Differences</h4>
vhardy@5412 1008
vhardy@5412 1009 <ul>
vhardy@5412 1010 <li><strong>scope</strong>. While floats apply to content that follows in the
vhardy@5412 1011 document, exclusions apply to content in their containing block.</li>
vhardy@5412 1012 <li><strong>positioning</strong>. Floats are part of the inline flow and 'float' on the
vhardy@5412 1013 line box. Authors can control how the floats move on the line box, to the right or to the
vhardy@5412 1014 left. By contrast, exclusions can be positioned using any positioning scheme such
vhardy@5412 1015 as grid layout ([[CSS3-GRID-LAYOUT]]), flexible box ([[CSS3-FLEXBOX]]) or any other
vhardy@5412 1016 CSS positioning scheme.</li>
vhardy@5412 1017 <li><strong>separation of concerns</strong>. Making an element a float determines both
vhardy@5412 1018 its positioning scheme and its effect on inline content. Making an element an
vhardy@5412 1019 exclusion only determines its impact on inline content and does not impose constraints
vhardy@5412 1020 on its positioning method.</li>
vhardy@5412 1021 </ul>
vhardy@5412 1022
vhardy@5412 1023 <h4 id="floats-and-exclusions-interoperability">Interoperability</h4>
vhardy@5412 1024
vhardy@5412 1025 <h5 id="effect-of-floats-on-exclusions">Effect of floats on exclusions</h5>
vhardy@5412 1026
vhardy@5412 1027 <p>Floats have an effect on the positioning of exclusions and the layout of their inline content. For
vhardy@5412 1028 example, if an exclusion is an inline-box which happens to be on the same line as a float,
stearns@5633 1029 its' position, as computed in <a href="#step-2-A-resolve-exclusions-position-and-size">Step 2-A</a> will be impacted by the float, as
vhardy@5412 1030 is any other inline content.</p>
vhardy@5412 1031
vhardy@5412 1032 <h5 id="effect-of-exclusions-on-floats">Effect of exclusions on floats</h5>
vhardy@5412 1033
vhardy@5412 1034 <p>Exclusions have an effect on the positioning of floats as they have an effect on inline content.
stearns@5633 1035 Therefore, in <a href="#step-2-B-layout-containing-block-applying-wrapping">Step 2-B</a>, floats will avoid <span>exclusion areas</span>.</p>
vhardy@5412 1036
rossen@3643 1037 <!-- End section "Exclusions" -->
vhardy@2780 1038
rossen@3643 1039 <h2 id="shapes">Shapes</h2>
stearns@5636 1040
stearns@5636 1041 <div class="issue-marker wrapper">
rossen@4463 1042 <div class="issue-marker" data-bug_id="15091" data-bug_status="NEW">
vhardy@5750 1043 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15091">Issue-15091</a><br />
rossen@4463 1044 <div class="issue-details">
rossen@4463 1045 <p class="short-desc">Simplify the syntax for shapes</p>
rossen@4463 1046 </div>
vhardy@4045 1047 </div>
vhardy@4045 1048
stearns@5636 1049 <div class="issue-marker" data-bug_id="16716" data-bug_status="NEW">
vhardy@5750 1050 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16716">Issue-16716</a>
stearns@5636 1051 <div class="issue-details">
stearns@5636 1052 <p class="short-desc">Handling visible content as a shape for Exclusions</p>
stearns@5636 1053 </div>
stearns@5636 1054 </div>
stearns@5636 1055 </div>
stearns@5636 1056
rossen@3643 1057 <p>
vhardy@3659 1058 Shapes define arbitrary geometric contours around which or into which inline flow
rossen@3643 1059 content flows. There are two different types of shapes – 'outside' and 'inside'.
vhardy@5412 1060 The outside shape defines the <span>exclusion area</span> for an <span>exclusion element</span>
vhardy@5412 1061 or the <span>float area</span> for a float.
vhardy@3659 1062 The inside shape defines an element's <span>content shape</span> and the element's inline
vhardy@3659 1063 content will flow within that shape.
rossen@3643 1064 </p>
vhardy@5412 1065
vhardy@5412 1066 <p class="note">It is important to note that while outside shapes only apply to
vhardy@5412 1067 <span>exclusions</span> and floats, inside shapes apply to all block-level elements.</p>
vhardy@2780 1068
vhardy@5412 1069 <h3 id="relation-to-box-model-and-float-behavior">Relation to the box model and float behavior</h3>
vhardy@5412 1070
vhardy@5412 1071 <p>
vhardy@5412 1072 While the boundaries used for wrapping inline flow content outside and inside
rossen@3643 1073 an element can be defined using shapes, the actual box model does not change. If
rossen@3643 1074 the element has specified margins, borders or paddings they will be computed and
vhardy@5214 1075 rendered according to the [[!CSS3BOX]] module.
rossen@3643 1076 </p>
rossen@3643 1077
vhardy@5412 1078 <p>
vhardy@5412 1079 However, floats are an exception. If a float has an outside shape, its positioning
vhardy@5412 1080 is resolved as
vhardy@5412 1081 <a href="http://www.w3.org/TR/CSS2/visuren.html#float-position">defined</a> in
vhardy@5412 1082 [[!CSS21]] but using the
vhardy@5412 1083 outside shape's bounding box is used in lieu of the float's margin box.
vhardy@5412 1084 </p>
vhardy@5412 1085
rossen@3643 1086 <div class="example">
vhardy@5622 1087 <p>CSS 'shape-outside' and CSS box model relation: the red box illustrates the exclusion element's
vhardy@5622 1088 content box, which is unmodified and subject to normal CSS positioning (here absolute positioning).</p>
rossen@3643 1089 <pre><code class="html">
rossen@3643 1090 &lt;style type="text/css"&gt;
rossen@3643 1091 .exclusion {
rossen@3643 1092 wrap-flow: both;
rossen@3643 1093 position: absolute;
vhardy@5622 1094 top: 25%;
vhardy@5622 1095 left: 25%;
vhardy@5622 1096 width: 50%;
vhardy@5622 1097 height: 50%;
rossen@3762 1098 shape-outside: circle(50%, 50%, 50%);
vhardy@3659 1099 border: 1px solid red;
rossen@3643 1100 }
rossen@3643 1101 &lt;/style&gt;
vhardy@2780 1102
vhardy@5459 1103 &lt;div style=”position: relative;”&gt;
rossen@3643 1104 &lt;div class=”exclusion”&gt;&lt;/div&gt;
rossen@3643 1105 Lorem ipsum dolor sit amet...
rossen@3643 1106 &lt;/div&gt;
rossen@3643 1107 </code></pre>
vhardy@3707 1108 <img class="singleImgExample" src="images/shapes_CSS2.1_MBP.png" alt="Example rendering of circle shape and box model." style="max-width:40%"/>
rossen@3643 1109 </div>
vhardy@5622 1110
vhardy@5622 1111 <div class="example">
vhardy@5622 1112 <p>In the following example the left and right floating <code class="html">div</code> elements
vhardy@5622 1113 specify a triangular shape using the 'shape-outside' property.</p>
vhardy@5622 1114
vhardy@5622 1115 <pre><code class="html">
vhardy@5622 1116 &lt;div style="text-align:center;"&gt;
vhardy@5622 1117 &lt;div id="float-left"&gt;&lt;/div&gt;
vhardy@5622 1118 &lt;div id="float-right"&gt;&lt;/div&gt;
vhardy@5622 1119 &lt;div&gt;
vhardy@5622 1120 Sometimes a web page's text content appears to be
vhardy@5622 1121 funneling your attention towards a spot on the page
vhardy@5622 1122 to drive you to follow a particular link. Sometimes
vhardy@5622 1123 you don't notice.
vhardy@5622 1124 &lt;/div&gt;
vhardy@5622 1125 &lt;/div&gt;
vhardy@5622 1126
vhardy@5622 1127 &lt;style type="text/css"&gt;
vhardy@5622 1128 #float-left {
vhardy@5622 1129 shape-outside: polygon(0,0 100%,100% 0,100%);
vhardy@5622 1130 float: left;
vhardy@5622 1131 width: 40%;
vhardy@5622 1132 height: 12ex;
vhardy@5622 1133 }
vhardy@5622 1134
vhardy@5622 1135 #float-right {
vhardy@5622 1136 shape-outside: polygon(100%,0 100%,100% 0,100%);
vhardy@5622 1137 float: right;
vhardy@5622 1138 width: 40%;
vhardy@5622 1139 height: 12ex;
vhardy@5622 1140 }
vhardy@5622 1141 &lt;/style&gt;
vhardy@5622 1142 &lt;/div&gt;</code></pre>
rossen@3643 1143
vhardy@5622 1144 <img class="singleImgExample" src="images/float-shape-outside.png" alt="Using the shape-outside property with a float"/>
vhardy@5622 1145 </div>
stearns@6587 1146 <h3 id="basic-shapes-from-svg-syntax">Basic Shapes</h3>
rossen@3643 1147 <p>
stearns@6587 1148 Shapes can be specified using
stearns@6587 1149 syntax similar to <a href="http://www.w3.org/TR/SVG/shapes.html">SVG basic shapes</a>.
stearns@6587 1150 The definitions use
stearns@6587 1151 <code><a href="http://www.w3.org/TR/css3-values/#lengths">&lt;length&gt;</a></code> type
stearns@6587 1152 and the <code><a href="">&lt;percentage&gt;</a></code> types (see [[!CSS3VAL]]).
stearns@6587 1153 Percentages are resolved
stearns@6587 1154 from the border box
stearns@6587 1155 of the element to which the property applies.
stearns@6587 1156 For the radius <code>r</code> of the <code>circle</code> shape,
stearns@6587 1157 a percentage value is resolved as
stearns@6587 1158 <a href="http://www.w3.org/TR/SVG/coords.html#Units">specified</a>
stearns@6587 1159 in the SVG recommendation (see [[!SVG11]]).
stearns@6587 1160 SVG strokes are not considered part of the shape,
stearns@6587 1161 thus only the following geometries are valid.
rossen@3643 1162 </p>
vhardy@3659 1163
vhardy@3659 1164
stearns@6587 1165 <h4 id="supported-basic-shapes">Supported Shapes</h4>
rossen@3643 1166 The following SVG shapes are supported by the CSS shapes module.
rossen@3643 1167 <dl>
stearns@6301 1168 <dt><dfn id="rectangle">rectangle</dfn>([&lt;length&gt;|&lt;percentage&gt;]{4} [ curve [&lt;length&gt;|&lt;percentage&gt;]{1,2} ]? )</dt>
rossen@3643 1169 <dd>
rossen@3643 1170 <ul>
rossen@4465 1171 <li>
stearns@6283 1172 The four values represent
stearns@6283 1173 <strong>x, y, width</strong> and
stearns@6283 1174 <strong>height</strong>.
stearns@6283 1175 They define the bounding box
stearns@6283 1176 of the rectangle.
stearns@6283 1177 Negative values for width and height are invalid.
stearns@6283 1178 </li>
stearns@6283 1179 <li>
stearns@6283 1180 The two 'curve' values represent
stearns@6283 1181 <strong> rx</strong> and <strong>ry</strong>.
stearns@6283 1182 For rounded rectangles they define
stearns@6283 1183 the x-axis radius and y-axis radius
stearns@6283 1184 of the ellipse used to round off
stearns@6283 1185 the corners of the rectangle.
stearns@6283 1186 Negative values for rx and ry are invalid.
rossen@4465 1187 </li>
rossen@3643 1188 </ul>
rossen@3643 1189 </dd>
stearns@6301 1190 <dt><dfn id="circle">circle</dfn>([&lt;length&gt;|&lt;percentage&gt;]{3})</dt>
rossen@3643 1191 <dd>
rossen@3643 1192 <ul>
rossen@4465 1193 <li>
stearns@6283 1194 The three values values represent
stearns@6283 1195 <strong>cx</strong>,
stearns@6283 1196 <strong>cy</strong>,
stearns@6283 1197 and <strong>r</strong>.
stearns@6283 1198 They define the x-axis and y-axis coordinates
stearns@6283 1199 of the center of the circle
stearns@6283 1200 and the radius of the circle.
stearns@6283 1201 A negative value for r is invalid.
rossen@4465 1202 </li>
rossen@3643 1203 </ul>
rossen@3643 1204 </dd>
stearns@6301 1205 <dt><dfn id="ellipse">ellipse</dfn>([&lt;length&gt;|&lt;percentage&gt;]{4})</dt>
rossen@3643 1206 <dd>
rossen@3643 1207 <ul>
stearns@6283 1208 <li>
stearns@6283 1209 The four values represent
stearns@6283 1210 <strong>cx</strong>,
stearns@6283 1211 <strong>cy</strong>,
stearns@6283 1212 <strong>rx</strong>, and
stearns@6283 1213 <strong>ry</strong>.
stearns@6283 1214 They define the x-axis and y-axis coordinates
stearns@6283 1215 of the center of the ellipse
stearns@6283 1216 and the x-axis and y-axis radius
stearns@6283 1217 of the ellipse.
stearns@6283 1218 Negative values for rx and ry are invalid.
rossen@4465 1219 </li>
rossen@3643 1220 </ul>
rossen@3643 1221 </dd>
stearns@6301 1222 <dt><dfn id="polygon">polygon</dfn>([&lt;fill-rule&gt;,]? [&lt;length&gt;|&lt;percentage&gt;]{2}#)</dt>
rossen@3643 1223 <dd>
rossen@3643 1224 <ul>
rossen@3643 1225 <li><strong>fillRule</strong> - The filling rule used to determine the interior of the
stearns@6587 1226 polygon. See <a href="http://www.w3.org/TR/SVG/painting.html#FillRuleProperty">fill-rule</a> property in SVG for details. Possible values are nonzero
rossen@3643 1227 or evenodd. Default value when omitted is nonzero.</li>
rossen@4465 1228 <li>
rossen@4465 1229 The two length values represent <strong>xi</strong> and <strong>yi</strong> -
vhardy@5214 1230 the <strong>x</strong> and <strong>y</strong> axis coordinates of the i-th vertex of the polygon.
rossen@4465 1231 </li>
rossen@3643 1232 </ul>
rossen@3643 1233 <p>
rossen@3643 1234 If the polygon is not closed the user-agent will automatically add a new vertex
rossen@3643 1235 at the end.</p>
rossen@4463 1236 <br/>
rossen@3643 1237 </dd>
rossen@3643 1238 </dl>
vhardy@3659 1239
vhardy@3659 1240 <h4 id='referencing-svg-shapes'>Referencing SVG shapes</h4>
vhardy@3659 1241
vhardy@3659 1242 <p>An SVG shape can be referenced using the <code>url()</code> syntax. The shape can be
vhardy@3659 1243 any of the <a href="http://www.w3.org/TR/SVG/shapes.html">SVG basic shapes</a> or a
vhardy@3659 1244 <a href="http://www.w3.org/TR/SVG/paths.html">path element</a>.</p>
vhardy@5488 1245
vhardy@3659 1246 <div class="example">
stearns@6654 1247 <div style="float:right">
stearns@6654 1248 <img alt="results of referencing SVG shapes" src="images/svg-shape-reference.png">
stearns@6654 1249 </div>
vhardy@3659 1250 <code class="html"><pre>
vhardy@3659 1251 &lt;style&gt;
stearns@6654 1252 div {
stearns@6654 1253 height: 400px;
stearns@6654 1254 width: 400px;
stearns@6654 1255 }
vhardy@3659 1256 .in-a-circle {
vhardy@3659 1257 shape-inside: url(#circle_shape);
vhardy@3659 1258 }
vhardy@2780 1259
vhardy@3659 1260 .in-a-path {
vhardy@3659 1261 shape-inside: url(#path-shape);
vhardy@3659 1262 }
vhardy@3659 1263
vhardy@3659 1264 &lt;/style&gt;
vhardy@3659 1265
vhardy@3659 1266 &lt;svg ...&gt;
vhardy@5126 1267 &lt;circle id="circle_shape" cx="50%" cy="50%" r="50%" /&gt;
stearns@6654 1268 &lt;path id="path-shape" d="M 100 100 L 300 100 L 200 300 z" /&gt;
vhardy@3659 1269 &lt;/svg&gt;
vhardy@3659 1270
vhardy@3659 1271 &lt;div class="in-a-circle"&gt;...&lt;/div&gt;
vhardy@3659 1272 &lt;div class="in-a-path"&gt;...&lt;/div&gt;
vhardy@3659 1273 </pre></code>
vhardy@3659 1274 </div>
rossen@3716 1275 <p>
rossen@3716 1276 When using the SVG syntax or referencing SVG elements to define shapes, all the
rossen@3716 1277 lengths expressed in percentages are resolved from the border box of the element.
vhardy@5126 1278 The coordinate system for the shape has its origin on the top-left corner of the
rossen@3716 1279 border box with the x-axis running to the right and the y-axis running downwards.
rossen@3716 1280 If the SVG element uses unitless coordinate values, they are equivalent to using
rossen@3716 1281 'px' units. If the border box of the element is dependent on auto sizing (i.e.,
rossen@3716 1282 the element's 'width' or 'height' property is 'auto'), then the percentage values
vhardy@5126 1283 resolve to 0.
rossen@3716 1284 </p>
rossen@3716 1285 <!-- End section "Shapes from SVG Syntax -->
rossen@3643 1286
rossen@3643 1287 <h3 id="shapes-from-image">Shapes from Image</h3>
vhardy@3731 1288
stearns@5636 1289 <div class="issue-marker wrapper">
rossen@4463 1290 <div class="issue-marker" data-bug_id="15093" data-bug_status="NEW">
vhardy@5750 1291 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15093">Issue-15093</a><br />
rossen@4463 1292 <div class="issue-details">
stearns@5899 1293 <p class="short-desc">Do we need to provide properties to repeat exclusion images as for the background-image property?</p>
rossen@4463 1294 </div>
rossen@4463 1295 </div>
rossen@4463 1296 <div class="issue-marker" data-bug_id="15090" data-bug_status="NEW">
stearns@5899 1297 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15090">Issue-15090</a>
rossen@4463 1298 <div class="issue-details">
stearns@5899 1299 <p class="short-desc">Use the contour keyword in shape-outside property?</p>
stearns@5899 1300 </div>
rossen@4463 1301 </div>
rossen@4463 1302
rossen@4463 1303 <div class="issue-marker" data-bug_id="15092" data-bug_status="NEW">
vhardy@5750 1304 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15092">Issue-15092</a>
rossen@4463 1305 <div class="issue-details">
rossen@4463 1306 <p class="short-desc">Specify what happens with animated images</p>
rossen@4463 1307 </div>
vhardy@4045 1308 </div>
stearns@5636 1309
stearns@5636 1310 <div class="issue-marker" data-bug_id="16112" data-bug_status="NEW">
vhardy@5750 1311 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16112">Issue-16112</a>
stearns@5636 1312 <div class="issue-details">
stearns@5636 1313 <p class="short-desc">Address security concern with automatic shape extractions for images</p>
stearns@5636 1314 </div>
stearns@5636 1315 </div>
stearns@5636 1316 </div>
vhardy@4045 1317
rossen@3643 1318 <p>
rossen@3643 1319 Another way of defining shapes is by specifying a source image whose alpha channel
rossen@3716 1320 is used to compute the inside or outside shape. The shape is computed to be the
rossen@3716 1321 path that encloses the area where the opacity of the specified image is greater
rossen@3716 1322 than the 'shape-image-threshold' value. If the 'shape-image-threshold' is not specified,
rossen@3716 1323 the initial value to be considered is 0.5.
rossen@3643 1324 </p>
vhardy@3659 1325
rossen@3643 1326 <p class="note">
vhardy@3659 1327 Note, images can define cavities and inline flow content should wrap inside
rossen@3643 1328 them. In order to avoid that, another exclusion element can be overlaid.
rossen@3643 1329 </p>
vhardy@3659 1330
vhardy@5468 1331 <p>For animated raster image formats (such as <a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">GIF</a>), the first frame of the animation
vhardy@5468 1332 sequence is used. For <a href="http://www.w3.org/TR/2002/WD-SVG2Reqs-20020422/">SVG</a> images
vhardy@5468 1333 ([[SVG11]]), the image is rendered without animations applied.</p>
vhardy@5468 1334
rossen@3643 1335 <!-- End section "Shapes from image" -->
vhardy@2780 1336
rossen@3643 1337 <h3 id="declaring-shapes">Declaring Shapes</h3>
rossen@3643 1338 <p>
vhardy@3659 1339 Shapes are declared with the 'shape-outside' or 'shape-inside' properties.
vhardy@3659 1340 The 'shape-outside' property changes the geometry of an <span>exclusion element</span>'s
vhardy@5412 1341 <span>exclusion area</span> or or a float element's <span>float area</span>.
vhardy@5412 1342 If the element is not an <span>exclusion element</span>
vhardy@5412 1343 (see the 'wrap-flow' property) or a float, then the 'shape-outside' property has no effect.
vhardy@3659 1344 </p>
vhardy@3659 1345 <p>
vhardy@3659 1346 The 'shape-inside' property defines an element's <span>content area</span> and
vhardy@5412 1347 the element's inline flow content wraps into that shape. The 'shape-inside' property
vhardy@5412 1348 applies to all block-level elements.
rossen@3643 1349 </p>
vhardy@2780 1350
rossen@3643 1351 <h4 id="shape-outside-property">The 'shape-outside' Property</h4>
vhardy@2780 1352
rossen@3643 1353 <table class="propdef">
rossen@3643 1354 <tr>
rossen@3643 1355 <th>Name:</th>
rossen@3643 1356 <td><dfn title="'shape-outside'">shape-outside</dfn></td>
rossen@3643 1357 </tr>
rossen@3643 1358 <tr>
rossen@3643 1359 <th>Value:</th>
vhardy@3659 1360 <td><var>auto</var> | <var>&lt;shape&gt;</var> | <var>&lt;uri&gt;</var></td>
rossen@3643 1361 </tr>
rossen@3643 1362 <tr>
rossen@3643 1363 <th>Initial:</th>
rossen@3643 1364 <td>auto</td>
rossen@3643 1365 </tr>
rossen@3643 1366 <tr>
rossen@3643 1367 <th>Applies to:</th>
vhardy@5412 1368 <td>exclusion elements and floats</td>
rossen@3643 1369 </tr>
rossen@3643 1370 <tr>
rossen@3643 1371 <th>Inherited:</th>
rossen@3643 1372 <td>no</td>
rossen@3643 1373 </tr>
rossen@3643 1374 <tr>
rossen@3643 1375 <th>Percentages:</th>
rossen@3643 1376 <td>N/A</td>
rossen@3643 1377 </tr>
rossen@3643 1378 <tr>
rossen@3643 1379 <th>Media:</th>
rossen@3643 1380 <td>visual</td>
rossen@3643 1381 </tr>
rossen@3643 1382 <tr>
rossen@3643 1383 <th>Computed&nbsp;value:</th>
vhardy@3659 1384 <td>computed lengths for &lt;shape&gt;, the absolute URI for &lt;uri&gt;, otherwise as specified</td>
rossen@3643 1385 </tr>
rossen@3643 1386 </table>
rossen@3643 1387
rossen@3643 1388 <p>The values of this property have the following meanings:</p>
rossen@3643 1389 <dl>
rossen@3643 1390 <dt><dfn title="'shape-outside'!!'auto'">auto</dfn></dt>
rossen@3643 1391 <dd>The shape is computed based on the border box of the element.</dd>
rossen@3643 1392 </dl>
rossen@3643 1393 <dl>
rossen@3643 1394 <dt><dfn title="'shape-outside'!!'&lt;shape&gt;'">&lt;shape&gt;</dfn></dt>
rossen@3643 1395 <dd>
vhardy@5466 1396 The shape is computed based on the values of one of 'rectangle', 'circle', 'ellipse'
rossen@3643 1397 or 'polygon'.
rossen@3643 1398 </dd>
rossen@3643 1399 </dl>
rossen@3643 1400 <dl>
vhardy@3659 1401 <dt><dfn title="'shape-outside'!!'&lt;uri&gt;'">&lt;uri&gt;</dfn></dt>
rossen@3643 1402 <dd>
vhardy@3659 1403 If the &lt;uri&gt; references an SVG shape element, that element defines the shape.
vhardy@3659 1404 Otherwise, if the &lt;uri&gt; references an image, the shape is extracted and computed
vhardy@3659 1405 based on the alpha channel of the specified image.
vhardy@3659 1406
vhardy@3659 1407 If the &lt;uri&gt; does not reference an SVG shape element or an image, the
vhardy@3659 1408 effect is as if the value 'auto' had been specified.
rossen@3643 1409 </dd>
rossen@3643 1410 </dl>
vhardy@3707 1411
vhardy@3707 1412 <div class='figure'>
stearns@6654 1413 <img alt="arbitrary shapes for exclusions. Illustrates how content flows around shapes" src="images/shapes-exclusions.png" width="70%"/>
vhardy@3707 1414 <p class="caption">Arbitrary shapes for exclusions</p>
vhardy@3707 1415 </div>
vhardy@3707 1416
vhardy@3707 1417 <div>
stearns@6339 1418 <p>The above figure shows how
stearns@6339 1419 'shape-outside' shapes
stearns@6339 1420 impact the <span>exclusion areas</span>.
stearns@6339 1421 The red box represents an element's content box
stearns@6339 1422 and 'A', 'B', 'C' and 'C' represent exclusions
stearns@6339 1423 with a complex shape
stearns@6339 1424 and their 'wrap-flow' property
stearns@6339 1425 set to 'both', 'start', 'end' and 'clear',
stearns@6339 1426 respectively.</p>
vhardy@3707 1427
stearns@6339 1428 <p>As illustrated in the picture,
stearns@6339 1429 when an exclusion allows wrapping
stearns@6339 1430 on all sides,
stearns@6339 1431 text can flow inside 'holes'
stearns@6339 1432 in the exclusion
stearns@6339 1433 (as for exclusion 'A').
stearns@6339 1434 Otherwise, the exclusion clears
stearns@6339 1435 the area on the side(s)
stearns@6339 1436 defined by 'wrap-flow',
stearns@6339 1437 as illustrated
stearns@6339 1438 for 'B', 'C' and 'D' above.</p>
vhardy@3707 1439 </div>
rossen@3643 1440 <!-- End section "The shape-outside Property" -->
vhardy@2780 1441
rossen@3643 1442 <h4 id="shape-inside-property">The 'shape-inside' Property</h4>
rossen@3643 1443 <p>
rossen@3643 1444 The 'shape-inside' modifies the shape of the inner inline flow content from rectangular
rossen@3643 1445 content box to an arbitrary geometry.
rossen@3643 1446 </p>
vhardy@2780 1447
rossen@3643 1448 <table class="propdef">
rossen@3643 1449 <tr>
rossen@3643 1450 <th>Name:</th>
rossen@3643 1451 <td><dfn title="'shape-inside'">shape-inside</dfn></td>
rossen@3643 1452 </tr>
rossen@3643 1453 <tr>
rossen@3643 1454 <th>Value:</th>
vhardy@3659 1455 <td><var>outside-shape</var> | <var>auto</var> | <var>&lt;shape&gt;</var> | <var>&lt;uri&gt;</var></td>
rossen@3643 1456 </tr>
rossen@3643 1457 <tr>
rossen@3643 1458 <th>Initial:</th>
rossen@3643 1459 <td>outside-shape</td>
rossen@3643 1460 </tr>
rossen@3643 1461 <tr>
rossen@3643 1462 <th>Applies to:</th>
rossen@3643 1463 <td>block-level elements</td>
rossen@3643 1464 </tr>
rossen@3643 1465 <tr>
rossen@3643 1466 <th>Inherited:</th>
rossen@3643 1467 <td>no</td>
rossen@3643 1468 </tr>
rossen@3643 1469 <tr>
rossen@3643 1470 <th>Percentages:</th>
rossen@3643 1471 <td>N/A</td>
rossen@3643 1472 </tr>
rossen@3643 1473 <tr>
rossen@3643 1474 <th>Media:</th>
rossen@3643 1475 <td>visual</td>
rossen@3643 1476 </tr>
rossen@3643 1477 <tr>
rossen@3643 1478 <th>Computed&nbsp;value:</th>
vhardy@3659 1479 <td>computed lengths for &lt;shape&gt;, the absolute URI for &lt;uri&gt;, otherwise as specified</td>
rossen@3643 1480 </tr>
rossen@3643 1481 </table>
stearns@5636 1482
stearns@5636 1483 <div class="issue-marker wrapper">
stearns@5636 1484 <div class="issue-marker" data-bug_id="16448" data-bug_status="ASSIGNED">
vhardy@5750 1485 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16448">Issue-16448</a>
stearns@5636 1486 <div class="issue-details">
stearns@5636 1487 <p class="short-desc">Should we revisit the decision to not allow SVG path syntax in the shape-inside, shape-outside properties</p>
stearns@5636 1488 </div>
stearns@5636 1489 </div>
stearns@5636 1490
stearns@5636 1491 <div class="issue-marker" data-bug_id="16460" data-bug_status="NEW">
vhardy@5750 1492 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16460">Issue-16460</a>
stearns@5636 1493 <div class="issue-details">
stearns@5636 1494 <p class="short-desc">Specify overflow behavior for shape-inside</p>
stearns@5636 1495 </div>
stearns@5636 1496 </div>
stearns@5636 1497 </div>
stearns@5636 1498
rossen@3643 1499 <p>The values of this property have the following meanings:</p>
rossen@3643 1500 <dl>
rossen@3643 1501 <dt><dfn title="'shape-inside'!!'outside-shape'">outside-shape</dfn></dt>
rossen@3643 1502 <dd>
rossen@3643 1503 The shape is computed based on the computed value of the 'shape-outside' property.
rossen@3643 1504 </dd>
rossen@3643 1505 </dl>
rossen@3643 1506 <dl>
rossen@3643 1507 <dt><dfn title="'shape-inside'!!'auto'">auto</dfn></dt>
rossen@3643 1508 <dd>
rossen@3643 1509 The shape is computed based on the content box of the element.
rossen@3643 1510 </dd>
rossen@3643 1511 </dl>
rossen@3643 1512 <dl>
rossen@3643 1513 <dt><dfn title="'shape-inside'!!'&lt;shape&gt;'">&lt;shape&gt;</dfn></dt>
rossen@3643 1514 <dd>
stearns@6301 1515 The shape is computed based on the values of one of 'rectangle', 'circle', 'ellipse'
rossen@3643 1516 or 'polygon'.
rossen@3643 1517 </dd>
rossen@3643 1518 </dl>
rossen@3643 1519 <dl>
rossen@3716 1520 <dt><dfn title="'shape-inside'!!'&lt;uri&gt;'">&lt;uri&gt;</dfn></dt>
rossen@3643 1521 <dd>
vhardy@3659 1522 If the &lt;uri&gt; references an SVG shape element, that element defines the shape.
vhardy@3659 1523 Otherwise, if the &lt;uri&gt; references an image, the shape is extracted and computed
vhardy@3659 1524 based on the alpha channel of the specified image.
vhardy@3659 1525
vhardy@3659 1526 If the &lt;uri&gt; does not reference an SVG shape element or an image, the
vhardy@3659 1527 effect is as if the value 'auto' had been specified.
rossen@3643 1528 </dd>
rossen@3643 1529 </dl>
vhardy@5412 1530
vhardy@5412 1531 <p>The 'shape-inside' property applies to floats.</p>
vhardy@5412 1532
vhardy@5412 1533 <p>The 'shape-inside' property may not apply on some elements such as elements with a
vhardy@5412 1534 computed 'display' value of 'table'.</p>
stearns@6654 1535
stearns@6654 1536 <div class='figure'>
stearns@6654 1537 <img alt="Content flowing with and without a shape-inside" src="images/shape-inside-content.png"/>
stearns@6654 1538 <p class="caption">Effect of shape-inside on inline content.</p>
stearns@6654 1539 </div>
vhardy@5412 1540
rossen@3643 1541 <!-- End section "The shape-inside property" -->
rossen@3643 1542 <h4 id="shape-image-threshold-property">The 'shape-image-threshold' Property</h4>
vhardy@4045 1543
vhardy@4045 1544
rossen@3643 1545 <p>
rossen@3643 1546 The 'shape-image-threshold' defines the alpha channel threshold used to extract
rossen@3655 1547 the shape using an image. A value of 0.5 means that all the pixels that are more
rossen@3655 1548 than 50% transparent define the path of the exclusion shape. The 'shape-image-threshold'
rossen@3643 1549 applies to both 'shape-outside' and 'shape-inside'.
rossen@3643 1550 </p>
rossen@3643 1551 <p class="note">
rossen@3643 1552 The specified value of 'shape-image-threshold' is applied to both images used for
rossen@3643 1553 'shape-outside' and 'shape-inside'.
rossen@3643 1554 </p>
vhardy@2780 1555
rossen@3643 1556 <table class="propdef">
rossen@3643 1557 <tr>
rossen@3643 1558 <th>Name:</th>
rossen@3643 1559 <td><dfn title="'shape-image-threshold'">shape-image-threshold</dfn></td>
rossen@3643 1560 </tr>
rossen@3643 1561 <tr>
rossen@3643 1562 <th>Value:</th>
rossen@3643 1563 <td><var>&lt;alphavalue&gt;</var></td>
rossen@3643 1564 </tr>
rossen@3643 1565 <tr>
rossen@3643 1566 <th>Initial:</th>
rossen@3643 1567 <td>0.5</td>
rossen@3643 1568 </tr>
rossen@3643 1569 <tr>
rossen@3643 1570 <th>Applies to:</th>
rossen@3643 1571 <td>block-level elements</td>
rossen@3643 1572 </tr>
rossen@3643 1573 <tr>
rossen@3643 1574 <th>Inherited:</th>
rossen@3643 1575 <td>no</td>
rossen@3643 1576 </tr>
rossen@3643 1577 <tr>
rossen@3643 1578 <th>Percentages:</th>
rossen@3716 1579 <td>alpha channel of the image specified by &lt;uri&gt;</td>
rossen@3643 1580 </tr>
rossen@3643 1581 <tr>
rossen@3643 1582 <th>Media:</th>
rossen@3643 1583 <td>visual</td>
rossen@3643 1584 </tr>
rossen@3643 1585 <tr>
rossen@3643 1586 <th>Computed&nbsp;value:</th>
rossen@3643 1587 <td>The same as the specified value after clipping the &lt;alphavalue&gt; to the range [0.0,1.0].</td>
rossen@3643 1588 </tr>
rossen@3643 1589 </table>
rossen@3643 1590 <p>The values of this property have the following meanings:</p>
rossen@3643 1591 <dl>
rossen@3643 1592 <dt><dfn title="'shape-image-threshold'!!'&lt;alphavalue&gt;'">&lt;alphavalue&gt;</dfn></dt>
rossen@3643 1593 <dd>
rossen@3655 1594 A &lt;number&gt; value used to set the threshold used for extracting a shape from
rossen@3655 1595 an image. Any values outside the range 0.0 (fully transparent) to 1.0 (fully opaque)
rossen@3655 1596 will be clamped to this range.
rossen@3643 1597 </dd>
rossen@3643 1598 </dl>
rossen@3643 1599 <!-- End section "The shape-image-threshold property" -->
vhardy@3659 1600 <!--
rossen@3643 1601 <h4 id="shape-shorthand-property">The 'shape' Shorthand Property</h4>
vhardy@2780 1602
rossen@3643 1603 <table class="propdef">
rossen@3643 1604 <tr>
rossen@3643 1605 <th>Name:</th>
rossen@3643 1606 <td><dfn title="'shape'">shape</dfn></td>
rossen@3643 1607 </tr>
rossen@3643 1608 <tr>
rossen@3643 1609 <th>Value:</th>
rossen@3643 1610 <td><var>&lt;shape-outside&gt;</var> [ / <var>&lt;shape-inside&gt;</var> ] || <var>&lt;shape-image-threshold&gt;</var></td>
rossen@3643 1611 </tr>
rossen@3643 1612 <tr>
rossen@3643 1613 <th>Initial:</th>
rossen@3643 1614 <td>see individual properties</td>
rossen@3643 1615 </tr>
rossen@3643 1616 <tr>
rossen@3643 1617 <th>Applies to:</th>
rossen@3643 1618 <td>block-level elements</td>
rossen@3643 1619 </tr>
rossen@3643 1620 <tr>
rossen@3643 1621 <th>Inherited:</th>
rossen@3643 1622 <td>no</td>
rossen@3643 1623 </tr>
rossen@3643 1624 <tr>
rossen@3643 1625 <th>Percentages:</th>
rossen@3643 1626 <td>N/A</td>
rossen@3643 1627 </tr>
rossen@3643 1628 <tr>
rossen@3643 1629 <th>Media:</th>
rossen@3643 1630 <td>visual</td>
rossen@3643 1631 </tr>
rossen@3643 1632 <tr>
rossen@3643 1633 <th>Computed&nbsp;value:</th>
rossen@3643 1634 <td>see individual properties</td>
rossen@3643 1635 </tr>
rossen@3643 1636 </table>
rossen@3643 1637 <p>
rossen@3643 1638 The 'shape' property is a shorthand property for setting the individual shape properties
rossen@3643 1639 at the same place in a style sheet.
rossen@3643 1640 </p>
vhardy@2780 1641
rossen@3643 1642 <div class="example">
rossen@3655 1643 <p>Style declaration using the 'shape' shorthand property.</p>
rossen@3643 1644 <pre><code class="html">
rossen@3643 1645 &lt;style type="text/css"&gt;
rossen@3643 1646 .shape {
rossen@3643 1647 shape: rectangle(50px, 50px, 200px, 100px) / url("shape_image.png") 0.7;
vhardy@2780 1648 }
rossen@3643 1649 &lt;/style&gt
rossen@3643 1650 </code></pre>
rossen@3643 1651 </div>
rossen@3643 1652 <p class="issue">The example above must be finished.</p>
vhardy@3659 1653
vhardy@3659 1654 -->
rossen@3643 1655 <!-- End section "Shape Shorthand property -->
rossen@3643 1656 <!-- End section "Declaring Shapes" -->
stearns@6601 1657
stearns@6601 1658 <h4 id="shape-margin-property">The 'shape-margin' property</h4>
stearns@6601 1659 <p>
stearns@6601 1660 The 'shape-margin' property adds a margin to a shape-outside.
stearns@6601 1661 This defines a new shape where every point
stearns@6601 1662 is the specified distance from the shape-outside.
stearns@6601 1663 This property takes on positive values only.
stearns@6601 1664 </p>
stearns@6601 1665 <table class="propdef">
stearns@6601 1666 <tr>
stearns@6601 1667 <th>Name:</th>
stearns@6601 1668 <td><dfn title="'shape-margin'">shape-margin</dfn></td>
stearns@6601 1669 </tr>
stearns@6601 1670 <tr>
stearns@6601 1671 <th>Value:</th>
stearns@6601 1672 <td><var>&lt;length&gt;</var></td>
stearns@6601 1673 </tr>
stearns@6601 1674 <tr>
stearns@6601 1675 <th>Initial:</th>
stearns@6601 1676 <td>0</td>
stearns@6601 1677 </tr>
stearns@6601 1678 <tr>
stearns@6601 1679 <th>Applies to:</th>
stearns@6602 1680 <td>exclusion elements and floats</td>
stearns@6601 1681 </tr>
stearns@6601 1682 <tr>
stearns@6601 1683 <th>Inherited:</th>
stearns@6601 1684 <td>no</td>
stearns@6601 1685 </tr>
stearns@6601 1686 <tr>
stearns@6601 1687 <th>Percentages:</th>
stearns@6601 1688 <td>N/A</td>
stearns@6601 1689 </tr>
stearns@6601 1690 <tr>
stearns@6601 1691 <th>Media:</th>
stearns@6601 1692 <td>visual</td>
stearns@6601 1693 </tr>
stearns@6601 1694 <tr>
stearns@6601 1695 <th>Computed&nbsp;value:</th>
stearns@6601 1696 <td>the absolute length</td>
stearns@6601 1697 </tr>
stearns@6601 1698 </table>
stearns@6601 1699
stearns@6601 1700 <div class="example">
stearns@6601 1701 <p>A 'shape-margin' creating an offset
stearns@6609 1702 from a circlular shape-outside.
stearns@6609 1703 The blue rectangles represent
stearns@6609 1704 inline content affected
stearns@6609 1705 by the shape created
stearns@6609 1706 by the margin.</p>
stearns@6601 1707 <img src="images/wrap-margin.png"
stearns@6601 1708 alt="Example of a shape-margin offset"/>
stearns@6601 1709 </div>
stearns@6601 1710
stearns@6601 1711 <!-- End secion "shape-margin property" -->
stearns@6601 1712
stearns@6601 1713 <h4 id="shape-padding-property">The 'shape-padding' Property</h4>
stearns@6601 1714 <p>
stearns@6601 1715 The 'shape-padding' property adds padding to a shape-inside.
stearns@6601 1716 This defines a new shape where every point
stearns@6601 1717 is the specified distance from the shape-inside.
stearns@6601 1718 This property takes on positive values only.
stearns@6601 1719 </p>
stearns@6601 1720 <table class="propdef">
stearns@6601 1721 <tr>
stearns@6601 1722 <th>Name:</th>
stearns@6601 1723 <td><dfn title="'shape-padding'">shape-padding</dfn></td>
stearns@6601 1724 </tr>
stearns@6601 1725 <tr>
stearns@6601 1726 <th>Value:</th>
stearns@6601 1727 <td><var>&lt;length&gt;</var></td>
stearns@6601 1728 </tr>
stearns@6601 1729 <tr>
stearns@6601 1730 <th>Initial:</th>
stearns@6601 1731 <td>0</td>
stearns@6601 1732 </tr>
stearns@6601 1733 <tr>
stearns@6601 1734 <th>Applies to:</th>
stearns@6602 1735 <td>block-level elements</td>
stearns@6601 1736 </tr>
stearns@6601 1737 <tr>
stearns@6601 1738 <th>Inherited:</th>
stearns@6601 1739 <td>no</td>
stearns@6601 1740 </tr>
stearns@6601 1741 <tr>
stearns@6601 1742 <th>Percentages:</th>
stearns@6601 1743 <td>N/A</td>
stearns@6601 1744 </tr>
stearns@6601 1745 <tr>
stearns@6601 1746 <th>Media:</th>
stearns@6601 1747 <td>visual</td>
stearns@6601 1748 </tr>
stearns@6601 1749 <tr>
stearns@6601 1750 <th>Computed&nbsp;value:</th>
stearns@6601 1751 <td>the absolute length</td>
stearns@6601 1752 </tr>
stearns@6601 1753 </table>
stearns@6609 1754
stearns@6609 1755 <div class="example">
stearns@6609 1756 <p>A 'shape-padding' creating an offset
stearns@6609 1757 from a circlular shape-inside.
stearns@6609 1758 The light blue rectangles represent
stearns@6609 1759 inline content affected
stearns@6609 1760 by the shape created
stearns@6609 1761 by the padding.</p>
stearns@6609 1762 <img src="images/shape-padding.png"
stearns@6609 1763 alt="Example of a shape-padding offset"/>
stearns@6609 1764 </div>
stearns@6601 1765 <!-- End section "shape-padding property" -->
stearns@6601 1766
stearns@6601 1767 <div class="note">Note that the 'shape-padding' property only affects layout of content inside
stearns@6601 1768 the element it applies to while the 'shape-margin' property only affects layout of content
stearns@6601 1769 outside the element.</div>
vhardy@5412 1770
rossen@3643 1771 <!-- End section "Shapes" -->
rossen@3643 1772 <h2 id="conformance">Conformance</h2>
rossen@3643 1773 <h3 id="conventions">Document Conventions</h3>
rossen@3643 1774 <p>
rossen@3643 1775 Conformance requirements are expressed with a combination of descriptive assertions
rossen@3643 1776 and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”,
rossen@3643 1777 “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
rossen@3643 1778 normative parts of this document are to be interpreted as described in RFC 2119.
rossen@3643 1779 However, for readability, these words do not appear in all uppercase letters in
rossen@3643 1780 this specification.
rossen@3643 1781 </p>
rossen@3643 1782 <p>
rossen@3643 1783 All of the text of this specification is normative except sections explicitly marked
rossen@3643 1784 as non-normative, examples, and notes. [[!RFC2119]]
rossen@3643 1785 </p>
rossen@3643 1786 <p>
rossen@3643 1787 Examples in this specification are introduced with the words “for example” or are
rossen@3643 1788 set apart from the normative text with <code>class="example"</code>, like this:
rossen@3643 1789 </p>
rossen@3643 1790 <div class="example">
rossen@3643 1791 <p>This is an example of an informative example.</p>
rossen@3643 1792 </div>
rossen@3643 1793 <p>
rossen@3643 1794 Informative notes begin with the word “Note” and are set apart from the normative
rossen@3643 1795 text with <code>class="note"</code>, like this:
rossen@3643 1796 </p>
rossen@3643 1797 <p class="note">Note, this is an informative note.</p>
rossen@3643 1798 <h3 id="conformance-classes">Conformance Classes</h3>
rossen@3643 1799 <p>Conformance to CSS Exclusions and Shapes is defined for three conformance classes:</p>
rossen@3643 1800 <dl>
rossen@3643 1801 <dt><dfn title="style sheet!!as conformance class">style sheet</dfn></dt>
rossen@3643 1802 <dd>
rossen@3643 1803 A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS style sheet</a>.</dd>
rossen@3643 1804 <dt><dfn>renderer</dfn></dt>
rossen@3643 1805 <dd>
rossen@3643 1806 A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> that interprets
rossen@3643 1807 the semantics of a style sheet and renders documents that use them.</dd>
rossen@3643 1808 <dt><dfn id="authoring-tool">authoring tool</dfn></dt>
rossen@3643 1809 <dd>
rossen@3643 1810 A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> that writes
rossen@3643 1811 a style sheet.</dd>
rossen@3643 1812 </dl>
rossen@3643 1813 <p>
rossen@3643 1814 A style sheet is conformant to CSS Exclusions and Shapes if all of its declarations
rossen@3643 1815 that use properties defined in this module have values that are valid according
rossen@3643 1816 to the generic CSS grammar and the individual grammars of each property as given
rossen@3643 1817 in this module.
rossen@3643 1818 </p>
rossen@3643 1819 <p>
rossen@3643 1820 A renderer is conformant to CSS Exclusions and Shapes if, in addition to interpreting
rossen@3643 1821 the style sheet as defined by the appropriate specifications, it supports all the
rossen@3643 1822 features defined by CSS Exclusions and Shapes by parsing them correctly and rendering
rossen@3643 1823 the document accordingly. However, the inability of a UA to correctly render a document
rossen@3643 1824 due to limitations of the device does not make the UA non-conformant. (For example,
rossen@3643 1825 a UA is not required to render color on a monochrome monitor.)
rossen@3643 1826 </p>
rossen@3643 1827 <p>
rossen@3643 1828 An authoring tool is conformant to CSS Exclusions and Shapes if it writes style
rossen@3643 1829 sheets that are syntactically correct according to the generic CSS grammar and the
rossen@3643 1830 individual grammars of each feature in this module, and meet all other conformance
rossen@3643 1831 requirements of style sheets as described in this module.
rossen@3643 1832 </p>
rossen@3643 1833 <h3 id="partial">
rossen@3643 1834 Partial Implementations</h3>
rossen@3643 1835 <p>
rossen@3643 1836 So that authors can exploit the forward-compatible parsing rules to assign fallback
rossen@3643 1837 values, CSS renderers <strong>must</strong> treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">
rossen@3643 1838 ignore as appropriate</a>) any at-rules, properties, property values, keywords,
rossen@3643 1839 and other syntactic constructs for which they have no usable level of support. In
rossen@3643 1840 particular, user agents <strong>must not</strong> selectively ignore unsupported
rossen@3643 1841 component values and honor supported values in a single multi-value property declaration:
rossen@3643 1842 if any value is considered invalid (as unsupported values must be), CSS requires
rossen@3643 1843 that the entire declaration be ignored.
rossen@3643 1844 </p>
rossen@3643 1845 <h3 id="experimental">
rossen@3643 1846 Experimental Implementations</h3>
rossen@3643 1847 <p>
rossen@3643 1848 To avoid clashes with future CSS features, the CSS2.1 specification reserves a <a
rossen@3643 1849 href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed syntax</a>
rossen@3643 1850 for proprietary and experimental extensions to CSS.</p>
rossen@3643 1851 <p>
rossen@3643 1852 Prior to a specification reaching the Candidate Recommendation stage in the W3C
rossen@3643 1853 process, all implementations of a CSS feature are considered experimental. The CSS
rossen@3643 1854 Working Group recommends that implementations use a vendor-prefixed syntax for such
rossen@3643 1855 features, including those in W3C Working Drafts. This avoids incompatibilities with
rossen@3643 1856 future changes in the draft.
rossen@3643 1857 </p>
rossen@3643 1858 <h3 id="testing">
rossen@3643 1859 Non-Experimental Implementations</h3>
rossen@3643 1860 <p>
rossen@3643 1861 Once a specification reaches the Candidate Recommendation stage, non-experimental
rossen@3643 1862 implementations are possible, and implementors should release an unprefixed implementation
rossen@3643 1863 of any CR-level feature they can demonstrate to be correctly implemented according
rossen@3643 1864 to spec.
rossen@3643 1865 </p>
rossen@3643 1866 <p>
rossen@3643 1867 To establish and maintain the interoperability of CSS across implementations, the
rossen@3643 1868 CSS Working Group requests that non-experimental CSS renderers submit an implementation
rossen@3643 1869 report (and, if necessary, the testcases used for that implementation report) to
rossen@3643 1870 the W3C before releasing an unprefixed implementation of any CSS features. Testcases
rossen@3643 1871 submitted to W3C are subject to review and correction by the CSS Working Group.
rossen@3643 1872 </p>
rossen@3643 1873 <p>
rossen@3643 1874 Further information on submitting testcases and implementation reports can be found
rossen@3643 1875 from on the CSS Working Group's website at <a href="http://www.w3.org/Style/CSS/Test/">
rossen@3643 1876 http://www.w3.org/Style/CSS/Test/</a>. Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">
rossen@3643 1877 public-css-testsuite@w3.org</a> mailing list.
rossen@3643 1878 </p>
rossen@3643 1879 <h3 id="cr-exit-criteria">
rossen@3643 1880 CR Exit Criteria</h3>
rossen@3643 1881 <p>
rossen@3643 1882 For this specification to be advanced to Proposed Recommendation, there must be
rossen@3643 1883 at least two independent, interoperable implementations of each feature. Each feature
rossen@3643 1884 may be implemented by a different set of products, there is no requirement that
rossen@3643 1885 all features be implemented by a single product. For the purposes of this criterion,
rossen@3643 1886 we define the following terms:
rossen@3643 1887 </p>
rossen@3643 1888 <dl>
rossen@3643 1889 <dt>independent </dt>
rossen@3643 1890 <dd>
rossen@3643 1891 each implementation must be developed by a different party and cannot share, reuse,
rossen@3643 1892 or derive from code used by another qualifying implementation. Sections of code
rossen@3643 1893 that have no bearing on the implementation of this specification are exempt from
rossen@3643 1894 this requirement.</dd>
rossen@3643 1895 <dt>interoperable</dt>
rossen@3643 1896 <dd>
rossen@3643 1897 passing the respective test case(s) in the official CSS test suite, or, if the implementation
rossen@3643 1898 is not a Web browser, an equivalent test. Every relevant test in the test suite
rossen@3643 1899 should have an equivalent test created if such a user agent (UA) is to be used to
rossen@3643 1900 claim interoperability. In addition if such a UA is to be used to claim interoperability,
rossen@3643 1901 then there must one or more additional UAs which can also pass those equivalent
rossen@3643 1902 tests in the same way for the purpose of interoperability. The equivalent tests
rossen@3643 1903 must be made publicly available for the purposes of peer review.
rossen@3643 1904 </dd>
rossen@3643 1905 <dt>implementation</dt>
rossen@3643 1906 <dd>
rossen@3643 1907 a user agent which:
rossen@3643 1908 <ol class="inline">
rossen@3643 1909 <li>implements the specification.</li>
rossen@3643 1910 <li>is available to the general public. The implementation may be a shipping product
rossen@3643 1911 or other publicly available version (i.e., beta version, preview release, or “nightly
rossen@3643 1912 build”). Non-shipping product releases must have implemented the feature(s) for
rossen@3643 1913 a period of at least one month in order to demonstrate stability.</li>
rossen@3643 1914 <li>is not experimental (i.e., a version specifically designed to pass the test suite
rossen@3643 1915 and is not intended for normal usage going forward).</li>
rossen@3643 1916 </ol>
rossen@3643 1917 </dd>
rossen@3643 1918 </dl>
rossen@3643 1919 <p>
rossen@3643 1920 The specification will remain Candidate Recommendation for at least six months.
rossen@3643 1921 </p>
rossen@3643 1922 <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
stearns@5634 1923 <p>This specification is made possible by input from
stearns@5634 1924 Andrei Bucur,
stearns@5634 1925 Alexandru Chiculita,
stearns@5634 1926 Arron Eicholz,
stearns@5634 1927 Daniel Glazman,
stearns@5634 1928 Arno Gourdol,
stearns@5634 1929 Chris Jones,
stearns@5634 1930 Marcus Mielke,
stearns@5634 1931 Alex Mogilevsky,
stearns@6338 1932 Hans Muller,
stearns@5634 1933 Mihnea Ovidenie,
stearns@5634 1934 Virgil Palanciuc,
stearns@5634 1935 Peter Sorotokin,
stearns@6338 1936 Bear Travis,
stearns@5634 1937 Eugene Veselov,
stearns@5634 1938 Stephen Zilles
stearns@5634 1939 and the CSS Working Group members.
rossen@3643 1940 </p>
rossen@3643 1941 <h2 class="no-num" id="references">References</h2>
rossen@3643 1942 <h3 class="no-num" id="normative-references">Normative references</h3>
rossen@3643 1943 <!--normative-->
rossen@3643 1944 <h3 class="no-num" id="other-references">Other references</h3>
rossen@3643 1945 <!--informative-->
rossen@3643 1946 <h2 class="no-num" id="index">Index</h2>
rossen@3643 1947 <!--index-->
rossen@3643 1948 <h2 class="no-num" id="property-index">Property index</h2>
rossen@3643 1949 <!-- properties -->
vhardy@5555 1950
vhardy@5746 1951 <!-- template markup for issues pulled from Bugzilla -->
vhardy@5746 1952 <script type="text/template" id="issue-template">
vhardy@5746 1953 <div class="issue-marker" data-bug_id="{{bug_id}}" data-bug_status="{{bug_status}}">
vhardy@5749 1954 <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id={{bug_id}}">Issue-{{bug_id}}</a>
vhardy@5746 1955 <div class="issue-details">
vhardy@5746 1956 <p class="short-desc">{{short_desc}}</p>
vhardy@5746 1957 </div>
vhardy@5746 1958 </div>
vhardy@5746 1959 </script>
vhardy@5555 1960
vhardy@5746 1961 <script type="text/javascript" src="../shared/scripts/BugzillaTrackerUtil.js"></script>
vhardy@5746 1962 <script type="text/javascript" src="../shared/scripts/BugzillaTracker.js"></script>
vhardy@5746 1963 <script type="text/javascript">
vhardy@5748 1964 checkSpecificationIssues('CSS', 'Exclusions');
vhardy@5746 1965 </script>
vhardy@5746 1966
vhardy@5412 1967 <h2 class="no-num" id="change-log">Change Log</h2>
vhardy@5412 1968
stearns@5899 1969 <h3>Since <a href="http://www.w3.org/TR/2012/WD-css3-exclusions-20120503/">May 3rd 2012</a></h3>
stearns@5899 1970 <ul>
stearns@5899 1971 <li>Added wrap-flow:minimum</li>
stearns@6338 1972 <li>Clarified processing model</li>
stearns@6601 1973 <li>Changed wrap-margin and wrap-padding to shape-margin and shape-padding</li>
stearns@6601 1974 <li>Removed wrap shorthand</li>
stearns@5899 1975 </ul>
stearns@5899 1976
stearns@5899 1977 <h3>Since <a href="http://www.w3.org/TR/2011/WD-css3-exclusions-20111213/">December 13th 2011</a></h3>
vhardy@5412 1978 <ul>
vhardy@5412 1979 <li>Clarified processing model</li>
vhardy@5412 1980 <li>Clarified interaction with floats</li>
vhardy@5495 1981 <li>Clarified that an exclusion element establishes a new block formatting context</li>
vhardy@5412 1982 </ul>
vhardy@5555 1983
rossen@3643 1984 </body>
rossen@3643 1985 </html>
rossen@3643 1986 <!-- Keep this comment at the end of the file
vhardy@2780 1987 Local variables:
vhardy@2780 1988 mode: sgml
vhardy@2780 1989 sgml-declaration:"~/SGML/HTML4.decl"
vhardy@2780 1990 sgml-default-doctype-name:"html"
vhardy@2780 1991 sgml-minimize-attributes:t
vhardy@2780 1992 sgml-nofill-elements:("pre" "style" "br")
vhardy@2780 1993 sgml-live-element-indicator:t
vhardy@2780 1994 sgml-omittag:nil
vhardy@2780 1995 sgml-shorttag:nil
vhardy@2780 1996 sgml-namecase-general:t
vhardy@2780 1997 sgml-general-insert-case:lower
vhardy@2780 1998 sgml-always-quote-attributes:t
vhardy@2780 1999 sgml-indent-step:nil
vhardy@2780 2000 sgml-indent-data:t
vhardy@2780 2001 sgml-parent-document:nil
vhardy@2780 2002 sgml-exposed-tags:nil
vhardy@2780 2003 sgml-local-catalogs:nil
vhardy@2780 2004 sgml-local-ecat-files:nil
vhardy@2780 2005 End:
vhardy@2780 2006 -->
rossen@3643 2007

mercurial