6 var camelize = function(a,b){
7 return b.toUpperCase();
12 var fillStyle = function(dom)
14 if (!dom || dom.nodeType != 1) {
15 console.log("SKIP: " + dom.nodeName);
18 console.log(dom.nodeName);
20 var style = window.getComputedStyle(dom, null);
21 if (style.display == 'none') {
22 dom.parentElement.removeChild(dom);
27 if (dom.childNodes.length > 50) {
29 throw "too many child nodes?" + dom.childNodes.length ;
31 for (var i = 0;i < dom.childNodes.length;i++) {
32 cn.push(dom.childNodes[i]);
37 throw "too many child nodes? cn";
39 for (var i = 0;i < cn.length;i++) {
40 console.log( i + ':'+ cn[i].nodeName);
48 //if (dom.nodeName != 'BODY') {
49 // pstyle = window.getComputedStyle(dom.parentElement, null);
54 //if (dom.nodeName == 'LI') { throw 'done'; }
57 for(var i=0;i<style.length;i++){
59 var camel = prop.replace(/\-([a-z])/g, camelize);
60 var val = style.getPropertyValue(prop);
61 //returns[camel] = val;
63 // idea... if the parent has the same style.. then do not apply it to the child?
64 //if (pstyle && pstyle[prop] == val) {
67 console.log(prop + '=' + val);
69 dom.style[camel] = val;
73 var es = dom.getAttribute('style');
74 console.log(dom.nodeName + '::' + es);
75 dom.setAttribute('style', es);
83 var el = document.querySelector('body');
86 var matches = document.getElementsByTagName('style');
87 for(var i =0;i < matches.length;i++) {
88 matches[i].parentElement.removeChild(matches[i]);
90 var matches = document.getElementsByTagName('link');
91 for(var i =0;i < matches.length;i++) {
92 // matches[i].parentElement.removeChild(matches[i]);