Element's size & position updated after script continues

VERIFIED WORKSFORME

Status

()

P3
normal
VERIFIED WORKSFORME
19 years ago
18 years ago

People

(Reporter: warnckew, Assigned: jst)

Tracking

({testcase})

Trunk
x86
Windows 98
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

19 years ago
From Bugzilla Helper:
User-Agent: Mozilla/4.72 [en] (Win98; I)
BuildID:    2000041008

When positioning a number of elements relative to each other Mozilla doesn't 
update each element's properties quickly enough, and subsequent positioning 
becomes incorrect.  I will be uploading what I hope is a simple enough testcase 
to show this problem.  I have 10 positioned DIVs that, upon user interaction, 
should be positioned side-by-side from left to right.  This doesn't happen.  
Instead it seems that Mozilla is slow at updating the properties of the previous 
element, and the subsequent calculation of the position of the next returns an 
incorrect result.

The testcase has a button that will try to position the elements using a quick 
for()-loop, and one that does the same thing but with an alert() thrown in right 
after positioning each element.  With this workaround the elements are 
positioned correctly.

Reproducible: Always
Steps to Reproduce:
1. Open attachment
2 [details] [diff] [review]. Hit button marked "Test without alerts", notice result

Actual Results:  The DIVs are unevenly positioned, some stacking occurs.

Expected Results:  Perfect side-by-side positioning from left to right with each 
DIVs right-hand side flush with the next DIVs left-hand side.

I've tried to reduce the testcase to simple code with correct setting of all 
properties.  I'm not sure whether it's a DOM1 or DOM2 issue, so feel free to 
move it to other components if I filed it incorrectly.
(Reporter)

Comment 1

19 years ago
Created attachment 7469 [details]
Relative positioning testcase
(Reporter)

Comment 2

19 years ago
added keyword 'testcase' as per bugathon guidelines
Keywords: testcase
(Assignee)

Comment 3

19 years ago
Could you please try adding the following line to "prefs.js" in your user
profile directory and report back if you still see the same problem?

user_pref("layout.reflow.async.afterDocLoad", false);
(Reporter)

Comment 4

19 years ago
Adding the line makes the problem go away.  Tried adding & removing it several 
times (restarting Mozilla in between), and it works when it's added, and doesn't 
when it's removed again.

I also noticed another thing, although the add to prefs.js has removed the 
problem, that if I position each element in the Y-direction (element.style.top) 
before I position it in the X-direction, the positioning became correct.  Don't 
know if it's relevant or not anymore though. :)
warnckew@online.no - this now works the same for both cases. Please ask for this 
to be reopened if you see this bug again :-)

Gerv
Status: UNCONFIRMED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → WORKSFORME

Comment 6

18 years ago
Verified Win98 2000092808
Status: RESOLVED → VERIFIED
Component: DOM Level 2 → DOM Other
Component: DOM Other → DOM Level 1
You need to log in before you can comment on or make changes to this bug.