File size: 1,424 Bytes
07c3cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
% $Header: /cvsroot/html2ps/postscript/box.block.inline.ps,v 1.1 2005/12/18 07:21:36 Konstantin Exp $

/box-inline-block-create {
  box-container-create
  dup box-inline-block-setup-methods
  dup /box-inline-block add-type
} def

/box-inline-block-reflow {         % => Context Parent Box
  1 index /null ne {
% Calculate margin values if they have been set as a percentage
    2 copy
    box-generic-calc-percentage-margins

% Calculate width value if it had been set as a percentage
    3 copy
    box-generic-calc-percentage-width

% Calculate 'auto' values of width and margins
    2 copy
    box-generic-calc-auto-width-margins

% Add current box to the parent's line-box
    dup 2 index
    box-container-append-line

    2 copy
    box-generic-guess-corner

% By default, child block box will fill all available parent width;
% note that actual width will be smaller because of non-zero padding, border and margins
    1 index /get-width call-method
    1 index put-full-width
  } if

% Reflow content

  2 index 1 index box-container-reflow-content

  1 index /null ne {
% Extend parent's height to fit current box
    dup get-bottom-margin
    2 index box-generic-extend-height

% Offset current x coordinate of parent box
    dup get-right-margin
    2 index put-current-x
  } if

  pop pop pop
} def

/box-inline-block-setup-methods {
  dup /Methods get
  dup /reflow {box-inline-block-reflow} put
  pop pop
} def