I've accepted a contract position with Mozdev Group to work on some Mozilla-related projects. Actually, I started on Monday so I've already done some work already. It's always good to work with folks who share the same vision as I do. Let's hope together we can build some exciting products and help to promote Mozilla technologies.
10:25 PM New Work
5:28 PM Building Technologies with Baby Steps
When someone encounters somthing new, one has a tendency to compare it to something that already exists. This is a natural habit that everyone does to help provide a starting point for determining how to react to whatever this new thing is. For instance, when a new product is released, it will be compared to some existing product, and lists of advantages and disadvantages between the new and old will be created. It really doesn't matter that the new product has a very different purpose or not.
For instance, if you build a new revolutionary killer product that does all kinds of never-before-done things, but you put a Back button, and an address bar and Bookmarks on it, it is no longer a new revolutionary killer product, but just another web browser. It doesn't matter what you say, because people will look for the familiar in your new product, and compare your product to that. You can't create revolutionary products intentionally, so quit trying.
Why was XML successful? Likely much of its success was due its similarity to HTML. If XML had used square brackets or other different syntax, its possible that it wouldn't have gotten as far. People need a way to transition to new things so that familiarity is maintained thoughout the process. When building a new technology, you need to ensure that radical changes are minimal to encourage adoption.
For instance, a web developer that understands HTML forms would have no trouble with a few new tags or attributes added to HTML forms, but would really get lost when it comes to XForms. That would require one to grasp XML syntax, different tags for forms, the separation of UI and data, XPath, and a number of other things. The intuitive leap is just too great. Instead, technologies must be created which allow the developer to take baby steps from one concept to the other. In fact, Opera has provided an alternative to XForms which is much more transitional, and, if suitably implemented, would likely be more widely adopted.
Have you noticed how popular the web is? The web has slowly changed the way that developers and companies think about things. You can't just light a match and blow it away. Progress is done in small steps.
7:26 PM One more XAML thought
One thing I noted about XAML is that both the code and the XML parts need to be compiled before using them -- although the XAML can be interpreted by Explorer in some means, perhaps by compiling it when needed.
From what I can tell there is no XML at run-time, meaning no DOM-manipulation. You need to use all new APIs to manipulate the UI. Actually, the whole thing works very similar to Mac OS X, which stores UI descriptions in XML which map to classes. Apple doesn't promote this much though as they prefer that people use the visual tools.
6:38 PM Some XAML comments
OK, I took a quick look at XAML to see how it compares to XUL, or anything.
- It is indeed a XUL-like language for describing user interfaces. Why didn't they just use XUL? Well, you wouldn't expect MS to use something someone else created would you?
- XAML might be only a codename. Sometimes, the documentation says it's a codename, and XAML always appears in quotes.
- You can run compiled code in a standalone window or in a browser, but you can't do both. Switching requires recompiling.
- Each 'XAML' tag corresponds to a Class. Attributes on the tags correspond to the fields (properties) of the class. For example, a Button class can be specified with <Button Width="100" FontSize="10">
- There is no CSS used -- instead specific attributes are used. There is something confusingly called Styles, which appear to be more like CSS classes for sharing appearance with a number of elements. This Styles feature does seem to have the capability to adjust the appearance of inner content, for example the thumbs and slider part of a scrollbar can be adjusted with a block of XML. In fact, some of the examples suggest that the Style features might have some XBL-like content capability, although it looked more confusing.
- There's a databinding feature, kind of like the one IE already has which can bind to XML, SQL and so forth. In XUL, this is done with templates and RDF. In XAML, the data to bind to are even called data sources.
- There's something which falls into the category of 'Yet another XML vector language which isn't SVG.' It does look very similar though, but my cursory glance and limited knowledge of SVG suggest that it isn't the same. It is called Windows Vector Graphics though. Yes, this is exactly what the world needs. More similar but different vector graphics languages.
- As far as I can tell, there's no XBL or overlays or anything similar. Custom components can be created in native code (C# or whatever). So, there's isn't anything as cool as Firebird Extensions.
- The documentation is, like most of the stuff on MSDN, difficult to navigate through. Most of it is vague and more of a reference. There is only a few pages that actually explain how to do something. Because of this, there may be something I'm missing. There may be more interesting features that I missed, but I don't think XAML itself is necessarily all that powerful. In fact, it's really just a mapping between classes and XML.
There's a general overview here.
5:21 PM XAML Info now available
XAML info is now available. I haven't looked at it yet, but it's rumoured to be similar to XUL. More comments to come soon.
1:09 PM XUL-related quotes from Hixie
Ian Hickson has some interesting quotes from a recent XUL naming debate between him and, if you've been following XUL, you should know who else.
We stopped working on the XUL spec itself when XUL Planet started documenting XUL in more detail than we had time to do ourselves.
Most of the current XUL work is being done within standards organisations with strict NDA policies. If you are a ISO, W3C, ECMA, or IETF member let me know and I can show you the relevant links... I'm under NDA from one of the above groups, in which XUL is being discussed.
XUL _is_ in active development, we are currently taking feedback into account and are more carefully defining the XUL box model.
All quotes from here.
7:14 PM Custom XUL Rendering Widgets
I've been thinking a bit over the last week or so about support for custom drawing widgets in Mozilla. There are four possibilities:
- Create a <canvas> tag as described in bug 102285. Although the patch needs some work, this is probably the easiest approach. However, it limits one to a single special XUL tag for drawing.
- Create a modifiable image object. The image would have a variety of drawing functions such as drawLine, drawRect and so forth as well as pixel-level functions. It might even be possible to support transparency and animation as existing images do. It could then be used in the HTML and XUL image tags, or even CSS properties if a method was created to assign custom images to them. The canvas tag patch suggests that this technique would be quite simple to implement. It has the advantage that it could work on various different tags.
- Create an interface with drawing functions. These would be called by the application during paint events (such as onpaint) to update the display. This would have the advantage of not necessarily requiring a buffer to hold image data, but would be slower for repeated redraws. It would however, allow extra components to implement the drawing interface, allowing for various alternate system-specific libraries to handle drawing.
- Use SVG. This is the most work, but only really handles some cases. SVG requires a DOM node for every part of what is to be drawn, which isn't practical for pixel-level drawing or heavy animation.
There's also some security issues, for example, to ensure that unprivileged code either can't use custom drawing, or can't draw over things it shouldn't be able to.
11:20 PM XUL and XAML
A lot of people (here and here, for example) are discussing XAML, an upcoming MS technology which many think is similar to XUL. In case people are confused, no-one has actually seen XAML yet; we only have rumours as to what it is.
The only thing we know is that it is a markup language for describing applications and possibly a few clues from a screenshot. In fact, I don't think we even know for sure that it's for describing user interfaces at all. In fact, if it can, it may be a 'side effect' of what it's actual purpose is.
I suspect the goals of XAML are quite different from the goals of XUL (apart from any MS evil conspiracy). For instance, XUL is designed to be a cross-platform UI language, akin to HTML, that uses existing Web standards such as CSS, XML, DOM, RDF and so on, and includes some interesting features such as overlays and XBL for extensibilty. In my opinion, the only missing things could be fixed up in time with a few good developers who can dedicate themselves to it.
One of the difficulties in promoting XUL and Mozilla is that many people have this misconception that XUL shouldn't be used because IE has more users. That's unfortunate. That confusion is created because people hear the name Mozilla, and immediately lump it in the 'browser' category, forever more being known only as an IE competitor, not as something more. There's really no reason to do this of course. A better way to think is to allow room for both Mozilla and IE. There really isn't any reason to think that just because a user uses IE for browsing that they shouldn't use a mail reader or an RSS reader or an IM client that doesn't use Mozilla technology such as XUL or the Gecko engine.
So, even if there are lots of competing XML UI languages (and there are many), there's no reason to think you need to use one or the other because one is more popular.
8:48 PM Map Creation
The RDF Interest Group logs point to a RDF file containing US States meta-info. It lists capitals, regions and the neighbours of states. Upon looking at the data, I thought of an interesting challenge: write a script that could generate a map -- perhaps with SVG -- using only the list of regions and neighbours from the RDF. Obviously, the map would be completely wrong, but it would be interesting to see what the results would be. Better accuracy would require more data: land areas, border sizes, etc...
10:28 PM Inline Weblog Comments
On newsgroups and forums with similar mechanics, users that want to refer to an earlier comment will quote some of the text and the newsreader will add some marks to the left or indent it or something. After several postings, you end up with long blocks of quoted text at several levels deep.
Chris: Yes, I really hate when people leave in huge blocks of irrelevant text from earlier posts.
Weblogs tend to only allow comments at a single level. What if, when reading a posting on a weblog, one could select a paragraph, and then click a Respond button, which would associate the comment with that particular paragraph. Or, better, a fancy inline editor, where one could add text in-between paragraphs. To another reader, the whole text appears as it was originally, but upon selecting a Comments button, the additions are displayed in place.
Julie: We need weblog tools that have much more sophisticated comment systems. Unfortunately, right now I'm battling all kinds of comments from "enhancement pills" web sites on my weblog where I write about how to get cheap loans.
Chris: Perhaps you need to disable posting links from comments.
It might appear something like what happens when you click the Comments button here:
12:56 PM ReoPath Templates Specification
For Topicalla, I created a more sophisticated RDF templating language than the one XUL has. It uses ReoPath expressions to bind RDF data to XUL elements. It will also work for XHTML and other XML languages.
The implementation isn't finished; some tags don't work, and the auto-updating of the display when the RDF is changed hasn't been extensively tested.
However, here is a ReoPath Templates Specification.
11:25 PM New Topicalla features
I'm currently working on some significant new features for Topicalla. These features are very exciting. Here are some hints as to what they involve:
- An Edit button
- A Save button
12:34 PM An Open Letter to Movie Studios
Dear Movie Industry:
Please stop making movies involving talking dogs.
2:07 PM Election Day
There's an election today. It was called exactly one month ago. That's thirty days. It wasn't delayed at all. Every single poll location uses the same high-tech equipment where one writes a mark on a piece of paper and puts it in a box. And as far as I know, no celebrities are running. Where I live, I could vote for someone who used to work at the same place I did, or someone who looks like Jerry Springer. There are other people too but they can only be distinguished by their opinions on real politcal issues which makes them less interesting.
12:46 PM XUL Template Building
There's been some discussion over the XUL template building process in various newsgroup threads. I've added some additional information about builders in the template section of the tutorial. A brief overview here:
When you have an element with a 'datasources' attribute, it acquires both a database and a builder object, responsible for holding the RDF datasources and constructing the content with a template respectively. The <template> tag is just a placeholder for the content to be generated. It has style 'display: none'. If you change this style, the template will appear in the document as well.
One trick many people don't know about is to move the template outside the element like this:
<template id="btem"> <button uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name"/> </template> <vbox datasources="rdf:bookmarks" ref="NC:BookmarksRoot" template="btem"/>
There are two types of builders, the content builder and the tree builder. The latter may only be used with trees, the former may be used with any kind of content, including trees. The default is the content builder. You can select the tree builder using flags="dont-build-content".
The content builder generates the content by cloning the DOM nodes in the template and inserting them into the document at the necessary position. The tree builder does not do this and gets the labels of the tree cells directly from the RDF datasource when necessary. For this reason, the tree builder is more efficient for trees with hundreds or thousands of rows. However, you can't use functions that deal with DOM elements such as those in tree.contentView since no content is generated.