Closed
Bug 333829
Opened 19 years ago
Closed 15 years ago
RTL horizontal scrollbar can not return to the left edge on reload
Categories
(Core :: Layout: Text and Fonts, defect)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: hsaito54, Assigned: hsaito54)
References
()
Details
(Keywords: rtl)
Attachments
(1 file, 3 obsolete files)
2.25 KB,
patch
|
dbaron
:
review-
|
Details | Diff | Splinter Review |
Horizontal scrollbar in RTL direction can not return to the left edge on reload(i.e. it goes back to the right edge) although the contents return to the left side. This problem came from Bug 331607.
steps are:
1. load the following page
http://mozilla.org.il/board/viewtopic.php?t=53
2. move horizontal scrollbar to the left edge
3. reload the page
actual result:
Only horizontal scrollbar goes back to the initial position(right edge).
Assignee | ||
Comment 1•19 years ago
|
||
Please refer to |nsSliderFrame::CurrentPositionChanged| called from |nsGfxScrollFrameInner::SetCoordAttribute|.
PRInt32 maxpos = GetMaxPosition(scrollbar);
if (curpos < 0)
curpos = 0;
else if (curpos > maxpos)
curpos = maxpos;
I think that |maxpos| needs to be set before |curpos|.
Comment on attachment 218574 [details] [diff] [review]
patch
r+sr=dbaron given a comment explaining why it needs to be in this order
Attachment #218574 -
Flags: superreview+
Attachment #218574 -
Flags: review+
Assignee: nobody → saito
Checked in to trunk. Thanks for debugging this and writing the patch.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 4•19 years ago
|
||
I am sorry, this patch has a regress.
If the window is resized, the contents does not change(resize reflow can not start). Please review this added patch. I think that checking for the ranges of |curPos| needs in order to start |ScrollbarChanged| called from |CurPosAttributeChanged|. If this added patch is wrong, please back base patch from trunk.
Attachment #218592 -
Flags: review?(dbaron)
Comment on attachment 218592 [details] [diff] [review]
added patch
r+sr=dbaron. Checked in to trunk, with comment added. Thanks for fixing this as well.
Attachment #218592 -
Flags: superreview+
Attachment #218592 -
Flags: review?(dbaron)
Attachment #218592 -
Flags: review+
Comment 6•19 years ago
|
||
it looks like this may have caused:
Bug 334262 and Bug 334266 (possibly dupes)
Comment 7•19 years ago
|
||
and no, it wasn't fixed by the additional checkin at 04/16 12:58:22
Also, sorry for checking this in before you'd requested review -- I should have waited until you asked.
I've backed this out for now due to the regressions. I don't have time to look into them; if you have time to do so, that would be great.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•19 years ago
|
Assignee | ||
Comment 10•18 years ago
|
||
I can see this problem on current seamenkey. However I can't fix previous posted patch because I can't see the regressions on firefox. If possible, I wish a new patch is reviewed although this patch may have same regressions. I think that the correct value should be set to |mCurPos| for current position.
Attachment #218574 -
Attachment is obsolete: true
Attachment #218592 -
Attachment is obsolete: true
Attachment #259588 -
Flags: review?(dbaron)
Sorry to take so long to get to this.
I don't see how this works, or at least how it will work in all cases. The code right above the code you change permanently changes the curpos attribute based on minpos and maxpos. Given that, how do you get the original curpos back?
Comment on attachment 259588 [details] [diff] [review]
patch
Marking review- since I think this makes the issue of whether the curpos attribute and mCurPos are clamped to within minpos and maxpos even more confusing than it is already.
Attachment #259588 -
Flags: review?(dbaron) → review-
Comment 13•17 years ago
|
||
The linked URL no longer has a horizontal scrollbar, and I can't create a testcase where I can see this problem (even in a 2006-04-13 build). Is anyone able to create a testcase for this?
Keywords: qawanted
Comment 14•17 years ago
|
||
Mass-assigning the new rtl keyword to RTL-related (see bug 349193).
Keywords: rtl
Assignee | ||
Comment 15•16 years ago
|
||
This problem is yet reproduced with the saved page on my disk, when the value of |maxpospx| is sometimes 0 at |nsSliderFrame::CurrentPositionChanged|, though the value is almost always 100. The meaning of the value of 100 is a default value at |nsSliderFrame::GetMaxPosition|. If the scroll position(that is pointed by |mCurPos|) is 100, this problem is always reproduced, because |mCurPos| is forced to set 100, in the result that the position is not changed at |nsSliderFrame::CurrentPositionChanged| since the value of |mCurPos| is already 100.
In the posted patch, following optimization will be ignored at |nsSliderFrame::CurrentPositionChanged| using new variable |mForcePositionChange|.
// do nothing if the position did not change
if (mCurPos == curpospx && !mForcePositionChange)
return NS_OK;
For reproducing this problem, a complex page may be needed like as that the scroll position moves to the right side of the window first and returns to the current position when the page is reloaded.
Attachment #259588 -
Attachment is obsolete: true
Assignee | ||
Comment 16•16 years ago
|
||
Comment on attachment 327261 [details] [diff] [review]
patch
David, could you review this patch?
I think that the value of |mCurPos| has two meanings, first is the current scroll position and second is the forced value by |maxpospx|, so that these cases need to be distinguished. This approach is to skip the optimization using a new boolean |mForcePositionChange| in the second case.
Attachment #327261 -
Flags: review?(dbaron)
Component: Layout: BiDi Hebrew & Arabic → Layout: Text
QA Contact: layout.bidi → layout.fonts-and-text
Comment on attachment 327261 [details] [diff] [review]
patch
Sorry for taking so long to get to this.
I'd echo Uri's comment: do you have a testcase where this bug is still present? This patch seems like it introduces extra complexity, and I'd like to know that that complexity is needed.
If you do have a testcase, could you add the testcase as an automated test and re-request review? This code has become very fragile, and we should really be adding automated tests for changes we make to it.
Attachment #327261 -
Flags: review?(dbaron) → review-
Comment 18•15 years ago
|
||
The page in comment 0 no longer has a horizontal scrollbar. I wrote a simple test case. Comment 0 is WorksForMe with this test case.
Status: REOPENED → RESOLVED
Closed: 19 years ago → 15 years ago
Keywords: qawanted
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•