Fixing Util.getRenderedDimensions so it assigns units to positional values. Thanks Wally for the report. r=euzuro (closes #1570)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7329 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-06-07 15:17:10 +00:00
parent aa486090f1
commit bed7f208ab
2 changed files with 19 additions and 3 deletions

View File

@@ -782,6 +782,20 @@
t.ok(ret == g_TestVal3, "try returns first sucessfully executed function's return");
}
function test_getRenderedDimensions(t) {
t.plan(2);
var content = (new Array(100)).join("foo ");
// test with fixed width
var fw = OpenLayers.Util.getRenderedDimensions(content, {w: 20});
t.eq(fw.w, 20, "got the fixed width");
// test with fixed height
var fh = OpenLayers.Util.getRenderedDimensions(content, {h: 15});
t.eq(fh.h, 15, "got the fixed height");
}
</script>
</head>