Bug Tracker


Ticket #12359 (closed bug: fixed)

Opened 20 months ago

Last modified 20 months ago

1.8.0 creating invalid tag/attribute when loading the library

Reported by: Herbalite Owned by:
Priority: blocker Milestone: 1.8.1
Component: selector Version: 1.8.0
Keywords: Cc:
Blocking: Blocked by:


Using XHTML strict documents and all the related headers including xml declaration. In FF 14.0.1 and Firebug 1.10.2 I get two errors. However they do not hinder code execution, so this is low priority.

The first problem occurs on line 5010

div.innerHTML = "<select><option selected></option></select>";

This should read


div.innerHTML = "<select><option selected='selected'></option></select>";


div.innerHTML = "<select><option selected=\"selected\"></option></select>";

The other line is 5036

div.innerHTML = "<input type='hidden'>";

This should read

div.innerHTML = "<input type='hidden'/>";

Change History

comment:1 Changed 20 months ago by dmethvin

#12357 is a duplicate of this ticket.

comment:2 Changed 20 months ago by dmethvin

  • Priority changed from undecided to blocker
  • Status changed from new to open
  • Milestone changed from None to 1.8.1

This is another cry for #10198. Thanks for the clear bug report!

comment:3 Changed 20 months ago by dmethvin

  • Component changed from unfiled to selector

comment:4 Changed 20 months ago by tomgrohl

As mentioned in #10198, I've wrote some code to check for content type and doctype.

It detects if closing tags / quoted attributes are required based on the following:

1 - content type is application/xhtml+xml 2 - content type is text/html and doctype is XHTML 3 - document is xul (Needs more testing though)

Generally is a doctype and/or content type is omitted it detaults to text/html.

This should fix this issue.

I'll create a pull request when I get a chance.

comment:5 Changed 20 months ago by Timmy Willison

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

Sizzle: make html from assertions xhtml compliant. Fixes #12359.

Changeset: 157c561c153a7e63040904241a0e2bee82109f81

comment:6 Changed 20 months ago by dmethvin

@Herbalite, can you try your code with  http://code.jquery.com/jquery-git.js and let us know if the problem has been fixed? Thanks!

P.S. Fix code now, ask me how.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.