| 1 |
lars |
1 |
% $Header: /cvsroot/html2ps/postscript/box.table.cell.ps,v 1.1 2005/12/18 07:21:37 Konstantin Exp $
|
|
|
2 |
|
|
|
3 |
/box-table-cell-apply-vertical-align { % => Baseline Height Cell
|
|
|
4 |
dup /vertical-align
|
|
|
5 |
get-css-value % => Baseline Height Cell Valign
|
|
|
6 |
{ % => Baseline Height Cell Valign
|
|
|
7 |
dup /baseline eq {
|
|
|
8 |
pop % => Baseline Height Cell
|
|
|
9 |
|
|
|
10 |
2 index
|
|
|
11 |
1 index box-table-cell-get-baseline
|
|
|
12 |
sub % => Baseline Height Cell Delta
|
|
|
13 |
|
|
|
14 |
1 index get-top % => Baseline Height Cell Delta OldTop
|
|
|
15 |
1 index neg
|
|
|
16 |
|
|
|
17 |
4 index /offset call-method % => Baseline Height Cell Delta OldTop
|
|
|
18 |
2 index put-top % => Baseline Height Cell Delta
|
|
|
19 |
|
|
|
20 |
pop
|
|
|
21 |
|
|
|
22 |
exit
|
|
|
23 |
} if
|
|
|
24 |
dup /bottom eq {
|
|
|
25 |
pop % => Baseline Height Cell
|
|
|
26 |
|
|
|
27 |
1 index
|
|
|
28 |
1 index box-container-get-real-full-height
|
|
|
29 |
sub % => Baseline Height Cell Delta
|
|
|
30 |
|
|
|
31 |
1 index get-top % => Baseline Height Cell Delta OldTop
|
|
|
32 |
|
|
|
33 |
1 index neg 0
|
|
|
34 |
4 index
|
|
|
35 |
/offset call-method % => Baseline Height Cell Delta OldTop
|
|
|
36 |
|
|
|
37 |
2 index put-top % => Baseline Height Cell Delta
|
|
|
38 |
pop
|
|
|
39 |
exit
|
|
|
40 |
} if
|
|
|
41 |
dup /middle eq {
|
|
|
42 |
pop % => Baseline Height Cell
|
|
|
43 |
|
|
|
44 |
1 index
|
|
|
45 |
1 index box-container-get-real-full-height
|
|
|
46 |
sub 2 div
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
1 index get-top % => Baseline Height Cell Delta OldTop
|
|
|
50 |
|
|
|
51 |
1 index neg 0
|
|
|
52 |
4 index
|
|
|
53 |
/offset call-method % => Baseline Height Cell Delta OldTop
|
|
|
54 |
|
|
|
55 |
2 index put-top % => Baseline Height Cell Delta
|
|
|
56 |
pop
|
|
|
57 |
exit
|
|
|
58 |
} if
|
|
|
59 |
dup /super eq { pop exit } if
|
|
|
60 |
dup /sub eq { pop exit } if
|
|
|
61 |
dup /text-top eq { pop exit } if
|
|
|
62 |
dup /text-bottom eq {
|
|
|
63 |
pop % => Baseline Height Cell
|
|
|
64 |
|
|
|
65 |
2 index
|
|
|
66 |
1 index box-table-cell-get-baseline
|
|
|
67 |
sub % => Baseline Height Cell Delta
|
|
|
68 |
|
|
|
69 |
1 index get-top % => Baseline Height Cell Delta OldTop
|
|
|
70 |
1 index neg
|
|
|
71 |
|
|
|
72 |
4 index /offset call-method % => Baseline Height Cell Delta OldTop
|
|
|
73 |
2 index put-top % => Baseline Height Cell Delta
|
|
|
74 |
|
|
|
75 |
pop
|
|
|
76 |
|
|
|
77 |
exit
|
|
|
78 |
} if
|
|
|
79 |
dup /top eq { pop exit } if
|
|
|
80 |
pop exit
|
|
|
81 |
} loop
|
|
|
82 |
|
|
|
83 |
pop pop pop
|
|
|
84 |
} def
|
|
|
85 |
|
|
|
86 |
/box-table-cell-create {
|
|
|
87 |
box-container-create
|
|
|
88 |
dup box-table-cell-setup-methods
|
|
|
89 |
dup /box-table-cell add-type
|
|
|
90 |
|
|
|
91 |
dup /Colspan 1 put
|
|
|
92 |
dup /Rowspan 1 put
|
|
|
93 |
dup /column 0 put
|
|
|
94 |
dup /row 0 put
|
|
|
95 |
} def
|
|
|
96 |
|
|
|
97 |
/box-table-cell-get-baseline { % => Cell
|
|
|
98 |
dup box-container-get-first-data % => Cell First
|
|
|
99 |
dup /null eq {
|
|
|
100 |
pop pop 0
|
|
|
101 |
} {
|
|
|
102 |
get-baseline exch pop
|
|
|
103 |
} ifelse
|
|
|
104 |
} def
|
|
|
105 |
|
|
|
106 |
/box-table-cell-get-colspan {
|
|
|
107 |
/Colspan get
|
|
|
108 |
} def
|
|
|
109 |
|
|
|
110 |
/box-table-cell-get-rowspan {
|
|
|
111 |
/Rowspan get
|
|
|
112 |
} def
|
|
|
113 |
|
|
|
114 |
/box-table-cell-put-colspan {
|
|
|
115 |
exch /Colspan exch put
|
|
|
116 |
} def
|
|
|
117 |
|
|
|
118 |
/box-table-cell-put-rowspan {
|
|
|
119 |
exch /Rowspan exch put
|
|
|
120 |
} def
|
|
|
121 |
|
|
|
122 |
/box-table-cell-reflow { % => Context Parent Cell
|
|
|
123 |
% Determine upper-left _content_ corner position of current box
|
|
|
124 |
1 index get-current-x
|
|
|
125 |
1 index get-extra-left add
|
|
|
126 |
1 index put-left % => Content Parent Cell
|
|
|
127 |
|
|
|
128 |
% NOTE: Table cell margin is used as a cell-spacing value
|
|
|
129 |
1 index get-current-y
|
|
|
130 |
1 index get-border-top-width sub
|
|
|
131 |
1 index get-padding-top sub
|
|
|
132 |
1 index put-top % => Content Parent Cell
|
|
|
133 |
|
|
|
134 |
% CSS 2.1:
|
|
|
135 |
% Floats, absolutely positioned elements, inline-blocks, table-cells, and elements with 'overflow' other than
|
|
|
136 |
% 'visible' establish new block formatting contexts.
|
|
|
137 |
2 index context-push
|
|
|
138 |
dup get-uid
|
|
|
139 |
3 index context-push-container-uid
|
|
|
140 |
|
|
|
141 |
% Reflow cell content
|
|
|
142 |
2 index 1 index
|
|
|
143 |
box-container-reflow-content % => Content Parent Cell
|
|
|
144 |
|
|
|
145 |
% Extend the table cell height to fit all contained floats
|
|
|
146 |
% Determine the bottom edge corrdinate of the bottommost float
|
|
|
147 |
2 index context-float-bottom % => Content Parent Cell FloatBottom
|
|
|
148 |
dup /null ne {
|
|
|
149 |
1 index box-generic-extend-height
|
|
|
150 |
} {
|
|
|
151 |
pop
|
|
|
152 |
} ifelse % => Content Parent Cell
|
|
|
153 |
|
|
|
154 |
% Restore old context
|
|
|
155 |
2 index context-pop-container-uid
|
|
|
156 |
2 index context-pop
|
|
|
157 |
|
|
|
158 |
pop pop pop
|
|
|
159 |
} def
|
|
|
160 |
|
|
|
161 |
/box-table-cell-setup-methods {
|
|
|
162 |
dup /Methods get
|
|
|
163 |
dup /reflow {box-table-cell-reflow} put
|
|
|
164 |
pop pop
|
|
|
165 |
} def
|
|
|
166 |
|