[OpenLayers-Trac] [OpenLayers] #3184: IE8 throws an invalid argument exception when Size(10, 'auto') is passed to modifyDOMElement()

OpenLayers trac-20090302 at openlayers.org
Mon Mar 21 14:53:02 EDT 2011


#3184: IE8 throws an invalid argument exception when Size(10, 'auto') is passed to
modifyDOMElement()
------------------------------+---------------------------------------------
 Reporter:  sredl             |       Owner:              
     Type:  bug               |      Status:  new         
 Priority:  minor             |   Milestone:  2.11 Release
Component:  Util              |     Version:  2.10        
 Keywords:  modifyDOMElement  |       State:  Review      
------------------------------+---------------------------------------------
 Consider the following call:

 this.titleDiv = OpenLayers.Util.createDiv(this.id + "_titleDiv",
                   null,
                   new OpenLayers.Size('auto', this.titleHeight),
                   null, "absolute", null, "hidden", null
   );

 New Size object is created and as a result of parseFloat('auto') call in
 Size:initialize(), its 'w' property is set to NaN. This Size object is
 passed to createDiv() and there it is passed to modifyDOMElement(). And
 there it goes:

 163         if (sz) {
 164             element.style.width = sz.w + "px";
 165             element.style.height = sz.h + "px";
 166         }

 Now on the line 164 IE8 throws invalid argument exception as sz.w is NaN.

 Simple fix is attached.

 Cheers,

 Michal

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3184>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list