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?");
31 for (var i = 0;i < dom.childNodes.length;i++) {
32 cn.push(dom.childNodes[i]);
36 for (var i = 0;i < cn.length;i++) {
37 console.log( i + ':'+ cn[i].nodeName);
45 //if (dom.nodeName != 'BODY') {
46 // pstyle = window.getComputedStyle(dom.parentElement, null);
51 //if (dom.nodeName == 'LI') { throw 'done'; }
54 for(var i=0;i<style.length;i++){
56 var camel = prop.replace(/\-([a-z])/g, camelize);
57 var val = style.getPropertyValue(prop);
58 //returns[camel] = val;
60 // idea... if the parent has the same style.. then do not apply it to the child?
61 //if (pstyle && pstyle[prop] == val) {
64 console.log(prop + '=' + val);
66 dom.style[camel] = val;
70 var es = dom.getAttribute('style');
71 console.log(dom.nodeName + '::' + es);
72 dom.setAttribute('style', es);
80 var el = document.querySelector('body');
83 var matches = document.getElementsByTagName('style');
84 for(var i =0;i < matches.length;i++) {
85 matches[i].parentElement.removeChild(matches[i]);
87 var matches = document.getElementsByTagName('link');
88 for(var i =0;i < matches.length;i++) {
89 // matches[i].parentElement.removeChild(matches[i]);