Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12569 closed defect (wontfix)

IE8 bug causing js execution to halt in _Templated.xd.js

Reported by: Dan Farrow Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.5
Keywords: ie8 firstChild appendChild invalid argument error Cc:
Blocked By: Blocking:

Description

hi all, I've been pulling out my hair trying to fix an Invalid argument error message in IE8 which is stopping my dijits from working.

The problem occurs in dijit/_Templated.xd.js, specifically the _fillContent function:

while(source.hasChildNodes()){

dest.appendChild(source.firstChild);

}

In IE8's debugger, source.hasChildNodes() returns true, but source.firstChild evaluates to null, hence the Invalid argument error.

Simple test html here: http://scsys.co.uk:8002/95245

Thanks in advance for any help anybody can provide on this

Dan

Attachments (1)

12569.html (660 bytes) - added by bill 8 years ago.
simplified test case

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by bill

Attachment: 12569.html added

simplified test case

comment:1 Changed 8 years ago by bill

Thanks for the test case. Hmm, that's a strange one, it only seems to happen with that <p> → <form> → <dl> hierarchy.

I tried changing the code to:

while(source.firstChild){
        dest.appendChild(source.firstChild);
}

However, that doesn't really solve your problem as it won't copy any of the content from inside the <form> node. Referencing source.childNodes[0] instead of source.firstChild seems to work:

while(source.hasChildNodes()){
	dest.appendChild(source.childNodes[0]);
}

...although I'm worried it would be slower.

It might make sense for you to redesign your HTML to avoid that problem?

comment:2 Changed 8 years ago by bill

Resolution: wontfix
Status: newclosed

Since this is such a corner case, I'm going to close the ticket as wontfix. You can workaround the problem by redefining _fillContent or by changing your markup to not have that specific <p> → <form> → <dl> hierarchy.

comment:3 Changed 8 years ago by Dan Farrow

hi bill, following up this particular issue got pushed to the back of my (long) queue so apologies for not responding sooner

Yes, removing the surrounding <p> tags solves it, and I agree it's very much a corner case

Thanks so much for your help Dan

comment:4 in reply to:  3 Changed 8 years ago by Dan Farrow

Replying to sqrbrkt: I meant - "Thanks so much for your help, Dan"

Note: See TracTickets for help on using tickets.