getWidth/getHeight implementation for web