diff --git a/mozilla/xpfe/global/resources/content/bindings/listbox.xml b/mozilla/xpfe/global/resources/content/bindings/listbox.xml index b89f2a300ef..2ac8c0c20b2 100644 --- a/mozilla/xpfe/global/resources/content/bindings/listbox.xml +++ b/mozilla/xpfe/global/resources/content/bindings/listbox.xml @@ -28,8 +28,6 @@ - 0 - 0 false null null @@ -219,8 +217,12 @@ if (this._currentItem) this._currentItem.current = false; this._currentItem = val; - if (val) - val.current = true; + if (val) { + val.current = true; + var event = document.createEvent("Events"); + event.initEvent("DOMMenuItemActive", true, true); + val.dispatchEvent(event); + } return val; ]]> @@ -228,7 +230,7 @@ = 0) @@ -339,7 +341,6 @@ var suppressSelect = this._suppressOnSelect; this._suppressOnSelect = true; - this.clearSelection(); this._selectionStart = startItem; @@ -353,17 +354,29 @@ } else { currentItem = startItem; } - + while (currentItem) { if (currentItem.localName == "listitem") this.addItemToSelection(currentItem); - if (currentItem == endItem) + if (currentItem == endItem) { + currentItem = this.getNextItem(currentItem, 1); break; + } currentItem = this.getNextItem(currentItem, 1); } + // Clear around new selection + // Don't use clearSelection() because it causes a lot of noise + // with respect to selection removed notifications used by the + // accessibility API support. + for (; currentItem; currentItem = this.getNextItem(currentItem, 1)) + this.removeItemFromSelection(currentItem); + for (currentItem = this.getItemAtIndex(0); currentItem != startItem; + currentItem = this.getNextItem(currentItem, 1)) + this.removeItemFromSelection(currentItem); + this._suppressOnSelect = suppressSelect; - + this._fireOnSelect(); ]]> @@ -501,160 +514,84 @@ return this.listBoxObject.getRowCount(); + + + + + + numItems - 1) + newIndex = numItems - 1; + var newItem = this.getItemAtIndex(newIndex); + if (newItem) { + this.ensureIndexIsVisible(newIndex); + if (isSelectingRange) { + this.selectItemRange(null, newItem); + } + else if (isSelecting) { + this.selectItem(newItem); + } + this.currentItem = newItem; + } + ]]> + + + + + + = maxTop && maxTop > this.currentIndex) { + newTop = maxTop; + } + } + else if (newTop < 0) + newTop = 0; + this.scrollToIndex(newTop); + return pageOffset; + ]]> + + - - - - - - - - 1 ) - this.removeItemFromSelection(this.selectedItems[l-1]); - if ( l <= 2 ) - this._isDownSelection=0; - } - else { - this.addItemToSelection(n); - this._isUpSelection=1; - } - } - ]]> - - - 1 ) - this.removeItemFromSelection(this.selectedItems[l-1]); - if ( l <= 2 ) - this._isUpSelection=0; - } - else { - this.addItemToSelection(n); - this._isDownSelection=1; - } - } - ]]> - - - - - - = count - v ) - n=this.getItemAtIndex(count - 1); - else { - n = this.getNextItem(this.selectedItems[l-1], v); - var newIndex = i + v; - if ( ! n || newIndex > count - v ) { - newIndex = count - v; - n = this.getItemAtIndex(newIndex + this.getIndexOfItem(this.selectedItems[l-1]) - i); - } - this.scrollToIndex(newIndex); - } - this.timedSelect(n, this._selectDelay); - ]]> - - - - - - - - + + + + + + + + + 0 && @@ -697,8 +634,6 @@ var cellText = item.getAttribute("label"); cellText = cellText.substring(0, length).toLowerCase(); if (cellText == incrementalString) { - this._isUpSelection=0; - this._isDownSelection=0; this.ensureIndexIsVisible(k); this.timedSelect(item, this._selectDelay); break;