Get the correct width and height for svg elements in firefox

This commit fixes #2506

In firefox the offsetParent of svg returns undefined so i implemented a
fallback to getCBoundingClientRect to get the right ones