Re: [webkit-dev] XML Events in WebKit

2007-12-09 Thread Ian Hickson
On Sat, 8 Dec 2007, Antoine Quint wrote:
  
  ...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, when used over the wire, is intended to be used to augment the 
presentation and behaviour of documents with semantics. For example, you 
could use it to take an HTML select element and make it look like a 
fancu map, or you could take a table and make it so that its column 
headers allow the table to be interactively sorted.

The XBL2 spec actually says this explicitly:

   The binding element defines a presentation and behavior binding. It 
   does not define an element's semantics. If an element has no semantics 
   when processed alone, then it has no semantics when processed with XBL.

   Sending markup that does not have well-defined semantics over the 
   network is bad practice. XBL is intended to be used to augment the user 
   experience, for instance by providing better quality widgets or 
   enhancing aesthetics. If the document being sent is unusable without 
   XBL, then XBL is being abused.

-- http://www.w3.org/TR/xbl/

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


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

2007-12-09 Thread Maciej Stachowiak


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

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] XML Events in WebKit

2007-12-09 Thread Maciej Stachowiak


On Dec 7, 2007, at 7:02 PM, Raj Kiran Talusani wrote:


Guys,

thanks very much for all the comments. let me be more specific about  
my problem.


i want to add multimodal capabilities to the webkit. I want to  
trigger (or communicate with) an external app based on events  
happening in the xhtml document. Also i want to insert custom events  
into the XHTML context based on results from the external process.  
Is there any way i can do this with current version of webkit. any  
pointers on what needs to be done?


Are you working with the Mac OS X WebKit API? If so, you can use the  
Objective-C DOM API to attach native event listeners, and to inject  
custom events. Alternately, you can use the Objective-C JavaScript  
bindings to export a custom native object to JavaScript, and call that  
from event listeners defined in script or using onxxx handlers. You  
could also use the JavaScript bindings to call JavaScript functions  
that dispatch custom events.


Which way works better will depend on the details of your application.

Regards,
Maciej

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev