obtain [width, height] from an element or window