8000 csswg-drafts/css-shapes/Overview.html at 122f057cd0af17726ec785efdb8ba6ea9d488753 · simonwuelker/csswg-drafts · GitHub
Skip to content

Latest commit

 

History

History
1366 lines (1172 loc) · 78.3 KB

File metadata and controls

1366 lines (1172 loc) · 78.3 KB
<!DOCTYPE html><html lang=en><head>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Shapes Module Level 1</title>
<link href=../default.css rel=stylesheet type=text/css>
<link href=../csslogo.ico rel="shortcut icon" type=image/x-icon>
<style>
body {
background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat white;
background-attachment: fixed;
color: black;
font-family: sans-serif;
margin: 0 auto;
max-width: 50em;
padding: 2em 1em 2em 70px;
}
:link { color: #00C; background: transparent }
:visited { color: #609; background: transparent }
a[href]:active { color: #C00; background: transparent }
a[href]:hover { background: #ffa }
a[href] img { border-style: none }
h1, h2, h3, h4, h5, h6 { text-align: left }
h1, h2, h3 { color: #005A9C; }
h1 { font: 170% sans-serif }
h2 { font: 140% sans-serif }
h3 { font: 120% sans-serif }
h4 { font: bold 100% sans-serif }
h5 { font: italic 100% sans-serif }
h6 { font: small-caps 100% sans-serif }
.hide { display: none }
div.head { margin-bottom: 1em }
div.head h1 { margin-top: 2em; clear: both }
div.head table { margin-left: 2em; margin-top: 2em }
p.copyright { font-size: small }
p.copyright small { font-size: small }
pre { margin-left: 2em }
dt { font-weight: bold }
ul.toc, ol.toc {
list-style: none;
}
</style>
<script defer src=//test.csswg.org/harness/annotate.js#css-shapes-1_dev type=text/javascript></script>
<style type=text/css>
.singleImgExample {
display: block;
margin: auto;
}
</style>
</head>
<body class=h-entry>
<div class=head>
<p data-fill-with=logo><a class=logo href=http://www.w3.org/>
<img alt=W3C height=48 src=http://www.w3.org/Icons/w3c_home width=72>
</a>
</p>
<h1 class="p-name no-ref" id=title>CSS Shapes Module Level 1</h1>
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
<span class=dt-updated><span class=value-title title=20140305>5 March 2014</span></span></span></h2>
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-shapes/>http://dev.w3.org/csswg/css-shapes/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-shapes/>http://www.w3.org/TR/css-shapes/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-shapes/>http://dev.w3.org/csswg/css-shapes/</a>
<dt>Feedback:</dt>
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-shapes%5D%20feedback">www-style@w3.org</a>
with subject line
“<kbd>[css-shapes] <var>… message topic …</var></kbd>”(<a href=http://lists.w3.org/Archives/Public/www-style/ rel=discussion>archives</a>)<dt>Test Suite:<dd><a href=http://test.csswg.org/suites/css3-shapes/nightly-unstable/>http://test.csswg.org/suites/css3-shapes/nightly-unstable/</a><dt>Editors:
<dd class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:vhardy@adobe.com>Vincent Hardy</a> (<span class="p-org org">Adobe Systems, Inc.</span>)<dd class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:ratan@microsoft.com>Rossen Atanassov</a> (<span class="p-org org">Microsoft Corporation</span>)<dd class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:stearns@adobe.com>Alan Stearns</a> (<span class="p-org org">Adobe Systems, Inc.</span>)<dt>Issues List:<dd><a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;product=CSS&amp;component=Shapes&amp;resolution=---&amp;cmdtype=doit">In Bugzilla</a></dl></div>
<div data-fill-with=warning></div>
<p class=copyright data-fill-with=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a> © 2014 <a href=http://www.w3.org/><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href=http://www.csail.mit.edu/><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href=http://www.ercim.eu/><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href=http://www.keio.ac.jp/>Keio</a>, <a href=http://ev.buaa.edu.cn/>Beihang</a>), All Rights Reserved. W3C <a href=http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer>liability</a>, <a href=http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks>trademark</a> and <a href=http://www.w3.org/Consortium/Legal/copyright-documents>document use</a> rules apply.
</p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled heading" id=abstract><span class=content>Abstract</span></h2>
<p class=p-summary data-fill-with=abstract>CSS Shapes describe geometric shapes for use in CSS. For Level 1, CSS Shapes can be applied to floats. A circle shape on a float will cause inline content to <a data-link-type=dfn href=#wrap title=wrap>wrap</a> around the circle shape instead of the float’s bounding box.
<a href=http://www.w3.org/TR/CSS/>CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.</p>
<h2 class="no-num no-toc no-ref heading settled heading" id=status><span class=content>Status of this document</span></h2>
<div data-fill-with=status><p>
This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress.
<p>
The (<a href=http://lists.w3.org/Archives/Public/www-style/>archived</a>) public mailing list
<a href="mailto:www-style@w3.org?Subject=%5Bcss-shapes%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>
(see <a href=http://www.w3.org/Mail/Request>instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-shapes” in the subject,
preferably like this:
“[css-shapes] <em>…summary of comment…</em>”
<p>
This document was produced by the <a href=http://www.w3.org/Style/CSS/members>CSS Working Group</a>
(part of the <a href=http://www.w3.org/Style/>Style Activity</a>).
<p>
This document was produced by a group operating under
the <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/>5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href=http://www.w3.org/2004/01/pp-impl/32061/status rel=disclosure>public list of any patent disclosures</a>
made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential>Essential Claim(s)</a>
must disclose the information in accordance with <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure>section 6 of the W3C Patent Policy</a>.</div>
<div data-fill-with=at-risk></div>
<h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class=content>Table of Contents</span></h2>
<div data-fill-with=table-of-contents><ul class=toc>
<li><a href=#intro><span class=secno>1</span> Introduction</a>
<ul class=toc>
<li><a href=#module-interactions><span class=secno>1.1</span> Module Interactions</a>
<li><a href=#values><span class=secno>1.2</span>Values</a>
<li><a href=#animations><span class=secno>1.3</span>Animated Values</a>
<li><a href=#terminology><span class=secno>1.4</span> Terminology</a></ul>
<li><a href=#relation-to-box-model-and-float-behavior><span class=secno>2</span> Relation to the box model and float behavior</a>
<li><a href=#basic-shape-functions><span class=secno>3</span> Basic Shapes</a>
<ul class=toc>
<li><a href=#supported-basic-shapes><span class=secno>3.1</span> Supported Shapes</a>
<li><a href=#basic-shape-computed-values><span class=secno>3.2</span> Computed Values of Basic Shapes</a>
<li><a href=#basic-shape-serialization><span class=secno>3.3</span> Serialization of Basic Shapes</a>
<li><a href=#basic-shape-interpolation><span class=secno>3.4</span> Interpolation of Basic Shapes</a></ul>
<li><a href=#shapes-from-image><span class=secno>4</span> Shapes from Image</a>
<li><a href=#shapes-from-box-values><span class=secno>5</span> Shapes from Box Values</a>
<li><a href=#declaring-shapes><span class=secno>6</span> Declaring Shapes</a>
<ul class=toc>
<li><a href=#shape-outside-property><span class=secno>6.1</span> Float Area Shape: the <span class=property data-link-type=propdesc title=shape-outside>shape-outside</span> property</a>
<li><a href=#shape-image-threshold-property><span class=secno>6.2</span> Choosing Image Pixels: the <span class=property data-link-type=propdesc title=shape-image-threshold>shape-image-threshold</span> property</a>
<li><a href=#shape-margin-property><span class=secno>6.3</span> Embiggening a Shape: the <span class=property data-link-type=propdesc title=shape-margin>shape-margin</span> property</a></ul>
<li><a href=#acknowledgments><span class=secno></span> Acknowledgments</a>
<li><a href=#change-log><span class=secno></span> Change Log</a>
<ul class=toc>
<li><a href=#20140211><span class=secno></span> Since <span>February 11th 2014</span></a>
<li><a href=#20131203><span class=secno></span> Since <span>December 3rd 2013</span></a>
<li><a href=#20130620><span class=secno></span> Since <span>June 20th 2013</span></a>
<li><a href=#20120503><span class=secno></span> Since <span>May 3rd 2012</span></a>
<li><a href=#20111213><span class=secno></span> Since <span>December 13th 2011</span></a></ul>
<li><a href=#conformance><span class=secno></span> Conformance</a>
<ul class=toc>
<li><a href=#conventions><span class=secno></span> Document conventions</a>
<li><a href=#conformance-classes><span class=secno></span> Conformance classes</a>
<li><a href=#partial><span class=secno></span> Partial implementations</a>
<li><a href=#experimental><span class=secno></span> Experimental implementations</a>
<li><a href=#testing><span class=secno></span> Non-experimental implementations</a></ul>
<li><a href=#references><span class=secno></span> References</a>
<ul class=toc>
<li><a href=#normative><span class=secno></span> Normative References</a>
<li><a href=#informative><span class=secno></span> Informative References</a></ul>
<li><a href=#index><span class=secno></span> Index</a>
<li><a href=#property-index><span class=secno></span> Property index</a></ul></div>
<h2 class="heading settled heading" data-level=1 id=intro><span class=secno>1 </span><span class=content>
Introduction</span><a class=self-link href=#intro></a></h2>
<p><em>This section is not normative.</em>
<p> Shapes define arbitrary geometries
that can be used as CSS values.
This specification defines properties
to control the geometry
of an element’s <a data-link-type=dfn href=#float-area title="float area">float area</a>.
The <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> property uses shape values
to define the <a data-link-type=dfn href=#float-area title="float area">float area</a> for a float.
<p class=note> Note: Future levels of CSS Shapes will allow use of shapes
on elements other than floats.
Other CSS modules can make use of shapes as well,
such as CSS Masking <a data-biblio-type=informative data-link-type=biblio href=#css-masking title=css-masking>[CSS-MASKING]</a>
and CSS Exclusions <a data-biblio-type=informative data-link-type=biblio href=#css3-exclusions title=css3-exclusions>[CSS3-EXCLUSIONS]</a>.
<p class=note> Note: If a user agent implements both CSS Shapes
and CSS Exclusions,
the <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> property defines
the exclusion area for an exclusion.
<p class=note> Note: A future level of CSS Shapes will define a shape-inside property,
which will define a shape to <a data-link-type=dfn href=#wrap title=wrap>wrap</a> content within the element.
<h3 class="heading settled heading" data-level=1.1 id=module-interactions><span class=secno>1.1 </span><span class=content>
Module Interactions</span><a class=self-link href=#module-interactions></a></h3>
<p> This module extends the float features defined in <a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a> chapter 9.
<h3 class="heading settled heading" data-level=1.2 id=values><span class=secno>1.2 </span><span class=content>Values</span><a class=self-link href=#values></a></h3>
<p> This specification follows the CSS property definition conventions from <a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a>. Value types not defined in these specifications are defined in CSS Values and Units Module Level 3 <a data-biblio-type=normative data-link-type=biblio href=#css3val title=css3val>[CSS3VAL]</a>.
<p> In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the inherit keyword as their property value. For readability it has not been repeated explicitly.
<h3 class="heading settled heading" data-level=1.3 id=animations><span class=secno>1.3 </span><span class=content>Animated Values</span><a class=self-link href=#animations></a></h3>
<p> It is expected that CSS will include ways
to animate transitions between styles.
(The section
<a href=http://www.w3.org/TR/css3-transitions/#animatable-types>"Animation of property types"</a>
of the <cite>CSS Transitions module</cite> <a data-biblio-type=informative data-link-type=biblio href=#css3-transitions title=css3-transitions>[CSS3-TRANSITIONS]</a>
is expected to define how different kinds
of values are interpolated during a transition.)
In anticipation of that,
this module includes a line "Animatable" for each property,
which specifies whether and how values
of the property can be animated.
<h3 class="heading settled heading" data-level=1.4 id=terminology><span class=secno>1.4 </span><span class=content>
Terminology</span><a class=self-link href=#terminology></a></h3>
<p> <dfn data-dfn-type=dfn data-noexport="" id=wrap>Wrap<a class=self-link href=#wrap></a></dfn>
<p> This specification uses the term <a data-link-type=dfn href=#wrap title=wrap>wrap</a>
to refer to flowing content
around the sides of a <a data-link-type=dfn href=#float-area title="float area">float area</a>,
defined in <a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a> chapter 9.
Content <a data-link-type=dfn href=#wrap title=wrap>wraps</a> around the right side
of a left-floated box,
and content <a data-link-type=dfn href=#wrap title=wrap>wraps</a> around the left side
of a right-floated box.
One result of this <a data-link-type=dfn href=#wrap title=wrap>wrapping</a>
is that line boxes next to a float
are shortened as necessary
to avoid intersections with the <a data-link-type=dfn href=#float-area title="float area">float area</a>.
<p> <dfn data-dfn-type=dfn data-noexport="" id=float-area>Float area<a class=self-link href=#float-area></a></dfn>
<p> The area used
for <a data-link-type=dfn href=#wrap title=wrap>wrapping</a> content
around a float element.
The rules for float behavior
use the sides of the <a data-link-type=dfn href=#float-area title="float area">float area</a>
to determine where content flows.
By default,
the <a data-link-type=dfn href=#float-area title="float area">float area</a> is the float element’s
<a href=http://www.w3.org/TR/CSS2/box.html#box-dimensions>margin box</a>
(note this can be different than
the <a data-link-type=dfn href=#float-area title="float area">float area</a> produced
by the <a class=css data-link-type=maybe href=#margin-box title=margin-box>margin-box</a> value,
which includes border-radius curvature).
This specification’s <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> property
can be used to define an arbitrary,
non-rectangular <a data-link-type=dfn href=#float-area title="float area">float area</a>.
<h2 class="heading settled heading" data-level=2 id=relation-to-box-model-and-float-behavior><span class=secno>2 </span><span class=content>
Relation to the box model and float behavior</span><a class=self-link href=#relation-to-box-model-and-float-behavior></a></h2>
<p> While the boundaries used
for <a data-link-type=dfn href=#wrap title=wrap>wrapping</a> inline flow content
outside a float
can be defined using shapes,
the actual box model does not change.
If the element has specified
margins, borders or padding
they will be computed and rendered
according to the <a data-biblio-type=normative data-link-type=biblio href=#css3box title=css3box>[CSS3BOX]</a> module.
Also, float positioning and stacking are not affected
by defining a <a data-link-type=dfn href=#float-area title="float area">float area</a> with a shape.
<p> When a shape is used to define
a <a data-link-type=dfn href=#float-area title="float area">float area</a>,
the shape is clipped
to the float’s margin box.
In other words,
a shape can only ever reduce
a <a data-link-type=dfn href=#float-area title="float area">float area</a>,
not increase it.
A reduced <a data-link-type=dfn href=#float-area title="float area">float area</a> may have no effect
on some line boxes
that would normally be affected by the float.
An <dfn data-dfn-type=dfn data-noexport="" id=empty-float-area>empty float area<a class=self-link href=#empty-float-area></a></dfn>
(where the shape encloses no area)
has no effect on line boxes.
<p> A <a data-link-type=dfn href=#float-area title="float area">float area</a> defined by a shape
may reduce the normal <a data-link-type=dfn href=#float-area title="float area">float area</a> on all sides,
but this does not allow content to <a data-link-type=dfn href=#wrap title=wrap>wrap</a>
on both sides of a float.
Left floats with a <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> still
only allow content <a data-link-type=dfn href=#wrap title=wrap>wrapping</a> on the right side,
and right floats only allow <a data-link-type=dfn href=#wrap title=wrap>wrapping</a> on the left.
<div class=example>
<p> In the following example
the left and right floating
<code class=html>img</code> elements
specify a triangular shape
using the <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> property.
<pre><code class=css>
&lt;img class="left" src="hand.svg"/&gt;
&lt;img class="right" src="hand.svg"/&gt;
&lt;p&gt;
Sometimes a web page’s text content appears to be
funneling your attention towards a spot on the page
to drive you to follow a particular link. Sometimes
you don’t notice.
&lt;/p&gt;
&lt;style type="text/css"&gt;
.left {
shape-outside: polygon(0 0, 100% 100%, 0 100%);
float: left;
width: 40%;
height: 12ex;
transform: scaleX(-1);
}
.right {
shape-outside: polygon(100% 0, 100% 100%, 0 100%);
float: right;
width: 40%;
height: 12ex;
}
p {
text-align: center;
}
&lt;/style&gt;
</code>
</pre>
<p> <img alt="Using the shape-outside property with floats" class=singleImgExample src=images/hand-funnel.png>
</div>
<div class=example>
<p> Since shapes are clipped to the float’s margin box,
adding this shape to the left float above
would result in the same rendering.
<pre><code class=css>
shape-outside: polygon(0 0, 500% 500%, 0 500%);
</code>
</pre> </div>
<div class=example>
<p> A shape with no extent will create
a <a data-link-type=dfn href=#float-area title="float area">float area</a> with no extent.
Because <a data-link-type=dfn href=#wrap title=wrap>wrapping</a> only considers the <a data-link-type=dfn href=#float-area title="float area">float area</a>,
either shape below applied to a float
will allow inline content
to flow through all of the float’s box.
<pre><code class=css>
shape-outside: inset(50% 50% 50% 50%);
shape-outside: inset(150% 150% 0% 0%);
</code>
</pre> </div>
<div class=example>
<p> A <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> can create open areas
on both the left and right
of a <a data-link-type=dfn href=#float-area title="float area">float area</a>.
Content still <a data-link-type=dfn href=#wrap title=wrap>wraps</a> only on one side
of a float in this case.
In the picture,
the shape is rendered in blue,
and the content area outside the shape in mauve.
<pre><code class=css>
shape-outside: polygon(50px 0px, 100px 100px, 0px 100px);
</code>
</pre><p> <img alt="wrapping around right side of a left-float float area" class=singleImgExample src=images/float-side-example.png>
</div>
<div class=example>
<p> The following styling creates
a shape much smaller than
the float’s content area,
and adds a margin-top to the float.
In the picture,
the shape is rendered in blue,
the content area outside the shape in mauve,
and the margin area of the float box in yellow.
The inline content only <a data-link-type=dfn href=#wrap title=wrap>wraps</a> around the shape,
and otherwise overlays the rest
of the float margin box.
<pre><code class=css>
.float-left {
shape-outside: polygon(0% 50%, 50% 100%, 0 100%);
float: left;
width: 100px;
height: 100px;
margin-top: 20px;
}
</code></pre>
<p> <img alt="Adding margin-top to a float with a small shape-outside" class=singleImgExample src=images/float-margin-example.png>
<p> The next picture shows a possible result
if two of these floats
were stacked next to each other.
Note that the floats are positioned
using their margin boxes,
not the <a data-link-type=dfn href=#float-area title="float area">float area</a>.
<p> <img alt="Stacking two floats with a small shape-outside" class=singleImgExample src=images/stacked-float-example.png>
</div>
<h2 class="heading settled heading" data-level=3 id=basic-shape-functions><span class=secno>3 </span><span class=content>
Basic Shapes</span><a class=self-link href=#basic-shape-functions></a></h2>
<p> The <dfn class=css-code data-dfn-type=type data-export="" id=typedef-basic-shape>&lt;basic-shape&gt;<a class=self-link href=#typedef-basic-shape></a></dfn> type
can be specified using basic shape functions.
When using this syntax
to define shapes,
the <dfn data-dfn-type=dfn data-noexport="" id=reference-box>reference box<a class=self-link href=#reference-box></a></dfn> is defined
by each property that uses
<a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> values.
The coordinate system for the shape
has its origin on the top-left corner of the
<a data-link-type=dfn href=#reference-box title="reference box">reference box</a> with the x-axis
running to the right
and the y-axis running downwards.
All the lengths expressed in percentages
are resolved from the used dimensions
of the <a data-link-type=dfn href=#reference-box title="reference box">reference box</a>.
<h3 class="heading settled heading" data-level=3.1 id=supported-basic-shapes><span class=secno>3.1 </span><span class=content>
Supported Shapes</span><a class=self-link href=#supported-basic-shapes></a></h3>
<p> The following shapes are supported.
All <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> values use
<a href=http://www.w3.org/TR/css3-values/#functional-notation>functional notation</a>
and are defined here using the
<a href=http://www.w3.org/TR/css3-values/#value-defs>Value Definition Syntax</a>.
<dl>
<dt><dfn class=css-code data-dfn-type=function data-export="" id=funcdef-inset>inset()<a class=self-link href=#funcdef-inset></a></dfn> =
inset( <a class="production css-code" data-link-type=type href=#typedef-shape-arg title="<shape-arg>">&lt;shape-arg&gt;</a>{1,4} [round &lt;<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#border-radius title=border-radius>border-radius</a>&gt;]? )
</dt>
<dd>
Defines an inset rectangle.
<ul>
<li>
When all of the first four arguments
are supplied they represent the
<strong>top, right, bottom</strong> and
<strong>left</strong> offsets
from the <a data-link-type=dfn href=#reference-box title="reference box">reference box</a> inward
that define the positions
of the edges
of the inset rectangle.
These arguments follow the syntax
of the <a class=property data-link-type=propdesc href=http://www.w3.org/TR/CSS21/box.html#propdef-margin title=margin>margin</a> shorthand,
that let you set all four insets
with one, two or four values.
</li>
<li>
The optional <a class=production data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#border-radius title=border-radius>&lt;‘border-radius’&gt;</a> argument(s)
define rounded corners for the inset rectangle
using the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#border-radius title=border-radius>border-radius</a> shorthand syntax.
</li>
</ul>
<p> A pair of insets in either dimension
that add up to more than the used dimension
(such as left and right insets of 75% apiece)
define a shape enclosing no area.
For this specification,
this results in an <a data-link-type=dfn href=#empty-float-area title="empty float area">empty float area</a>.
</dd>
<dt><dfn class=css-code data-dfn-type=function data-export="" id=funcdef-circle>circle()<a class=self-link href=#funcdef-circle></a></dfn> =
circle( [<a class="production css-code" data-link-type=type href=#typedef-shape-radius title="<shape-radius>">&lt;shape-radius&gt;</a>]? [at <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>">&lt;position&gt;</a>]? )
</dt>
<dd>
<ul>
<li>
The shape-radius argument represents
<strong>r</strong>, the radius
of the circle.
Negative values are invalid.
A percentage value here
is resolved from the used width and height
of the <a data-link-type=dfn href=#reference-box title="reference box">reference box</a> as <br>
<code>sqrt(<em>width</em><sup>2</sup>+<em>height</em><sup>2</sup>)/sqrt(2)</code>.
</li>
<li>
The position argument defines
the center of the circle.
This defaults to center if omitted.
</li>
</ul>
</dd>
<dt><dfn class=css-code data-dfn-type=function data-export="" id=funcdef-ellipse>ellipse()<a class=self-link href=#funcdef-ellipse></a></dfn> =
ellipse( [<a class="production css-code" data-link-type=type href=#typedef-shape-radius title="<shape-radius>">&lt;shape-radius&gt;</a>{2}]? [at <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>">&lt;position&gt;</a>]? )
</dt>
<dd>
<ul>
<li>
The shape-radius arguments represent
<strong>rx</strong> and
<strong>ry</strong>,
the x-axis and y-axis radii
of the ellipse,
in that order.
Negative values for either radius are invalid.
Percentage values here are resolved
against the used width (for the rx value)
and the used height (for the ry value)
of the reference box.
</li>
<li>
The position argument defines
the center of the ellipse.
This defaults to center if omitted.
</li>
</ul>
</dd>
<dt><dfn class=css-code data-dfn-type=function data-export="" id=funcdef-polygon>polygon()<a class=self-link href=#funcdef-polygon></a></dfn> =
polygon( [<a class="production css-code" data-link-type=type href=#typedef-fill-rule title="<fill-rule>">&lt;fill-rule&gt;</a>,]? [<a class="production css-code" data-link-type=type href=#typedef-shape-arg title="<shape-arg>">&lt;shape-arg&gt;</a> <a class="production css-code" data-link-type=type href=#typedef-shape-arg title="<shape-arg>">&lt;shape-arg&gt;</a>]# )
</dt>
<dd>
<ul>
<li>
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-fill-rule><a class="production css-code" data-link-type=type href=#typedef-fill-rule title="<fill-rule>">&lt;fill-rule&gt;</a><a class=self-link href=#typedef-fill-rule></a></dfn> -
The filling rule used
to determine the interior
of the polygon.
See <a href=http://www.w3.org/TR/SVG/painting.html#FillRuleProperty>fill-rule</a> property
in SVG for details.
Possible values are <span class=css data-link-type=maybe title=nonzero>nonzero</span>
or <span class=css data-link-type=maybe title=evenodd>evenodd</span>.
Default value when omitted is <span class=css data-link-type=maybe title=nonzero>nonzero</span>.</li>
<li>
Each pair argument in the list represents <strong>x<sub>i</sub></strong> and <strong>y<sub>i</sub></strong> -
the <strong>x</strong> and <strong>y</strong> axis coordinates of the i-th vertex of the polygon.
</li>
</ul>
<p> The UA must close a polygon
by connecting the last vertex
with the first vertex of the list.
<p> At least three vertices are required
to define a polygon with an area.
This means that (for this specification)
polygons with less than three vertices
(or with three or more vertices
arranged to enclose no area)
result in an <a data-link-type=dfn href=#empty-float-area title="empty float area">empty float area</a>.
</dd>
</dl>
<p> The arguments not defined above are defined as follows:
<dl>
<dt><dfn class=css-code data-dfn-type=type data-export="" id=typedef-shape-arg><a class="production css-code" data-link-type=type href=#typedef-shape-arg title="<shape-arg>">&lt;shape-arg&gt;</a><a class=self-link href=#typedef-shape-arg></a></dfn> = <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>">&lt;length&gt;</a> | <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#percentage-value title="<percentage>">&lt;percentage&gt;</a>
</dt>
<dt><dfn class=css-code data-dfn-type=type data-export="" id=typedef-shape-radius><a class="production css-code" data-link-type=type href=#typedef-shape-radius title="<shape-radius>">&lt;shape-radius&gt;</a><a class=self-link href=#typedef-shape-radius></a></dfn> = <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>">&lt;length&gt;</a> | <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#percentage-value title="<percentage>">&lt;percentage&gt;</a> | closest-side | farthest-side
</dt>
<dd>
Defines a radius for a circle or ellipse. If omitted it defaults to closest-side.
<ul>
<li>
<dfn data-dfn-type=dfn data-noexport="" id=closest-side>closest-side<a class=self-link href=#closest-side></a></dfn>
uses the length from the center
of the shape to the closest side
of the <a data-link-type=dfn href=#reference-box title="reference box">reference box</a>.
For circles,
this is the closest side
in any dimension.
For ellipses,
this is the closest side
in the radius dimension.
</li>
<li>
<dfn data-dfn-type=dfn data-noexport="" id=farthest-side>farthest-side<a class=self-link href=#farthest-side></a></dfn>
uses the length from the center
of the shape to the farthest side
of the <a data-link-type=dfn href=#reference-box title="reference box">reference box</a>.
For circles,
this is the farthest side
in any dimension.
For ellipses,
this is the farthest side
in the radius dimension.</li>
</ul>
</dd>
</dl>
<h3 class="heading settled heading" data-level=3.2 id=basic-shape-computed-values><span class=secno>3.2 </span><span class=content>
Computed Values of Basic Shapes</span><a class=self-link href=#basic-shape-computed-values></a></h3>
<p> The values in a <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> function are computed as specified, with these exceptions:
<p> <ul>
<li>
Omitted values are included and compute to their defaults.
</li>
<li>
A <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>">&lt;position&gt;</a> value in <a class=css data-link-type=maybe href=#funcdef-circle title=circle()>circle()</a> or <a class=css data-link-type=maybe href=#funcdef-ellipse title=ellipse()>ellipse()</a> is computed as a pair of offsets (horizontal then vertical) from the top left origin, each given as a combination of an absolute length and a percentage.
</li>
<li>
A &lt;<a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#border-radius title=border-radius>border-radius</a>&gt; value in <a class=css data-link-type=maybe href=#funcdef-inset title=inset()>inset()</a> is computed as an expanded list of all eight <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>">&lt;length&gt;</a> or percentage values.
</li>
</ul>
<h3 class="heading settled heading" data-level=3.3 id=basic-shape-serialization><span class=secno>3.3 </span><span class=content>
Serialization of Basic Shapes</span><a class=self-link href=#basic-shape-serialization></a></h3>
<p> To serialize the <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> functions,
serialize as per their individual grammars,
in the order the grammars are written in,
avoiding calc() expressions where possible,
avoiding calc() transformations,
omitting components when possible without changing the meaning,
joining space-separated tokens with a single space,
and following each serialized comma with a single space.
<p> The <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>">&lt;position&gt;</a> values in <a class=css data-link-type=maybe href=#funcdef-ellipse title=ellipse()>ellipse()</a> and <a class=css data-link-type=maybe href=#funcdef-circle title=circle()>circle()</a>
serialize to their 2- and 4-value forms only,
preferring the 2-value form
when it can be expressed without calc(),
preferring left and top origins,
and preferring 0% over a zero length.
<div class=example>
<p> Since <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>">&lt;position&gt;</a> keywords stand in for percentages, keywords without an offset turn into percentages.
<pre><code class=css>
circle(at left bottom)
serializes as "circle(at 0% 100%)"
</code></pre>
<p> Omitting components means that some default values do not show up in the serialization. But since <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>">&lt;position&gt;</a> always uses the 2- or 4-value form, a default <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>">&lt;position&gt;</a> is not omitted.
<pre><code class=css>
circle(closest-side at center)
serializes as "circle(at 50% 50%)"
</code></pre>
<p> Using grammar order means that <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>">&lt;position&gt;</a> values always give horizontal components first, then vertical.
<pre><code class=css>
circle(at bottom left)
serializes as "circle(at 0% 100%)"
</code></pre>
<p> Avoiding calc() expressions means that some <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#position-value title="<position>">&lt;position&gt;</a> values that could be simplified to the 2-value form must be serialized in 4-value form instead.
<pre><code class=css>
circle(at right 5px bottom 10px)
serializes as "circle(at right 5px bottom 10px)"
not as "circle(at calc(100% - 5px) calc(100% - 10px))"
</code></pre>
<p> Avoiding calc() transformations means that if a specified (or computed) calc() must stay in calc() form, it will be used as-is, not reformulated with a different origin or reduced.
<pre><code class=css>
bottom calc(10% + 5px)
serializes as "bottom calc(10% + 5px)"
not as "top calc(90% - 5px)" or "calc(90% - 5px)"
</code></pre>
<p> Preferring 0% over a zero length comes up when you must supply an omitted offset.
<pre><code class=css>
circle(at right 5px top)
serializes as "circle(at right 5px top 0%)"
</code></pre>
<p> Preferring left and top origins means that some percentage offsets will normalize to those origins (when calc can be avoided).
<pre><code class=css>
circle(at right 5% top 0px)
serializes as "circle(at 95% 0%)"
</code></pre>
</div>
<h3 class="heading settled heading" data-level=3.4 id=basic-shape-interpolation><span class=secno>3.4 </span><span class=content>
Interpolation of Basic Shapes</span><a class=self-link href=#basic-shape-interpolation></a></h3>
<p> For interpolating between
one basic shape and a second,
the rules below are applied.
The values in the shape functions interpolate
as a <a href=http://www.w3.org/TR/css3-transitions/#animtype-simple-list>simple list</a>.
The list values interpolate as
<a href=http://www.w3.org/TR/css3-transitions/#animtype-lpcalc>length,
percentage, or calc</a> where possible.
If list values are not one of those types
but are identical
(such as finding <span class=css data-link-type=maybe title=nonzero>nonzero</span>
in the same list position
in both lists)
those values do interpolate.
<p> <ul>
<li>
Both shapes must use the same <a data-link-type=dfn href=#reference-box title="reference box">reference box</a>.
</li>
<li>
If both shapes are the same type,
that type is <a class=css data-link-type=maybe href=#funcdef-ellipse title=ellipse()>ellipse()</a> or <a class=css data-link-type=maybe href=#funcdef-circle title=circle()>circle()</a>,
and none of the radii use
the <a class=css data-link-type=maybe href=#closest-side title=closest-side>closest-side</a> or <a class=css data-link-type=maybe href=#farthest-side title=farthest-side>farthest-side</a> keywords,
interpolate between each value
in the shape functions.
</li>
<li>
If both shapes are of type <a class=css data-link-type=maybe href=#funcdef-inset title=inset()>inset()</a>,
interpolate between each value
in the shape functions.
</li>
<li>
If both shapes are of type <a class=css data-link-type=maybe href=#funcdef-polygon title=polygon()>polygon()</a>,
both polygons have the same number of vertices,
and use the same <a class="production css-code" data-link-type=type href=#typedef-fill-rule title="<fill-rule>">&lt;fill-rule&gt;</a>,
interpolate between each value
in the shape functions.
</li>
<li>
In all other cases no interpolation is specified.
</li>
</ul>
<h2 class="heading settled heading" data-level=4 id=shapes-from-image><span class=secno>4 </span><span class=content>
Shapes from Image</span><a class=self-link href=#shapes-from-image></a></h2>
<p> Another way of defining shapes
is by specifying a source <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a>
whose alpha channel is used
to compute the shape.
The shape is computed to be the path or paths
that enclose the area(s)
where the opacity of the specified image
is greater than the <a class=property data-link-type=propdesc href=#propdef-shape-image-threshold title=shape-image-threshold>shape-image-threshold</a> value.
The absence of any pixels with an alpha value
greater than the specified threshold
results in an <a data-link-type=dfn href=#empty-float-area title="empty float area">empty float area</a>.
If the <a class=property data-link-type=propdesc href=#propdef-shape-image-threshold title=shape-image-threshold>shape-image-threshold</a> is not specified,
the initial value to be considered is 0.0.
<p> The image is sized and positioned
as if it were a replaced element
whose specified width and height
are the same as the element’s
used content box size.
<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 sequence is used.
<div class=example>
<p> An image is floating to the left of a paragraph.
The image shows the 3D version of the
CSS logo over a transparent background.
The logo has a shadow using an alpha-channel.
<p> The image defines its <a data-link-type=dfn href=#float-area title="float area">float area</a>
through the <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> property.
<pre> <code class=css>
&lt;p&gt;
&lt;img id="CSSlogo" src="CSS-logo1s.png"/&gt;
blah blah blah blah...
&lt;/p&gt;
&lt;style&gt;
#CSSlogo {
float: left;
shape-outside: attr(src url);
shape-image-threshold: 0.1;
}
&lt;/style&gt;
</code>
</pre>
<p> The <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> property re-uses the url
from the src attribute of the img element.
<p> It is perfectly possible to display an image
and use a different image for its <a data-link-type=dfn href=#float-area title="float area">float area</a>.
<p> In the figure below, the alpha-channel threshold
is represented by the dotted line around the CSS logo.
<p> It’s then possible to affect where the lines
of the paragraph start in three ways:
<ol>
<li>Modifying the alpha channel in the image</li>
<li>Changing the value of the <a class=property data-link-type=propdesc href=#propdef-shape-image-threshold title=shape-image-threshold>shape-image-threshold</a> property</li>
<li>Changing the value of the <a class=property data-link-type=propdesc href=#propdef-shape-margin title=shape-margin>shape-margin</a> property (see example 8)</li>
</ol>
<div class=figure>
<img alt="A float shape around an image using its alpha-channel" src=images/shape-outside-image.png style=width:70%>
<p class=caption>A float shape around an image using its alpha-channel.</p>
</div>
</div>
<h2 class="heading settled heading" data-level=5 id=shapes-from-box-values><span class=secno>5 </span><span class=content>
Shapes from Box Values</span><a class=self-link href=#shapes-from-box-values></a></h2>
<p> Shapes can be defined
by reference to edges in the
<a href=http://www.w3.org/TR/CSS21/box.html#box-dimensions>CSS Box Model</a>.
These edges include
<a href=http://www.w3.org/TR/css3-background/#corner-shaping>border-radius curvature</a> <a data-biblio-type=normative data-link-type=biblio href=#css3bg title=css3bg>[CSS3BG]</a>
from the used border-radius values.
The <a class="production css-code" data-link-type=type href=#typedef-shape-box title="<shape-box>">&lt;shape-box&gt;</a> value extends the <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-backgrounds-3/#box title="<box>">&lt;box&gt;</a> value
to include <a class=css data-link-type=maybe href=#margin-box title=margin-box>margin-box</a>.
Its syntax is:
<pre> <dfn class=css-code data-dfn-type=type data-export="" id=typedef-shape-box><a class="production css-code" data-link-type=type href=#typedef-shape-box title="<shape-box>">&lt;shape-box&gt;</a><a class=self-link href=#typedef-shape-box></a></dfn> = <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-backgrounds-3/#box title="<box>">&lt;box&gt;</a> | <a class=css data-link-type=maybe href=#margin-box title=margin-box>margin-box</a>
</pre>
<p> The definitions of the values are:
<p> The <dfn data-dfn-type=dfn data-noexport="" id=margin-box>margin-box<a class=self-link href=#margin-box></a></dfn> value defines the shape
enclosed by the outside margin edge.
The corner radii of this shape are determined
by the corresponding border-radius and margin values.
If the ratio of <code>border-radius/margin</code> is 1 or more,
then the margin box corner radius is
<code>border-radius + margin</code>.
If the ratio of <code>border-radius/margin</code> is less than 1,
then the margin box corner radius is
<code>border-radius + (margin * (1 + (ratio-1)^3))</code>.
<p> The <dfn data-dfn-type=dfn data-noexport="" id=border-box>border-box<a class=self-link href=#border-box></a></dfn> value defines the shape
enclosed by the outside border edge.
This shape follows all
of the normal border radius shaping rules
for the outside of the border.
<p> The <dfn data-dfn-type=dfn data-noexport="" id=padding-box>padding-box<a class=self-link href=#padding-box></a></dfn> value defines the shape
enclosed by the outside padding edge.
This shape follows all
of the normal border radius shaping rules
for the inside of the border.
<p> The <dfn data-dfn-type=dfn data-noexport="" id=content-box>content-box<a class=self-link href=#content-box></a></dfn> value defines the shape
enclosed by the outside content edge.
Each corner radius of this box
is the larger of 0
or <code>border-radius - border-width - padding</code>.
<div class=example>
<p> Given the 100px square below with
10px padding, border and margins,
the box values define these shapes:
<p> <ul>
<li><a class=css data-link-type=maybe href=#margin-box title=margin-box>margin-box</a>: the shape containing all of the yellow pixels</li>
<li><a class=css data-link-type=maybe href=#border-box title=border-box>border-box</a>: the shape containing all of the black pixels</li>
<li><a class=css data-link-type=maybe href=#padding-box title=padding-box>padding-box</a>: the shape containing all of the mauve pixels</li>
<li><a class=css data-link-type=maybe href=#content-box title=content-box>content-box</a>: the shape containing all of the blue pixels</li>
</ul>
<div class=figure>
<img alt="Colored boxes representing simple box edges" src=images/box-edges-simple.png>
<p class=caption>Simple CSS Box Model Edges</p>
</div>
<p> And the same definitions apply to a more complex example with the same 100px square, but with these border, padding and margin properties:
<pre> <code class=css>
border-radius: 20px 20px 20px 40px;
border-width: 30px 10px 20px 10px;
padding: 10px 20px 10px 10px;
margin: 20px 10px 10px 10px;
</code>
</pre>
<div class=figure>
<img alt="Colored boxes representing complex box edges" src=images/box-edges-complex.png>
<p class=caption>Complex CSS Box Model Edges</p>
</div>
</div>
<div class=example>
<p> The difference between normal float wrapping
and wrapping around the shape defined
by the margin-box value is that
the margin-box shape includes corner shaping.
Take the 100px square with 10px padding,
border and margins,
but with a border-radius of 60px.
If you make a left float out of it,
content normally wraps in this manner:
<div class=figure>
<img alt="Text wrapping around float with no shape" src=images/normal-wrap.png>
<p class=caption>Normal float wrapping</p>
</div>
<p> If you add a margin-box shape to the float,
then content wraps around the rounded margin-box corners.
<pre> <code class=css>
shape-outside: margin-box;
</code>
</pre>
<div class=figure>
<img alt="Text wrapping around float with margin-box shape" src=images/margin-box-wrap.png>
<p class=caption>Float wrapping with margin-box</p>
</div>
</div>
<h2 class="heading settled heading" data-level=6 id=declaring-shapes><span class=secno>6 </span><span class=content>
Declaring Shapes</span><a class=self-link href=#declaring-shapes></a></h2>
<p> Shapes are declared with
the <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> property,
with possible modifications
from the <a class=property data-link-type=propdesc href=#propdef-shape-margin title=shape-margin>shape-margin</a> property.
The shape defined by
the <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a>
and <a class=property data-link-type=propdesc href=#prop 22D5 def-shape-margin title=shape-margin>shape-margin</a> properties
changes the geometry
of a float element’s
<a data-link-type=dfn href=#float-area title="float area">float area</a>.
<h3 class="heading settled heading" data-level=6.1 id=shape-outside-property><span class=secno>6.1 </span><span class=content>
Float Area Shape: the <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> property</span><a class=self-link href=#shape-outside-property></a></h3>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css-code data-dfn-type=property data-export="" id=propdef-shape-outside>shape-outside<a class=self-link href=#propdef-shape-outside></a></dfn><tr><th>Value:<td class=prod>none | [ <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> || <a class="production css-code" data-link-type=type href=#typedef-shape-box title="<shape-box>">&lt;shape-box&gt;</a> ] | <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a><tr><th>Initial:<td>none<tr><th>Applies to:<td>floats<tr><th>Inherited:<td>no<tr><th>Media:<td>visual<tr><th>Computed value:<td>as <a href=#basic-shape-computed-values>defined</a> for <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> (with <a class="production css-code" data-link-type=type href=#typedef-shape-box title="<shape-box>">&lt;shape-box&gt;</a> following, if supplied), the <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a> with its URI made absolute, otherwise as specified.<tr><th>Animatable:<td>as <a href=#basic-shape-interpolation>specified</a> for <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a>, otherwise no</table>
<p> The values of this property have the following meanings:
<dl data-dfn-for=shape-outside data-dfn-type=value>
<dt><dfn class=css-code data-dfn-for=shape-outside data-dfn-type=value data-export="" id=valuedef-none>none<a class=self-link href=#valuedef-none></a></dfn></dt>
<dd>
The <a data-link-type=dfn href=#float-area title="float area">float area</a> is unaffected.
</dd>
<dt><a class="production css-code" data-link-type=type href=#typedef-shape-box title="<shape-box>">&lt;shape-box&gt;</a></dt>
<dd>
If one of these values is specified by itself
the shape is computed based on one of
<a class=css data-link-type=maybe href=#margin-box title=margin-box>margin-box</a>,
<a class=css data-link-type=maybe href=#border-box title=border-box>border-box</a>,
<a class=css data-link-type=maybe href=#padding-box title=padding-box>padding-box</a> or
<a class=css data-link-type=maybe href=#content-box title=content-box>content-box</a>
which use their respective boxes
including curvature from border-radius,
similar to <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#background-clip title=background-clip>background-clip</a> <a data-biblio-type=normative data-link-type=biblio href=#css3bg title=css3bg>[CSS3BG]</a>.
</dd>
<dt><dfn class=css-code data-dfn-for=shape-outside data-dfn-type=value data-export="" id=valuedef-basic-shape><a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a><a class=self-link href=#valuedef-basic-shape></a></dfn></dt>
<dd>
The shape is computed based on the values of one
of <a class=css data-link-type=maybe href=#funcdef-inset title=inset()>inset()</a>, <a class=css data-link-type=maybe href=#funcdef-circle title=circle()>circle()</a>, <a class=css data-link-type=maybe href=#funcdef-ellipse title=ellipse()>ellipse()</a>
or <a class=css data-link-type=maybe href=#funcdef-polygon title=polygon()>polygon()</a>. If a <a class="production css-code" data-link-type=type href=#typedef-shape-box title="<shape-box>">&lt;shape-box&gt;</a> is also supplied, this defines the <a data-link-type=dfn href=#reference-box title="reference box">reference box</a> for the <a class="production css-code" data-link-type=type href=#typedef-basic-shape title="<basic-shape>">&lt;basic-shape&gt;</a> function. If <a class="production css-code" data-link-type=type href=#typedef-shape-box title="<shape-box>">&lt;shape-box&gt;</a> is not supplied, then the <a data-link-type=dfn href=#reference-box title="reference box">reference box</a> defaults to <a class=css data-link-type=maybe href=#margin-box title=margin-box>margin-box</a>.
</dd>
<dt><dfn class=css-code data-dfn-for=shape-outside data-dfn-type=value data-export="" id=valuedef-image><a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a><a class=self-link href=#valuedef-image></a></dfn></dt>
<dd>
The shape is extracted
and computed based
on the alpha channel
of the specified <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-images-3/#image-type title="<image>">&lt;image&gt;</a>
as defined by <a class=property data-link-type=propdesc href=#propdef-shape-image-threshold title=shape-image-threshold>shape-image-threshold</a>.
<p> User agents must use the
<a href=http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch>potentially CORS-enabled fetch</a>
method defined by the <a data-biblio-type=normative data-link-type=biblio href=#html5 title=html5>[HTML5]</a> specification
for all URLs in a <a class=property data-link-type=propdesc href=#propdef-shape-outside title=shape-outside>shape-outside</a> value.
When fetching,
user agents must use "Anonymous" mode,
set the referrer source
to the stylesheet’s URL
and set the origin to the URL
of the containing document.
If this results in network errors
such that there is no valid fallback image,
the effect is as if
the value <a class=css-code data-link-for=shape-outside data-link-type=value href=#valuedef-none title=none>none</a>
had been specified.
</dd>
</dl>
<h3 class="heading settled heading" data-level=6.2 id=shape-image-threshold-property><span class=secno>6.2 </span><span class=content>
Choosing Image Pixels: the <a class=property data-link-type=propdesc href=#propdef-shape-image-threshold title=shape-image-threshold>shape-image-threshold</a> property</span><a class=self-link href=#shape-image-threshold-property></a></h3>
<p> The <a class=property data-link-type=propdesc href=#propdef-shape-image-threshold title=shape-image-threshold>shape-image-threshold</a>
defines the alpha channel threshold
used to extract the shape