Subversion Repositories Applications.papyrus

Rev

Rev 1318 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1318 Rev 1422
1
/*
1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
3
	All Rights Reserved.
4
 
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
9
*/
-
 
10
 
-
 
11
 
10
 
12
 
11
dojo.provide("dojo.html.layout");
13
dojo.provide("dojo.html.layout");
12
dojo.require("dojo.html.common");
14
dojo.require("dojo.html.common");
13
dojo.require("dojo.html.style");
15
dojo.require("dojo.html.style");
14
dojo.require("dojo.html.display");
16
dojo.require("dojo.html.display");
15
dojo.html.sumAncestorProperties = function (node, prop) {
17
dojo.html.sumAncestorProperties = function (node, prop) {
16
	node = dojo.byId(node);
18
	node = dojo.byId(node);
17
	if (!node) {
19
	if (!node) {
18
		return 0;
20
		return 0;
19
	}
21
	}
20
	var retVal = 0;
22
	var retVal = 0;
21
	while (node) {
23
	while (node) {
22
		if (dojo.html.getComputedStyle(node, "position") == "fixed") {
24
		if (dojo.html.getComputedStyle(node, "position") == "fixed") {
23
			return 0;
25
			return 0;
24
		}
26
		}
25
		var val = node[prop];
27
		var val = node[prop];
26
		if (val) {
28
		if (val) {
27
			retVal += val - 0;
29
			retVal += val - 0;
28
			if (node == dojo.body()) {
30
			if (node == dojo.body()) {
29
				break;
31
				break;
30
			}
32
			}
31
		}
33
		}
32
		node = node.parentNode;
34
		node = node.parentNode;
33
	}
35
	}
34
	return retVal;
36
	return retVal;
35
};
37
};
36
dojo.html.setStyleAttributes = function (node, attributes) {
38
dojo.html.setStyleAttributes = function (node, attributes) {
37
	node = dojo.byId(node);
39
	node = dojo.byId(node);
38
	var splittedAttribs = attributes.replace(/(;)?\s*$/, "").split(";");
40
	var splittedAttribs = attributes.replace(/(;)?\s*$/, "").split(";");
39
	for (var i = 0; i < splittedAttribs.length; i++) {
41
	for (var i = 0; i < splittedAttribs.length; i++) {
40
		var nameValue = splittedAttribs[i].split(":");
42
		var nameValue = splittedAttribs[i].split(":");
41
		var name = nameValue[0].replace(/\s*$/, "").replace(/^\s*/, "").toLowerCase();
43
		var name = nameValue[0].replace(/\s*$/, "").replace(/^\s*/, "").toLowerCase();
42
		var value = nameValue[1].replace(/\s*$/, "").replace(/^\s*/, "");
44
		var value = nameValue[1].replace(/\s*$/, "").replace(/^\s*/, "");
43
		switch (name) {
45
		switch (name) {
44
		  case "opacity":
46
		  case "opacity":
45
			dojo.html.setOpacity(node, value);
47
			dojo.html.setOpacity(node, value);
46
			break;
48
			break;
47
		  case "content-height":
49
		  case "content-height":
48
			dojo.html.setContentBox(node, {height:value});
50
			dojo.html.setContentBox(node, {height:value});
49
			break;
51
			break;
50
		  case "content-width":
52
		  case "content-width":
51
			dojo.html.setContentBox(node, {width:value});
53
			dojo.html.setContentBox(node, {width:value});
52
			break;
54
			break;
53
		  case "outer-height":
55
		  case "outer-height":
54
			dojo.html.setMarginBox(node, {height:value});
56
			dojo.html.setMarginBox(node, {height:value});
55
			break;
57
			break;
56
		  case "outer-width":
58
		  case "outer-width":
57
			dojo.html.setMarginBox(node, {width:value});
59
			dojo.html.setMarginBox(node, {width:value});
58
			break;
60
			break;
59
		  default:
61
		  default:
60
			node.style[dojo.html.toCamelCase(name)] = value;
62
			node.style[dojo.html.toCamelCase(name)] = value;
61
		}
63
		}
62
	}
64
	}
63
};
65
};
64
dojo.html.boxSizing = {MARGIN_BOX:"margin-box", BORDER_BOX:"border-box", PADDING_BOX:"padding-box", CONTENT_BOX:"content-box"};
66
dojo.html.boxSizing = {MARGIN_BOX:"margin-box", BORDER_BOX:"border-box", PADDING_BOX:"padding-box", CONTENT_BOX:"content-box"};
65
dojo.html.getAbsolutePosition = dojo.html.abs = function (node, includeScroll, boxType) {
67
dojo.html.getAbsolutePosition = dojo.html.abs = function (node, includeScroll, boxType) {
66
	node = dojo.byId(node, node.ownerDocument);
68
	node = dojo.byId(node, node.ownerDocument);
67
	var ret = {x:0, y:0};
69
	var ret = {x:0, y:0};
68
	var bs = dojo.html.boxSizing;
70
	var bs = dojo.html.boxSizing;
69
	if (!boxType) {
71
	if (!boxType) {
70
		boxType = bs.CONTENT_BOX;
72
		boxType = bs.CONTENT_BOX;
71
	}
73
	}
72
	var nativeBoxType = 2;
74
	var nativeBoxType = 2;
73
	var targetBoxType;
75
	var targetBoxType;
74
	switch (boxType) {
76
	switch (boxType) {
75
	  case bs.MARGIN_BOX:
77
	  case bs.MARGIN_BOX:
76
		targetBoxType = 3;
78
		targetBoxType = 3;
77
		break;
79
		break;
78
	  case bs.BORDER_BOX:
80
	  case bs.BORDER_BOX:
79
		targetBoxType = 2;
81
		targetBoxType = 2;
80
		break;
82
		break;
81
	  case bs.PADDING_BOX:
83
	  case bs.PADDING_BOX:
82
	  default:
84
	  default:
83
		targetBoxType = 1;
85
		targetBoxType = 1;
84
		break;
86
		break;
85
	  case bs.CONTENT_BOX:
87
	  case bs.CONTENT_BOX:
86
		targetBoxType = 0;
88
		targetBoxType = 0;
87
		break;
89
		break;
88
	}
90
	}
89
	var h = dojo.render.html;
91
	var h = dojo.render.html;
90
	var db = document["body"] || document["documentElement"];
92
	var db = document["body"] || document["documentElement"];
91
	if (h.ie) {
93
	if (h.ie) {
92
		with (node.getBoundingClientRect()) {
94
		with (node.getBoundingClientRect()) {
93
			ret.x = left - 2;
95
			ret.x = left - 2;
94
			ret.y = top - 2;
96
			ret.y = top - 2;
95
		}
97
		}
96
	} else {
98
	} else {
97
		if (document.getBoxObjectFor) {
99
		if (document.getBoxObjectFor) {
98
			nativeBoxType = 1;
100
			nativeBoxType = 1;
99
			try {
101
			try {
100
				var bo = document.getBoxObjectFor(node);
102
				var bo = document.getBoxObjectFor(node);
101
				ret.x = bo.x - dojo.html.sumAncestorProperties(node, "scrollLeft");
103
				ret.x = bo.x - dojo.html.sumAncestorProperties(node, "scrollLeft");
102
				ret.y = bo.y - dojo.html.sumAncestorProperties(node, "scrollTop");
104
				ret.y = bo.y - dojo.html.sumAncestorProperties(node, "scrollTop");
103
			}
105
			}
104
			catch (e) {
106
			catch (e) {
105
			}
107
			}
106
		} else {
108
		} else {
107
			if (node["offsetParent"]) {
109
			if (node["offsetParent"]) {
108
				var endNode;
110
				var endNode;
109
				if ((h.safari) && (node.style.getPropertyValue("position") == "absolute") && (node.parentNode == db)) {
111
				if ((h.safari) && (node.style.getPropertyValue("position") == "absolute") && (node.parentNode == db)) {
110
					endNode = db;
112
					endNode = db;
111
				} else {
113
				} else {
112
					endNode = db.parentNode;
114
					endNode = db.parentNode;
113
				}
115
				}
114
				if (node.parentNode != db) {
116
				if (node.parentNode != db) {
115
					var nd = node;
117
					var nd = node;
116
					if (dojo.render.html.opera) {
118
					if (dojo.render.html.opera) {
117
						nd = db;
119
						nd = db;
118
					}
120
					}
119
					ret.x -= dojo.html.sumAncestorProperties(nd, "scrollLeft");
121
					ret.x -= dojo.html.sumAncestorProperties(nd, "scrollLeft");
120
					ret.y -= dojo.html.sumAncestorProperties(nd, "scrollTop");
122
					ret.y -= dojo.html.sumAncestorProperties(nd, "scrollTop");
121
				}
123
				}
122
				var curnode = node;
124
				var curnode = node;
123
				do {
125
				do {
124
					var n = curnode["offsetLeft"];
126
					var n = curnode["offsetLeft"];
125
					if (!h.opera || n > 0) {
127
					if (!h.opera || n > 0) {
126
						ret.x += isNaN(n) ? 0 : n;
128
						ret.x += isNaN(n) ? 0 : n;
127
					}
129
					}
128
					var m = curnode["offsetTop"];
130
					var m = curnode["offsetTop"];
129
					ret.y += isNaN(m) ? 0 : m;
131
					ret.y += isNaN(m) ? 0 : m;
130
					curnode = curnode.offsetParent;
132
					curnode = curnode.offsetParent;
131
				} while ((curnode != endNode) && (curnode != null));
133
				} while ((curnode != endNode) && (curnode != null));
132
			} else {
134
			} else {
133
				if (node["x"] && node["y"]) {
135
				if (node["x"] && node["y"]) {
134
					ret.x += isNaN(node.x) ? 0 : node.x;
136
					ret.x += isNaN(node.x) ? 0 : node.x;
135
					ret.y += isNaN(node.y) ? 0 : node.y;
137
					ret.y += isNaN(node.y) ? 0 : node.y;
136
				}
138
				}
137
			}
139
			}
138
		}
140
		}
139
	}
141
	}
140
	if (includeScroll) {
142
	if (includeScroll) {
141
		var scroll = dojo.html.getScroll();
143
		var scroll = dojo.html.getScroll();
142
		ret.y += scroll.top;
144
		ret.y += scroll.top;
143
		ret.x += scroll.left;
145
		ret.x += scroll.left;
144
	}
146
	}
145
	var extentFuncArray = [dojo.html.getPaddingExtent, dojo.html.getBorderExtent, dojo.html.getMarginExtent];
147
	var extentFuncArray = [dojo.html.getPaddingExtent, dojo.html.getBorderExtent, dojo.html.getMarginExtent];
146
	if (nativeBoxType > targetBoxType) {
148
	if (nativeBoxType > targetBoxType) {
147
		for (var i = targetBoxType; i < nativeBoxType; ++i) {
149
		for (var i = targetBoxType; i < nativeBoxType; ++i) {
148
			ret.y += extentFuncArray[i](node, "top");
150
			ret.y += extentFuncArray[i](node, "top");
149
			ret.x += extentFuncArray[i](node, "left");
151
			ret.x += extentFuncArray[i](node, "left");
150
		}
152
		}
151
	} else {
153
	} else {
152
		if (nativeBoxType < targetBoxType) {
154
		if (nativeBoxType < targetBoxType) {
153
			for (var i = targetBoxType; i > nativeBoxType; --i) {
155
			for (var i = targetBoxType; i > nativeBoxType; --i) {
154
				ret.y -= extentFuncArray[i - 1](node, "top");
156
				ret.y -= extentFuncArray[i - 1](node, "top");
155
				ret.x -= extentFuncArray[i - 1](node, "left");
157
				ret.x -= extentFuncArray[i - 1](node, "left");
156
			}
158
			}
157
		}
159
		}
158
	}
160
	}
159
	ret.top = ret.y;
161
	ret.top = ret.y;
160
	ret.left = ret.x;
162
	ret.left = ret.x;
161
	return ret;
163
	return ret;
162
};
164
};
163
dojo.html.isPositionAbsolute = function (node) {
165
dojo.html.isPositionAbsolute = function (node) {
164
	return (dojo.html.getComputedStyle(node, "position") == "absolute");
166
	return (dojo.html.getComputedStyle(node, "position") == "absolute");
165
};
167
};
166
dojo.html._sumPixelValues = function (node, selectors, autoIsZero) {
168
dojo.html._sumPixelValues = function (node, selectors, autoIsZero) {
167
	var total = 0;
169
	var total = 0;
168
	for (var x = 0; x < selectors.length; x++) {
170
	for (var x = 0; x < selectors.length; x++) {
169
		total += dojo.html.getPixelValue(node, selectors[x], autoIsZero);
171
		total += dojo.html.getPixelValue(node, selectors[x], autoIsZero);
170
	}
172
	}
171
	return total;
173
	return total;
172
};
174
};
173
dojo.html.getMargin = function (node) {
175
dojo.html.getMargin = function (node) {
174
	return {width:dojo.html._sumPixelValues(node, ["margin-left", "margin-right"], (dojo.html.getComputedStyle(node, "position") == "absolute")), height:dojo.html._sumPixelValues(node, ["margin-top", "margin-bottom"], (dojo.html.getComputedStyle(node, "position") == "absolute"))};
176
	return {width:dojo.html._sumPixelValues(node, ["margin-left", "margin-right"], (dojo.html.getComputedStyle(node, "position") == "absolute")), height:dojo.html._sumPixelValues(node, ["margin-top", "margin-bottom"], (dojo.html.getComputedStyle(node, "position") == "absolute"))};
175
};
177
};
176
dojo.html.getBorder = function (node) {
178
dojo.html.getBorder = function (node) {
177
	return {width:dojo.html.getBorderExtent(node, "left") + dojo.html.getBorderExtent(node, "right"), height:dojo.html.getBorderExtent(node, "top") + dojo.html.getBorderExtent(node, "bottom")};
179
	return {width:dojo.html.getBorderExtent(node, "left") + dojo.html.getBorderExtent(node, "right"), height:dojo.html.getBorderExtent(node, "top") + dojo.html.getBorderExtent(node, "bottom")};
178
};
180
};
179
dojo.html.getBorderExtent = function (node, side) {
181
dojo.html.getBorderExtent = function (node, side) {
180
	return (dojo.html.getStyle(node, "border-" + side + "-style") == "none" ? 0 : dojo.html.getPixelValue(node, "border-" + side + "-width"));
182
	return (dojo.html.getStyle(node, "border-" + side + "-style") == "none" ? 0 : dojo.html.getPixelValue(node, "border-" + side + "-width"));
181
};
183
};
182
dojo.html.getMarginExtent = function (node, side) {
184
dojo.html.getMarginExtent = function (node, side) {
183
	return dojo.html._sumPixelValues(node, ["margin-" + side], dojo.html.isPositionAbsolute(node));
185
	return dojo.html._sumPixelValues(node, ["margin-" + side], dojo.html.isPositionAbsolute(node));
184
};
186
};
185
dojo.html.getPaddingExtent = function (node, side) {
187
dojo.html.getPaddingExtent = function (node, side) {
186
	return dojo.html._sumPixelValues(node, ["padding-" + side], true);
188
	return dojo.html._sumPixelValues(node, ["padding-" + side], true);
187
};
189
};
188
dojo.html.getPadding = function (node) {
190
dojo.html.getPadding = function (node) {
189
	return {width:dojo.html._sumPixelValues(node, ["padding-left", "padding-right"], true), height:dojo.html._sumPixelValues(node, ["padding-top", "padding-bottom"], true)};
191
	return {width:dojo.html._sumPixelValues(node, ["padding-left", "padding-right"], true), height:dojo.html._sumPixelValues(node, ["padding-top", "padding-bottom"], true)};
190
};
192
};
191
dojo.html.getPadBorder = function (node) {
193
dojo.html.getPadBorder = function (node) {
192
	var pad = dojo.html.getPadding(node);
194
	var pad = dojo.html.getPadding(node);
193
	var border = dojo.html.getBorder(node);
195
	var border = dojo.html.getBorder(node);
194
	return {width:pad.width + border.width, height:pad.height + border.height};
196
	return {width:pad.width + border.width, height:pad.height + border.height};
195
};
197
};
196
dojo.html.getBoxSizing = function (node) {
198
dojo.html.getBoxSizing = function (node) {
197
	var h = dojo.render.html;
199
	var h = dojo.render.html;
198
	var bs = dojo.html.boxSizing;
200
	var bs = dojo.html.boxSizing;
199
	if (((h.ie) || (h.opera)) && node.nodeName.toLowerCase() != "img") {
201
	if (((h.ie) || (h.opera)) && node.nodeName.toLowerCase() != "img") {
200
		var cm = document["compatMode"];
202
		var cm = document["compatMode"];
201
		if ((cm == "BackCompat") || (cm == "QuirksMode")) {
203
		if ((cm == "BackCompat") || (cm == "QuirksMode")) {
202
			return bs.BORDER_BOX;
204
			return bs.BORDER_BOX;
203
		} else {
205
		} else {
204
			return bs.CONTENT_BOX;
206
			return bs.CONTENT_BOX;
205
		}
207
		}
206
	} else {
208
	} else {
207
		if (arguments.length == 0) {
209
		if (arguments.length == 0) {
208
			node = document.documentElement;
210
			node = document.documentElement;
209
		}
211
		}
210
		var sizing;
212
		var sizing;
211
		if (!h.ie) {
213
		if (!h.ie) {
212
			sizing = dojo.html.getStyle(node, "-moz-box-sizing");
214
			sizing = dojo.html.getStyle(node, "-moz-box-sizing");
213
			if (!sizing) {
215
			if (!sizing) {
214
				sizing = dojo.html.getStyle(node, "box-sizing");
216
				sizing = dojo.html.getStyle(node, "box-sizing");
215
			}
217
			}
216
		}
218
		}
217
		return (sizing ? sizing : bs.CONTENT_BOX);
219
		return (sizing ? sizing : bs.CONTENT_BOX);
218
	}
220
	}
219
};
221
};
220
dojo.html.isBorderBox = function (node) {
222
dojo.html.isBorderBox = function (node) {
221
	return (dojo.html.getBoxSizing(node) == dojo.html.boxSizing.BORDER_BOX);
223
	return (dojo.html.getBoxSizing(node) == dojo.html.boxSizing.BORDER_BOX);
222
};
224
};
223
dojo.html.getBorderBox = function (node) {
225
dojo.html.getBorderBox = function (node) {
224
	node = dojo.byId(node);
226
	node = dojo.byId(node);
225
	return {width:node.offsetWidth, height:node.offsetHeight};
227
	return {width:node.offsetWidth, height:node.offsetHeight};
226
};
228
};
227
dojo.html.getPaddingBox = function (node) {
229
dojo.html.getPaddingBox = function (node) {
228
	var box = dojo.html.getBorderBox(node);
230
	var box = dojo.html.getBorderBox(node);
229
	var border = dojo.html.getBorder(node);
231
	var border = dojo.html.getBorder(node);
230
	return {width:box.width - border.width, height:box.height - border.height};
232
	return {width:box.width - border.width, height:box.height - border.height};
231
};
233
};
232
dojo.html.getContentBox = function (node) {
234
dojo.html.getContentBox = function (node) {
233
	node = dojo.byId(node);
235
	node = dojo.byId(node);
234
	var padborder = dojo.html.getPadBorder(node);
236
	var padborder = dojo.html.getPadBorder(node);
235
	return {width:node.offsetWidth - padborder.width, height:node.offsetHeight - padborder.height};
237
	return {width:node.offsetWidth - padborder.width, height:node.offsetHeight - padborder.height};
236
};
238
};
237
dojo.html.setContentBox = function (node, args) {
239
dojo.html.setContentBox = function (node, args) {
238
	node = dojo.byId(node);
240
	node = dojo.byId(node);
239
	var width = 0;
241
	var width = 0;
240
	var height = 0;
242
	var height = 0;
241
	var isbb = dojo.html.isBorderBox(node);
243
	var isbb = dojo.html.isBorderBox(node);
242
	var padborder = (isbb ? dojo.html.getPadBorder(node) : {width:0, height:0});
244
	var padborder = (isbb ? dojo.html.getPadBorder(node) : {width:0, height:0});
243
	var ret = {};
245
	var ret = {};
244
	if (typeof args.width != "undefined") {
246
	if (typeof args.width != "undefined") {
245
		width = args.width + padborder.width;
247
		width = args.width + padborder.width;
246
		ret.width = dojo.html.setPositivePixelValue(node, "width", width);
248
		ret.width = dojo.html.setPositivePixelValue(node, "width", width);
247
	}
249
	}
248
	if (typeof args.height != "undefined") {
250
	if (typeof args.height != "undefined") {
249
		height = args.height + padborder.height;
251
		height = args.height + padborder.height;
250
		ret.height = dojo.html.setPositivePixelValue(node, "height", height);
252
		ret.height = dojo.html.setPositivePixelValue(node, "height", height);
251
	}
253
	}
252
	return ret;
254
	return ret;
253
};
255
};
254
dojo.html.getMarginBox = function (node) {
256
dojo.html.getMarginBox = function (node) {
255
	var borderbox = dojo.html.getBorderBox(node);
257
	var borderbox = dojo.html.getBorderBox(node);
256
	var margin = dojo.html.getMargin(node);
258
	var margin = dojo.html.getMargin(node);
257
	return {width:borderbox.width + margin.width, height:borderbox.height + margin.height};
259
	return {width:borderbox.width + margin.width, height:borderbox.height + margin.height};
258
};
260
};
259
dojo.html.setMarginBox = function (node, args) {
261
dojo.html.setMarginBox = function (node, args) {
260
	node = dojo.byId(node);
262
	node = dojo.byId(node);
261
	var width = 0;
263
	var width = 0;
262
	var height = 0;
264
	var height = 0;
263
	var isbb = dojo.html.isBorderBox(node);
265
	var isbb = dojo.html.isBorderBox(node);
264
	var padborder = (!isbb ? dojo.html.getPadBorder(node) : {width:0, height:0});
266
	var padborder = (!isbb ? dojo.html.getPadBorder(node) : {width:0, height:0});
265
	var margin = dojo.html.getMargin(node);
267
	var margin = dojo.html.getMargin(node);
266
	var ret = {};
268
	var ret = {};
267
	if (typeof args.width != "undefined") {
269
	if (typeof args.width != "undefined") {
268
		width = args.width - padborder.width;
270
		width = args.width - padborder.width;
269
		width -= margin.width;
271
		width -= margin.width;
270
		ret.width = dojo.html.setPositivePixelValue(node, "width", width);
272
		ret.width = dojo.html.setPositivePixelValue(node, "width", width);
271
	}
273
	}
272
	if (typeof args.height != "undefined") {
274
	if (typeof args.height != "undefined") {
273
		height = args.height - padborder.height;
275
		height = args.height - padborder.height;
274
		height -= margin.height;
276
		height -= margin.height;
275
		ret.height = dojo.html.setPositivePixelValue(node, "height", height);
277
		ret.height = dojo.html.setPositivePixelValue(node, "height", height);
276
	}
278
	}
277
	return ret;
279
	return ret;
278
};
280
};
279
dojo.html.getElementBox = function (node, type) {
281
dojo.html.getElementBox = function (node, type) {
280
	var bs = dojo.html.boxSizing;
282
	var bs = dojo.html.boxSizing;
281
	switch (type) {
283
	switch (type) {
282
	  case bs.MARGIN_BOX:
284
	  case bs.MARGIN_BOX:
283
		return dojo.html.getMarginBox(node);
285
		return dojo.html.getMarginBox(node);
284
	  case bs.BORDER_BOX:
286
	  case bs.BORDER_BOX:
285
		return dojo.html.getBorderBox(node);
287
		return dojo.html.getBorderBox(node);
286
	  case bs.PADDING_BOX:
288
	  case bs.PADDING_BOX:
287
		return dojo.html.getPaddingBox(node);
289
		return dojo.html.getPaddingBox(node);
288
	  case bs.CONTENT_BOX:
290
	  case bs.CONTENT_BOX:
289
	  default:
291
	  default:
290
		return dojo.html.getContentBox(node);
292
		return dojo.html.getContentBox(node);
291
	}
293
	}
292
};
294
};
293
dojo.html.toCoordinateObject = dojo.html.toCoordinateArray = function (coords, includeScroll, boxtype) {
295
dojo.html.toCoordinateObject = dojo.html.toCoordinateArray = function (coords, includeScroll, boxtype) {
294
	if (coords instanceof Array || typeof coords == "array") {
296
	if (coords instanceof Array || typeof coords == "array") {
295
		dojo.deprecated("dojo.html.toCoordinateArray", "use dojo.html.toCoordinateObject({left: , top: , width: , height: }) instead", "0.5");
297
		dojo.deprecated("dojo.html.toCoordinateArray", "use dojo.html.toCoordinateObject({left: , top: , width: , height: }) instead", "0.5");
296
		while (coords.length < 4) {
298
		while (coords.length < 4) {
297
			coords.push(0);
299
			coords.push(0);
298
		}
300
		}
299
		while (coords.length > 4) {
301
		while (coords.length > 4) {
300
			coords.pop();
302
			coords.pop();
301
		}
303
		}
302
		var ret = {left:coords[0], top:coords[1], width:coords[2], height:coords[3]};
304
		var ret = {left:coords[0], top:coords[1], width:coords[2], height:coords[3]};
303
	} else {
305
	} else {
304
		if (!coords.nodeType && !(coords instanceof String || typeof coords == "string") && ("width" in coords || "height" in coords || "left" in coords || "x" in coords || "top" in coords || "y" in coords)) {
306
		if (!coords.nodeType && !(coords instanceof String || typeof coords == "string") && ("width" in coords || "height" in coords || "left" in coords || "x" in coords || "top" in coords || "y" in coords)) {
305
			var ret = {left:coords.left || coords.x || 0, top:coords.top || coords.y || 0, width:coords.width || 0, height:coords.height || 0};
307
			var ret = {left:coords.left || coords.x || 0, top:coords.top || coords.y || 0, width:coords.width || 0, height:coords.height || 0};
306
		} else {
308
		} else {
307
			var node = dojo.byId(coords);
309
			var node = dojo.byId(coords);
308
			var pos = dojo.html.abs(node, includeScroll, boxtype);
310
			var pos = dojo.html.abs(node, includeScroll, boxtype);
309
			var marginbox = dojo.html.getMarginBox(node);
311
			var marginbox = dojo.html.getMarginBox(node);
310
			var ret = {left:pos.left, top:pos.top, width:marginbox.width, height:marginbox.height};
312
			var ret = {left:pos.left, top:pos.top, width:marginbox.width, height:marginbox.height};
311
		}
313
		}
312
	}
314
	}
313
	ret.x = ret.left;
315
	ret.x = ret.left;
314
	ret.y = ret.top;
316
	ret.y = ret.top;
315
	return ret;
317
	return ret;
316
};
318
};
317
dojo.html.setMarginBoxWidth = dojo.html.setOuterWidth = function (node, width) {
319
dojo.html.setMarginBoxWidth = dojo.html.setOuterWidth = function (node, width) {
318
	return dojo.html._callDeprecated("setMarginBoxWidth", "setMarginBox", arguments, "width");
320
	return dojo.html._callDeprecated("setMarginBoxWidth", "setMarginBox", arguments, "width");
319
};
321
};
320
dojo.html.setMarginBoxHeight = dojo.html.setOuterHeight = function () {
322
dojo.html.setMarginBoxHeight = dojo.html.setOuterHeight = function () {
321
	return dojo.html._callDeprecated("setMarginBoxHeight", "setMarginBox", arguments, "height");
323
	return dojo.html._callDeprecated("setMarginBoxHeight", "setMarginBox", arguments, "height");
322
};
324
};
323
dojo.html.getMarginBoxWidth = dojo.html.getOuterWidth = function () {
325
dojo.html.getMarginBoxWidth = dojo.html.getOuterWidth = function () {
324
	return dojo.html._callDeprecated("getMarginBoxWidth", "getMarginBox", arguments, null, "width");
326
	return dojo.html._callDeprecated("getMarginBoxWidth", "getMarginBox", arguments, null, "width");
325
};
327
};
326
dojo.html.getMarginBoxHeight = dojo.html.getOuterHeight = function () {
328
dojo.html.getMarginBoxHeight = dojo.html.getOuterHeight = function () {
327
	return dojo.html._callDeprecated("getMarginBoxHeight", "getMarginBox", arguments, null, "height");
329
	return dojo.html._callDeprecated("getMarginBoxHeight", "getMarginBox", arguments, null, "height");
328
};
330
};
329
dojo.html.getTotalOffset = function (node, type, includeScroll) {
331
dojo.html.getTotalOffset = function (node, type, includeScroll) {
330
	return dojo.html._callDeprecated("getTotalOffset", "getAbsolutePosition", arguments, null, type);
332
	return dojo.html._callDeprecated("getTotalOffset", "getAbsolutePosition", arguments, null, type);
331
};
333
};
332
dojo.html.getAbsoluteX = function (node, includeScroll) {
334
dojo.html.getAbsoluteX = function (node, includeScroll) {
333
	return dojo.html._callDeprecated("getAbsoluteX", "getAbsolutePosition", arguments, null, "x");
335
	return dojo.html._callDeprecated("getAbsoluteX", "getAbsolutePosition", arguments, null, "x");
334
};
336
};
335
dojo.html.getAbsoluteY = function (node, includeScroll) {
337
dojo.html.getAbsoluteY = function (node, includeScroll) {
336
	return dojo.html._callDeprecated("getAbsoluteY", "getAbsolutePosition", arguments, null, "y");
338
	return dojo.html._callDeprecated("getAbsoluteY", "getAbsolutePosition", arguments, null, "y");
337
};
339
};
338
dojo.html.totalOffsetLeft = function (node, includeScroll) {
340
dojo.html.totalOffsetLeft = function (node, includeScroll) {
339
	return dojo.html._callDeprecated("totalOffsetLeft", "getAbsolutePosition", arguments, null, "left");
341
	return dojo.html._callDeprecated("totalOffsetLeft", "getAbsolutePosition", arguments, null, "left");
340
};
342
};
341
dojo.html.totalOffsetTop = function (node, includeScroll) {
343
dojo.html.totalOffsetTop = function (node, includeScroll) {
342
	return dojo.html._callDeprecated("totalOffsetTop", "getAbsolutePosition", arguments, null, "top");
344
	return dojo.html._callDeprecated("totalOffsetTop", "getAbsolutePosition", arguments, null, "top");
343
};
345
};
344
dojo.html.getMarginWidth = function (node) {
346
dojo.html.getMarginWidth = function (node) {
345
	return dojo.html._callDeprecated("getMarginWidth", "getMargin", arguments, null, "width");
347
	return dojo.html._callDeprecated("getMarginWidth", "getMargin", arguments, null, "width");
346
};
348
};
347
dojo.html.getMarginHeight = function (node) {
349
dojo.html.getMarginHeight = function (node) {
348
	return dojo.html._callDeprecated("getMarginHeight", "getMargin", arguments, null, "height");
350
	return dojo.html._callDeprecated("getMarginHeight", "getMargin", arguments, null, "height");
349
};
351
};
350
dojo.html.getBorderWidth = function (node) {
352
dojo.html.getBorderWidth = function (node) {
351
	return dojo.html._callDeprecated("getBorderWidth", "getBorder", arguments, null, "width");
353
	return dojo.html._callDeprecated("getBorderWidth", "getBorder", arguments, null, "width");
352
};
354
};
353
dojo.html.getBorderHeight = function (node) {
355
dojo.html.getBorderHeight = function (node) {
354
	return dojo.html._callDeprecated("getBorderHeight", "getBorder", arguments, null, "height");
356
	return dojo.html._callDeprecated("getBorderHeight", "getBorder", arguments, null, "height");
355
};
357
};
356
dojo.html.getPaddingWidth = function (node) {
358
dojo.html.getPaddingWidth = function (node) {
357
	return dojo.html._callDeprecated("getPaddingWidth", "getPadding", arguments, null, "width");
359
	return dojo.html._callDeprecated("getPaddingWidth", "getPadding", arguments, null, "width");
358
};
360
};
359
dojo.html.getPaddingHeight = function (node) {
361
dojo.html.getPaddingHeight = function (node) {
360
	return dojo.html._callDeprecated("getPaddingHeight", "getPadding", arguments, null, "height");
362
	return dojo.html._callDeprecated("getPaddingHeight", "getPadding", arguments, null, "height");
361
};
363
};
362
dojo.html.getPadBorderWidth = function (node) {
364
dojo.html.getPadBorderWidth = function (node) {
363
	return dojo.html._callDeprecated("getPadBorderWidth", "getPadBorder", arguments, null, "width");
365
	return dojo.html._callDeprecated("getPadBorderWidth", "getPadBorder", arguments, null, "width");
364
};
366
};
365
dojo.html.getPadBorderHeight = function (node) {
367
dojo.html.getPadBorderHeight = function (node) {
366
	return dojo.html._callDeprecated("getPadBorderHeight", "getPadBorder", arguments, null, "height");
368
	return dojo.html._callDeprecated("getPadBorderHeight", "getPadBorder", arguments, null, "height");
367
};
369
};
368
dojo.html.getBorderBoxWidth = dojo.html.getInnerWidth = function () {
370
dojo.html.getBorderBoxWidth = dojo.html.getInnerWidth = function () {
369
	return dojo.html._callDeprecated("getBorderBoxWidth", "getBorderBox", arguments, null, "width");
371
	return dojo.html._callDeprecated("getBorderBoxWidth", "getBorderBox", arguments, null, "width");
370
};
372
};
371
dojo.html.getBorderBoxHeight = dojo.html.getInnerHeight = function () {
373
dojo.html.getBorderBoxHeight = dojo.html.getInnerHeight = function () {
372
	return dojo.html._callDeprecated("getBorderBoxHeight", "getBorderBox", arguments, null, "height");
374
	return dojo.html._callDeprecated("getBorderBoxHeight", "getBorderBox", arguments, null, "height");
373
};
375
};
374
dojo.html.getContentBoxWidth = dojo.html.getContentWidth = function () {
376
dojo.html.getContentBoxWidth = dojo.html.getContentWidth = function () {
375
	return dojo.html._callDeprecated("getContentBoxWidth", "getContentBox", arguments, null, "width");
377
	return dojo.html._callDeprecated("getContentBoxWidth", "getContentBox", arguments, null, "width");
376
};
378
};
377
dojo.html.getContentBoxHeight = dojo.html.getContentHeight = function () {
379
dojo.html.getContentBoxHeight = dojo.html.getContentHeight = function () {
378
	return dojo.html._callDeprecated("getContentBoxHeight", "getContentBox", arguments, null, "height");
380
	return dojo.html._callDeprecated("getContentBoxHeight", "getContentBox", arguments, null, "height");
379
};
381
};
380
dojo.html.setContentBoxWidth = dojo.html.setContentWidth = function (node, width) {
382
dojo.html.setContentBoxWidth = dojo.html.setContentWidth = function (node, width) {
381
	return dojo.html._callDeprecated("setContentBoxWidth", "setContentBox", arguments, "width");
383
	return dojo.html._callDeprecated("setContentBoxWidth", "setContentBox", arguments, "width");
382
};
384
};
383
dojo.html.setContentBoxHeight = dojo.html.setContentHeight = function (node, height) {
385
dojo.html.setContentBoxHeight = dojo.html.setContentHeight = function (node, height) {
384
	return dojo.html._callDeprecated("setContentBoxHeight", "setContentBox", arguments, "height");
386
	return dojo.html._callDeprecated("setContentBoxHeight", "setContentBox", arguments, "height");
385
};
387
};
386
 
388