src/common/js/winjs/js/ui.js
function VirtualizeContentsView_updateAriaMarkers(listViewIsEmpty, firstIndexDisplayed, lastIndexDisplayed) {
                    var that = this;
                    if (this._listView._isZombie()) {
                        return;
                    }

                    function getFirstVisibleItem() {
                        return that.items.itemAt(firstIndexDisplayed);
                    }

                    // At a certain index, the VDS may return null for all items at that index and
                    // higher. When this is the case, the end marker should point to the last
                    // non-null item in the visible range.
                    function getLastVisibleItem() {
                        for (var i = lastIndexDisplayed; i >= firstIndexDisplayed; i--) {
                            if (that.items.itemAt(i)) {
                                return that.items.itemAt(i);
                            }
                        }
                        return null;
                    }

                    this._listView._createAriaMarkers();
                    var startMarker = this._listView._ariaStartMarker,
                        endMarker = this._listView._ariaEndMarker,
                        firstVisibleItem,
                        lastVisibleItem;

                    if (firstIndexDisplayed !== -1 && lastIndexDisplayed !== -1 && firstIndexDisplayed <= lastIndexDisplayed) {
                        firstVisibleItem = getFirstVisibleItem();
                        lastVisibleItem = getLastVisibleItem();
                    }

                    if (listViewIsEmpty || !firstVisibleItem || !lastVisibleItem) {
                        setFlow(startMarker, endMarker);
                        this._listView._fireAccessibilityAnnotationCompleteEvent(-1, -1);
                    } else {
                        _ElementUtilities._ensureId(firstVisibleItem);
                        _ElementUtilities._ensureId(lastVisibleItem);

                        // Set startMarker's flowto
                        if (this._listView._groupsEnabled()) {
                            var groups = this._listView._groups,
                                firstVisibleGroup = groups.group(groups.groupFromItem(firstIndexDisplayed));

                            if (firstVisibleGroup.header) {
                                _ElementUtilities._ensureId(firstVisibleGroup.header);

                                if (firstIndexDisplayed === firstVisibleGroup.startIndex) {
                                    _ElementUtilities._setAttribute(startMarker, "aria-flowto", firstVisibleGroup.header.id);
                                } else {
                                    _ElementUtilities._setAttribute(startMarker, "aria-flowto", firstVisibleItem.id);
                                }
                            }
                        } else {
                            _ElementUtilities._setAttribute(startMarker, "aria-flowto", firstVisibleItem.id);
                        }

                        // Set endMarker's flowfrom
                        _ElementUtilities._setAttribute(endMarker, "x-ms-aria-flowfrom", lastVisibleItem.id);
                    }
                }
function VirtualizeContentsView_updateAriaMarkers(listViewIsEmpty, firstIndexDisplayed, lastIndexDisplayed) {
                    var that = this;
                    if (this._listView._isZombie()) {
                        return;
                    }

                    function getFirstVisibleItem() {
                        return that.items.itemAt(firstIndexDisplayed);
                    }

                    // At a certain index, the VDS may return null for all items at that index and
                    // higher. When this is the case, the end marker should point to the last
                    // non-null item in the visible range.
                    function getLastVisibleItem() {
                        for (var i = lastIndexDisplayed; i >= firstIndexDisplayed; i--) {
                            if (that.items.itemAt(i)) {
                                return that.items.itemAt(i);
                            }
                        }
                        return null;
                    }

                    this._listView._createAriaMarkers();
                    var startMarker = this._listView._ariaStartMarker,
                        endMarker = this._listView._ariaEndMarker,
                        firstVisibleItem,
                        lastVisibleItem;

                    if (firstIndexDisplayed !== -1 && lastIndexDisplayed !== -1 && firstIndexDisplayed <= lastIndexDisplayed) {
                        firstVisibleItem = getFirstVisibleItem();
                        lastVisibleItem = getLastVisibleItem();
                    }

                    if (listViewIsEmpty || !firstVisibleItem || !lastVisibleItem) {
                        setFlow(startMarker, endMarker);
                        this._listView._fireAccessibilityAnnotationCompleteEvent(-1, -1);
                    } else {
                        _ElementUtilities._ensureId(firstVisibleItem);
                        _ElementUtilities._ensureId(lastVisibleItem);

                        // Set startMarker's flowto
                        if (this._listView._groupsEnabled()) {
                            var groups = this._listView._groups,
                                firstVisibleGroup = groups.group(groups.groupFromItem(firstIndexDisplayed));

                            if (firstVisibleGroup.header) {
                                _ElementUtilities._ensureId(firstVisibleGroup.header);

                                if (firstIndexDisplayed === firstVisibleGroup.startIndex) {
                                    _ElementUtilities._setAttribute(startMarker, "aria-flowto", firstVisibleGroup.header.id);
                                } else {
                                    _ElementUtilities._setAttribute(startMarker, "aria-flowto", firstVisibleItem.id);
                                }
                            }
                        } else {
                            _ElementUtilities._setAttribute(startMarker, "aria-flowto", firstVisibleItem.id);
                        }

                        // Set endMarker's flowfrom
                        _ElementUtilities._setAttribute(endMarker, "x-ms-aria-flowfrom", lastVisibleItem.id);
                    }
                }
