Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

DOMDocument : jQuery 1.3.1: isXml causing endless recursion

#15

All, I just upgraded from jQuery 1.2.6 to 1.3.1 and I'm seeing this while using Chris Thatcher's latest (as of Jan 20, 2009). (This is after I patched the problem from my earlier email regarding arrays: http://groups.google.com/group/e...

java.lang.StackOverflowError
       at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1658)
       at org.mozilla.javascript.gen.c2._c295(../..//vendor/plugins/javascript_testing/lib/env.rhino.js:4336)
       at org.mozilla.javascript.gen.c2.call(../..//vendor/plugins/javascript_testing/lib/env.rhino.js)
       at org.mozilla.javascript.ScriptableObject.getImpl(ScriptableObject.java:2008)
       at org.mozilla.javascript.ScriptableObject.get(ScriptableObject.java:286)
       at org.mozilla.javascript.IdScriptableObject.get(IdScriptableObject.java:387)
       at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1601)
       at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1398)
       at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1384)
       at org.mozilla.javascript.gen.c3._c197(../..//vendor/plugins/javascript_testing/lib/jquery-1.3.1.js:2220)
       at org.mozilla.javascript.gen.c3.call(../..//vendor/plugins/javascript_testing/lib/jquery-1.3.1.js)
       at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
       at org.mozilla.javascript.gen.c3._c197(../..//vendor/plugins/javascript_testing/lib/jquery-1.3.1.js:2220)
       at org.mozilla.javascript.gen.c3.call(../..//vendor/plugins/javascript_testing/lib/jquery-1.3.1.js)
       at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
       at org.mozilla.javascript.gen.c3._c197(../..//vendor/plugins/javascript_testing/lib/jquery-1.3.1.js:2220)
       at org.mozilla.javascript.gen.c3.call(../..//vendor/plugins/javascript_testing/lib/jquery-1.3.1.js)
       at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
       at org.mozilla.javascript.gen.c3._c197(../..//vendor/plugins/javascript_testing/lib/jquery-1.3.1.js:2220)
       at org.mozilla.javascript.gen.c3.call(../..//vendor/plugins/javascript_testing/lib/jquery-1.3.1.js)
       at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)

I tracked this down to the jQuery isXml() function that changed from 1.2.6 to 1.3.1. Here are two related change-logs: http://code.google.com/p/jqueryj... http://code.google.com/p/jqueryj...

It looks to me that isXml recurses up the DOM tree and finds the root DOMDocument. However, since DOMDocument says its ownerDocument is itself, isXml gets stuck in an endless recursion, causing the StackOverflow above.

I tried just telling DOMDocument that its ownerDocument was null, but that seemed to cause several more problems. I'm not sure if that's the correct thing to do.

Any ideas?

Thanks again, Larry

Reported by thatcher.christopher (at gmail) · January 31st, 2009 @ 06:29 AM

State: resolved
Milestone: 1.0 Release
Assigned to: Thatcher Thatcher

Activity

  1. Thatcher
    Thatcher
    • State changed from new to open

    If I call document.ownerDocument in ff3 in firebug console I get null. So I think this is right.

    The issue is total cruft from the integration of the pure js dom.

    The big problem is that DOMDocument inherits from DOMNode which uses this.ownerDocument.implementation all over the place.

    I have to figure out a good solution for this.

    Thanks for finding this.

    February 1st, 2009 @ 05:42 PM

  2. Thatcher
    Thatcher
    • Assigned user changed from thatcher.christopher (at gmail) to Thatcher

    still working on this. I'm going to have to refactor the some of the dom stuff or might add a getter to the dom document so it only exposes the ownerDocument as null there.

    February 16th, 2009 @ 09:45 AM

  3. larry.karnowski (at gmail)
    larry.karnowski (at gmail)

    Thatcher, now that I can run the jQuery 1.3.1 compatibility test suite from my env.js working directory, I'm starting to refactor the DOM a bit to tackle that null ownerDocument.

    February 17th, 2009 @ 01:53 AM

  4. Thatcher
    Thatcher

    this should be fixed. I added a util function ownerDocument that takes a node and return the ownerdocument or the document if the node is a document node. this allows us to us the method internally to safely set ownerDocument to null in DOMDocument while inheriting everything from DOMNode.

    Still leaving this open till we verify it fixes the recursion.

    Once I get larry's test framework in and verify I'll close.

    February 17th, 2009 @ 04:31 AM

  5. Thatcher
    Thatcher
    • State changed from open to resolved

    September 9th, 2009 @ 07:12 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.