aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPat O'Callaghan <patocallaghan@gmail.com>2019-05-06 18:23:00 +0100
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2019-05-06 21:07:53 +0200
commit42badf34607092fd754a18f5b71e9b08457f982a (patch)
tree0bc39f3ff8b812ba2c4dc8007b3c243833ca6d1d /test
parent0e3e23df2275ed3a3f9f4ec3fd1dca4587969b7c (diff)
downloadjquery-42badf34607092fd754a18f5b71e9b08457f982a.tar.gz
jquery-42badf34607092fd754a18f5b71e9b08457f982a.zip
Traversing: Fix `contents()` on `<object>`s with children
(cherry-picked from 4d865d96aa5aae91823c50020b5c19da79566811) Fixes gh-4384 Closes gh-4385
Diffstat (limited to 'test')
-rw-r--r--test/unit/traversing.js13
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 );