Skip to content

Commit 4f8b4b0

Browse files
committed
[css2] revising the algoritm for min/max width/height properties
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%40312
1 parent c519f68 commit 4f8b4b0

1 file changed

Lines changed: 69 additions & 10 deletions

File tree

css2/visudet.src

Lines changed: 69 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22
<html lang="en">
3-
<!-- $Id: visudet.src,v 1.21 1997-10-29 19:05:51 howcome Exp $ -->
3+
<!-- $Id: visudet.src,v 1.22 1997-10-29 23:31:41 howcome Exp $ -->
44
<HEAD>
55
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66
<TITLE>Visual rendering model details</TITLE>
@@ -123,14 +123,45 @@ exactly the width of the inherited reference box.
123123
class="propinst-min-width">'min-width'</span> and <span
124124
class="propinst-max-width">'max-width'</span></h3>
125125

126-
<P> The <span class="propinst-width">'width'</span> has a
126+
<P>It is sometimes useful to contrain the width of elements to a
127+
certain range. Two properties offer this functionality:
128+
129+
<!-- #include src=properties/min-width.srb -->
130+
<!-- #include src=properties/max-width.srb -->
131+
132+
<P>This algorithm describes how the two properteis influence the width
133+
calculations:
134+
135+
<OL>
136+
137+
<LI>the normal width calculations (without 'min-width' and 'max-width')
138+
are performed and the calculated width is found
139+
140+
<LI>if the value of 'min-width' is greater than the value of
141+
'max-width', 'max-width' should be set to the value of 'min-width'
142+
143+
<LI>if the calculated width is greater than 'max-width', the
144+
value of 'width' is set to 'max-width'. Goto step 1.
145+
146+
<LI>if the calculated width is smaller than 'min-width', the
147+
value of 'width' is set to 'min-width'. Goto step 1.
148+
149+
<LI>terminate
150+
151+
</OL>
152+
153+
<P>When the algorith terminates, use the calculated width as the
154+
width of the element.
155+
156+
<!--
157+
158+
The <span class="propinst-width">'width'</span> has a
127159
non-negative UA-defined minimum value (which may vary from element to
128160
element and even depend on other properties).
129161

130-
<P>Users may override the UA-defined value with the following
162+
<P>A style sheet may add an additional constraint on the Users may override the UA-defined value with the following
131163
property.
132164

133-
<!-- #include src=properties/min-width.srb -->
134165

135166
<P>If <span class="propinst-width">'width'</span> goes below the minimum
136167
width, either because it was set explicitly, or because it was 'auto'
@@ -145,7 +176,7 @@ too large, the value will be replaced by either the width of the
145176
parent or reference box, or the value set by <span
146177
class="propinst-max-width">'max-width'</span>, whichever is smaller.
147178

148-
<!-- #include src=properties/max-width.srb -->
179+
-->
149180

150181
<H2><a name="box-height">Box height calculations</a>: the <span
151182
class="propinst-height">'height'</span> property</H2>
@@ -218,12 +249,40 @@ exactly the height of the inherited reference box.
218249
class="propinst-min-height">'min-height'</span> and <span
219250
class="propinst-max-height">'max-height'</span></h3>
220251

221-
<P>The height of a box is either the minimal height necessary to
222-
include the vertical content of the element and that of all its flowed
223-
children, or the value of <span
224-
class="propinst-min-height">'min-height'</span>, whichever is larger.
252+
253+
<P>It is sometimes useful to contrain the height of elements to a
254+
certain range. Two properties offer this functionality:
225255

226256
<!-- #include src=properties/min-height.srb -->
257+
<!-- #include src=properties/max-height.srb -->
258+
259+
<P>This algorithm describes how the two properteis influence the height
260+
calculations:
261+
262+
<OL>
263+
264+
<LI>the normal height calculations (without 'min-height' and 'max-height')
265+
are performed and the calculated height is found
266+
267+
<LI>if the value of 'min-height' is greater than the value of
268+
'max-height', 'max-height' should be set to the value of 'min-height'
269+
270+
<LI>if the calculated height is greater than 'max-height', the
271+
value of 'height' is set to 'max-height'. Goto step 1.
272+
273+
<LI>if the calculated height is smaller than 'min-height', the
274+
value of 'height' is set to 'min-height'. Goto step 1.
275+
276+
<LI>terminate
277+
278+
</OL>
279+
280+
<P>When the algorith terminates, use the calculated height as the
281+
height of the element.
282+
283+
284+
285+
<!--
227286

228287
<P>If <span class="propinst-height">'height'</span> goes below the minimum
229288
height, either because it was set explicitly, or because it was 'auto'
@@ -238,7 +297,7 @@ too large, the value will be replaced by either the height of the
238297
parent or reference box, or the value set by <span
239298
class="propinst-max-height">'max-height'</span>, whichever is smaller.
240299

241-
<!-- #include src=properties/max-height.srb -->
300+
-->
242301

243302
<H3><a name="collapsing-margins">Collapsing margins</a></H3>
244303

0 commit comments

Comments
 (0)