W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2013

Re: [dom] Is it recommended to use Node.getFeature() or Node.isSupported()?

From: James Craig <jcraig@apple.com>
Date: Wed, 21 Aug 2013 17:43:02 -0700
Cc: "www-dom@w3.org" <www-dom@w3.org>, Indie UI <public-indie-ui@w3.org>
Message-id: <274B4DF7-9686-4F67-BD9B-B779E7D236F4@apple.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
On Aug 21, 2013, at 5:35 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Wed, Aug 21, 2013 at 5:03 PM, James Craig <jcraig@apple.com> wrote:
> 
>> Remaining in the spec (presumably still intended to work) but without much detail listed are Node.isSupported [2] and Node.getFeature [3]. Given that these methods are so similar to the functionality of DOMImplementation.hasFeature(), is it okay to rely on these?
> 
> No, use of these functions should be strongly discouraged.
> 
> Assuming you follow best practice of providing on* properties on the
> event sources, that's an easy way to detect event types.


Just to be clear, is this what you're recommending?

if (typeof document.body.ondismissrequest !== "undefined") {
	// okay to use dismissrequest
}
Received on Thursday, 22 August 2013 00:43:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:03 UTC