diff options
author | Pat O'Callaghan <patocallaghan@gmail.com> | 2019-05-06 18:23:00 +0100 |
---|---|---|
committer | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2019-05-06 19:23:00 +0200 |
commit | 4d865d96aa5aae91823c50020b5c19da79566811 (patch) | |
tree | 1a0dcf5ad6c982c25f4e2dacca140f27a257b80b /test/unit | |
parent | 110802c7f22b677ef658963aa95ebdf5cb9c5573 (diff) | |
download | jquery-4d865d96aa5aae91823c50020b5c19da79566811.tar.gz jquery-4d865d96aa5aae91823c50020b5c19da79566811.zip |
Traversing: Fix `contents()` on `<object>`s with children
Fixes gh-4384
Closes gh-4385
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/traversing.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/traversing.js b/test/unit/traversing.js index e70c121ed..e8d23536e 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -808,6 +808,19 @@ QUnit.test( "contents() for <object />", function( assert ) { jQuery( "#qunit-fixture" ).append( svgObject ); } ); +QUnit.test( "contents() for <object /> with children", function( assert ) { + assert.expect( 1 ); + + var object = "<object type='application/x-shockwave-flash' width='200' height='300' id='penguin'>" + + "<param name='movie' value='flash/penguin.swf'>" + + "<param name='quality' value='high'>" + + "<img src='images/penguin.jpg' width='200' height='300' alt='Penguin'>" + + "</object>"; + + var contents = jQuery( object ).contents(); + assert.equal( contents.length, 3, "Check object contents children are correct" ); +} ); + QUnit.test( "contents() for <frame />", function( assert ) { assert.expect( 2 ); |