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 = dom.childNodes.length -1; i--; i> -1) {
27 fillStyle(dom.childNodes[i]);
33 //if (dom.nodeName != 'BODY') {
34 // pstyle = window.getComputedStyle(dom.parentElement, null);
39 //if (dom.nodeName == 'LI') { throw 'done'; }
42 for(var i=0;i<style.length;i++){
44 var camel = prop.replace(/\-([a-z])/g, camelize);
45 var val = style.getPropertyValue(prop);
46 //returns[camel] = val;
48 // idea... if the parent has the same style.. then do not apply it to the child?
49 //if (pstyle && pstyle[prop] == val) {
52 console.log(prop + '=' + val);
54 dom.style[camel] = val;
58 var es = dom.getAttribute('style');
59 console.log(dom.nodeName + '::' + es);
60 dom.setAttribute('style', es);
64 var el = document.querySelector('body');
67 var matches = document.getElementsByTagName('style');
68 for(var i =0;i < matches.length;i++) {
69 matches[i].parentElement.removeChild(matches[i]);
71 var matches = document.getElementsByTagName('link');
72 for(var i =0;i < matches.length;i++) {
73 // matches[i].parentElement.removeChild(matches[i]);