-
Notifications
You must be signed in to change notification settings - Fork 708
/
Copy pathOverview.bs
662 lines (538 loc) · 25.1 KB
/
Overview.bs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
<pre class='metadata'>
Title: CSS Shapes Module Level 2
Status: ED
Work Status: Exploring
Shortname: css-shapes
Level: 2
Group: csswg
TR: https://www.w3.org/TR/css-shapes-2/
ED: https://drafts.csswg.org/css-shapes-2/
Editor: Rossen Atanassov, Microsoft Corporation, ratan@microsoft.com, w3cid 49885
Editor: Alan Stearns, Adobe Systems, Inc., stearns@adobe.com, w3cid 46659
Abstract: This draft contains the features of CSS relating to wrapping content around and inside shapes. It (implicitly for now) includes and extends the functionality of CSS Shapes Level 1 [[CSS-SHAPES]]. The main points of extension compared to level 1 include additional ways of defining shapes, defining an exclusion area using a shape, and restricting an element's content area using a shape.
Link Defaults: css2 (property) margin, css-display-3 (value) table
</pre>
<pre class='link-defaults'>
spec:css-masking-1; type: value
text: nonzero
text: evenodd
spec:css-shapes-1;
type:property;
text:shape-margin
text:shape-outside
type:dfn; text: reference box
type:function; text: path()
spec:css-writing-modes-4; type:concept; text:physical
spec:css-writing-modes-4; type:concept; text:"writing mode"
spec:svg2; type:property;
text:fill-rule
</pre>
<style type="text/css">
.singleImgExample {
display: block;
margin: auto;
}
.example-table {
table-layout: fixed;
width: 100%;
}
.example-table tr td img {
width: 90%;
}
</style>
<h2 id="intro">
Introduction</h2>
<em>This section is not normative.</em>
Level 1 of this specification defined properties
to control the geometry of an element's [=float area=].
This level defines how shapes apply to exclusions.
It also includes a 'shape-inside' property
for applying a shape to an element's content area.
Finally, it defines new ways of specifying shapes for all of these applications.
<h3 id="values">
Value Definitions</h3>
This specification follows the <a href="https://www.w3.org/TR/CSS2/about.html#property-defs">CSS property definition conventions</a> from [[!CSS2]]
using the <a href="https://www.w3.org/TR/css-values-3/#value-defs">value definition syntax</a> from [[!CSS-VALUES-3]].
Value types not defined in this specification are defined in CSS Values & Units [[!CSS-VALUES-3]].
Combination with other CSS modules may expand the definitions of these value types.
In addition to the property-specific values listed in their definitions,
all properties defined in this specification
also accept the [=CSS-wide keywords=] as their property value.
For readability they have not been repeated explicitly.
<h2 id="terminology">
Terminology</h2>
: <dfn>exclusion area</dfn>
:: The area used for excluding inline flow content around an exclusion box.
The [=exclusion area=] is equivalent to the [=border box=] for an exclusion box.
This specification's 'shape-outside' property
can be used to define arbitrary, non-rectangular [=exclusion areas=].
The 'shape-inside' property also defines an [=exclusion area=],
but in this case it is the area outside the shape that inline content avoids.
: <dfn>float area</dfn>
:: The area used for wrapping content around a float element.
By default, the float area is the float element's [=margin box=].
This specification's 'shape-outside' property can be used
to define arbitrary, non-rectangular float areas.
: <dfn>content area</dfn>
:: The [=content area=] is normally used for layout of the inline flow content of a box.
: <dfn>direction-agnostic size</dfn>
:: The [=direction-agnostic size=] of a box is equal to the length of the diagonal of the box,
divided by sqrt(2).
Note: This is a method of averaging the width and height of a box
used by SVG in some cases,
when a percentage of a box's size is desired
but the context doesn't specifically favor the width or the height.
For square boxes, this is the same as the width/height.
<h2 id="shapes">
Shapes</h2>
Shapes define arbitrary geometric contours
around which inline content flows.
The shape-outside property defines the [=float area=] for a float,
and the [=exclusion area=] for an exclusion.
<h2 id="basic-shape-functions">
Basic Shapes</h3>
Add the final
<a href="https://www.w3.org/TR/css-shapes/#basic-shape-functions">level 1</a>
section.
<h3 id="supported-basic-shapes">
Supported Shapes</h3>
Add the final
<a href="https://www.w3.org/TR/css-shapes/#basic-shape-functions">level 1</a>
sections.
<h4 id='shape-function'>
The ''shape()'' Function</h4>
While the ''path()'' function allows reuse of the SVG path syntax
to define more arbitrary shapes than allowed by more specialized shape functions,
it requires writing a path as a single string
(which is not compatible with, for example, building a path piecemeal with ''var()''),
and inherits a number of limitations from SVG,
such as implicitly only allowing the ''px'' unit.
The ''shape()'' function defines a path in the same way,
but does so with more standard CSS syntax,
and allows the full range of CSS functionality,
such as additional units and math functions.
<pre class=prod>
<dfn>shape()</dfn> = shape( <<'fill-rule'>>? from <<coordinate-pair>>, <<shape-command>>#)
</pre>
The <<'fill-rule'>> is interpreted identically to the same argument in ''path()''.
The rest of the arguments define a list of path data commands,
identical to that of an <a href="https://www.w3.org/TR/SVG11/paths.html#PathData">SVG Path</a>,
which the function represents.
The <css>from <<coordinate-pair>></css> represents the starting point for the first shape-command.
It adds an initial <a href="https://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands">absolute moveto</a>
to the list of path data commands,
with the <<coordinate-pair>> measured from the top-left corner of the [=reference box=].
The sequence of <dfn><<shape-command>></dfn>s represent
further <a href="https://www.w3.org/TR/SVG11/paths.html#PathData">path data commands</a>.
Each command's starting point is the previous command's ending point.
<pre class=prod>
<<shape-command>> = <<move-command>> | <<line-command>> | <<hv-line-command>> |
<<curve-command>> | <<smooth-command>> | <<arc-command>> | close
<<coordinate-pair>> = <<length-percentage>>{2}
<<by-to>> = by | to
<<move-command>> = move <<by-to>> <<coordinate-pair>>
<<line-command>> = line <<by-to>> <<coordinate-pair>>
<<hv-line-command>> = [hline | vline] <<by-to>> <<length-percentage>>
<<curve-command>> = curve <<by-to>> <<coordinate-pair>> via <<coordinate-pair>>{1,2}
<<smooth-command>> = smooth <<by-to>> <<coordinate-pair>> [via <<coordinate-pair>>]?
<<arc-command>> = arc <<by-to>> <<coordinate-pair>> of <<length-percentage>>{1,2}
[ <<arc-sweep>> || <<arc-size>> || rotate <<angle>> ]?
<<arc-sweep>> = cw | ccw
<<arc-size>> = large | small
</pre>
<dl dfn-for="shape()">
<dt><dfn><<coordinate-pair>></dfn> = <<length-percentage>>{2}
<dd>Defines a pair of coordinates,
representing a rightward and downward offset, respectively,
from a specified reference point.
Percentages are resolved against the width or height, respectively,
of the [=reference box=].
<dt><dfn><<by-to>></dfn> = <dfn value for="shape(), <by-to>">by</dfn> | <dfn value for="shape(), <by-to>">to</dfn>
<dd>
Every command can be specified in "absolute" or "relative" coordinates,
determined by their <<by-to>> component.
''to'' indicates that any <<coordinate-pair>>s in the command
are relative to the top-left corner of the [=reference box=],
while ''by'' indicates that the <<coordinate-pair>>s
are relative to the command's starting point.
Note: In either case, <<percentage>> values in <<coordinate-pair>>s
are always computed relative to the [=reference box's=] size.
<dt><dfn><<move-command>></dfn> = <dfn value>move</dfn> <<by-to>> <<coordinate-pair>>
<dd>
Adds a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands">moveto</a> command
to the list of path data commands,
with an ending point specified by the <<coordinate-pair>>.
This draws nothing,
and merely "moves the pen" for the next command.
Note: This starts a new subpath,
for the purpose of the ''close'' command.
<dt><dfn><<line-command>></dfn> = <dfn value>line</dfn> <<by-to>> <<coordinate-pair>>
<dd>
Adds a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataLinetoCommands">lineto</a> command
to the list of path data commands,
with an ending point specified by the <<coordinate-pair>>.
This draws a straight line from the command's starting point to its ending point.
<dt><dfn><<hv-line-command>></dfn> = [<dfn value>hline</dfn> | <dfn value>vline</dfn>] <<by-to>> <<length-percentage>>
<dd>
Adds a horizontal (for ''hline'') or vertical (for ''vline'')
<a href="https://www.w3.org/TR/SVG/paths.html#PathDataLinetoCommands">lineto</a> command
to the list of path data commands.
This is equivalent to a ''line'' command
with the <<length-percentage>> given as the horizontal or vertical component, respectively,
of the <<coordinate-pair>>,
and the other component specified appropriately to make the line horizontal or vertical.
<dt><dfn><<curve-command>></dfn> = <dfn value>curve</dfn> <<by-to>> <<coordinate-pair>> via <<coordinate-pair>>{1,2}
<dd>
Adds a Bézier curve command to the list of path data commands,
ending at the point specified by the first <<coordinate-pair>>.
The <css>via</css> component specifies control points for the curve:
if a single <<coordinate-pair>> is provided,
the command specifies a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataQuadraticBezierCommands">quadratic curve</a>;
if two <<coordinate-pair>>s are provided,
it specifies a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands">cubic curve</a>.
<dt><dfn><<smooth-command>></dfn> = <dfn value>smooth</dfn> <<by-to>> <<coordinate-pair>> [via <<coordinate-pair>>]?
<dd>
Adds a smooth Bézier curve command to the list of path data commands,
ending at the point specified by the first <<coordinate-pair>>.
The <css>via</css> component specifies control points for the curve:
if it's omitted,
the command specifies a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataQuadraticBezierCommands">smooth quadratic curve</a>;
if it's provided,
if specifies a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands">smooth cubic curve</a>.
Note: A ''smooth'' command is equivalent to a ''curve'' command
with the first control point automatically specified
as the reflection of the previous curve's second control point
around the starting point,
or as the starting point if the previous path data command wasn't a curve.
This ensures G1 continuity with the previous command,
so the curve appears to smoothly continue from the previous command,
rather than possibly making a sudden direction change.
<dt><dfn><<arc-command>></dfn> = <dfn value>arc</dfn> <<by-to>> <<coordinate-pair>> of <<length-percentage>>{1,2} [ <<arc-sweep>> || <<arc-size>> || rotate <<angle>> ]
<dd>
Add an <a href="https://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands">elliptical arc</a> command
to the list of path data commands,
ending at the point specified by the <<coordinate-pair>>.
The <css>of</css> component specifies the size of the ellipse that the arc is taken from.
The first <<length-percentage>> provides the horizontal radius of the ellipse
and the second provides the vertical radius.
Like for <<coordinate-pair>>s,
<<percentage>> values are resolved against the width or height of the [=reference box=],
as appropriate.
If only one <<length-percentage>> is provided,
both radiuses use the provided value.
In that case, <<percentage>> values are resolved against the [=direction-agnostic size=] of the [=reference box=]
(similar to the ''circle()'' function).
<div class=note>
Note that SVG has [[svg2#ArcOutOfRangeParameters|some specific error-handling for the ellipse radiuses]]:
* if the endpoint is the same as the starting point, the command does nothing
* if either radius is zero, the command is equivalent to a <<line-command>> to the ending point
* if either radius is negative, its absolute value is used instead
* if the radiuses don't describe an ellipse large enough
to intersect both the starting point and ending point
(after rotation by the specified <<angle>>),
they are scaled up uniformly until the ellipse is just large enough to reach.
</div>
The ellipse described by the specified radiuses defaults to being axis-aligned,
but can be rotated by specifying an <<angle>>.
Similar to the ''rotate()'' transform function,
positive angles specify a clockwise rotation,
and negative angles specify a counterclockwise rotation.
If omitted, this defaults to ''0deg''.
The ending point, radiuses, and angle,
taken together,
usually define two possible ellipses
that intersect the starting point and ending point,
and each ellipse can be traced in either direction,
for a total of four possible arcs.
The <<arc-sweep>> and <<arc-size>> components specify which of these arcs is desired:
* <dfn><<arc-sweep>></dfn> can be <dfn value for="shape(), arc">cw</dfn> or <dfn value for="shape(), arc">ccw</dfn>,
indicating that the arc that is traced around the ellipse clockwise or counter-clockwise from the center, respectively,
must be chosen.
If omitted, this defaults to ''ccw''.
Note: In the SVG arc command, ''cw'' corresponds to the value 1 for the sweep flag, and ''ccw'' to the value 0.
* <dfn><<arc-size>></dfn> can be <dfn value for="shape(), arc">large</dfn> or <dfn value for="shape(), arc">small</dfn>,
indicating that the larger or smaller, respectively, of the two possible arcs
must be chosen.
If omitted, this defaults to ''small''.
Note: In the SVG arc command, ''large'' corresponds to the value 1 for the large flag, and ''small'' to the 0.
Note: If the starting and ending points are on exactly opposite sides of the ellipse,
both possible arcs are the same size,
but also there is only one possible ellipse.
In this case, the <<arc-sweep>> distinguishes which of the two possible arcs will be chosen,
and <<arc-size>> has no effect.
<figure>
<img src="images/four-arcs.svg">
<figcaption>
A depiction of the two possible ellipses,
and four possible arcs,
that can be chosen between.
</figcaption>
</figure>
<dt><dfn value>close</dfn>
<dd>
Adds a <a href="https://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand">closepath</a> command
to the list of path data commands.
Note: This is similar to a ''line'' command
with its ending point set to the starting point of the subpath.
When specifying a raw shape, they're identical,
but if the path is stroked,
the ending point of the ''close'' command is smoothly joined
with the start of the subpath,
which affects how line-joins and line-caps are rendered.
</dl>
<h5 id=interpolating-shape>
Interpolating the ''shape()'' Function</h5>
''shape()'' and ''path()'' functions can be <l spec=css-values-4>[=interpolated=]</l> with each other
if their associated list of path data commands is the same length
and has the same commands, in order.
If the starting and ending values are both ''path()'' functions,
the interpolated value is a ''path()'' function;
otherwise it's a ''shape()'' function.
In either case,
the interpolated value must represent the same list of path data commands,
with each command having its numerical components interpolated between the corresponding components of the starting and ending list.
For this purpose, commands are "the same" if they use the same command keyword,
and use the same <<by-to>> keyword.
For ''curve'' and ''smooth'', they also must have the same number of control points.
If an ''arc'' command has different <<arc-sweep>> between its starting and ending list,
then the interpolated result uses ''cw'' for any progress value between 0 and 1.
If it has different <<arc-size>> keywords,
then the interpolated result uses ''large'' for any progress value between 0 and 1.
Note: The ''arc'' keyword interpolation rules
are meant to match existing SVG <{path}> interpolation rules.
<h2 id='referencing-svg-shapes'>
Referencing SVG shapes</h4>
An SVG shape can be referenced using the <code>url()</code> syntax.
The shape can be any
of the <a href="https://www.w3.org/TR/SVG/shapes.html">SVG basic shapes</a>
or a <a href="https://www.w3.org/TR/SVG/paths.html">path element</a>.
<div class="example">
<img style="float: right" alt="results of referencing SVG shapes" src="images/svg-shape-reference.png">
<xmp highlight=html>
<style>
div {
height: 400px;
width: 400px;
}
.in-a-circle {
shape-outside: url(#circle_shape);
}
.in-a-path {
shape-outside: url(#path-shape);
}
</style>
<svg ...>
<circle id="circle_shape" cx="50%" cy="50%" r="50%" />
<path id="path-shape" d="M 100 100 L 300 100 L 200 300 z" />
</svg>
<div class="around-a-circle">...</div>
<div class="around-a-path">...</div>
</xmp>
</div>
<h2 id="shapes-from-image">
Shapes from Image</h3>
Add the final
<a href="https://www.w3.org/TR/css-shapes/#shapes-from-image">level 1</a>
section.
Issue: One <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=16716">suggestion</a>
is to define a shape based on an element's rendered content.
This could have security implications.
Issue: Another <a href="http://lists.w3.org/Archives/Public/www-style/2014Mar/0120.html">suggestion</a>
is to add something to an image() function
that determines the relevant pixels to use
(both for defining a shape and for display).
<h2 id="fetching-external-shapes">
Fetching external shapes</h2>
To <dfn>fetch an external resource for a shape</dfn>, either an SVG or an image, given a
{{CSSStyleRule}} |rule|,
[=fetch a style resource=] given |rule|'s URL,
with stylesheet being |rule|'s <a spec=cssom for=CSSRule>parent CSS style sheet</a>,
destination "image",
CORS mode "cors",
and processResponse being the following steps given [=/response=] |res| and null, failure or
a byte stream |byteStream|:
If |byteStream| is a byte stream,
apply the image or SVG to the appropriate shape-accepting property.
Note: shapes require CORS mode as their effect is detected by the document.
<h2 id="shapes-from-box-values">
Shapes from Box Values</h2>
Add the final
<a href="https://www.w3.org/TR/css-shapes/#shapes-from-box-values">level 1</a>
section.
<h2 id="declaring-shapes">
Declaring Shapes</h3>
A shape can be declared with the 'shape-outside' property,
with possible modifications from the 'shape-margin' property.
The shape defined by the 'shape-outside' and 'shape-margin' properties
changes the geometry of a float element's [=float area=]
and an exclusion element's [=exclusion area=].
A shape can be declared with the 'shape-inside' property,
with possible modifications from the 'shape-padding' property.
The shape defined by the 'shape-inside' and 'shape-padding' properties
defines an [=exclusion area=]
that contributes to the element's [=wrapping context=].
The 'shape-inside' property applies to all block-level elements.
<div class="example">
The red box illustrates an exclusion element's content box,
which is unmodified and subject to normal CSS positioning
(here absolute positioning).
<xmp highlight=html>
<style type="text/css">
.exclusion {
wrap-flow: both;
position: absolute;
top: 25%;
left: 25%;
width: 50%;
height: 50%;
shape-outside: circle(50% at 50% 50%);
border: 1px solid red;
}
</style>
<div style=”position: relative;”>
<div class=”exclusion”></div>
Lorem ipsum dolor sit amet...
</div>
</xmp>
<img class="singleImgExample"
src="images/shapes_CSS2.1_MBP.png"
alt="Example rendering of circle shape and box model."
style="max-width:40%"/>
</div>
<h3 id="shape-outside-property">
The 'shape-outside' Property</h4>
Add the final <a href="https://www.w3.org/TR/css-shapes/#shape-outside-property">level 1</a> section
with the change that shape-outside applies to block-level elements
and has an effect if the element is an exclusion.
<h3 id="shape-inside-property">
The 'shape-inside' Property</h4>
The 'shape-inside' property adds one or more exclusion areas
to the element's wrapping context.
This modifies the normal rectangular shape of the content area
to a possibly non-rectangular wrapping area.
The exclusion areas are defined by subtracting the shape from the element's content area.
Any part of the shape outside the element's content area has no effect.
<pre class='propdef'>
Name: shape-inside
Value: auto | outside-shape | [ <<basic-shape>> || shape-box ] | <<image>> | display
Initial: auto
Applies To: block-level elements
Inherited: no
Computed Value: computed lengths for <<basic-shape>>, the absolute URL for <<url>>, otherwise as specified
Animation type: as defined for <<basic-shape>>, otherwise discrete
</pre>
The values of this property have the following meanings:
<dl dfn-type=value dfn-for=shape-inside>
<dt><dfn>auto</dfn>
<dd>
The shape is computed based on the content box of the element.
<dt><dfn>outside-shape</dfn>
<dd>
The shape is computed based on
the shape defined by the shape-outside
and shape-margin properties.
<dt><dfn><<basic-shape>></dfn>
<dd>
The shape is computed based
on the values of one of
''inset()'', ''circle()'', ''ellipse()'' or ''polygon()''.
<dt><dfn><<url>></dfn>
<dd>
If the <uri> references an SVG shape element,
that element defines the shape.
Otherwise, if the <uri> references an image,
the shape is extracted and computed
based on the alpha channel
of the specified image.
If the <uri> does not reference
an SVG shape element or an image,
the effect is as if the value ''auto'' had been specified.
<dt><dfn>display</dfn>
<dd>
The shape is computed based on the shape of the display
as described in <a href="https://drafts.csswg.org/css-round-display">css-round-display</a>.
</dl>
The 'shape-inside' property applies to floats.
The 'shape-inside' property may not apply on some elements
such as elements with a computed 'display' value of ''display/table''.
<figure>
<img alt="Content flowing with and without a shape-inside"
src="images/shape-inside-content.png"/>
<figcaption>Effect of shape-inside on inline content.</figcaption>
</figure>
Overflow content avoids
the exclusion area(s) added
by 'shape-inside' and 'shape-padding'
(as well as any other exclusion areas
in the element's wrapping context).
In other words,
overflow continues outside
the rectangular bounds of the element.</p>
<figure>
<img alt="Overflow interacting with rounded rect"
style="display:inline-block;vertical-align:top"
src="images/rounded-rect-overflow.png"/>
<img alt="Overflow interacting with ellipse"
style="display:inline-block;vertical-align:top"
src="images/ellipse-overflow.png"/>
<figcaption>
Overflow interacting with exclusion areas
defined by 'shape-inside' and 'shape-padding'.
</figcaption>
</figure>
Issue: improve the illustration above,
using text to show overflow instead of grey boxes.
When a shape-inside has a definite size
(no percentages used in the shape's definition)
an auto-sized element should use the shape
as a constraint in determining its maximum size.
<h3 id="shape-image-threshold-property">
The shape-image-threshold Property</h4>
Add the final
<a href="https://www.w3.org/TR/css-shapes/#shape-image-threshold-property">level 1</a>
section with the change that
it applies to both 'shape-inside'
and 'shape-outside'.
<h3 id="shape-image-source-type-property">
The shape-image-source-type Property</h4>
Should we add an alpha/luminance switch
to determine which values we use
from the shape-image source?
This could just be a keyword
on the shape-image-threshold property.
Whatever we go with should be compatible
with the alpha/luminance switch from mask sources.
<h3 id="shape-margin-property">
The 'shape-margin' property</h4>
Add the final
<a href="https://www.w3.org/TR/css-shapes/#shape-margin-property">level 1</a>
section with the change that it applies to exclusions.
<h3 id="shape-padding-property">
The 'shape-padding' Property</h4>
The 'shape-padding' property adds padding to a shape-inside.
This defines a new shape where every point
is the specified distance from the shape-inside.
This property takes on positive values only.
<pre class='propdef'>
Name: shape-padding
Value: <<length>>
Initial: none
Applies To: block-level elements
Inherited: no
Computed Value: the absolute length
Animation type: by computed value
</pre>
<div class="example">
<figure>
<img src="images/shape-padding.png" alt="Example of a shape-padding offset"/>
<figcaption>
A 'shape-padding' creating an offset from a circular 'shape-inside'.
The light blue rectangles represent inline content
affected by the shape created by the padding.
</figcaption>
</figure>
</div>
Note: The 'shape-padding' property only affects layout of content
inside the element it applies to
while the 'shape-margin' property only affects layout of content
outside the element.