function VirtualizeContentsView_updateAriaMarkers ( listViewIsEmpty , firstIndexDisplayed , lastIndexDisplayed ) { var that = this ; if ( this . _listView . _isZombie ( ) ) { return ; } function getFirstVisibleItem ( ) { return that . items . itemAt ( firstIndexDisplayed ) ; } // At a certain index, the VDS may return null for all items at that index and // higher. When this is the case, the end marker should point to the last // non-null item in the visible range. function getLastVisibleItem ( ) { for ( var i = lastIndexDisplayed ; i >= firstIndexDisplayed ; i -- ) { if ( that . items . itemAt ( i ) ) { return that . items . itemAt ( i ) ; } } return null ; } this . _listView . _createAriaMarkers ( ) ; var startMarker = this . _listView . _ariaStartMarker , endMarker = this . _listView . _ariaEndMarker , firstVisibleItem , lastVisibleItem ; if ( firstIndexDisplayed !== - 1 && lastIndexDisplayed !== - 1 && firstIndexDisplayed <= lastIndexDisplayed ) { firstVisibleItem = getFirstVisibleItem ( ) ; lastVisibleItem = getLastVisibleItem ( ) ; } if ( listViewIsEmpty || ! firstVisibleItem || ! lastVisibleItem ) { setFlow ( startMarker , endMarker ) ; this . _listView . _fireAccessibilityAnnotationCompleteEvent ( - 1 , - 1 ) ; } else { _ElementUtilities . _ensureId ( firstVisibleItem ) ; _ElementUtilities . _ensureId ( lastVisibleItem ) ; // Set startMarker's flowto if ( this . _listView . _groupsEnabled ( ) ) { var groups = this . _listView . _groups , firstVisibleGroup = groups . group ( groups . groupFromItem ( firstIndexDisplayed ) ) ; if ( firstVisibleGroup . header ) { _ElementUtilities . _ensureId ( firstVisibleGroup . header ) ; if ( firstIndexDisplayed === firstVisibleGroup . startIndex ) { _ElementUtilities . _setAttribute ( startMarker , "aria-flowto" , firstVisibleGroup . header . id ) ; } else { _ElementUtilities . _setAttribute ( startMarker , "aria-flowto" , firstVisibleItem . id ) ; } } } else { _ElementUtilities . _setAttribute ( startMarker , "aria-flowto" , firstVisibleItem . id ) ; } // Set endMarker's flowfrom _ElementUtilities . _setAttribute ( endMarker , "x-ms-aria-flowfrom" , lastVisibleItem . id ) ; } }
Sets aria-flowto on _ariaStartMarker and x-ms-aria-flowfrom on _ariaEndMarker. The former points to either the first visible group header or the first visible item. The latter points to the last visible item.
Sets aria - flowto on _ariaStartMarker and x - ms - aria - flowfrom on _ariaEndMarker . The former points to either the first visible group header or the first visible item . The latter points to the last visible item .