@@ -1426,59 +1426,3 @@ lib.getPositionFromD3Event = function() {
14261426 ] ;
14271427 }
14281428} ;
1429-
1430- // Pixelated image rendering
1431- // The actual CSS declaration is prepended with fallbacks for older browsers.
1432- // NB. IE's `-ms-interpolation-mode` works only with <img> not with SVG <image>
1433- // https://developer.mozilla.org/en-US/docs/Web/CSS/image-rendering
1434- // https://caniuse.com/?search=image-rendering
1435- // http://phrogz.net/tmp/canvas_image_zoom.html
1436- var PIXELATED_IMAGE_DECLARATIONS = [
1437- [ 'image-rendering' , 'optimizeSpeed' ] ,
1438- [ 'image-rendering' , '-moz-crisp-edges' ] ,
1439- [ 'image-rendering' , '-o-crisp-edges' ] ,
1440- [ 'image-rendering' , '-webkit-optimize-contrast' ] ,
1441- [ 'image-rendering' , 'optimize-contrast' ] ,
1442- [ 'image-rendering' , 'crisp-edges' ] ,
1443- [ 'image-rendering' , 'pixelated' ]
1444- ] ;
1445-
1446- lib . PIXELATED_IMAGE_STYLE = PIXELATED_IMAGE_DECLARATIONS . map ( function ( d ) {
1447- return d . join ( ': ' ) + '; ' ;
1448- } ) . join ( '' ) ;
1449-
1450- var _supportsPixelated = null ;
1451-
1452- /**
1453- * Check browser support for pixelated image rendering
1454- *
1455- * @return {boolean }
1456- */
1457- lib . supportsPixelatedImage = function ( ) {
1458- if ( _supportsPixelated !== null ) { // only run the feature detection once
1459- return _supportsPixelated ;
1460- }
1461- if ( lib . isIE ( ) ) {
1462- _supportsPixelated = false ;
1463- } else {
1464- var declarations = Array . from ( PIXELATED_IMAGE_DECLARATIONS ) . reverse ( ) ;
1465- var supports = window . CSS && window . CSS . supports || window . supportsCSS ;
1466- if ( typeof supports === 'function' ) {
1467- _supportsPixelated = declarations . some ( function ( d ) {
1468- return supports . apply ( null , d ) ;
1469- } ) ;
1470- } else {
1471- var Drawing = require ( '../components/drawing' ) ;
1472- var image3 = Drawing . tester . append ( 'image' ) ;
1473- var cStyles = window . getComputedStyle ( image3 . node ( ) ) ;
1474- image3 . attr ( 'style' , lib . PIXELATED_IMAGE_STYLE ) ;
1475- _supportsPixelated = declarations . some ( function ( d ) {
1476- var value = d [ 1 ] ;
1477- return cStyles . imageRendering === value ||
1478- cStyles . imageRendering === value . toLowerCase ( ) ;
1479- } ) ;
1480- image3 . remove ( ) ;
1481- }
1482- }
1483- return _supportsPixelated ;
1484- } ;
0 commit comments