…a blog about ubuntu, sublime text and the web

Be careful when playing with clientWidth and masking SVG elements.

Each element "hidden" in <defs> will have a zero clientWidth, clientTop etc. in Firefox.

<svg xmlns="" version="1.1"
  width="100%" height="100%" xlink="">
    rx="10%" ry="20%" cx="50%" cy="55%">
        rx="10%" ry="20%" cx="50%" cy="55%">

To get the real dimensions, you'll have to clone the element and insert it as a direct child of the SVG tag. This applies to the current Firefox version - 22.0.