, , , script body, , . , appendChild innerHTML, , , , .
onload, . (SVG?), - -, 7px.
...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>get computed width in pixels in Opera</title>
<script type="application/javascript">
function getStyle(element, styleProp)
{
return element.currentStyle ? element.currentStyle[styleProp] : getComputedStyle(element, null).getPropertyValue(styleProp);
}
function textDiv(textContent, className)
{
var tmp = document.createElement('div');
if (className) tmp.className = className;
tmp.appendChild(document.createTextNode(textContent));
return tmp;
}
window.onload = function()
{
var box = document.getElementById('box'),glyph = box.appendChild(textDiv('g', 'glyph')),size=500;
glyph.style.position = 'absolute';
document.getElementById('status').appendChild(document.createTextNode(document.getElementById('box').firstChild.scrollWidth+'px'));
}
</script>
</head>
<body>
<div id="status"></div>
<div id="box"></div>
</body>
</html>