Bug Tracker

Opened 7 years ago

Closed 6 years ago

#6598 closed bug (patchwelcome)

TypeError: Result of expression 'div.style' [null] is not an object when loading using XSLT

Reported by: kevinpeno Owned by:
Priority: undecided Milestone:
Component: support Version: 1.4.4
Keywords: xml xsl xslt needsreview Cc:
Blocked by: Blocking:

Description

When loading jquery via an xslt page, Safari 4.0.4 (531.21.10), the latest windows build, throws the following error:

TypeError: Result of expression 'div.style' [null] is not an object.

See attached files for test case.

Attachments (2)

test.xml (110 bytes) - added by kevinpeno 7 years ago.
XML file a user would access
simple-template.xsl (737 bytes) - added by kevinpeno 7 years ago.
Fixed invalid path to jquery

Download all attachments as: .zip

Change History (16)

Changed 7 years ago by kevinpeno

Attachment: test.xml added

XML file a user would access

Changed 7 years ago by kevinpeno

Attachment: simple-template.xsl added

Fixed invalid path to jquery

comment:1 Changed 7 years ago by kevinpeno

Also verified that this affects FF 3.6.3 as well. IE 6+ is not affected.

comment:2 Changed 7 years ago by kevinpeno

I found a few more things through research today that I think should be taken into consideration when resolving this bug. Please see the references below:

Forum post with the same issue: http://forum.jquery.com/topic/using-jquery-from-an-xslt-throws-error-is-undefined-after-that

2008 mailing list message regarding a fix to this issue: http://groups.google.com/group/jquery-en/msg/a86c35b90d143c4f

GitHub submission containing a hack to workaround this issue until it is resolved: http://gist.github.com/352210

Thanks!

comment:3 Changed 7 years ago by dmethvin

Component: unfiledmanipulation

comment:4 Changed 7 years ago by snover

Milestone: 1.4.3

Resetting milestone to future.

comment:5 Changed 7 years ago by snover

Keywords: xml xslt added
Priority: undecided

comment:6 Changed 7 years ago by jitter

#4895 is a duplicate of this ticket.

comment:7 Changed 7 years ago by jitter

Version: 1.4.21.4.4

comment:8 Changed 7 years ago by snover

Keywords: needsreview added

But does anyone care…?

comment:9 Changed 7 years ago by snover

Keywords: xsl added
Summary: TypeError: Result of expression 'div.style' [null] is not an object.TypeError: Result of expression 'div.style' [null] is not an object when loading using XSLT

comment:10 Changed 7 years ago by dvdckl

More details available in ticket 4264 (why are the older XSLT namespace bugs are being marked as duplicates of the newer ones?)

comment:11 in reply to:  10 ; Changed 7 years ago by kevinpeno

Replying to snover:

But does anyone care…?

I'll provide a patch as soon as I have some time. I assume that will expedite the resolution? Is there anything else I should supply with the patch that will help with getting this resolved and/or approved for a future release?

Replying to dvdckl:

More details available in ticket 4264 (why are the older XSLT namespace bugs are being marked as duplicates of the newer ones?)

Hey! Thanks for the reference to your ticket (which is far more comprehensible than mine). I've altered my local copy of http://gist.github.com/352210 to add the code below and it resolves all errors with all browsers when using jQuery with namespaces (XHTML) and/or using XSLT. I did note, however, that, unlike you, I did not suffer from document.body issues in webkit browsers. This has likely been fixed recently because I recall having issues with them in the past regarding document.body.

Also, if you haven't, make sure you vote this ticket up ;)

// XSLT causes Gecko and Webkit to not set document.body
if( !document.body )
	document.body = document.documentElement.getElementsByTagName("body")[0];

comment:12 Changed 7 years ago by kevinpeno

Also, doesn't this belong under support module?

comment:13 in reply to:  11 Changed 7 years ago by Rick Waldron

Replying to kevinpeno:

Is there anything else I should supply with the patch that will help with getting this resolved and/or approved for a future release?

Adequate unit tests must be added to the jQuery Test Suite. Your tests must pass 100% in at least the following:

  • Chrome 5
  • Safari 3+
  • Firefox 3.0.12, 3.5, 3.6, 4
  • IE 6+
  • Opera 10.60+

comment:14 Changed 6 years ago by john

Component: manipulationsupport
Resolution: patchwelcome
Status: newclosed

I don't think that this is something that we're going to reasonably fix. If a patch with a pull request is issued, pleased feel free to re-open this and we can take a look. Thanks!

Note: See TracTickets for help on using tickets.