@@ -513,7 +513,12 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
513513 } ,
514514
515515 YGNodeStyleSetGridTemplateRows : {
516- value : function ( nodeName , tracks ) {
516+ value : function ( nodeName , value ) {
517+ if ( ! value ) {
518+ return ;
519+ }
520+
521+ const tracks = parseGridTrackList ( this , value ) ;
517522 if ( ! tracks || tracks . length === 0 ) {
518523 return ;
519524 }
@@ -545,7 +550,12 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
545550 } ,
546551
547552 YGNodeStyleSetGridTemplateColumns : {
548- value : function ( nodeName , tracks ) {
553+ value : function ( nodeName , value ) {
554+ if ( ! value ) {
555+ return ;
556+ }
557+
558+ const tracks = parseGridTrackList ( this , value ) ;
549559 if ( ! tracks || tracks . length === 0 ) {
550560 return ;
551561 }
@@ -576,6 +586,104 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
576586 } ,
577587 } ,
578588
589+ YGNodeStyleSetGridColumnStart : {
590+ value : function ( nodeName , value ) {
591+ this . push ( `YGNodeStyleSetGridColumnStart(${ nodeName } , ${ value } );` ) ;
592+ } ,
593+ } ,
594+
595+ YGNodeStyleSetGridColumnEnd : {
596+ value : function ( nodeName , value ) {
597+ this . push ( `YGNodeStyleSetGridColumnEnd(${ nodeName } , ${ value } );` ) ;
598+ } ,
599+ } ,
600+
601+ YGNodeStyleSetGridRowStart : {
602+ value : function ( nodeName , value ) {
603+ this . push ( `YGNodeStyleSetGridRowStart(${ nodeName } , ${ value } );` ) ;
604+ } ,
605+ } ,
606+
607+ YGNodeStyleSetGridRowEnd : {
608+ value : function ( nodeName , value ) {
609+ this . push ( `YGNodeStyleSetGridRowEnd(${ nodeName } , ${ value } );` ) ;
610+ } ,
611+ } ,
612+
613+ YGNodeStyleSetGridAutoColumns : {
614+ value : function ( nodeName , value ) {
615+ if ( ! value ) {
616+ return ;
617+ }
618+
619+ const tracks = parseGridTrackList ( this , value ) ;
620+ if ( ! tracks || tracks . length === 0 ) {
621+ return ;
622+ }
623+
624+ this . push ( `auto ${ nodeName } _gridAutoColumns = YGGridTrackListCreate();` ) ;
625+
626+ for ( const track of tracks ) {
627+ if ( track . type === 'minmax' ) {
628+ const minVal = this . formatGridTrackValue ( track . min ) ;
629+ const maxVal = this . formatGridTrackValue ( track . max ) ;
630+ this . push (
631+ `YGGridTrackListAddTrack(${ nodeName } _gridAutoColumns, YGMinMax(${ minVal } , ${ maxVal } ));` ,
632+ ) ;
633+ } else {
634+ const val = this . formatGridTrackValue ( track ) ;
635+ this . push (
636+ `YGGridTrackListAddTrack(${ nodeName } _gridAutoColumns, ${ val } );` ,
637+ ) ;
638+ }
639+ }
640+
641+ this . push (
642+ `YGNodeStyleSetGridAutoColumns(${ nodeName } , ${ nodeName } _gridAutoColumns);` ,
643+ ) ;
644+ this . push (
645+ `YGGridTrackListFree(${ nodeName } _gridAutoColumns);` ,
646+ ) ;
647+ } ,
648+ } ,
649+
650+ YGNodeStyleSetGridAutoRows : {
651+ value : function ( nodeName , value ) {
652+ if ( ! value ) {
653+ return ;
654+ }
655+
656+ const tracks = parseGridTrackList ( this , value ) ;
657+ if ( ! tracks || tracks . length === 0 ) {
658+ return ;
659+ }
660+
661+ this . push ( `auto ${ nodeName } _gridAutoRows = YGGridTrackListCreate();` ) ;
662+
663+ for ( const track of tracks ) {
664+ if ( track . type === 'minmax' ) {
665+ const minVal = this . formatGridTrackValue ( track . min ) ;
666+ const maxVal = this . formatGridTrackValue ( track . max ) ;
667+ this . push (
668+ `YGGridTrackListAddTrack(${ nodeName } _gridAutoRows, YGMinMax(${ minVal } , ${ maxVal } ));` ,
669+ ) ;
670+ } else {
671+ const val = this . formatGridTrackValue ( track ) ;
672+ this . push (
673+ `YGGridTrackListAddTrack(${ nodeName } _gridAutoRows, ${ val } );` ,
674+ ) ;
675+ }
676+ }
677+
678+ this . push (
679+ `YGNodeStyleSetGridAutoRows(${ nodeName } , ${ nodeName } _gridAutoRows);` ,
680+ ) ;
681+ this . push (
682+ `YGGridTrackListFree(${ nodeName } _gridAutoRows);` ,
683+ ) ;
684+ } ,
685+ } ,
686+
579687 formatGridTrackValue : {
580688 value : function ( track ) {
581689 switch ( track . type ) {
0 commit comments