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