[Dojo-interest] bug on IE7 with dojo.style() when setting line-height?

Mike Wilcox mwilcox at sitepen.com
Mon Jul 27 14:58:24 EDT 2009


Thanks. IE is really messing with my head on this error.

Mike Wilcox
mwilcox at sitepen.com
http://www.sitepen.com
work: 650.968.8787 x218
cell:	  214.697.4872

On Jul 27, 2009, at 1:54 PM, Remy Damour wrote:

> When using solution implemented in trunk ("inherited" value), same
> error still pops up in IE7.
> Value "normal" does not to trigger the error, at least in my
> implementation (IE7 + xp).
>
> On Mon, Jul 27, 2009 at 8:38 PM, Remy Damour<remy.damour at gmail.com>  
> wrote:
>> nice! (please ignore ticket #9616 then)
>>
>> Regards,
>> Remy
>>
>> On Mon, Jul 27, 2009 at 8:34 PM, Mike Wilcox<mwilcox at sitepen.com>  
>> wrote:
>>> This has already been fixed in the trunk, but in my haste I did not
>>> create a ticket for it. Ticket:
>>> http://bugs.dojotoolkit.org/ticket/9615
>>>
>>> Workaround if you're not using the trunk:
>>>
>>> <script type="text/javascript">
>>>        dojo.require("dojo.html");
>>>        dojo.require("dojox.form.FileUploader");
>>>
>>> // overwrite method:
>>> dojox.form.FileUploader.prototype._styleContent = function(){
>>>        var o = this.fhtml.nr;
>>>        var lh = dojo.isIE ? "inherit" : "auto";
>>>        dojo.style(this.insideNode, {
>>>                width:o.w+"px",
>>>                height:o.va == "middle"?o.h+"px":"auto",
>>>                lineHeight:o.va == "middle"?o.h+"px":lh,
>>>                textAlign:o.ta,
>>>                paddingTop:o.p[0]+"px",
>>>                paddingRight:o.p[1]+"px",
>>>                paddingBottom:o.p[2]+"px",
>>>                paddingLeft:o.p[3]+"px"
>>>        });
>>> }
>>>
>>> </script>
>>>
>>> Mike Wilcox
>>> mwilcox at sitepen.com
>>> http://www.sitepen.com
>>> work: 650.968.8787 x218
>>> cell:     214.697.4872
>>>
>>> On Jul 27, 2009, at 1:22 PM, Remy Damour wrote:
>>>
>>>> Here is a shorter test-file http://remydamour.com/iebug-test.php  
>>>> (as
>>>> suggested :-) ), and it looks like bug is not on dojo.style() but
>>>> rather on dojox.form.FileUploader which sets lineHeight to invalid
>>>> "auto" value.
>>>> According to w3 TR
>>>> (http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height)  
>>>> allowed
>>>> value is "normal" and not "auto".
>>>>
>>>> FF looks like silently defaulting to "normal" while IE triggers an
>>>> error.
>>>> I will raise corresponding ticket for FileUploader widget.
>>>>
>>>> Regards,
>>>> Remy
>>>>
>>>> On Mon, Jul 27, 2009 at 8:08 PM, Peter E
>>>> Higgins<dante at dojotoolkit.org> wrote:
>>>>> FWIW, I've seen _something_, but never been able to figure out  
>>>>> why. I
>>>>> suspect is has something to do with computed styles of inherited
>>>>> line-height settings.
>>>>>
>>>>> http://bugs.dojotoolkit.org/ticket/6303 is what I believe to be a
>>>>> similar issue.
>>>>>
>>>>> Break a leg.
>>>>>
>>>>> Regards,
>>>>> Peter
>>>>>
>>>>> James Burke wrote:
>>>>>> If you can reduce the dojo.style issue to a simple test case that
>>>>>> does
>>>>>> not rely on a specific widget (just modifies a plain DOM node),  
>>>>>> then
>>>>>> please file a bug and attach the test case. AFAIK, there is not a
>>>>>> known issue with line-height.
>>>>>>
>>>>>> James
>>>>>>
>>>>>> On Mon, Jul 27, 2009 at 10:58 AM, Remy
>>>>>> Damour<remy.damour at gmail.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I tried to use dojox.form.FileUploader and while it worked fine
>>>>>>> with
>>>>>>> firefox, dijit instanciation failed with IE7 with following  
>>>>>>> error
>>>>>>> message: "invalid argument"
>>>>>>> (see http://remydamour.com/dojo-uploader-IEBug/bug-screenshot.png) 
>>>>>>> .
>>>>>>>
>>>>>>> After digging up, it appears that js error is provoked by  
>>>>>>> following
>>>>>>> line-block (extracted from
>>>>>>> /dojox/form/FileUploader.js:_styleContent()):
>>>>>>>                        dojo.style(this.insideNode, {
>>>>>>>                                width:o.w+"px",
>>>>>>>                                height:o.va=="middle"?o.h
>>>>>>> +"px":"auto",
>>>>>>>                                lineHeight:o.va=="middle"?o.h
>>>>>>> +"px":"auto", // rdcomment: this line
>>>>>>> triggers bug, comment it out this line to remove bug
>>>>>>>                                textAlign:o.ta,
>>>>>>>                                paddingTop:o.p[0]+"px",
>>>>>>>                                paddingRight:o.p[1]+"px",
>>>>>>>                                paddingBottom:o.p[2]+"px",
>>>>>>>                                paddingLeft:o.p[3]+"px"
>>>>>>>                        });
>>>>>>>
>>>>>>> When lineHeight property is commented out, no error is triggered
>>>>>>> on IE7.
>>>>>>>
>>>>>>> Here is a live example with a breakpoint set prior to line
>>>>>>> execution:
>>>>>>> http://remydamour.com/dojo-uploader-IEBug/advanced-uploader_IEbug.php
>>>>>>> .
>>>>>>>
>>>>>>> Should I raise a ticket (and link it to dojox or dojo?) or am I
>>>>>>> completely wrong?
>>>>>>>
>>>>>>> Regards,
>>>>>>> Remy
>>>>>>> _______________________________________________
>>>>>>> FAQ: http://dojotoolkit.org/support/faq
>>>>>>> Book: http://dojotoolkit.org/docs/book
>>>>>>> Forums: http://dojotoolkit.org/forum
>>>>>>> Dojo-interest at mail.dojotoolkit.org
>>>>>>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>>>> FAQ: http://dojotoolkit.org/support/faq
>>>>>> Book: http://dojotoolkit.org/docs/book
>>>>>> Forums: http://dojotoolkit.org/forum
>>>>>> Dojo-interest at mail.dojotoolkit.org
>>>>>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Peter E Higgins
>>>>> Dojo Project Lead : http://dojotoolkit.org
>>>>>
>>>>> _______________________________________________
>>>>> FAQ: http://dojotoolkit.org/support/faq
>>>>> Book: http://dojotoolkit.org/docs/book
>>>>> Forums: http://dojotoolkit.org/forum
>>>>> Dojo-interest at mail.dojotoolkit.org
>>>>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>>>>>
>>>> _______________________________________________
>>>> FAQ: http://dojotoolkit.org/support/faq
>>>> Book: http://dojotoolkit.org/docs/book
>>>> Forums: http://dojotoolkit.org/forum
>>>> Dojo-interest at mail.dojotoolkit.org
>>>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>>>>
>>>
>>> _______________________________________________
>>> FAQ: http://dojotoolkit.org/support/faq
>>> Book: http://dojotoolkit.org/docs/book
>>> Forums: http://dojotoolkit.org/forum
>>> Dojo-interest at mail.dojotoolkit.org
>>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>>>
>>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>



More information about the Dojo-interest mailing list