Closed Bug 133678 Opened 19 years ago Closed 19 years ago

Horizontal scrollbar move to left side when reload current page

Categories

(SeaMonkey :: General, defect)

Other
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 99094

People

(Reporter: hsaito54, Assigned: asa)

Details

Attachments

(3 files)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Set Horizontal Scrollbar and Vertical Scrollbar to right side and bottom side.
<TABLE BORDER="1" CELLPADDING="0" CELLSPACING="0" WIDTH="1400" HEIGHT="1400" ALI
GN="left"><TR><TD>
</TD></TR></TABLE>
<BR>And reload current page.
</body></html>

In case of this simple HTML, Horizontal Scrollbar and Vertical Scrollbar
move to left side from right side and short distance up from bottom side.
I test mozilla-0.9.8 on NetBSD.
Summary is "Horizontal scrollbar move to left side when reload current page".
Summary: In case of this simple HTML, Horizontal Scrollbar and Vertical Scrollbar → Horizontal scrollbar move to left side when reload current page
Attached file simple HTML
Yes, in my opinion, for consistency, either the horizontal bar shouldn't be
resetted to the left or the vertical bar should be resetted to the top as well.

btw, confirmed on build 2002032503 win98
Marking as a dupe of bug 99094.  Bug 99094 does not mention the very small
change in the vertical scroll bar, I will add a comment to that bug along with
this testcase.  Please un-dupe of you disagree.

*** This bug has been marked as a duplicate of 99094 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
I found a bug in my patch with Japanese URL
 "http://bugzilla.mozilla.gr.jp/reports.cgi".

In case of this page, the vertical scroll bar moved up
 a very small amount from bottom side with Reload botton.

Because the height of this page is narrow from first to just
 before page was loaded.
When this page was loaded and the height grew to correct length,
as a result of the vertical scroll bar shrank, the vertical scroll bar moved up
a very small amount.

This patch permit to scroll when the height grew finaly.

--- layout/xul/base/src/nsScrollBoxFrame.cpp.org	Wed Jan 23 11:53:02
2002
+++ layout/xul/base/src/nsScrollBoxFrame.cpp	Fri Mar 29 12:39:00 2002
@@ -523,6 +523,7 @@
       scrollingView->GetScrollPosition(x, y);
 
       // if we didn't move, we still need to restore
+    again:
       if ((x == mLastPos.x) && (y == mLastPos.y)) {
	 nsRect childRect(0, 0, 0, 0);
	 nsIView* child = nsnull;
@@ -556,8 +557,9 @@
       }
       else {
	 // user moved the position, so we won't need to restore
-	 mLastPos.x = -1;
-	 mLastPos.y = -1;
+	 mLastPos.x = x;
+	 mLastPos.y = y;
+	 goto again;
       }
     }
   }
 
Sometimes this page's view of right side dameged,
then this patch is effective.

--- view/src/nsViewManager.cpp.org	Wed Jan 23 12:32:45 2002
+++ view/src/nsViewManager.cpp	Fri Mar 29 12:29:48 2002
@@ -2247,6 +2247,10 @@
	  
 
	 view->SetDimensions(width, height);
+	 nscoord maxWidth = (oldWidth < width ? width : oldWidth);
+	 nscoord maxHeight = (oldHeight < height ? height : oldHeight);
+	 nsRect boundingArea(x, y, maxWidth, maxHeight);
+	 UpdateView(parentView, boundingArea, NS_VMREFRESH_NO_SYNC);
       } 
     }
   }
My 1st patch "do not move Scrollbar when Reload" is obsolete.

If you test my 2nd patch, this patch is effective for web-page only.
The scroll bar both can move to correct position with the
reload, back or forward botton.

In case of internal link of document page, not effecive.
It seems that the scroll position of internal linked page can not be restored.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.