Last Comment Bug 101147 - some XUL features don't work in XML documents (i.e. when served as text/xml)
: some XUL features don't work in XML documents (i.e. when served as text/xml)
Status: NEW
: meta
Product: Core
Classification: Components
Component: XUL (show other bugs)
: Trunk
: x86 All
: -- normal with 1 vote (vote)
: Future
Assigned To: Nobody; OK to take it and work on it
:
: Neil Deakin
Mentors:
Depends on: 432720
Blocks:
  Show dependency treegraph
 
Reported: 2001-09-22 17:10 PDT by Erich 'Ricky' Iseli
Modified: 2008-07-31 03:02 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Served with xul mime type: works (1.41 KB, application/vnd.mozilla.xul+xml)
2001-09-22 17:19 PDT, Erich 'Ricky' Iseli
no flags Details
xhtml file served as text/xml: doesn't work (2.02 KB, text/xml)
2001-09-22 17:30 PDT, Erich 'Ricky' Iseli
no flags Details
xhtml served as application/xml: doesn't work (2.02 KB, application/xml)
2001-09-22 17:33 PDT, Erich 'Ricky' Iseli
no flags Details
xhtml served as xhtml: doesn't work (2.02 KB, application/xhtml+xml)
2001-09-22 17:36 PDT, Erich 'Ricky' Iseli
no flags Details
xul served as xml: doesn't work (1.41 KB, text/xml)
2001-09-22 17:37 PDT, Erich 'Ricky' Iseli
no flags Details
Minimal testcase. Serving as text/xml, but any other non-xul mime type should repro this too (406 bytes, text/xml)
2001-09-22 17:44 PDT, Erich 'Ricky' Iseli
no flags Details

Description Erich 'Ricky' Iseli 2001-09-22 17:10:00 PDT
If a file has the extension .xml (instead of .xul), the label of the menu
element won't display. The menu items pop up correctly and have the label
displayed as well.

When loading the page, there is a javascript error:

Error: this.childNodes[i].getAttribute is not a function
Source File: chrome://global/content/bindings/toolbar.xml#toolbox.init()
Line: 2

This happens both if the file is a valid xul file but with the extension xml,
and if the file is a valid xhtml file, with the xul namespace defined, and
served as xml.

Gonna attach the testcase.
Comment 1 HÃ¥kan Waara 2001-09-22 17:15:07 PDT
this is some kind of namespace issue, it seems. I got an assertion when going 
to Erich's page.
Comment 2 Erich 'Ricky' Iseli 2001-09-22 17:19:15 PDT
Created attachment 50414 [details]
Served with xul mime type: works
Comment 3 Erich 'Ricky' Iseli 2001-09-22 17:30:36 PDT
Created attachment 50416 [details]
xhtml file served as text/xml: doesn't work
Comment 4 Erich 'Ricky' Iseli 2001-09-22 17:32:27 PDT
Adding URL to which hwaara refers.
Comment 5 Erich 'Ricky' Iseli 2001-09-22 17:33:55 PDT
Created attachment 50417 [details]
xhtml served as application/xml: doesn't work
Comment 6 Erich 'Ricky' Iseli 2001-09-22 17:36:01 PDT
Created attachment 50418 [details]
xhtml served as xhtml: doesn't work
Comment 7 Erich 'Ricky' Iseli 2001-09-22 17:37:25 PDT
Created attachment 50419 [details]
xul served as xml: doesn't work
Comment 8 Erich 'Ricky' Iseli 2001-09-22 17:39:19 PDT
Ok, so it looks like this bug appears whenever the document is not served as xul
file (mime type  application/vnd.mozilla.xul+xml)
Comment 9 Erich 'Ricky' Iseli 2001-09-22 17:44:17 PDT
Created attachment 50420 [details]
Minimal testcase. Serving as text/xml, but any other non-xul mime type should repro this too
Comment 10 Erich 'Ricky' Iseli 2001-09-22 17:52:54 PDT
Hm... not that easy. Now there's no javascript error on loading. However if you
click on the toolbar-grippy, you get this new js error:

Error: toolbox.collapseToolbar is not a function
Source File:
chrome://global/content/bindings/toolbar.xml#toolbargrippy.grippyTriggered()
Line: 6
Comment 11 harishd 2001-09-25 08:55:47 PDT
CCing heikki.
Comment 12 Heikki Toivonen (remove -bugzilla when emailing directly) 2001-09-25 09:18:53 PDT
You are going to have problems if you try to load a XUL file with a wrong mime
type. Most people know that if they serve their HTML documents as text/plain, it
won't work. This is the same thing. We shouldn't crash or leak memory or do
anything terminally bad if served a wrong mime type, of course, but XUL-specific
things just not working is different. Use the correct mime type.

Someone may argue that XUL is just XML, and another namespace, and therefore it
should work. Our implementation does not think so: the mime type triggers
completely different code for XUL. XUL also has an officially declared mime
type, so I would really like you to use it.

In my opinion this is wontfix, or perhaps future.
Comment 13 harishd 2001-10-09 21:20:03 PDT
This bug has been marked "future" because the original netscape engineer working 
on this is over-burdened. If you feel this is an error, that you or another
known resource will be working on this bug,or if it blocks your work in some way 
-- please attach your concern to the bug for reconsideration -----

Comment 14 Christopher Hoess (gone) 2003-03-16 14:48:28 PST
->XML
Comment 15 Anne (:annevk) 2004-08-20 05:40:13 PDT
WFM.
Comment 16 Anne (:annevk) 2004-09-13 01:15:16 PDT
Because this bug is really old and no one is responding resolving WFM.
Comment 17 Erich 'Ricky' Iseli 2004-09-13 20:19:55 PDT
Anne, with all my respects, but WFM is not the right resolution. Wontfix would
be the more appropriate resolution, as per comment 12.
Comment 18 Erich 'Ricky' Iseli 2004-09-13 20:20:52 PDT
resolving wontfix as per comment 12.
Comment 19 Anne (:annevk) 2004-09-13 21:58:41 PDT
Erich, when I try to load a XUL file with a 'text/xml' or 'application/xml' MIME
type it works fine. I think people from mozilla.org switched minds since 2001 ;-).
Comment 20 Erich 'Ricky' Iseli 2004-09-15 13:25:22 PDT
(In reply to comment #19)
> Erich, when I try to load a XUL file with a 'text/xml' or 'application/xml' MIME
> type it works fine. I think people from mozilla.org switched minds since 2001

Anne, how did you do that? Maybe my testcases are broken then? If you look at
the attached testcases above, all drop-down menus indeed work, but the menu-bar
has no text, except of course if it is served as a xul document. So is <xul:menu
id="file-menu" label="File"> the cause of all this trouble? Is there a new way
to label a menu item?
Comment 21 Anne (:annevk) 2004-09-15 23:03:51 PDT
Never mind. I was just seeing the style sheets being applied and I thought no
functionality was lost as well.

-> VERIFIED
Comment 22 Nickolay_Ponomarev 2008-05-09 06:35:15 PDT
> Someone may argue that XUL is just XML, and another namespace, and therefore it
> should work. Our implementation does not think so: the mime type triggers
> completely different code for XUL.

That's not a valid reason for wontfix, and wontfixing is supposed to be done by module owners. This is not to say that fixing this bug was ever a priority, but it may still be a valid bug.

I'm reopening this bug to make it easier to find and turning it into a meta bug.
Comment 23 Erich 'Ricky' Iseli 2008-05-10 09:20:25 PDT
removing URL of testcase hosted on my site because it's no longer there. The attached testcases should be enough, I guess.

Note You need to log in before you can comment on or make changes to this bug.