Closed Bug 35452 Opened 24 years ago Closed 24 years ago

Element's size & position updated after script continues

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
Windows 98
defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: warnckew, Assigned: jst)

Details

(Keywords: testcase)

Attachments

(1 file)

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.
added keyword 'testcase' as per bugathon guidelines
Keywords: testcase
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);
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
Closed: 24 years ago
Resolution: --- → WORKSFORME
Verified Win98 2000092808
Status: RESOLVED → VERIFIED
Component: DOM Level 2 → DOM Other
Component: DOM Other → DOM Level 1
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: