-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Closed
Milestone
Description
First of all, thank you very much for this project and for your work!
Description
A regression could have been introduced in this commit 3e3b09d and, as it is returning documentContent only for <iframe>, it is no longer possible to access the document content of an <object> with an svg provided in the data attribute.
For example this would stop working since version 3.2.0:
<object id="svg-object" data="1x1.svg"></object>var svgObject = $("#svg-object")
svgObject.on("load", function(){
svgObject.contents().find('svg');
})Test link
The test to reproduce this bug would need a svg in the same domain, as it isn't possible to upload it to any of the platforms, I cannot provide a test link. However, I've prepared a PR with the fix and the test case provided in it is the following:
QUnit.test( "contents() for <object />", function( assert ) {
assert.expect( 2 );
var svgObject = jQuery( "<object id='svg-object' data='" + baseURL + "1x1.svg'></object>" );
var done = assert.async();
svgObject.on( "load", function() {
var contents = jQuery( "#svg-object" ).contents();
assert.equal( contents.length, 1, "Check object contents" );
assert.equal( contents.find( "svg" ).length, 1, "Find svg within object" );
done();
} );
jQuery( "#qunit-fixture" ).append( svgObject );
} );Metadata
Metadata
Assignees
Labels
No labels