Bug Tracker

Ticket #10558 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Test Support bug

Reported by: zhengzongyi@… Owned by: dmethvin
Priority: blocker Milestone: 1.7
Component: support Version: 1.7b2
Keywords: Cc:
Blocking: Blocked by:

Description

hi , when i read the jQuery's code, in line 1286. the jQuery append firstChild of div that is either a table or textNode, not a checkbox. but test its checked property in line 1289.

thanks.

Change History

comment:1 Changed 3 years ago by dmethvin

  • Owner set to zhengzongyi@…
  • Status changed from new to pending

I think the code you are referring to is here in support.js:

input.setAttribute("checked", "checked");
div.appendChild( input );
fragment = document.createDocumentFragment();
fragment.appendChild( div.firstChild );

// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;

It looks correct to me; the fragment is being cloned and the only thing in the fragment is an input element. Can you provide more information, or better yet a test case that fails?

comment:2 Changed 3 years ago by anonymous

sorry, i can't provide more information. i debug the code, the "fragment.lastChild" isn't a input, it is a textNode or table.

comment:3 Changed 3 years ago by dmethvin

  • Priority changed from undecided to blocker
  • Status changed from pending to open
  • Version changed from 1.6.4 to 1.7b2
  • Component changed from unfiled to support
  • Milestone changed from None to 1.7

I agree, it seems like a bug. Thanks! I think the code should have appended div.lastChild which is an <input /> and not div.firstChild.

comment:4 Changed 3 years ago by dmethvin

  • Owner changed from zhengzongyi@… to dmethvin
  • Status changed from open to assigned

comment:5 Changed 3 years ago by dmethvin

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

comment:6 Changed 3 years ago by anonymous

I think this is fixed.

Note: See TracTickets for help on using tickets.