Closed Bug 296418 Opened 18 years ago Closed 4 months ago

can't put tags/elements before prefpane elements in prefwindow


(Toolkit :: Preferences, defect)

Windows XP





(Reporter: asqueella, Unassigned)



When you put a tag, like <script/> or <button/> inside a prefwindow, before any
prefpanes, the window breaks: when I select first pane in the selector, the
second pane is actually displayed, same when I select the second pane.

Moving the tags after the prefpanes makes Firefox happy.

Playing with the document in the DOMi makes me think it's a core bug, but I
couldn't make a testcase not using the preferences binding, so I'm filing it in
Toolkit for now.

To reproduce, open the following in a chrome window and try switching panes:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>

<prefwindow xmlns=""
            id="options-test" title="Options" style="width: 40em;">


  <prefpane id="paneGeneral" label="1">
    <button label="1"/>

  <prefpane id="panePattern" label="2">
    <button label="2"/>

This blocks a fix to bug 296606.
Blocks: 296606
Severity: normal → major
Flags: blocking-aviary1.1?
Blocks: 295867
Flags: blocking-aviary1.5? → blocking-aviary1.5-
Yikes, this is a bigger problem than it looks like.

Just about every extension/example I've seen sets up a chrome window with code like:

<dialog> or <overlay>
    <script src="your extension code.js"/>
    ...bunch of XUL...

But if you do this with a <prefwindow>, things break in weird and non-obvious
ways. I just spent time banging my head against the wall because the preference
panes were in the reverse order of the tabs... Click the first tab, get the last
pane! Removing two <script> tags I had between the <prefwindow> and first
<prefpane> seems to have fixed that. I'm still getting a random tab with
incorrect pane content when the window opens, but after clicking a tab things work.

I would imagine many potential users of <prefwindow> are going to give up and
not use it with problems like this...
Flags: blocking1.8b4?
we need to document this at devmo. not going to get this changed for 1.5. Deb,
can you make sure we have some kind of note on the workaround for this at devmo?
Flags: blocking1.8b4? → blocking1.8b4-
Who would be the best person to write this up?  I'd recommend simply adding it
directly to the wiki.  I could start a page for it if you like, if you could
provide a title.  
(In reply to comment #4)
> I could start a page for it if you like, if you could
> provide a title.  

Actually, I ran across this while writing some sample code for the related
article page on the wiki... I'll add it to a tips/tricks/traps section.

anyone feel like putting a link to the devmo article?
The notes on this bug seem to indicate there is a workaround but no matter in my experience no matter where you put the <script> tags it still breaks in the same way.
Just wanted to mention this is still an issue since the bug seems to have gone quiet. 

Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20061201 Firefox/ (Ubuntu-feisty)
Adding to Tom Aratyn's report, the bug still exists in
  Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20071203
  Ubuntu/7.10 (gutsy) Firefox/ (Linux Mint)

However, it works fine under OSX 10.4 in both 2.0.0.* and
  Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b1)
  Gecko/2007110903 Firefox/3.0b1
I spend some time to resolve this bug, because i use prefwindow in my extension.

This bug is caused by somehow incorrect code in deck implementation. It have problem with correctly handling anonymous XBL content.
Also deck binding in general.xul does not care about anonymous content (uses "childNodes" for example).
Unfortunately i work only on XUL/XBL/JS level, and "deck" seems to be implemented in C++.

Anyway i found some workaround for this problem:
 1. I changed "prefwindow" binding to use "vbox" instead of deck.
 2. In "_selectPane" method i first collapse all prefpanes, and then un-collapse active one.

As far as i can test it (TB on WinXp), it works OK.

Does this problem affect prefwindow's with just one prefpane? 

I wasn't sure from reading:
QA Contact: nobody → preferences
This wasn't effecting me in 3.5.6, but now it's hitting me hard in 3.6.  I don't seem to be able to put *anything* under prefwindow other than prefpane.

I'm not sure where I can put my script and stringbundleset elements, now. :-(
Christian: if you can't use the workarounds that worked previously, it's a different bug from this one; you should find (or file) another bug (preferably with a testcase and the day it regressed). Or at least post to the newsgroups.
It turned out to be the prefwindow/@onload attribute.  When I moved it into prefpane/@onpaneload it worked.  Does that warrant a new bug?
I still don't understand what your issue was and whether it was a regression since 3.5, so yes, it shouldn't be discussed here. Either in a separate bug or in a newsgroup, depending on how sure you are that it's a bug.

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --

I don't think this XBL element exists anymore

Closed: 4 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.