%globalDTD; ]> document.getAnonymousElementByAttribute(this, "anonid", "scrollbox"); document.getAnonymousElementByAttribute(this, "anonid", "scrollbutton-up"); document.getAnonymousElementByAttribute(this, "anonid", "scrollbutton-down"); null null null null null 0) { for (var i = Math.round(off / FRAME_LENGTH); i > 0; i--) distance += scrollAmounts.shift() || 0; } self.scrollByPixels(distance); if (!scrollAmounts.length) self._stopSmoothScroll(); } // amountToScroll: total distance to scroll // scrollAmount: distance to move during the particular effect frame (60ms) var scrollAmount, scrollAmounts = []; if (amountToScroll > 2 || amountToScroll < -2) { scrollAmount = round(amountToScroll * 0.2); scrollAmounts.push(scrollAmount, scrollAmount, scrollAmount); amountToScroll -= 3 * scrollAmount; } while (this._isScrolling < 0 && amountToScroll < 0 || this._isScrolling > 0 && amountToScroll > 0) { amountToScroll -= (scrollAmount = round(amountToScroll * 0.5)); scrollAmounts.push(scrollAmount); } this._smoothScrollTimer = setInterval(processFrame, FRAME_LENGTH, this, scrollAmounts); processFrame(this, scrollAmounts, 0); ]]> 0 ? rect[end] + 1 : rect[start] - 1; var nextElement = this._elementFromPoint(x, index); if (!nextElement) return; var targetElement; if (this._isRTLScrollbox) index *= -1; while (index < 0 && nextElement) { targetElement = nextElement; nextElement = nextElement.previousSibling; index++; } while (index > 0 && nextElement) { targetElement = nextElement; nextElement = nextElement.nextSibling; index--; } this.ensureElementIsVisible(targetElement, aSmoothScroll); ]]> elements[high].getBoundingClientRect()[end]) return null; var mid, rect; while (low <= high) { mid = Math.floor((low + high) / 2); rect = elements[mid].getBoundingClientRect(); if (rect[start] > aX) high = mid - 1; else if (rect[end] < aX) low = mid + 1; else return elements[mid]; } // There's no element at the requested coordinate, but the algorithm // from above yields an element next to it, in a random direction. // The desired scrolling direction leads to the correct element. if (!aPhysicalScrollDir) return null; if (aPhysicalScrollDir < 0 && rect[start] > aX) mid = Math.max(mid - 1, 0); else if (aPhysicalScrollDir > 0 && rect[end] < aX) mid = Math.min(mid + 1, elements.length - 1); return elements[mid]; ]]> 0 0 0 150 3) return; var scrollBack = (aEvent.originalTarget == this._scrollButtonUp); var scrollLeftOrUp = this._isRTLScrollbox ? !scrollBack : scrollBack; var targetElement; if (aEvent.detail == 2) { // scroll by the size of the scrollbox let [start, end] = this._startEndProps; let x; if (scrollLeftOrUp) x = this.scrollClientRect[start] - this.scrollClientSize; else x = this.scrollClientRect[end] + this.scrollClientSize; targetElement = this._elementFromPoint(x, scrollLeftOrUp ? -1 : 1); // the next partly-hidden element will become fully visible, // so don't scroll too far if (targetElement) targetElement = scrollBack ? targetElement.nextSibling : targetElement.previousSibling; } if (!targetElement) { // scroll to the first resp. last element let elements = this._getScrollableElements(); targetElement = scrollBack ? elements[0] : elements[elements.length - 1]; } this.ensureElementIsVisible(targetElement); ]]>