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++) {
37 //if (dom.nodeName != 'BODY') {
38 // pstyle = window.getComputedStyle(dom.parentElement, null);
43 //if (dom.nodeName == 'LI') { throw 'done'; }
46 for(var i=0;i<style.length;i++){
48 var camel = prop.replace(/\-([a-z])/g, camelize);
49 var val = style.getPropertyValue(prop);
50 //returns[camel] = val;
52 // idea... if the parent has the same style.. then do not apply it to the child?
53 //if (pstyle && pstyle[prop] == val) {
56 console.log(prop + '=' + val);
58 dom.style[camel] = val;
62 var es = dom.getAttribute('style');
63 console.log(dom.nodeName + '::' + es);
64 dom.setAttribute('style', es);
68 var el = document.querySelector('body');
71 var matches = document.getElementsByTagName('style');
72 for(var i =0;i < matches.length;i++) {
73 matches[i].parentElement.removeChild(matches[i]);
75 var matches = document.getElementsByTagName('link');
76 for(var i =0;i < matches.length;i++) {
77 // matches[i].parentElement.removeChild(matches[i]);