Sending custom elements over the wire (was Re: [webkit-dev] XML Events in WebKit)

Maciej Stachowiak mjs at apple.com
Sun Dec 9 01:36:51 PST 2007


Getting marginally off-topic for webkit-dev, but I don't mind having a  
bit of general web standards discussion here...

On Dec 8, 2007, at 8:05 AM, Antoine Quint wrote:

> On 8 déc. 07, at 01:14, Ian Hickson wrote:
>
>> On Fri, 7 Dec 2007, Antoine Quint wrote:
>>>
>>> XML Events basically come in handy when you want a generic markup- 
>>> based way to
>>> add event listeners for custom events. For instance, if XBL was  
>>> implemented in
>>> WebKit, and I had my own custom magic UI control implemented with  
>>> some custom
>>> XML element, [...]
>>
>> ...then you shouldn't be sending it over the wire, so it shouldn't
>> matter... (You shouldn't send custom, aka proprietary, vocabularies  
>> over
>> the wire, since you have no way to guarentee the end user can  
>> handle it.)
>
>
> We're drifting away from the original topic a bit, but I'm wondering  
> if such a statement would jeopardize the validity of the existence  
> of XBL, or if you see XBL as a technology for standalone, browser- 
> based application? Personally, I see no big problem using custom  
> grammars when XBL is available on the client.

XBL is a better solution than today's de facto approach to custom  
elements, <div class="something"> plus after-the-fact script hooks. It  
lets you avoid having semantically neutral <div> elements in the case  
where you want to make a custom widget that basically acts like an  
existing element with known semantics. For example, when making a  
custom button or checkbox with XBL, it's clearly better to bind to  
<button> or <input type="checkbox"> respectively than to <div  
class="button"> or <div class="checkbox">.

However, sometimes it is useful to package behavior and presentation  
that doesn't sensibly correspond to the semantics of any existing  
standard element. One example of this would be a tri-state checkbox.  
But it's likely there will always be application interaction elements  
that can't reasonably be expressed as a fancy version of a well-known  
control.

In this case you'll still have the option of <div> with a special  
class. And it is also technically feasible to use XML to bind to a  
custom element in the HTML namespace, or in XML a custom element in a  
custom namespace. I am not sure there is a material difference among  
these options. In each case there are no predefined semantics being  
expressed. But semantics could be added through widespread convention,  
as with microformats.

Regards,
Maciej



More information about the webkit-dev mailing list