Skip to main content

Bug Tracker

Side navigation

#5744 closed bug (worksforme)

Opened January 04, 2010 03:44AM UTC

Closed November 14, 2010 04:08AM UTC

Last modified March 15, 2012 10:29AM UTC

jQuery selectors search inside HTML comments, causing crashes and/or other errors

Reported by: MrPete Owned by: john
Priority: critical Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

Consider this scenario:

<body>

<div id="x">

<!--<small class="b"><a href="#" ></a></small>-->

<small class="b"><a href="#">Oct 3, 2009</a></small>

</div>

</body>

this:

var str= $('small.b:first').text();

Will either crash FireFox (total lockup) or return an empty string depending on (something)

I'm using jQuery inside of GreaseMonkey, for whatever that is worth. But it appears this is a jQuery problem.

Attachments (2)
  • gmstub.user.js (0.6 KB) - added by MrPete January 04, 2010 03:45AM UTC.

    GM stub excercising this bug

  • test.html (0.3 KB) - added by MrPete January 04, 2010 03:45AM UTC.

    Small test HTML file for this bug

Change History (3)

Changed January 04, 2010 03:47AM UTC by MrPete comment:1

Sorry about the non-code formatting. My first jQuery ticket :)

Changed January 06, 2010 11:18AM UTC by MrPete comment:2

Update: AFAIK, this is NOT a crasher bug. I've isolated the crashes to another issue.

The effect still stands, as demonstrated in my attachments: selectors "see" nonexistent elements inside of HTML comments.

Changed November 14, 2010 04:08AM UTC by dmethvin comment:3

resolution: → worksforme
status: newclosed