Bug 232540. List controls should not scroll an item into view if it is only outside the list in the horizontal direction.

git-svn-id: svn://10.0.0.236/trunk@155968 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu
2004-05-05 02:49:57 +00:00
parent 201c5e7ba4
commit ba11ee5bec
2 changed files with 10 additions and 6 deletions

View File

@@ -3092,10 +3092,12 @@ nsListControlFrame::ScrollToFrame(nsIContent* aOptElement)
}
fRect.y += optRect.y;
// see if the selected frame is inside the scrolled area
if (!rect.Contains(fRect)) {
// See if the selected frame (fRect) is inside the scrolled
// area (rect). Check only the vertical dimension. Don't
// scroll just because there's horizontal overflow.
if (!(rect.y <= fRect.y && fRect.YMost() <= rect.YMost())) {
// figure out which direction we are going
if (fRect.y+fRect.height >= rect.y+rect.height) {
if (fRect.YMost() > rect.YMost()) {
y = fRect.y-(rect.height-fRect.height);
} else {
y = fRect.y;

View File

@@ -3092,10 +3092,12 @@ nsListControlFrame::ScrollToFrame(nsIContent* aOptElement)
}
fRect.y += optRect.y;
// see if the selected frame is inside the scrolled area
if (!rect.Contains(fRect)) {
// See if the selected frame (fRect) is inside the scrolled
// area (rect). Check only the vertical dimension. Don't
// scroll just because there's horizontal overflow.
if (!(rect.y <= fRect.y && fRect.YMost() <= rect.YMost())) {
// figure out which direction we are going
if (fRect.y+fRect.height >= rect.y+rect.height) {
if (fRect.YMost() > rect.YMost()) {
y = fRect.y-(rect.height-fRect.height);
} else {
y = fRect.y;