Bug Tracker

Ticket #13208 (closed bug: fixed)

Opened 23 months ago

Last modified 9 months ago

JS error trying to get the id of the document in IE8

Reported by: tj.vantoll Owned by: gibson042
Priority: undecided Milestone: 1.9.1
Component: event Version: git
Keywords: Cc:
Blocking: Blocked by:

Description

See  http://jsfiddle.net/tj_vantoll/tg2VU/ and click on the link in IE8.

I get a JS error from this block in Sizzle:

Expr.filter["ID"] = function( id ) {
	var attrId = id.replace( runescape, funescape );
	return function( elem ) {
		//The error occurs here when trying to call getAttribute
                //on the document itself
		return elem.getAttribute("id") === attrId;
	};
};

Couple of things:

  • There needs to be an id listener attached to the document. It doesn't need to do anything, but it must be there.
  • This seems specific to tables, if I switch the <table> with a <div> the problem does not occur.
  • The issue does not occur in IE7, IE9, or the latest Chrome and Firefox. It seems specific to IE8.

I was unable to debug this any deeper on my own.

Thanks.

Change History

comment:1 Changed 23 months ago by gibson042

  • Status changed from new to closed
  • Resolution set to worksforme

I am unable to reproduce on jquery-1.8.3 or jquery-git with IE7 or IE8. Please let us know if you continue to observe this behavior.

comment:2 Changed 23 months ago by gibson042

  • Component changed from unfiled to event

comment:3 Changed 23 months ago by tj.vantoll

It's an IE8 only issue. I see it on  http://jsfiddle.net/tj_vantoll/tg2VU/show in both a real IE8 install as well as IE8 via BrowserStack.

The link is successfully removed but I do get a JS error.

comment:4 Changed 23 months ago by gibson042

  • Status changed from closed to reopened
  • Resolution worksforme deleted

Ah, I see now. Removing the ancestor element makes its parent a DocumentFragment for further event processing, which is invalid input for Sizzle. Sneaky.

comment:5 Changed 23 months ago by gibson042

  • Owner set to gibson042
  • Status changed from reopened to assigned

comment:6 Changed 23 months ago by mikesherov

Tsk tsk. You should know better than to challenge the king of all triagers: tj.vantoll. :)

comment:7 Changed 23 months ago by Richard Gibson

  • Status changed from assigned to closed
  • Resolution set to fixed

Fix #13208: only check elements for delegation matches

Changeset: fc2ba2e1361126c39f955437ee025cfca3bffa65

comment:8 Changed 23 months ago by gibson042

  • Milestone changed from None to 1.9.1

comment:9 Changed 10 months ago by dcherman

This seems like it may still be an issue in the 2.X branch. Here's a repro case ( tested in Chrome Latest ):

 http://jsfiddle.net/nsatZ/3/

comment:10 Changed 9 months ago by dmethvin

dcherman can you open a new ticket? Tagging onto old tickets is not good, even if it might be the same problem. Thanks!

comment:11 Changed 9 months ago by navjot.singh@…

I am having the same problem. Can you tell the solution to this problem ?

Note: See TracTickets for help on using tickets.