-
Notifications
You must be signed in to change notification settings - Fork 1.7k
WebGL renderer doesn't work in a shadow dom #5338
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
Comments
I don't claim to understand this fix and please excuse if this is an entirely separate issue (for me), but would this have any impact on external libs that allow for making an image off a DOM element, i.e., html-to-image? I ask because I don't understand why disabling WebGL allows for this lib to just work, while when WebGL renderer is enabled, it captures a black canvas. A code snippet follows to help clarify: function snap() {
htmlToImage.toJpeg(<HTMLDivElement>get(crtRef)!.getElementsByClassName('xterm-screen')[0],
{ quality: 0.95 }).then((dataUrl:string) => {
const link = document.createElement('a')
link.download = `${get(value)}-crt-snap.jpg`
link.href = dataUrl
link.click()
})
} ... whereas the |
@CGNonofr Can you plz provide a minimal repro example? This way we have a common error ground, from where we can investigate. @theflyingape No clue if it is related, but my first guess for your issue would be, that html-to-image does not correctly pull the webgl canvas content into its intermediate SVG. |
@jerch perhaps another addon to capure DOM or SVG is in order? 😉 |
I can probably a minimal repo exemple, but the suggested fix seems obvious enough to me to understand the issue that was already fixed somewhere else in the code in the past I'll provide a repo when I'll be able to |
@CGNonofr Gonna close the issue, feel free to re-open, if something is left unanswered (preferably a discussion/question, unless it is clearly a bug of xterm.js). |
I've attached a PR to the issue, why are you closing it ?? |
Oh sorry, didnt see that until now. Reopened the issue. |
Is the reproduction repo still required? Is there anything I can do to help moving forward on this? |
Yes a minimal repro would still be good, as we otherwise have no way to test it all. In general we try to be test-driven to some degree, so ideally we have things tested automatically in CI. But this seems rather cumbersome for this case here, so a minimal repro for a manual test is good enough imho and would document at least one setup, that it is supposed to fix. |
I was actually able to add a shadow dom test, see the attached PR |
Details
Steps to reproduce
The text was updated successfully, but these errors were encountered: