Open Bug 661754 Opened 13 years ago Updated 2 years ago

rectangle calculation after scrolling (an element, not the window)

Categories

(Firefox :: General, defect)

x86_64
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: patrick, Unassigned)

Details

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

The rectangles caculated after scrolling a DIV in an other DIV are not good.
Works the same way on FF 4.0.1 Windows XP.

Reproducible: Always

Steps to Reproduce:
1.Display the attached html file...
2.
3.

Actual Results:  
OK the first time the page is displayed. Never more than once!

Expected Results:  
Allways the same!
Attached file HTML file using jQuery
NOTE It seems to be correct (allways) when the scroll bars are are hidden (overflow:hidden)...
SORRY: previous comment (#3) is wrong.
Worse: scrollings themselves made ​​with the CSS attribute "overflow: hidden;", are" wrong"(wrong is subjective). The result of Opera is congruent with the case where the scroll bars are visibles. MSIE6 displays a "wrong" result in both axes, while for FF, the results on both axis are different.

Following: shorts HTML and JS, next attachement: screenshots

     <div id='div1' style='position:absolute;left:150px;top:150px;width:100px;height:100px;overflow:hidden;
      background-color:green;margin:10px;border:7px solid blue;padding:3px'>
      <div id='div10' style='width:150px;height:150px;background-color:yellow;
       margin:10px;border:7px solid silver;padding:3px'>
      Du texte...
      </div>
     </div>
     <div id='div2' style='position:absolute;left:300px;top:300px;width:100px;height:100px;overflow:auto; background-color:green;
     margin:10px;border:7px solid blue;padding:3px'>
      <div id='div20' style='width:150px;height:150px;background-color:yellow;
       margin:10px;border:7px solid silver;padding:3px'>
      Du texte...
      </div>
     </div>

gR=GetOutORect($("#div10"));
Chat.Print("gR: "+gR.toString());
DebugRectAdd(gR, "green");
$("#div1").scrollLeft(250);$("#div1").scrollTop(250);
gR=GetOutORect($("#div10"));
Chat.Print("gR: "+gR.toString());
DebugRectAdd(gR, "green");

gR=GetOutORect($("#div20"));
Chat.Print("gR: "+gR.toString());
DebugRectAdd(gR, "red");
gR=GetOutORect($("#div20"));
Chat.Print("gR: "+gR.toString());
DebugRectAdd(gR, "red");

$("#div2").scrollLeft(50);$("#div2").scrollTop(50);
gR=GetOutORect($("#div20"));
Chat.Print("gR: "+gR.toString());
DebugRectAdd(gR, "red");
Not really useful, indeed ?
I understand where is the problem (if it is one): When a refresh is requested, casi all browsers leave the scroll bars of the window "as is" and refresh the display. The "onscroll" events are sent to the document as necessary. The internal elements that are Scrollable are probably reset to 0, and this last point is probably not done in Firefox. The way Firefox treat that problem is probably the best. The only problem remaining is that the scroll bars should be reset upon the initialization of the page for Fireox, as others do (except MSIE, in an axis).
Now I can "turn around" the "bug"...
Someone competent should perhaps cancel this bug 661714...
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: