Bug Tracker

Opened 14 years ago

Closed 14 years ago

#4559 closed bug (duplicate)

AREA tag can't be created with inline attributes in Firefox

Reported by: borg42 Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: area map firefox browser_dependent Cc:
Blocked by: Blocking:

Description

Eg. the following works in IE7 but not in FF3 (where its .length is 0):

$('<area alt="something" />')

Test case attached.

Using Windows XP SP2, IE 7.0.5730.13, FF 3.0.8, jQuery 1.3.2 min.

(Prio somewhere between major and minor...)

Attachments (1)

area1.html (2.0 KB) - added by borg42 14 years ago.
test case

Download all attachments as: .zip

Change History (6)

Changed 14 years ago by borg42

Attachment: area1.html added

test case

comment:1 Changed 14 years ago by dmethvin

Resolution: duplicate
Status: newclosed

This is a dup of #4484.

comment:2 Changed 14 years ago by borg42

Resolution: duplicate
Status: closedreopened

I believe this ticket is not a duplicate.

4484 says (if I got it right) that when you use html() for an element, you need to support a parameter that's valid html in a div.

4559 reports you can create an AREA tag (test 1 passes), but you can't support inline attributes to it (test 2-4 fails) - and only fails in FF.

If your argument was true, $('<area/>') and $('<li/>') would also fail as these are not valid html in the document/div scope - but they succeed, both in IE and in FF.

comment:3 Changed 14 years ago by dmethvin

I agree they're not exactly the same but they seem to be pretty related. You are using XHTML 1.0 Transitional in your doc and that doctype says that AREA tags are only valid within a MAP. In particular,

  alert($("<div><br /></div>").html());    // "<br>"
  alert($("<div><area /></div>").html());  // ""
  alert($("<map><area /></map>").html());  // "<area>"

These aren't dependent on jQuery; try it with bare DOM, a div, and .innerHTML.

Like I said in #4484, it may be possible to do a fix in jQuery.clean (basically, detect AREA tags and wrap it in a map).

comment:4 in reply to:  3 Changed 14 years ago by borg42

Replying to dmethvin:

I see your point, and I've RTFM; please set the ticket to duplicate and close it. :)

Please note that even though http://docs.jquery.com/Core/jQuery is adequately documented regarding this issue, http://docs.jquery.com/Html is not.

I'll open a new ticket with my feature request.

comment:5 Changed 14 years ago by dmethvin

Resolution: duplicate
Status: reopenedclosed
Note: See TracTickets for help on using tickets.