W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2014

Re: Change to Attr interface in light of XPath

From: Robin Berjon <robin@w3.org>
Date: Wed, 19 Feb 2014 12:18:03 +0100
Message-ID: <530492EB.8080508@w3.org>
To: Justin Summerlin <justin@inkling.com>, Jonas Sicking <jonas@sicking.cc>
CC: Boris Zbarsky <bzbarsky@mit.edu>, DOM public list <www-dom@w3.org>
On 18/02/2014 21:02 , Justin Summerlin wrote:
> But by not fully inheriting from Node, we lose symmetry with other types
> of objects returned from XPath queries; we lose nodeType for example. If
> I get a result object and nodeType tells me nothing, I need to look at
> the prototype of the object or look at ownerElement, in this case, and
> see if that object is in the attribute list just to know what kind of
> object I'm working with.

Inheriting fully from Node is pretty heavy-handed, and for many things 
feels quite unnatural.

Do you have an implementation of XPath in JS? Maybe the simplest thing 
would be to show what information you need on Attr for it to work; it's 
likely to cover general-purpose requirements pretty well.

-- 
Robin Berjon - http://berjon.com/ - @robinberjon
Received on Wednesday, 19 February 2014 11:18:14 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:22 UTC