Closed Bug 801562 Opened 12 years ago Closed 11 years ago

Remove Node.isSupported

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: ayg, Assigned: ayg)

References

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(1 file, 1 obsolete file)

DOM says to.  Worth a try?
Flags: in-testsuite+
This should land after bug 773780 to avoid bitrot.  I'll still write the patch now while I have time, and update it later.
Depends on: 773780
Summary: Remove .isSupported → Remove Node.isSupported
Attached patch Patch (obsolete) — Splinter Review
The diffstat made me an immediate convert:

 42 files changed, 1 insertions(+), 3484 deletions(-)

Granted that it's almost all test files -- but still, they're horribly ugly tests and I'm delighted to be rid of them.  A few more test changes might be needed.  Try: <https://tbpl.mozilla.org/?tree=Try&rev=3f35951f7d8c>

The one line inserted is because of js/xpconnect/crashtests/468552-1.html.  Bug 468552 happened to use isSupported to test for an XPConnect bug -- I switched it to replaceChild instead, on the theory that it should be testing the same basic bug.
Attachment #671362 - Flags: review?(bzbarsky)
For the moment perhaps the SVG mochitest should stay but use hasFeature instead and only test SVG features. That would still allow you to get rid of isSupported wouldn't it?
Given that even removing navigator.taintEnabled() (Bug 679971) caused major problems, I'd
be very careful removing this stuff.
We need to have at least some data whether it is being used.
So, please add first some telemetry probes.
(In reply to Robert Longson from comment #3)
> For the moment perhaps the SVG mochitest should stay but use hasFeature
> instead and only test SVG features. That would still allow you to get rid of
> isSupported wouldn't it?

This is written on top of bug 801425, so hasFeature() always returns true.  If bug 801425 changes so that this is no longer the case, what you suggest would make sense.

(In reply to Olli Pettay [:smaug] from comment #4)
> Given that even removing navigator.taintEnabled() (Bug 679971) caused major
> problems, I'd
> be very careful removing this stuff.
> We need to have at least some data whether it is being used.
> So, please add first some telemetry probes.

I did Google Code Search for /isSupported\([^)[]*,/ in JavaScript.  There were around 85 results and I looked at all of them -- none seemed to be real uses.  That implies at least that it's not used in any major JS library, since any major JS library would be included in at least one project indexed by Code Search.  So it's better than navigator.taintEnabled, which it turned out was used in jQuery.

We could add telemetry probes, but if so, please let's decide in advance how we plan to interpret the results.
Comment on attachment 671362 [details] [diff] [review]
Patch

Rev iid, please.  ;)

Seems fine with that.
Attachment #671362 - Flags: review?(bzbarsky) → review+
Attached patch Patch, rebasedSplinter Review
I had to rewrite the patch to apply on top of the current tree, because IsSupported implementations have moved around a bunch.  It builds locally and passes some tests I tried.  I also adjusted the SVG test to use hasFeature instead of deleting it.  The basic idea is identical to the previous patch.

Try: https://tbpl.mozilla.org/?tree=Try&rev=4c0a12849b8f
Attachment #671362 - Attachment is obsolete: true
Attachment #724904 - Flags: review?(bzbarsky)
Comment on attachment 724904 [details] [diff] [review]
Patch, rebased

r=me especially if other UAs already don't support this...
Attachment #724904 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/0e7006217d7d
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
I've added this bug to the compatibility doc. Please correct the info if wrong.
https://developer.mozilla.org/en-US/docs/Site_Compatibility_for_Firefox_22
Keywords: site-compat
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: