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

Commitccbd6b9

Browse files
authored
Traversing: Fixcontents() on<object>s with children in IE
The original fix didn't account for the fact that in IE `<object>` elementswith no `data` attribute have an object `contentDocument`. The fix leveragesthe fact that this special object has a null prototype.Closesgh-4390Refgh-4384Refgh-4385
1 parent4d865d9 commitccbd6b9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎src/traversing.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
define([
22
"./core",
3+
"./var/getProto",
34
"./var/indexOf",
45
"./traversing/var/dir",
56
"./traversing/var/siblings",
@@ -9,7 +10,7 @@ define( [
910
"./core/init",
1011
"./traversing/findFilter",
1112
"./selector"
12-
],function(jQuery,indexOf,dir,siblings,rneedsContext,nodeName){
13+
],function(jQuery,getProto,indexOf,dir,siblings,rneedsContext,nodeName){
1314

1415
"use strict";
1516

@@ -145,7 +146,13 @@ jQuery.each( {
145146
returnsiblings(elem.firstChild);
146147
},
147148
contents:function(elem){
148-
if(elem.contentDocument!=null){
149+
if(elem.contentDocument!=null&&
150+
151+
// Support: IE 11+
152+
// <object> elements with no `data` attribute has an object
153+
// `contentDocument` with a `null` prototype.
154+
getProto(elem.contentDocument)){
155+
149156
returnelem.contentDocument;
150157
}
151158

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp