This is my first question on this forum. I apologize if I have made any mistakes.
I came across an issue while developing a scene using three.js with CSS3DObjects.
I noticed that the CSS3DObjects are slightly shifted in Safari, whereas they appear correctly in other browsers like Chrome and Firefox.
I replicated the problem in this simple example.
The CSS3DObject is a simple text wrapped in a div without any applied CSS styles.
In Safari the object is in the right position, but it appears slightly moved visually.
EDIT:
Problem was with using aspect-ratio, when I remove aspect ratio, it start rendering on right position. So safari still have problem with aspect-ratio implementation.
Zoom is on both browsers 100%.
It’s hard to find the issue with these examples, because there is only css 3D part. I find it with using css3d with standard webgl canvas. I test it on more computers (still same result).
If I hover over the canvas and then the cssrenderer… they are a different width/heights.
That might be your problem. They need to be the exact same size.
edit: hmm I could be wrong… I tried forcing their sizes to be the same but it still looked wrong.
perhaps there is a problem with the resize handler?
Another thing that has bitten me in the past is sometimes a random extension will screw up the css renderer… maybe try checking without extensions etc.
It’s not had same exactly same size. But in safari it was broken, but remove aspect-ratio helped. Thanks for help.
It’s still work in progress, I just working on make it same size etc.
It’s seems that safari have some problems with aspect ratio (also I had problem on safari if I use bigger size for div than was I css3Dcanvas width, it just cut off part of div. Text have also problem with rendering (sometimes are blur), but I hope i found solution for all these problems.
I would recommend making sure that you’re using a CSS reset: to make sure that the issue isn’t simply caused by different browsers using different default stylesheets.
Glad you figured out solutions to all the problems.
and yeah… now that you mention it, I recall that I had the blurry text problem too at one point, and yeah, you can fix it with larger font size, but keep an eye on performance… I think I noticed that at a certain point, using larger fonts started to slow things down too, so it’s a balancing act.