Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
html5 semantic tags + inline-svg = weird bug in old ie #66
results in the
So should self-closing tags within svgs (and, by extension, self-closing tags outside of the core html specs) be disallowed in favour of closing them explicitly? On the surface it seems like an edge case, but as we're taking a mobile first approach inline-svgs could become quite common and would tend to break layouts in ie without this stipulation
added a commit
Jan 27, 2014
I've now tested out #66 (comment) and my hunch was right; the bug can be fixed by adding
Currently html5shiv (which Modernizr consumes) allows redefining the list of elements, but doesn't allow just adding to it, so I created a pull request to achieve this aFarkas/html5shiv#142.
Whether we want to use this approach though is debatable as it's quite an unwieldy dependency to express: 'This module requires html5shiv or modernizr but with a, b, c additional tags added to the list of elements that are shived' - yuk!
A build script where? In build service/products, in which case its an extra overhead in adopting origami components (and an unpredictable one - update to a module version that starts using inline svg and suddenly your product's build needs a new step to process svgs).
Maybe the spec should say 'svgs must either not be inline or not use self-closing tags' I only used inline for ft-header as the ft logo is probably the thing that needs to load quickest anywhere, but for most other use cases an
Longer term, have you seen the new bounty feature in github? Offering a bounty to have html5shiv updated to a better api (aFarkas/html5shiv#142), and pushing for modernizr to adopt something like 'if modernizr is testing for inlinesvg then also shiv all the svg tags' could enable us to stop worrying about this entirely.
@triblondon Just run into same situation.
As turned out, you can use self-closing tags in inlined SVG and keep IE8 still working as expected. For this, surprisingly,
Note, that it has to be removed only for inlined SVG, and not ones, that declared through