Changeset 428

Show
Ignore:
Timestamp:
08/07/08 21:47:29 (2 years ago)
Author:
t-bone
Message:

Refs #182

  • Do not set extended-collapse marker attributes on <style> nodes.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • extension/kabl/content/kabl-policy.js

    r424 r428  
    206206            ('cutoff'==type && score>=gKablRulesObj.cutoff) 
    207207        ) { 
    208             // try block just in case, attempt to hide the node, i.e. 
    209             // if a non-loaded image will result in an alt tag showing 
    210208            try { 
    211                 fields.node=fields.node 
     209                var el=fields.node 
    212210                    .QueryInterface(Components.interfaces.nsIDOMNode); 
    213                 fields.node.setAttribute('style', 'display: none !important'); 
    214211            } catch (e) { 
    215212                if (gKablDebug) dump('Error in evalScore: '+e+'\n'); 
    216             } 
    217  
    218             // mark a node for extended hiding 
     213                return; 
     214            } 
     215 
     216            // Attempt to hide the node, i.e. if a non-loaded image will 
     217            // result in an alt tag showing. 
    219218            try { 
    220                 fields.node=fields.node 
    221                     .QueryInterface(Components.interfaces.nsIDOMNode); 
    222                 fields.node.setAttribute('kabl', gKablCollapseMarker); 
     219                el.setAttribute('style', 'display: none !important'); 
     220            } catch (e) { 
     221                if (gKablDebug) dump('Error in evalScore: '+e+'\n'); 
     222            } 
     223 
     224            // Mark the node for collapsing. 
     225            try { 
     226                if ('STYLE'!=el.tagName) { 
     227                    el.setAttribute('kabl', gKablCollapseMarker); 
     228                } 
    223229            } catch (e) { 
    224230                if (gKablDebug) dump('Error in evalScore: '+e+'\n'); 
     
    284290                if (el) { 
    285291                    el=el.QueryInterface(Components.interfaces.nsIDOMNode); 
    286                     //el.style.display='none !important'; 
    287292                    el.setAttribute('style', 'display: none !important'); 
    288293                    el.setAttribute('kablcollapse', '1');