Bug Tracker

Changeset 4513 for trunk/jquery/test

Show
Ignore:
Timestamp:
01/23/08 03:54:23 (1 year ago)
Author:
davidserduke
Message:

Fix #2184 by using the jQuery.clean() function instead of a direct innerHTML assignment in the clone() function for IE.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/test/unit/core.js

    r4449 r4513  
    956956 
    957957test("clone()", function() { 
    958     expect(4); 
     958    expect(20); 
    959959    ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Assert text for #en' ); 
    960960    var clone = $('#yahoo').clone(); 
    961961    ok( 'Try them out:Yahoo' == $('#first').append(clone).text(), 'Check for clone' ); 
    962962    ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Reassert text for #en' ); 
     963 
     964    var cloneTags = [  
     965        "<table/>", "<tr/>", "<td/>", "<div/>",  
     966        "<button/>", "<ul/>", "<ol/>", "<li/>", 
     967        "<input type='checkbox' />", "<select/>", "<option/>", "<textarea/>", 
     968        "<tbody/>", "<thead/>", "<tfoot/>", "<iframe/>" 
     969    ]; 
     970    for (var i = 0; i < cloneTags.length; i++) { 
     971        var j = $(cloneTags[i]); 
     972        equals( j[0].tagName, j.clone()[0].tagName, 'Clone a &lt;' + cloneTags[i].substring(1)); 
     973    } 
     974 
    963975    // using contents will get comments regular, text, and comment nodes 
    964976    var cl = $("#nonnodes").contents().clone();