XUL:New Widgets

From MozillaWiki
Jump to: navigation, search


XUL:Slider Tag

Description of a <slider> tag. XUL already has one as part of the scrollbar but it needs a useful API and theme styling (especially native-theme styling). (NeilRashbrook) Note that the Mac still uses native scrollbars.


Widget similar to HTML <a> element. Currently this can be/is implemented in a rather ugly way (in Extension Manager code): styling the label element in a special way + making it focusable and implementing oncommand/onkeypress.

Answering NeilRashbrook's question, <html:a> can't be used as is because:

  • it isn't even visible when used used as <html:a href="about:">some text</html:a>
    • (Neil) That's what you get for mixing box models. But you should be using <xul:label> or <xul:description>, not <html:p>.
  • not styled properly, if you get it to show by enclosing it in a <html:p> tags
  • and opening the link in the same (often chrome) window when clicked.
    • (Neil) I suggested to bz that chrome URI content listeners should not offer to handle link clicks, although that's not possible the way URI content listeners currently work.

File Input

Sample implementation in XUL:File_Input.

  • A file open dialog. This dialog would not only prompt the user for a file to read in, but would also read in the file and present it in a javascript string or array or input stream or something. I am not talking about direct access to the file objects, since remote scripts should not be able to read and write any file they want. What I want is a dialog (or just a tag, doesn't have to be a dialog) that prompts the user to select a file and then loads that file and returns it. It might also be nice to have a XMLFileOpen dialog, which would allow a DTD to be attached and would also return the data as a DOM tree. An example implementation is XUL:File_Input.
Rational: This is already possible with a html input type="file" inside the XUL. That is, create a HTML input type=file, which would then post the file to the remote server. The file could then be retrieved from the server by using xmlhttprequest. This doesn't scale well, and the end result is the same. Using something like this and some more CSS could probably even get the input to look exactly like it was just another XUL element. I also don't think it is a really big security issue, since the only file the remote script would be able to read would be the one the user selected.
  • A file save dialog. This would be similar to the above, allowing a remote script to present a javascript string to be saved or an output stream or something. I am not as sure about this, since it might be possible to load the data into a hidden iframe and then call the document.execCommand('SaveAs',null,filename) command. Again, this seems possible already.

Editable Combo Box

It will be nice if XUL can add a new combo box widget which allows editing its content

You mean menulist editable="true"? --Nickolay 16:44, 8 Mar 2006 (PST)

Notification Box

A notification box which displays informative messages. This is used by Firefox for the browser info bar.


Number, Date and Time Pickers