Closed DustinBrett closed 1 year ago
Base: 63.36% // Head: 63.24% // Decreases project coverage by -0.12%
:warning:
Coverage data is based on head (
728755c
) compared to base (d58db90
). Patch coverage: 65.00% of modified lines in pull request are covered.:exclamation: Current head 728755c differs from pull request most recent head 79d631d. Consider uploading reports for the commit 79d631d to get more accurate results
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Can you take a look at the demo I wrote? The height of the iframe is missing, which is not as expected. thanks
https://codesandbox.io/s/sweet-knuth-3n57ws?file=/index.html
Can you take a look at the demo I wrote? The height of the iframe is missing, which is not as expected. thanks
https://codesandbox.io/s/sweet-knuth-3n57ws?file=/index.html
I'll take a look as I didn't have this specific issue.
Can you take a look at the demo I wrote? The height of the iframe is missing, which is not as expected. thanks
https://codesandbox.io/s/sweet-knuth-3n57ws?file=/index.html
To me this doesn't seem so bad but maybe I am missing something. It did clone the iframe and the image inside, but didn't respect the height of the iframe you are saying? I'm not sure I have a solution for this atm and also I am wondering if this issue is more related to my previous merged PR where iframe cloning began. Could you clarify the expected results and suggestions if you have any? I'm not sure if this PR needs to solve this specific issue unless the code changes caused it.
To me this doesn't seem so bad but maybe I am missing something. It did clone the iframe and the image inside, but didn't respect the height of the iframe you are saying? I'm not sure I have a solution for this atm and also I am wondering if this issue is more related to my previous merged PR where iframe cloning began. Could you clarify the expected results and suggestions if you have any? I'm not sure if this PR needs to solve this specific issue unless the code changes caused it.
The solution for #351 PR is to replace the iframe
tag with a div
tag, set the div
as the style of the iframe
, and then clone the content in the iframe body
To me this doesn't seem so bad but maybe I am missing something. It did clone the iframe and the image inside, but didn't respect the height of the iframe you are saying? I'm not sure I have a solution for this atm and also I am wondering if this issue is more related to my previous merged PR where iframe cloning began. Could you clarify the expected results and suggestions if you have any? I'm not sure if this PR needs to solve this specific issue unless the code changes caused it.
![]()
![]()
The solution for #351 PR is to replace the
iframe
tag with adiv
tag, set thediv
as the style of theiframe
, and then clone the content in the iframe body
Ok thanks for clarification. It would be good if the iframe could be cloned without it being a div, unless that is the ideal solution. I'll look into it more.
To me this doesn't seem so bad but maybe I am missing something. It did clone the iframe and the image inside, but didn't respect the height of the iframe you are saying? I'm not sure I have a solution for this atm and also I am wondering if this issue is more related to my previous merged PR where iframe cloning began. Could you clarify the expected results and suggestions if you have any? I'm not sure if this PR needs to solve this specific issue unless the code changes caused it.
![]()
![]()
The solution for #351 PR is to replace the
iframe
tag with adiv
tag, set thediv
as the style of theiframe
, and then clone the content in the iframe body
I've looked into this and it turns out that although #351 had a solution, it was not because of the div but because of changing the iframe
(inline frame) to display as block. After looking at https://stackoverflow.com/a/28954135/5895982 I think it might make sense for this use case. I've applied that change in the latest commit and tested on your codesandbox and it seemed to give the correct result now.
:tada: This PR is included in version 1.11.6 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
My previous PR adding iframe cloning was incomplete.
Description
There were 2 specific reasons it didn't work:
instanceof
across realms (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms)iframe
need to come fromcontentDocument.body.childNodes
To solve
instanceof
I've changed to comparing such as:Object.getPrototypeOf(node).constructor.name === instance.name
whereinstance
would be a prototype such asHTMLImageElement
. This will also check recursively to see for example if something likeHTMLDivElement
also hasElement
in it's prototype chain and is therefore an instance of it.Another solution suggested in MDN could be something like
myNode instanceof myNode.ownerDocument.defaultView.SVGElement
, but I had no luck (Illegal invocation
) implementing this and I feel the method I have is a bit more ideal than just checkingtagName
's.Motivation and Context
I want to fix this as I added iframe capture changes recently which caused this new issue to be visible.
Types of changes
Self Check before Merge