Changeset 1154


Ignore:
Timestamp:
01/27/09 20:15:21 (10 years ago)
Author:
douglas
Message:

FIXED Ticket #1379 Firefox no longer corrupts image data from broken images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/GetHtml/DOMwalk.js

    r1084 r1154  
    130130        { 
    131131          var a = attrs.item(i); 
     132          // In certain browsers (*cough* firefox) the dom node loses 
     133          // information if the image is currently broken.  In order to prevent 
     134          // corrupting the height and width of image tags, we strip height and 
     135          // width from the image rather than reporting bad information. 
     136          if (Xinha.is_real_gecko && (root.tagName.toLowerCase() == 'img') && 
     137              ((a.nodeName.toLowerCase() == 'height') || (a.nodeName.toLowerCase() == 'width'))) 
     138          { 
     139            if (!root.complete || root.naturalWidth === 0) 
     140            { 
     141              // This means that firefox has been unable to read the dimensions from the actual image 
     142              continue; 
     143            } 
     144          } 
    132145          if (typeof a.nodeValue == 'object' ) continue; // see #684 
    133146          if (root.tagName.toLowerCase() == "input"  
Note: See TracChangeset for help on using the changeset viewer.