Skip to content

Commit fe2a03d

Browse files
committed
[css-overflow-3][css-contain-1] Define 'overflow-clip-margin', per WG resolution, and make paint containment respect it. Fixes w3c#4934.
1 parent 74496cd commit fe2a03d

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

css-contain-1/Overview.bs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,10 @@ Paint Containment</h3>
733733
nor does it inhibit the creation of any such mechanism through other properties,
734734
<span class=informative>such as 'overflow', 'resize', or 'text-overflow'</span>.
735735

736+
This clipping shape respects 'overflow-clip-margin',
737+
allowing an element with [=paint containment=]
738+
to still slightly overflow its normal bounds.
739+
736740
Note: The behavior is described in this paragraph is equivalent to changing
737741
''overflow-x: visible'' into ''overflow-x: clip''
738742
and

css-overflow-3/Overview.bs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,46 @@ Scrolling Origin, Direction, and Restriction</h3>
489489

490490
The viewport uses the <a>principal writing mode</a> for these calculations.
491491

492+
<h3 id="overflow-clip-margin">
493+
Expanding ''overflow:clip'' Bounds: the 'overflow-clip-margin' property</h3>
494+
495+
<pre class=propdef>
496+
Name: overflow-clip-margin
497+
Value: <<length>>
498+
Initial: ''0px''
499+
Inherited: no
500+
Applies to: all elements
501+
Computed value: the computed <<length>>
502+
</pre>
503+
504+
Unlike the scrollable 'overflow' values,
505+
which have various additional effects on an element
506+
to make it a scroll container,
507+
''overflow: clip'' solely has the effect
508+
of preventing an element from painting outside its bounds.
509+
The 'overflow-clip-margin' property
510+
determines precisely <em>how far</em> outside its bounds
511+
the element is allowed to paint
512+
before being clipped.
513+
514+
Values are defined as follows:
515+
516+
<dl dfn-type=value dfn-for=overflow-clip-margin>
517+
: <dfn><<length>></dfn>
518+
::
519+
If the element does not have ''overflow: clip''
520+
(or another property defined to respect this property),
521+
this property has no effect.
522+
523+
Otherwise, dictates how much the clipping shape is expanded
524+
from its initial shape.
525+
The clipping shape is expanded outward in all directions
526+
by the specified <<length>>,
527+
in exactly the same way as a 'box-shadow' grows
528+
due to a positive spread distance
529+
(including the effect on rounded corners).
530+
</dl>
531+
492532
<h3 id="overflow-propagation">
493533
Overflow Viewport Propagation</h3>
494534

0 commit comments

Comments
 (0)