-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Presence of xmlns attribute causes HTML5Shiv to Fail in IE8 #167
Comments
The SO question seems different, as the Operator stated
Putting |
Unfortunaley, I can't really replicate this issue using standard conform markup. This is my HTML: <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<title></title>
<style>
section {
margin: 10px;
padding: 10px;
border: 3px solid #000;
}
svg section,
section section {
border-color: red;
}
</style>
<script src="../src/html5shiv-printshiv.js"></script>
</head>
<body>
<section>
test
</section>
<section>
test
<svg width="400" height="110" xmlns="http://www.w3.org/2000/svg">
<rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
</svg>
</section>
<section>test</section>
<script>
if(document.querySelectorAll){
var section = document.querySelectorAll('section');
for(var i = 0; i < section.length; i++){
console.log(section[i].parentNode)
}
}
</script>
</body>
</html> The only way I can replicate that something is going wrong is by using a) a namespace (polyglot HTML5) and b) do not explicitly close the rect element. |
I had the same issue and it was the xmlns attribute in an inline SVG file (in the ). Even though IE8 isn't supposed to recognize SVGs... removing xmlns from the allowed the shiv to work correctly. |
Presence of the xmlns attribute causes the HTML5Shiv to fail.
Example instance:
element I have an element with the attribute xmlns="http://www.w3.org/2000/svg" . When testing in IE8 that line causes the HTML5Shiv to fail after that point. Removing that attribute "fixes" the shiv.In the
Issue only appeared in Internet Explorer 8 but fine in IE6 and IE7. Didn't test in other non-HTML5 supported browsers.
Found a similar bug report in stack overflow here: http://stackoverflow.com/questions/12619875/html5-block-level-elements-failing-in-ie-with-html5shiv-or-modernizr
The text was updated successfully, but these errors were encountered: