Skip to content

CSSRenderer: Ensure removing CSS objects works within iFrames. #29663

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

Merged

Conversation

yomotsu
Copy link
Contributor

@yomotsu yomotsu commented Oct 15, 2024

Fixed #29660

Description

scene.remove(CSS2DObjectInstance) may not work correctly if the CSS2DRenderer is inside an iframe.
Here is the demo of the problem:
https://jsfiddle.net/87f9azgn/

This PR is to fix it.

As I mentioned #29660 (comment) ,
The constructor of DOM element depends on its window.
Therefore object.element instanceof Element may not work in an iframe.
Element is actually window.Element and not a iframeWindow.Element.

@Mugen87 Mugen87 added this to the r170 milestone Oct 15, 2024
@Mugen87 Mugen87 merged commit aa4fa45 into mrdoob:dev Oct 15, 2024
11 checks passed
@Mugen87 Mugen87 changed the title fix: remove methods for CSSRenderer Objects within iframe CSSRenderer: Ensure removing CSS objects works within iFrames. Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The CSS2DObject cannot be deleted from the iframe
2 participants