Skip to main content

Bug Tracker

Side navigation

#6423 closed bug (wontfix)

Opened April 12, 2010 11:33AM UTC

Closed July 11, 2011 05:34PM UTC

"before()" works incorrectly with "clone()" in FF

Reported by: xitianfz Owned by:
Priority: low Milestone: 1.next
Component: manipulation Version: 1.4.2
Keywords: before clone FF Cc: timmywil
Blocked by: Blocking:
Description

alert($('<p>aaa</p>').clone().before('<a>bbb</a>').attr('nodeName'));

alert($('<p>aaa</p>').clone().after('<a>bbb</a>').attr('nodeName'));

These code will print "P" and "P" in IE, while it will be "A" and "P" in FF.

Attachments (0)
Change History (6)

Changed October 02, 2010 07:15PM UTC by addyosmani comment:1

need: ReviewPatch
priority: → low

Test case: http://jsfiddle.net/fA4tC/

FF 3.6.10: A, P

Chrome 6.04: A, P

IE 9.0: P, P

IE 6.0: P, P

Safari 5.02: A,P

It would appear that IE is the only browser outputting P,P for this at the moment. As there are workarounds for this type of behaviour, I'm flagging as a low priority bug requiring a review and patch.

Changed October 21, 2010 01:35AM UTC by addyosmani comment:2

status: newopen

Changed October 21, 2010 01:35AM UTC by addyosmani comment:3

keywords: before clonebefore clone FF
milestone: 1.4.31.4.4

Changed October 21, 2010 10:57PM UTC by snover comment:4

milestone: 1.4.41.4.5

Retargeting due to severity of regressions in 1.4.3.

Changed July 11, 2011 05:08PM UTC by addyosmani comment:5

cc: → timmywil

Hmm. The behaviour for this ticket appears to have changed from returning unexpected values to returning 'undefined' for both cases with FF5 and the latest jQuery (edge). http://jsfiddle.net/fA4tC/2/

Changed July 11, 2011 05:34PM UTC by ajpiano comment:6

resolution: → wontfix
status: openclosed

nodeName is a property, so in jQuery 1.6 and greater, it should be accessed using the .prop() method.