diff options
Diffstat (limited to 'test/testabilityPatch.js')
| -rw-r--r-- | test/testabilityPatch.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 5fae2817..d97d88a1 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -107,7 +107,12 @@ function dealoc(obj) { function cleanup(element) { element.off().removeData(); - for ( var i = 0, children = element.contents() || []; i < children.length; i++) { + // Note: We aren't using element.contents() here. Under jQuery, element.contents() can fail + // for IFRAME elements. jQuery explicitly uses (element.contentDocument || + // element.contentWindow.document) and both properties are null for IFRAMES that aren't attached + // to a document. + var children = element[0].childNodes || []; + for ( var i = 0; i < children.length; i++) { cleanup(angular.element(children[i])); } } |
