The default bug view has changed. See this FAQ.

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

NEW
Unassigned

Status

()

Toolkit
Preferences
--
major
12 years ago
3 years ago

People

(Reporter: Nickolay_Ponomarev, Unassigned)

Tracking

unspecified
x86
Windows XP
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.8b5 -
blocking-aviary1.5 -

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

12 years ago
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="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
            id="options-test" title="Options" style="width: 40em;">

  <button/>

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

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

</prefwindow>
This blocks a fix to bug 296606.
Blocks: 296606
Severity: normal → major
Flags: blocking-aviary1.1?
Blocks: 295867

Updated

12 years ago
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?

Comment 3

12 years ago
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.

Comment 6

11 years ago
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.

Comment 8

10 years ago
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:1.8.1.6) Gecko/20061201 Firefox/2.0.0.6 (Ubuntu-feisty)

Comment 9

9 years ago
Adding to Tom Aratyn's report, the bug still exists in
  Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.10) Gecko/20071203
  Ubuntu/7.10 (gutsy) Firefox/2.0.0.10 (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

Comment 10

9 years ago
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 2.0.0.6 on WinXp), it works OK.

Comment 11

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

I wasn't sure from reading:

http://developer.mozilla.org/en/docs/Preferences_System:prefwindow
QA Contact: nobody → preferences

Comment 12

7 years ago
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. :-(
(Reporter)

Comment 13

7 years ago
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.

Comment 14

7 years ago
It turned out to be the prefwindow/@onload attribute.  When I moved it into prefpane/@onpaneload it worked.  Does that warrant a new bug?
(Reporter)

Comment 15

7 years ago
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.
Duplicate of this bug: 636064
You need to log in before you can comment on or make changes to this bug.