googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 56 forks source link

IE10 sanitizes a bunch of content attribute values #110

Closed rafaelw closed 11 years ago

rafaelw commented 11 years ago

e.g.

var elmName, attrName;
var el = document.createElement(elmName);
el.setAttribute(attrName, '{{ foo }}');
alert(el.getAttribute(attrName)); // alerts 'null' in IE, but '{{ foo }}' in Gecko/WK/Blink.

E.g. elmName/attrName = input[type='number'] / value

Hixie says content attributes should never be sanitized. IE apparently disagrees.

Sad clown.

arv commented 11 years ago

Clearly an IE bug

rafaelw commented 11 years ago

Yes, but we still need to work in IE. I propose that when template finds, e.g.

<div _foo="{{ bar }}">

that it acts as if it had seen

<div foo="{{ bar }}">

This should cover the case of IE sanitizing attributes, as well as the issue of non-template browsers lacking inert content (e.g. <img _src="{{ foo }}.png">

neonstalwart commented 11 years ago

@rafaelw some of your comments don't seem to come through on github - maybe you need to use fenced code blocks

rafaelw commented 11 years ago

sorry. fixed.

rafaelw commented 11 years ago

Fixed: https://github.com/Polymer/TemplateBinding/commit/3932ebe