Closed Bug 496320 Opened 15 years ago Closed 4 years ago

Observer not always called when using document.loadOverlay()

Categories

(Core :: XUL, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bugzilla.mozilla.org, Unassigned)

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.10) Gecko/2009042700 SUSE/3.0.10-1.1 Firefox/3.0.10
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b4) Gecko/20090423 Firefox/3.5b4

I have found that if an overlay references a stylesheet with the
<?xml-stylesheet ... ?> link then any observer based queuing system loads the
first overlay and then fails to load subsequent items in the queue, due to the observer not being called. If I take out the stylesheets it works. To make it clear, the first offending overlay in the queue is loaded correctly, it is just that the observer isn't called after loading it. I originally posted this on:

https://bugzilla.mozilla.org/show_bug.cgi?id=330458

As you can see from that bug, Yan Morin claims to also have problems with the observer not being called when the overlay being loaded includes other overlays (presumably by <?xul-overlay ... ?>, he didn't say). Nickolay Ponomarev suggested I post this as a separate bug, and he thinks that this will block resolution of bug 330458 because the solution is likely to be implementing a queue inside document.loadOverlay().

Reproducible: Always

Steps to Reproduce:
1. Write a routine that uses document.loadOverlay() and then uses the observer to load more overlays. Look at Alice White's code in bug 330458 if you want an example.
2. Put <?xml-stylesheet ... ?> (or presumably <?xul-overlay ... ?>) directives in your overlay files and the observer will no longer be called after loading them.
3. Take out the XML directives and it will work again.
Actual Results:  
Described above.

Expected Results:  
Logically I would expect the observer to be called with a success/failure result regardless of what XML directives/CSS/JS was linked into the overlay being loaded.
Component: General → XUL
Product: Firefox → Core
QA Contact: general → xptoolkit.widgets
Attached file testcases (reftest)
I can't reproduce, see the attached files.

Loading both test040.xul (simple example per your description) and test041.xul (a more elaborate testcase with two loadOverlay calls) shows a green window, indicating that the stylesheet was loaded and the done() function was run (from the observer callback).

Please attach a testcase demonstrating the problem (preferably in a similar format, so that it can be used for automatic testing). I meant to ask you to attach the testcase when telling you to file a separate bug.
There's a detailed description of this problem in bug 392515 comment 3. Hmm, or maybe this is a duplicate.
Wladimir Palant, the author of AdBlock+ in his article http://adblockplus.org/blog/how-many-hacks-does-it-take-to-make-your-extension-install-without-a-restart in Catch 9 mentions this bug, so maybe it's better change the bug status from UNCONFIRMED?
Attached file mochikit testcase
Just attached a mochikit testcase for this bug.
The problem is reproducible easily: when you load an overlay that contains another overlay you get anything but the requested notification.

XUL overlays were removed in bug 1426763.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: