Skip to content
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

CSS3DRenderer: Modify perspective transform to avoid issues in Chrome and Firefox #27017

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

donmccurdy
Copy link
Collaborator

@donmccurdy donmccurdy commented Oct 20, 2023

Related:

Description

As described in #26950, Chrome, Safari, and Firefox all have slightly different issues rendering HTML elements positioned with CSS 3D transforms. I've reported bugs to Chrome and Safari, but some similar issues have been open for a while. My approach with this fix was to try slightly different CSS syntax that seemed like it should do the same thing, and see if any alternatives would side-step the browser issues.

This solution avoids the issues in Chrome and Firefox, leaving only the original issue in Safari. When the container has even-numbered pixel width and height, Safari renders correctly as well.

References on perspective: XXpx vs. transform: perspective(XXpx):

This contribution is funded by The New York Times.

@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 21, 2023

/cc @yomotsu

@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 25, 2023

Ref: #26950 (comment)

I'm not sure yet if there is a downside.

I have tested your branch with some examples on Chrome, Firefox and Safari and couldn't see any regressions so far. Still, should we target r159 for this change so we have more time for testing on dev?

@mrdoob
Copy link
Owner

mrdoob commented Oct 26, 2023

I think this can go in already 👍

@mrdoob mrdoob added this to the r158 milestone Oct 26, 2023
@mrdoob mrdoob merged commit 6408765 into mrdoob:dev Oct 26, 2023
18 checks passed
@donmccurdy donmccurdy deleted the hotfix/css3drenderer-perspective branch October 26, 2023 14:04
@donmccurdy
Copy link
Collaborator Author

Thank you for the additional testing @Mugen87!

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.

3 participants