Skip to content

Commit 27c1ff3

Browse files
committed
[css2] Small corrections.
Default clip region is size of box itself, not size of containing block. --HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401569
1 parent eb1f9f3 commit 27c1ff3

1 file changed

Lines changed: 65 additions & 37 deletions

File tree

css2/visufx.src

Lines changed: 65 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,32 @@ only presentation.</em>
1616
content edges of the box. In certain cases, a box may <span
1717
class="index-def"
1818
title="overflow|box::overflow"><dfn>overflow</dfn></span>, meaning its
19-
content lies partly or entirely outside of the containing block:</P>
19+
content lies partly or entirely outside of the box, e.g.:</P>
2020

2121
<ul>
22+
<li>A line cannot be broken, causing the line box to be wider than the
23+
block box.
2224

23-
<li>Content is too wide for the containing block. This may happen when an
25+
<li>A block-level box is too wide for the containing block. This may
26+
happen when an
2427
element's <span class="propinst-width">'width'</span> property has a
2528
value that causes the generated block box to spill over
26-
sides of the containing block. An inline replaced element
27-
(e.g., an image) that has a large <span class="index-inst"
28-
title="intrinsic width">intrinsic width</span> may also overflow.
29+
sides of the containing block.
2930

3031
<li>An element's height exceeds an explicit height assigned to the containing
3132
block (i.e., the containing block's height is determined by the <span
3233
class="propinst-height">'height'</span> property, not by content
3334
height).
3435

35-
<li>It is <a href="visuren.html#absolute-positioning">positioned
36+
<li>A box is <a href="visuren.html#absolute-positioning">positioned
3637
absolutely</a>.
3738

3839
<li>It has <a href="box.html#margin-properties">negative margins</a>.
3940
</ul>
4041

4142
<p>Whenever overflow occurs, the <span
42-
class="propinst-overflow">'overflow'</span> property specifies how a
43+
class="propinst-overflow">'overflow'</span> property specifies how
44+
(and whether) a
4345
box is clipped. The <span class="propinst-clip">'clip'</span> property
4446
specifies the size and shape of the clipping region. Specifying a
4547
small clipping region may cause clipping of otherwise visible
@@ -72,17 +74,18 @@ by the <span class="propinst-clip">'clip'</span> property.
7274

7375
<dt><strong>scroll</strong>
7476

75-
<dd>This value indicates that if the user agent supports a visible
76-
scrolling mechanism, that mechanism should be displayed for a box
77-
whether or not any of its content is clipped. This avoids any problem
78-
with scrollbars appearing and disappearing in a dynamic
77+
<dd>This value indicates that the content is clipped and that if the
78+
user agent uses scrolling mechanism that is visible on the screen
79+
(such as a scroll bar or a panner), that mechanism should be displayed
80+
for a box whether or not any of its content is clipped. This avoids
81+
any problem with scrollbars appearing and disappearing in a dynamic
7982
environment. When this value is specified and the target medium is
8083
'print' or 'projection', overflowing content should be printed.
8184

8285
<dt><strong>auto</strong>
8386

8487
<dd>The behavior of the 'auto' value is user agent-dependent, but
85-
should cause a scrolling mechanism to appear for overflowing boxes.
88+
should cause a scrolling mechanism to be provided for overflowing boxes.
8689

8790
</dl>
8891

@@ -91,7 +94,7 @@ to 'visible', content may be clipped to a UA's document window by the
9194
native operating environment.
9295

9396
<div class="example"><P>
94-
Consider the following example, of a block quotation
97+
Consider the following example of a block quotation
9598
(BLOCKQUOTE) that is too big
9699
for its containing block (established by a DIV). Here is
97100
the source document:</p>
@@ -111,18 +114,21 @@ generated boxes:
111114

112115
<PRE>
113116
DIV { width : 100px; height: 100px;
114-
border: thin solid red
117+
border: thin solid red;
115118
}
116119

117120
BLOCKQUOTE { width : 125px; height : 100px;
118-
position: absolute;
119-
top: 50px; left: 50px;
121+
margin-top: 50px; margin-left: 50px;
120122
border: thin dashed black
121123
}
122124

123125
DIV.attributed-to { text-align : right; }
124126
</PRE>
125127

128+
<!-- I replaced top and left with margin-top and margin-left, and
129+
removed postion:absolute. Another way to fix the example is to add
130+
position:relative to DIV, but that would make the example, longer,
131+
while this made it shorter. BB -->
126132

