Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4d865d9

Browse files
patocallaghanmgol
authored andcommitted
Traversing: Fixcontents() on<object>s with children
Fixesgh-4384Closesgh-4385
1 parent110802c commit4d865d9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

‎src/traversing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jQuery.each( {
145145
returnsiblings(elem.firstChild);
146146
},
147147
contents:function(elem){
148-
if(typeofelem.contentDocument!=="undefined"){
148+
if(elem.contentDocument!=null){
149149
returnelem.contentDocument;
150150
}
151151

‎test/unit/traversing.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,19 @@ QUnit.test( "contents() for <object />", function( assert ) {
808808
jQuery("#qunit-fixture").append(svgObject);
809809
});
810810

811+
QUnit.test("contents() for <object /> with children",function(assert){
812+
assert.expect(1);
813+
814+
varobject="<object type='application/x-shockwave-flash' width='200' height='300' id='penguin'>"+
815+
"<param name='movie' value='flash/penguin.swf'>"+
816+
"<param name='quality' value='high'>"+
817+
"<img src='images/penguin.jpg' width='200' height='300' alt='Penguin'>"+
818+
"</object>";
819+
820+
varcontents=jQuery(object).contents();
821+
assert.equal(contents.length,3,"Check object contents children are correct");
822+
});
823+
811824
QUnit.test("contents() for <frame />",function(assert){
812825
assert.expect(2);
813826

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp