Closed
Bug 93053
Opened 23 years ago
Closed 23 years ago
Constructor of XBL gets executed after usage of element
Categories
(Core :: XBL, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: wgrinfeld, Assigned: hyatt)
Details
Attachments
(8 files)
From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.2) Gecko/20010628 BuildID: 2001062815 In case an XUL page has elements that are defined in an XBL file, and this XUL also has <script> in its page, then the script will get executed before the XBL elements are fully constructed Reproducible: Always Steps to Reproduce: 1.create an XUL file and add some JavaScript to that file using the XBL 2.create XBL for this file + CSS 3.run it Actual Results: constructor runs too late Expected Results: constructor should run before using the XBL elements in JavaScript
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Comment 2•23 years ago
|
||
Reporter | ||
Comment 3•23 years ago
|
||
Reporter | ||
Comment 4•23 years ago
|
||
Reporter | ||
Comment 5•23 years ago
|
||
Reporter | ||
Comment 6•23 years ago
|
||
Reporter | ||
Comment 7•23 years ago
|
||
Reporter | ||
Comment 8•23 years ago
|
||
Reporter | ||
Comment 9•23 years ago
|
||
In order to get the bug, one has to bring up a new copy of the browser and the XUL page. Pressing the Reload button seems to give different results. A workaround to this problem is to use setTimeout('...',0) to run the required script.
Comment 10•23 years ago
|
||
That's because the CSS and XBL loads asynchronously. You need to use document.loadBindingDocument(url).
Comment 11•23 years ago
|
||
Or use an event handler (onload on the document, onbindingattached IIRC -- pls. correct me if I'm out of date -- on the xbl). Scripts should not assume a blocking i/o architecture. Is this bug invalid? /be
Assignee | ||
Comment 12•23 years ago
|
||
This is an invalid bug. There is no guarantee that the XBL for elements has been loaded at the time a <script> executes (the document is in a state of partial construction after all). If you wait for onload, your bindings will be fine.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•