-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Traversing: $.fn.contents() support for object #4046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/traversing.js
Outdated
| }, | ||
| contents: function( elem ) { | ||
| if ( nodeName( elem, "iframe" ) ) { | ||
| if ( nodeName( elem, "iframe" ) || nodeName( elem, "object" ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should just be checking typeof elem.contentDocument !== "undefined" or something to that effect. The check for a specific element is how the regression occurred. Are there any other elements where this might apply?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's applet, frame, iframe, and object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thanks!
I'll use that check and work on tests for those tags too.
Also, I'm seeing that the test for Node 8 is failing because the route for the svg is returning a 404.
Any advice on best practices for avoiding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason why you're using baseURL in the test? Usually a relative reference like data/1x1.svg should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed how it was done in other tests. Actually the problem was that I didn't add the svg extension to the karma config 😅.
I just applied the change you mention. However, due to the lack of browser support for applet nowadays, I wasn't able to prepare a test for this tag.
bd2c5a3 to
262417e
Compare
|
Hi @dmethvin ! |
|
@emibloque Nope, we're good. It should land before the next release goes out but I'm not sure when that will be at the moment. Thanks for the contribution! |
Fixes gh-4045
Summary
As described in gh-4045, this PR allows
<object>document content to be accessed again usingcontents()function.Checklist