W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2009

Re: Selectors CR criteria

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Fri, 27 Nov 2009 12:45:15 +0100
Message-ID: <4B0FBBCB.1050907@lachy.id.au>
Cc: Sean Hogan <shogun70@westnet.com.au>, public-webapps@w3.org
Sean Hogan wrote:
> What is the reason for the native implementation requirement?
> Is it W3C policy?

There's a couple of reasons for this.  The main reason being that 
JavaScript libraries are not limited by the same compatibility 
constraints as a browser, and so something that could be implemented in 
a JavaScript library without any problems may prove to have backwards 
compatibility issues with some legacy sites and affect a browser's 
ability to implement it.  Basically, in this sense, a JS library is 
effectively a walled garden implementation where it's only used on sites 
that are explicitly built for it.  So allowing such implementations to 
count effectively undermines the whole purpose of the implementation 
requirement, which is there to help demonstrate that the spec works in 
practice.

The other reason is that it's not always technically possible for a JS 
library to implement all the required functionality due to the 
limitations of the DOM, or at least some implementations of it.  For 
example, it's not possible in IE to add the methods to the prototypes 
for the Document, Element or DocumentFragment nodes.  Also, in practice, 
implementations like in JQuery don't actually try to implement the 
methods themselves. They just implement somewhat compatible 
functionality and expose it on their own objects (e.g. $("div>p"); 
instead of document.querySelector("div>p");).

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/
Received on Friday, 27 November 2009 12:05:43 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:35 GMT