I'm embarassed to admit that I can't find the standards-compliant method to modify CSS properties using Javascript. Or at least, I assume so, due to the following:
The following piece of code works fine in Firefox/WebKit without a DOCTYPE declaration, but doesn't work with the doctype specified (either HTML 4 or 5):
function setWindowSize(width, height) {
console.log("Syncing dimensions:",width,height); // prints correct values
var container = document.getElementById('canvasProxy');
console.log(container); // prints valid element
console.log(container.style); // prints valid object
container.style['width'] = width;
container.style['height'] = height;
console.log(container.style['width'], container.style['height']); // prints empty values
}
where canvas proxy is simply defined as:
<div id="canvasProxy"></div>
and has no style associated with it. The above code does not execute until after the DOM has loaded.
style.setProperty and style.getPropertyCSSValue also fail to work. So uh...what's the correct form? Am I going crazy?
(I'm betting that jQuery could handle this just fine, but I'm trying to keep page size at an absolute minimum in this particular case.)