Ruby Forum Rails Spinoffs (closed, excessive spam) > 1.6.0.2 IE Error on Insert

Posted by unknown (Guest)
on 29.01.2008 15:29
(Received via mailing list)
In my current project, I'm using the prototype window class found
here: http://prototype-window.xilinus.com/download.html

I've been using it up to prototype 1.6.0.1 without any problems what
so ever. However, after the recent upgrade to 1.6.0.2, I've
encountered an error in internet explorer 6 & 7.

Before I continue, here is the test case:

http://sandbox.protopository.com/samples/multi_modal.html

Steps to replicate:

Click the link "Open a modal window".

Error Message: 'style' is null or not an object (line 2252
prototype.js)

Here are my findings thus far:

1. The problem occurs in function _checkIEOverlapping in file
window.js
2. For arguments sake, I tried switching the function to be more
compliant of new version with no luck:

 this.element.insert({after: '<iframe id="' + this.element.id +
'_iefix" '+
'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);"
' + 'src="javascript:false;" frameborder="0" scrolling="no"></
iframe>'});

3. This error does not occur in firefox (tested by removing the
browser check "if" statement in the checkIEOverlapping function).
4. When this error occurs in the getStyle function, the element
nodeType is 9.

I have contacted the author of this great class, but I'm a little
pushed for a deadline...

Thanks,
Ian
Posted by seb (Guest)
on 29.01.2008 18:05
(Received via mailing list)
Use trunk version, it works
Sorry for not answering berfore but you contact me yesteray at 10pm
and I have some contracts to honor before :)
Posted by unknown (Guest)
on 29.01.2008 18:14
(Received via mailing list)
Thanks Seb!

Whats the repo address, can't find it on your site?
Posted by Sébastien Gruhier (Guest)
on 29.01.2008 19:03
(Received via mailing list)
Posted by unknown (Guest)
on 29.01.2008 19:32
(Received via mailing list)
Just checked out the trunk and updated my test case... same result.

Any ideas?
Posted by zmaj (Guest)
on 12.02.2008 15:26
(Received via mailing list)
Same problem here.. ugrading to 1.6.0.2 on IE6 .
When i use the http://svn.itseb.com/public/pwc/trunk/
i only see a 1.5.1.1 of protottype.js in it...

Any other hotfixes for this one available ?
Posted by unknown (Guest)
on 12.02.2008 17:08
(Received via mailing list)
zmaj,

Temporarily, I've been using the latest snapshot before the 1.6.0.2
release as it does not have any problems.

You can find the copy I'm using here: 
http://sandbox.protopository.com/javascripts/prototype.js.1.6.0.1

From what I understand, development of this class for 1.6.0.2 is not
going to happen... instead they will be offering prototype ui:
http://prototype-ui.com/

I'm not using the prototype ui class b/c of problems with Internet
Explorer:
http://dev.prototype-ui.com/ticket/7

As soon as the prototype ui is stable enough, I plan to port my
project to it.
Posted by zmaj (Guest)
on 12.02.2008 21:31
(Received via mailing list)
itynd,
thanky you for the information   i also downgraded to 1.6.0.1 and my
problem is gone for the momen.

What made me also wonder about 1.6.0.2 is that clonePosition in IE6
within large trees or nvery large nested tables
takes up to 15!! sec longer than with 1.6.0.1.
I saw the new code for IE offsetParent calculation for absolute
elements
and think it has somehow to do with this.
At the end i avoided clonePosition within large trees by wrinting my
own positioning logic.
DAMN IE stressed me all day long today .
Posted by Gary Liu (desp0916)
on 23.04.2008 18:23
I came upon the same problem, and here is my solution.
Change the line 1047 of the file window.js from:

    if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && 
(navigator.userAgent.indexOf('Opera')<0) && (this.elem
     ent.getStyle('position')=='absolute')) {

to:

    if(!this.iefix && (Prototype.Browser.IE) && 
this.element.getStyle('position') == 'absolute' && this.element.id == 
'overlay_modal') {

It works for me! :-p

unknown wrote:
> In my current project, I'm using the prototype window class found
> here: http://prototype-window.xilinus.com/download.html
> 
> I've been using it up to prototype 1.6.0.1 without any problems what
> so ever. However, after the recent upgrade to 1.6.0.2, I've
> encountered an error in internet explorer 6 & 7.
> 
> Before I continue, here is the test case:
> 
> http://sandbox.protopository.com/samples/multi_modal.html
> 
> Steps to replicate:
> 
> Click the link "Open a modal window".
> 
> Error Message: 'style' is null or not an object (line 2252
> prototype.js)
> 
> Here are my findings thus far:
> 
> 1. The problem occurs in function _checkIEOverlapping in file
> window.js
> 2. For arguments sake, I tried switching the function to be more
> compliant of new version with no luck:
> 
>  this.element.insert({after: '<iframe id="' + this.element.id +
> '_iefix" '+
> 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);"
> ' + 'src="javascript:false;" frameborder="0" scrolling="no"></
> iframe>'});
> 
> 3. This error does not occur in firefox (tested by removing the
> browser check "if" statement in the checkIEOverlapping function).
> 4. When this error occurs in the getStyle function, the element
> nodeType is 9.
> 
> I have contacted the author of this great class, but I'm a little
> pushed for a deadline...
> 
> Thanks,
> Ian
Posted by Ryan Spohn (rws1000)
on 09.07.2008 00:06
Gary - your fix works perfectly for me. Thanks!

Gary Liu wrote:
> I came upon the same problem, and here is my solution.
> Change the line 1047 of the file window.js from:
> 
>     if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && 
> (navigator.userAgent.indexOf('Opera')<0) && (this.elem
>      ent.getStyle('position')=='absolute')) {
> 
> to:
> 
>     if(!this.iefix && (Prototype.Browser.IE) && 
> this.element.getStyle('position') == 'absolute' && this.element.id == 
> 'overlay_modal') {
> 
> It works for me! :-p
>