File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1616 "Uint8Array": true,
1717 "Int16Array": true,
1818 "Int32Array": true,
19- "ArrayBuffer": true
19+ "ArrayBuffer": true,
20+ "SVGElement": false
2021 },
2122 "rules": {
2223 "no-trailing-spaces": [2],
Original file line number Diff line number Diff line change 1717
1818 if ( sel . size ( ) ) {
1919 if ( typeof obj === 'string' ) {
20- checkVal ( obj , arguments [ 1 ] ) ;
20+ checkVal ( sel , obj , arguments [ 1 ] ) ;
2121 }
2222 else {
23- Object . keys ( obj ) . forEach ( function ( key ) { checkVal ( key , obj [ key ] ) ; } ) ;
23+ Object . keys ( obj ) . forEach ( function ( key ) { checkVal ( sel , key , obj [ key ] ) ; } ) ;
2424 }
2525 }
2626
2727 return originalSelStyle . apply ( sel , arguments ) ;
2828 } ;
2929
30- function checkVal ( key , val ) {
30+ function checkVal ( sel , key , val ) {
3131 if ( typeof val === 'string' ) {
3232 // in case of multipart styles (stroke-dasharray, margins, etc)
3333 // test each part separately
3737 throw new Error ( 'd3 selection.style called with value: ' + val ) ;
3838 }
3939 } ) ;
40+
41+ // Microsoft browsers incl. "Edge" don't support CSS transform on SVG elements
42+ if ( key === 'transform' && sel . node ( ) instanceof SVGElement ) {
43+ throw new Error ( 'd3 selection.style called on an SVG element with key: ' + key ) ;
44+ }
4045 }
4146
4247 }
You can’t perform that action at this time.
0 commit comments