oschaaf commented on a change in pull request #1928:
URL: 
https://github.com/apache/incubator-pagespeed-mod/pull/1928#discussion_r463582318



##########
File path: net/instaweb/rewriter/critical_css_loader.js
##########
@@ -39,11 +39,16 @@ pagespeed.CriticalCssLoader.addAllStyles = function() {
 
   var elements = document.getElementsByClassName('psa_add_styles');
 
+  
   for (var i = 0, e; e = elements[i]; ++i) {
     if (e.nodeName != 'NOSCRIPT') { continue; }
     var div = document.createElement('div');
     div.innerHTML = e.textContent;
-    document.body.appendChild(div);
+    var children = div.childNodes;
+    for (var v = 0; v < children.length; ++v) {
+      children[v].removeAttribute('id');
+    }  
+  document.body.appendChild(div);

Review comment:
       yes, that would be great. But we may also want to recurse? So not only 
remove the `id` attribute from the direct children of the element, but also the 
children of the children, and so on?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to