Bug Tracker

Changeset 4031

Show
Ignore:
Timestamp:
12/05/07 05:01:46 (1 year ago)
Author:
davidserduke
Message:

Fixed #1419 where IE failed with .text() on an XML node. This is part of a series of tickets including #1264 where the context of the DOM manipulation was a problem in xml and iframe documents.

Location:
trunk/jquery
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/src/core.js

    r4029 r4031  
    918918        var ret = []; 
    919919        context = context || document; 
    920         if (!context.createElement)  
     920        // !context.createElement fails in IE with an error but returns typeof 'object' 
     921        if (typeof context.createElement == 'undefined')  
    921922            context = context.ownerDocument || context[0] && context[0].ownerDocument || document; 
    922923 
  • trunk/jquery/test/unit/core.js

    r4029 r4031  
    174174    var $div = $("<div/>"); 
    175175    var $span = $("<span/>", $div); 
    176     equals($span.length, 1, "Verify a span created with a div context works"); 
     176    equals($span.length, 1, "Verify a span created with a div context works, #1763"); 
     177}); 
     178 
     179test("$(selector, xml).text(str) - Loaded via XML document", function() { 
     180    expect(2); 
     181    stop(); 
     182    $.get('data/dashboard.xml', function(xml) {  
     183        // tests for #1419 where IE was a problem 
     184        equals( $("tab:first", xml).text(), "blabla", "Verify initial text correct" ); 
     185        $("tab:first", xml).text("newtext"); 
     186        equals( $("tab:first", xml).text(), "newtext", "Verify new text correct" ); 
     187        start(); 
     188    }); 
    177189}); 
    178190 
     
    356368                    titles.push($(this).attr('title')); 
    357369              }); 
    358               ok( titles[0] == 'Location', 'attr() in XML context: Check first title' ); 
    359               ok( titles[1] == 'Users', 'attr() in XML context: Check second title' ); 
     370              equals( titles[0], 'Location', 'attr() in XML context: Check first title' ); 
     371              equals( titles[1], 'Users', 'attr() in XML context: Check second title' ); 
    360372              start(); 
    361373        });