🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@emibloque
Copy link
Contributor

Fixes gh-4045

Summary

As described in gh-4045, this PR allows <object> document content to be accessed again using contents() function.

Checklist

},
contents: function( elem ) {
if ( nodeName( elem, "iframe" ) ) {
if ( nodeName( elem, "iframe" ) || nodeName( elem, "object" ) ) {
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

@emibloque emibloque force-pushed the gh-4045-object-contents branch from bd2c5a3 to 262417e Compare April 25, 2018 01:35
@emibloque
Copy link
Contributor Author

Hi @dmethvin !
Just to follow up on this, could I help with anything else here?
If there is anything left to do I will gladly try to work on that 😃

@dmethvin
Copy link
Member

@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!

@dmethvin dmethvin closed this in 0ba8e38 May 14, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Nov 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Object tag with svg being ignored at contents()

2 participants