in partnership with mediatemple

Ticket #754 (assigned defect)

Opened 4 months ago

Last modified 3 months ago

Safari 2 Crashes on $A(node.childNodes)

Reported by: subtleGradient Owned by: kamicane
Type: defect Priority: blocker
Milestone: Mootools version 1.2 Component: Core
Keywords: safari2 crash Cc: kamikane

Description

This crashes Safari 2 on Leopeard every time.
(note that if you relaunch safari2 after it crashes it will relaunch with the safari3 rendering engine)

Seems to be an issue with passing .childNodes into $A() on an element that isn't attached to anything.

http://tripledoubleyou.subtlegradient.com/Examples/mootools%20safari2%20crasher.html

var node = new Element('div', {html: $('test').innerHTML});
$A(node.childNodes);

I can't look at it anymore right now.
I originally found the issue when I was using the Request.HTML code and it's taken me a while to boil it down to this issue.
When I get some more time I can try and boil it down some more.

http://tripledoubleyou.subtlegradient.com/stuff/Safari2/

Change History

Changed 4 months ago by subtleGradient

Changed 4 months ago by kamicane

  • owner set to kamicane
  • status changed from new to assigned

Changed 3 months ago by JanK

Accessing node.childNodes.$family or any other undefined property of childNodes causes Safari 2 to crash in some cases.
Requirements for a crash seem to be: The node is not in the DOM and probably only text is set as node.innerHTML, if innerHTML is '<p>test</p>' for example it seems not to crash.

full html: http://pastie.textmate.org/private/o0mlq6vpx9yikudeexq5a

function init() {
        var node = document.createElement('div');
        node.innerHTML = 'doh';
        node.childNodes.$family; // or any undefined value
}
Note: See TracTickets for help on using tickets.