127133
<P>The initial value of <span
128134
class="propinst-overflow">'overflow'</span> is 'visible', so
@@ -151,20 +157,20 @@ class="propinst-clip">'clip'</span> property</h3>
151157
<p>A <span class="index-def" title="clipping region"><dfn>clipping
152158
region</dfn></span> defines what portion of an element's <a
153159
href="conform.html#rendered-content">rendered content</a> is
154-
visible. By default, the containing block established by the element
155-
acts as the clipping region for the element's content (i.e., the
156-
clipping region has the same size as the containing block). However,
157-
the clipping region dimensions may be modified by the <span
158-
class="propinst-clip">'clip'</span> property.
160+
visible. By default, the clipping region has the same size and shape
161+
as the element's box(es). However, the clipping region may be
162+
modified by the <span class="propinst-clip">'clip'</span> property.
159163

160164
<!-- #include src=properties/clip.srb -->
161165

162-
<P>Values have the following meanings:</p>
166+
<P>The 'clip' property applies to elements that have a <span
167+
class="propinst-overflow">'overflow'</span> property with a value
168+
other than 'visible'. Values have the following meanings:</p>
163169

164170
<dl>
165171
<dt><strong>auto</strong>
166172
<dd>The clipping region has the same size and location
167-
as the containing block established by the element.
173+
as the element's box(es).
168174

169175
<dt><span class="index-def" title="&lt;shape&gt;::definition of"><a
170176
name="value-def-shape"
@@ -196,11 +202,21 @@ value or 'auto'. Negative lengths are permitted. The value 'auto'
196202
means that a given edge of the clipping region will be the same as the
197203
edge of the element's generated box (i.e., 'auto' means the same as '0'.)
198204

199-
<P> When converted to pixel coordinates, the bottom-right corner is
205+
<P>When coordinates are rounded to pixel coordinates, care should be
206+
taken that no pixels remain visible when &lt;left&gt; + &lt;right&gt;
207+
is equal to the element's width (or &lt;top&gt; + &lt;bottom&gt;
208+
equals the element's height), and conversely that no pixels remain
209+
hidden when these values are 0.
210+
<!-- When converted to pixel coordinates, the bottom-right corner is
200211
excluded from the clipping rectangle. This rule is necessary to permit
201-
the definition of zero-width or zero-height rectangles.
212+
the definition of zero-width or zero-height rectangles. -->
202213
</dl>
203214

215+
<P>The element's ancestors may also have clipping regions (in case
216+
their <span class="propinst-overflow">'overflow'</span> property is
217+
not 'visible'); what is rendered is the intersection of the various
218+
clipping regions.
219+
204220
<P>If the clipping region exceeds the bounds of the UA's
205221
document window, content may be clipped to that window by the
206222
native operating environment.
@@ -243,7 +259,8 @@ meanings:</p>
243259
<dt><strong>visible</strong>
244260
<dd>The generated box is visible.
245261
<dt><strong>hidden</strong>
246-
<dd>The generated box is invisible, but still affects layout.
262+
<dd>The generated box is invisible (fully transparent), but still
263+
affects layout.
247264
<dt><strong>collapse</strong>
248265
<dd>Please consult the section on
249266
<a href="tables.html#dynamic-effects">dynamic row and column
@@ -254,12 +271,13 @@ effects</a> in tables. If used on elements other than rows or columns,
254271
<P>This property may be used in conjunction with scripts to create
255272
dynamic effects.
256273

257-
<div class="html-example"><P>
258-
In the following example, pressing either form button invokes a
259-
user-defined script function that causes the corresponding box to
260-
become visible and the other to be hidden. Since these boxes
261-
have the same size and position, the
262-
effect is that one replaces the other.
274+
<div class="html-example"><P> In the following example, pressing
275+
either form button invokes a user-defined script function that causes
276+
the corresponding box to become visible and the other to be
277+
hidden. Since these boxes have the same size and position, the effect
278+
is that one replaces the other. (The script code is in a hypothetical
279+
script language. It may or may not have any effect in a CSS-capable
280+
UA.)
263281

264282
<pre>
265283
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"&gt;
@@ -307,11 +325,21 @@ effect is that one replaces the other.
307325
&lt;/HTML&gt;
308326
</pre>
309327

310-
<P>Note that the <span class="propinst-position">'position'</span>
311-
property of each DIV element has the value 'relative'. A more
312-
visually appealing version of the above might be designed using
313-
overlapping <a href="visuren.html#absolute-positioning">
314-
absolutely positioned</a> boxes.</p>
315328
</div>
316329
</body>
317330
</html>
331+
<!-- Keep this comment at the end of the file
332+
Local variables:
333+
mode: sgml
334+
sgml-omittag:nil
335+
sgml-shorttag:nil
336+
sgml-minimize-attributes:nil
337+
sgml-always-quote-attributes:t
338+
sgml-indent-step:nil
339+
sgml-indent-data:t
340+
sgml-parent-document:nil
341+
sgml-exposed-tags:nil
342+
sgml-local-catalogs:nil
343+
sgml-local-ecat-files:nil
344+
End:
345+
-->

0 commit comments

Comments
 (0)