Element#getDimensions returns 0,0 when the element has ancestors set to display:none.
The current implementations sets only the element itself to display:block and visibility:hidden before checking it's dimensions.
When doing this for all display:none ancestors as well the dimensions will always return correctly.
I've added a patch with unit test, and a test-page
One thing to note is that I've removed the Safari bug from the current implementation, as tests passed. The Safari bug involves all values returning null when an element is set to display:none. I'm not able to test this on Safari2, but if it's still required I can work it back in.