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-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
id="options-test" title="Options" style="width: 40em;">
<prefpane id="paneGeneral" label="1">
<prefpane id="panePattern" label="2">
This blocks a fix to bug 296606.
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...
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?
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:184.108.40.206) Gecko/20061201 Firefox/220.127.116.11 (Ubuntu-feisty)
Adding to Tom Aratyn's report, the bug still exists in
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:18.104.22.168) Gecko/20071203
Ubuntu/7.10 (gutsy) Firefox/22.214.171.124 (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)
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 126.96.36.199 on WinXp), it works OK.
Does this problem affect prefwindow's with just one prefpane?
I wasn't sure from reading:
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.
*** Bug 636064 has been marked as a duplicate of this bug. ***