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. $(divp);
instead of document.querySelector(divp);).
--
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/