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);
26 for (var i = 0;i < dom.childNodes.length;i++) {
27 cn.push(dom.childNodes[i]);
29 for (var i = 0;i < cn.length;i++) {
30 console.log( i + ':'+ cn[i].nodeName);
38 //if (dom.nodeName != 'BODY') {
39 // pstyle = window.getComputedStyle(dom.parentElement, null);
44 //if (dom.nodeName == 'LI') { throw 'done'; }
47 for(var i=0;i<style.length;i++){
49 var camel = prop.replace(/\-([a-z])/g, camelize);
50 var val = style.getPropertyValue(prop);
51 //returns[camel] = val;
53 // idea... if the parent has the same style.. then do not apply it to the child?
54 //if (pstyle && pstyle[prop] == val) {
57 console.log(prop + '=' + val);
59 dom.style[camel] = val;
63 var es = dom.getAttribute('style');
64 console.log(dom.nodeName + '::' + es);
65 dom.setAttribute('style', es);
69 var el = document.querySelector('body');
72 var matches = document.getElementsByTagName('style');
73 for(var i =0;i < matches.length;i++) {
74 matches[i].parentElement.removeChild(matches[i]);
76 var matches = document.getElementsByTagName('link');
77 for(var i =0;i < matches.length;i++) {
78 // matches[i].parentElement.removeChild(matches[i]);