Comment #1 on issue 1131 by lucas.e.smith: constructClone in bridal.js doesn't account for IE's setAttribute bugs
http://code.google.com/p/google-caja/issues/detail?id=1131

One way of addressing this is to create a map of trouble attributes to their
functioning counterparts:

var attrs = (function () {
    var x = document.createElement('p');
    x.setAttribute('class', 'x');
    return x.className === 'x' ? {} : {
        'for': 'htmlFor',
        'class': 'className'
    };
})();

Then in the loop through the element's attributes,
clone.setAttribute((attrs[attr.nodeName] || attr.nodeName), attr.nodeValue);

That's a lot of unnecessary processing for every other attribute and all attributes
in other browsers, so less than ideal, but it is one idea.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply via email to