src/common/js/winjs/js/ui.js
function VirtualizeContentsView_createChunk(groups, count, chunkSize) {
                    var that = this;

                    this._listView._writeProfilerMark("createChunk,StartTM");

                    function addToGroup(itemsContainer, groupSize) {
                        var children = itemsContainer.element.children,
                            oldSize = children.length,
                            toAdd = Math.min(groupSize - itemsContainer.items.length, chunkSize);

                        _SafeHtml.insertAdjacentHTMLUnsafe(itemsContainer.element, "beforeend", _Helpers._repeat("<div class='win-container win-backdrop'></div>", toAdd));

                        for (var i = 0; i < toAdd; i++) {
                            var container = children[oldSize + i];
                            itemsContainer.items.push(container);
                            that.containers.push(container);
                        }
                    }

                    function newGroup(group) {
                        var node = {
                            header: that._listView._groupDataSource ? that._createHeaderContainer() : null,
                            itemsContainer: {
                                element: that._createItemsContainer(),
                                items: []
                            }
                        };


                        that.tree.push(node);
                        that.keyToGroupIndex[group.key] = that.tree.length - 1;
                        addToGroup(node.itemsContainer, group.size);
                    }

                    if (this.tree.length && this.tree.length <= groups.length) {
                        var last = this.tree[this.tree.length - 1],
                            finalSize = groups[this.tree.length - 1].size;

                        // check if the last group in the tree already has all items. If not add items to this group
                        if (last.itemsContainer.items.length < finalSize) {
                            addToGroup(last.itemsContainer, finalSize);
                            this._listView._writeProfilerMark("createChunk,StopTM");
                            return;
                        }
                    }

                    if (this.tree.length < groups.length) {
                        newGroup(groups[this.tree.length]);
                    }

                    this._listView._writeProfilerMark("createChunk,StopTM");
                }
function VirtualizeContentsView_createChunk(groups, count, chunkSize) {
                    var that = this;

                    this._listView._writeProfilerMark("createChunk,StartTM");

                    function addToGroup(itemsContainer, groupSize) {
                        var children = itemsContainer.element.children,
                            oldSize = children.length,
                            toAdd = Math.min(groupSize - itemsContainer.items.length, chunkSize);

                        _SafeHtml.insertAdjacentHTMLUnsafe(itemsContainer.element, "beforeend", _Helpers._repeat("<div class='win-container win-backdrop'></div>", toAdd));

                        for (var i = 0; i < toAdd; i++) {
                            var container = children[oldSize + i];
                            itemsContainer.items.push(container);
                            that.containers.push(container);
                        }
                    }

                    function newGroup(group) {
                        var node = {
                            header: that._listView._groupDataSource ? that._createHeaderContainer() : null,
                            itemsContainer: {
                                element: that._createItemsContainer(),
                                items: []
                            }
                        };


                        that.tree.push(node);
                        that.keyToGroupIndex[group.key] = that.tree.length - 1;
                        addToGroup(node.itemsContainer, group.size);
                    }

                    if (this.tree.length && this.tree.length <= groups.length) {
                        var last = this.tree[this.tree.length - 1],
                            finalSize = groups[this.tree.length - 1].size;

                        // check if the last group in the tree already has all items. If not add items to this group
                        if (last.itemsContainer.items.length < finalSize) {
                            addToGroup(last.itemsContainer, finalSize);
                            this._listView._writeProfilerMark("createChunk,StopTM");
                            return;
                        }
                    }

                    if (this.tree.length < groups.length) {
                        newGroup(groups[this.tree.length]);
                    }

                    this._listView._writeProfilerMark("createChunk,StopTM");
                }
function VirtualizeContentsView_createChunk ( groups , count , chunkSize ) { var that = this ; this . _listView . _writeProfilerMark ( "createChunk,StartTM" ) ; function addToGroup ( itemsContainer , groupSize ) { var children = itemsContainer . element . children , oldSize = children . length , toAdd = Math . min ( groupSize - itemsContainer . items . length , chunkSize ) ; _SafeHtml . insertAdjacentHTMLUnsafe ( itemsContainer . element , "beforeend" , _Helpers . _repeat ( "<div class='win-container win-backdrop'></div>" , toAdd ) ) ; for ( var i = 0 ; i < toAdd ; i ++ ) { var container = children [ oldSize + i ] ; itemsContainer . items . push ( container ) ; that . containers . push ( container ) ; } } function newGroup ( group ) { var node = { header : that . _listView . _groupDataSource ? that . _createHeaderContainer ( ) : null , itemsContainer : { element : that . _createItemsContainer ( ) , items : [ ] } } ; that . tree . push ( node ) ; that . keyToGroupIndex [ group . key ] = that . tree . length - 1 ; addToGroup ( node . itemsContainer , group . size ) ; } if ( this . tree . length && this . tree . length <= groups . length ) { var last = this . tree [ this . tree . length - 1 ] , finalSize = groups [ this . tree . length - 1 ] . size ; // check if the last group in the tree already has all items. If not add items to this group if ( last . itemsContainer . items . length < finalSize ) { addToGroup ( last . itemsContainer , finalSize ) ; this . _listView . _writeProfilerMark ( "createChunk,StopTM" ) ; return ; } } if ( this . tree . length < groups . length ) { newGroup ( groups [ this . tree . length ] ) ; } this . _listView . _writeProfilerMark ( "createChunk,StopTM" ) ; }
Overridden by tests. Tests should have _createChunk return true when they want _createContainers to stop creating containers.
Overridden by tests . Tests should have _createChunk return true when they want _createContainers to stop creating containers .