File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1088,7 +1088,7 @@ d3 = function() {
10881088 }
10891089 return d3_transition ( subgroups , id ) ;
10901090 } ;
1091- var d3_selectionRoot = d3_selection ( [ [ d3_document ] ] ) ;
1091+ var d3_selectionRoot = d3_selection ( [ [ d3_selectRoot ] ] ) ;
10921092 d3_selectionRoot [ 0 ] . parentNode = d3_selectRoot ;
10931093 d3 . select = function ( selector ) {
10941094 return typeof selector === "string" ? d3_selectionRoot . select ( selector ) : d3_selection ( [ [ selector ] ] ) ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ import "node";
5151import "enter" ;
5252import "transition" ;
5353
54- var d3_selectionRoot = d3_selection ( [ [ d3_document ] ] ) ;
54+ var d3_selectionRoot = d3_selection ( [ [ d3_selectRoot ] ] ) ;
5555
5656d3_selectionRoot [ 0 ] . parentNode = d3_selectRoot ;
5757
Original file line number Diff line number Diff line change @@ -7,11 +7,17 @@ var suite = vows.describe("d3.selection");
77suite . addBatch ( {
88 "selection" : {
99 topic : load ( "selection/selection" ) . document ( ) ,
10- "selects the document" : function ( d3 ) {
10+ "selects the document element " : function ( d3 ) {
1111 var selection = d3 . selection ( ) ;
1212 assert . equal ( selection . length , 1 ) ;
1313 assert . equal ( selection [ 0 ] . length , 1 ) ;
14- assert . equal ( selection [ 0 ] [ 0 ] . nodeType , 9 ) ;
14+ assert . equal ( selection [ 0 ] [ 0 ] . nodeType , 1 ) ;
15+ assert . equal ( selection [ 0 ] [ 0 ] . tagName , "HTML" ) ;
16+ } ,
17+ "the parentNode is also the document element" : function ( d3 ) {
18+ var parentNode = d3 . selection ( ) [ 0 ] . parentNode ;
19+ assert . equal ( parentNode . nodeType , 1 ) ;
20+ assert . equal ( parentNode . tagName , "HTML" ) ;
1521 } ,
1622 "is an instanceof d3.selection" : function ( d3 ) {
1723 assert . instanceOf ( d3 . selection ( ) , d3 . selection ) ;
Original file line number Diff line number Diff line change @@ -7,8 +7,12 @@ var suite = vows.describe("d3.transition");
77suite . addBatch ( {
88 "transition" : {
99 topic : load ( "transition/transition" ) . document ( ) ,
10- "selects the document" : function ( d3 ) {
11- assert . domEqual ( d3 . transition ( ) [ 0 ] [ 0 ] . nodeType , 9 ) ;
10+ "selects the document element" : function ( d3 ) {
11+ var transition = d3 . transition ( ) ;
12+ assert . equal ( transition . length , 1 ) ;
13+ assert . equal ( transition [ 0 ] . length , 1 ) ;
14+ assert . equal ( transition [ 0 ] [ 0 ] . nodeType , 1 ) ;
15+ assert . equal ( transition [ 0 ] [ 0 ] . tagName , "HTML" ) ;
1216 } ,
1317 "is an instanceof d3.transition" : function ( d3 ) {
1418 assert . isTrue ( d3 . transition ( ) instanceof d3 . transition ) ;
You can’t perform that action at this time.
0 commit comments