Skip to content

Commit a0f643d

Browse files
committed
[css-exclusions] define shape-inside to work like an exclusion
1 parent 483a3b6 commit a0f643d

2 files changed

Lines changed: 147 additions & 121 deletions

File tree

css-exclusions/Exclusions.src.html

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,13 @@ <h2 id="definitions">Definitions</h2>
133133
<p>
134134
The area used for excluding inline flow content around an exclusion box. The
135135
<span>exclusion area</span> is equivalent to the <a href="http://www.w3.org/TR/CSS2/box.html#box-dimensions">
136-
border box</a>.
136+
border box</a> for an exclusion box.
137137
This specification's
138138
'shape-outside' property
139139
can be used to define arbitrary,
140-
non-rectangular <span>exclusion areas</span>.
140+
non-rectangular <span>exclusion areas</span>.
141+
The 'shape-inside' property also defines an <span>exclusion area</span>,
142+
but in this case it is the area outside the shape that inline content avoids.
141143
</p>
142144

143145
<dfn>Float area</dfn>
@@ -168,8 +170,8 @@ <h2 id="definitions">Definitions</h2>
168170

169171
<p>
170172
The <span>wrapping context</span> of a box is a collection of <span>exclusion areas</span>
171-
contributed by its associated <span>exclusion boxes</span>. During layout,
172-
a box wraps its inline flow content in the area that corresponds to the subtraction of
173+
contributed by its associated <span>exclusion boxes</span> and elements with 'shape-inside'. During layout,
174+
a box wraps its inline flow content in the <code>wrapping area</code> that corresponds to the subtraction of
173175
its <span>wrapping context</span> from its own <span>content area</span>.
174176
</p>
175177

@@ -182,9 +184,13 @@ <h2 id="definitions">Definitions</h2>
182184

183185
<dfn>Content area</dfn>
184186
<p>
185-
The area used for layout of the inline flow content of a box. By default the
186-
area is equivalent to the <a href="http://www.w3.org/TR/CSS2/box.html#box-dimensions">content box</a>.
187-
This specification's 'shape-inside' property can define arbitrary, non-rectangular content areas.
187+
The <a href="http://www.w3.org/TR/CSS2/box.html#box-dimensions">content area</a>
188+
is normally used for layout of the inline flow content of a box.
189+
</p>
190+
191+
<dfn>Wrapping area</dfn>
192+
<p>
193+
The area used for layout of inline flow content of a box affected by a <span>wrapping context</span>, defined by subtracting the <span>wrapping context</span> from its <span>content area</span>
188194
</p>
189195

190196
<div class="issue-marker" data-bug_id="15089" data-bug_status="NEW">
@@ -1447,9 +1453,13 @@ <h3 id="declaring-shapes">Declaring Shapes</h3>
14471453
has no effect.
14481454
</p>
14491455
<p>
1450-
The shape defined by the 'shape-inside' and 'shape-padding' properties defines an element's <span>content area</span> and
1451-
the element's inline flow content wraps into that shape. The 'shape-inside' property
1452-
applies to all block-level elements.
1456+
The shape defined by the 'shape-inside'
1457+
and 'shape-padding' properties
1458+
defines an <span>exclusion area</span>
1459+
that contributes
1460+
to the element's <span>wrapping context</span>.
1461+
The 'shape-inside' property applies
1462+
to all block-level elements.
14531463
</p>
14541464

14551465
<h4 id="shape-outside-property">The 'shape-outside' Property</h4>
@@ -1547,8 +1557,15 @@ <h4 id="shape-outside-property">The 'shape-outside' Property</h4>
15471557

15481558
<h4 id="shape-inside-property">The 'shape-inside' Property</h4>
15491559
<p>
1550-
The 'shape-inside' modifies the shape of the inner inline flow content from rectangular
1551-
content box to an arbitrary geometry.
1560+
The 'shape-inside' property adds
1561+
an exclusion area
1562+
to the element's wrapping context.
1563+
This modifies the normal rectangular shape
1564+
of the content area
1565+
to a possibly non-rectangular wrapping area.
1566+
The exclusion area added
1567+
is defined by subtracting the shape
1568+
from the element's content area.
15521569
</p>
15531570

15541571
<table class="propdef">
@@ -1644,33 +1661,33 @@ <h4 id="shape-inside-property">The 'shape-inside' Property</h4>
16441661
</div>
16451662

16461663
<p>Overflow content can overlap
1647-
the after edge of a shape,
1664+
the after edge of a wrapping area,
16481665
and overflow content can be displayed
1649-
below the content area defined by shape.
1666+
below that edge.
16501667
When content overflows in the block direction,
1651-
the last line in the content area determines its width(s)
1668+
the last line in the wrapping area determines its width(s)
16521669
by finding the minimum shape width(s)
1653-
in the remaining area
1670+
in the remaining wrapping area
16541671
between the line's before edge
1655-
and the shape's after edge.
1672+
and the after edge of the wrapping area.
16561673
This can result
1657-
in the line intersecting the shape's after edge,
1674+
in the line intersecting the wrapping area's after edge,
16581675
or a zero-width line
1659-
if (for instance) the shape's after edge
1676+
if (for instance) the wrapping area's after edge
16601677
is a continuous curve.
16611678
In degenerate cases,
16621679
there may be no content
1663-
that fits inside the content area
1664-
defined by the shape.
1680+
that fits inside the wrapping area.
16651681
Further overflow is laid out
16661682
below the after edge
1667-
of the shape's bounding box
1668-
as if 'shape-inside' computes to 'auto'.</p>
1683+
of the wrapping area
1684+
as if the wrapping context
1685+
did not apply.</p>
16691686

16701687
<div class='figure'>
16711688
<img alt="Overflow interacting with rounded rect" style="display:inline-block;vertical-align:top" src="images/rounded-rect-overflow.png"/>
16721689
<img alt="Overflow interacting with ellipse" style="display:inline-block;vertical-align:top" src="images/ellipse-overflow.png"/>
1673-
<p class="caption">Overflow interacting with the after edge of shapes defined by 'shape-inside' and 'shape-padding'.</p>
1690+
<p class="caption">Overflow interacting with the after edge of wrapping contexts defined by 'shape-inside' and 'shape-padding'.</p>
16741691
</div>
16751692

16761693
<!-- End section "The shape-inside property" -->

0 commit comments

Comments
 (0)