Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (26 sloc) 825 Bytes
title slug category tags
SVG clientWidth in Firefox
web, firefox, svg

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.