From 39fc61d2c4aa2c7db9a0ede6aee1fd4264838bde Mon Sep 17 00:00:00 2001 From: Yomotsu Date: Sun, 21 Feb 2021 08:23:10 +0900 Subject: [PATCH] remove old css prefixes --- examples/js/renderers/CSS2DRenderer.js | 7 +------ examples/js/renderers/CSS3DRenderer.js | 16 +--------------- examples/jsm/renderers/CSS2DRenderer.js | 7 +------ examples/jsm/renderers/CSS3DRenderer.js | 16 +--------------- 4 files changed, 4 insertions(+), 42 deletions(-) diff --git a/examples/js/renderers/CSS2DRenderer.js b/examples/js/renderers/CSS2DRenderer.js index 5075e45160b302..02cb85708bd5db 100644 --- a/examples/js/renderers/CSS2DRenderer.js +++ b/examples/js/renderers/CSS2DRenderer.js @@ -92,13 +92,8 @@ THREE.CSS2DRenderer = function () { vector.applyMatrix4( viewProjectionMatrix ); var element = object.element; - var style = 'translate(-50%,-50%) translate(' + ( vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - vector.y * _heightHalf + _heightHalf ) + 'px)'; - - element.style.WebkitTransform = style; - element.style.MozTransform = style; - element.style.oTransform = style; - element.style.transform = style; + element.style.transform = 'translate(-50%,-50%) translate(' + ( vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - vector.y * _heightHalf + _heightHalf ) + 'px)'; element.style.display = ( object.visible && vector.z >= - 1 && vector.z <= 1 ) ? '' : 'none'; var objectData = { diff --git a/examples/js/renderers/CSS3DRenderer.js b/examples/js/renderers/CSS3DRenderer.js index 474dae2ac23266..f3258b70d5ab5a 100644 --- a/examples/js/renderers/CSS3DRenderer.js +++ b/examples/js/renderers/CSS3DRenderer.js @@ -74,7 +74,6 @@ THREE.CSS3DRenderer = function () { var cameraElement = document.createElement( 'div' ); - cameraElement.style.WebkitTransformStyle = 'preserve-3d'; cameraElement.style.transformStyle = 'preserve-3d'; cameraElement.style.pointerEvents = 'none'; @@ -196,7 +195,6 @@ THREE.CSS3DRenderer = function () { if ( cachedObject === undefined || cachedObject.style !== style ) { - element.style.WebkitTransform = style; element.style.transform = style; var objectData = { style: style }; @@ -230,18 +228,7 @@ THREE.CSS3DRenderer = function () { if ( cache.camera.fov !== fov ) { - if ( camera.isPerspectiveCamera ) { - - domElement.style.WebkitPerspective = fov + 'px'; - domElement.style.perspective = fov + 'px'; - - } else { - - domElement.style.WebkitPerspective = ''; - domElement.style.perspective = ''; - - } - + domElement.style.perspective = camera.isPerspectiveCamera ? fov + 'px' : ''; cache.camera.fov = fov; } @@ -265,7 +252,6 @@ THREE.CSS3DRenderer = function () { if ( cache.camera.style !== style ) { - cameraElement.style.WebkitTransform = style; cameraElement.style.transform = style; cache.camera.style = style; diff --git a/examples/jsm/renderers/CSS2DRenderer.js b/examples/jsm/renderers/CSS2DRenderer.js index 84e1780c001645..a142a6b6d2fc1f 100644 --- a/examples/jsm/renderers/CSS2DRenderer.js +++ b/examples/jsm/renderers/CSS2DRenderer.js @@ -98,13 +98,8 @@ var CSS2DRenderer = function () { vector.applyMatrix4( viewProjectionMatrix ); var element = object.element; - var style = 'translate(-50%,-50%) translate(' + ( vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - vector.y * _heightHalf + _heightHalf ) + 'px)'; - - element.style.WebkitTransform = style; - element.style.MozTransform = style; - element.style.oTransform = style; - element.style.transform = style; + element.style.transform = 'translate(-50%,-50%) translate(' + ( vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - vector.y * _heightHalf + _heightHalf ) + 'px)'; element.style.display = ( object.visible && vector.z >= - 1 && vector.z <= 1 ) ? '' : 'none'; var objectData = { diff --git a/examples/jsm/renderers/CSS3DRenderer.js b/examples/jsm/renderers/CSS3DRenderer.js index 9484ccfbd0bffb..c8d3222cca5411 100644 --- a/examples/jsm/renderers/CSS3DRenderer.js +++ b/examples/jsm/renderers/CSS3DRenderer.js @@ -79,7 +79,6 @@ var CSS3DRenderer = function () { var cameraElement = document.createElement( 'div' ); - cameraElement.style.WebkitTransformStyle = 'preserve-3d'; cameraElement.style.transformStyle = 'preserve-3d'; cameraElement.style.pointerEvents = 'none'; @@ -201,7 +200,6 @@ var CSS3DRenderer = function () { if ( cachedObject === undefined || cachedObject.style !== style ) { - element.style.WebkitTransform = style; element.style.transform = style; var objectData = { style: style }; @@ -235,18 +233,7 @@ var CSS3DRenderer = function () { if ( cache.camera.fov !== fov ) { - if ( camera.isPerspectiveCamera ) { - - domElement.style.WebkitPerspective = fov + 'px'; - domElement.style.perspective = fov + 'px'; - - } else { - - domElement.style.WebkitPerspective = ''; - domElement.style.perspective = ''; - - } - + domElement.style.perspective = camera.isPerspectiveCamera ? fov + 'px' : ''; cache.camera.fov = fov; } @@ -270,7 +257,6 @@ var CSS3DRenderer = function () { if ( cache.camera.style !== style ) { - cameraElement.style.WebkitTransform = style; cameraElement.style.transform = style; cache.camera.style = style;