Closed Bug 691151 Opened 8 years ago Closed 2 years ago

Remove Event.prototype.getPreventDefault

Categories

(Core :: DOM: Events, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: bruant.d, Assigned: bzbarsky)

References

Details

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

Attachments

(1 file)

This is not standard and has a standard alternative (defaultPrevented property).
There is no reason to keep this around forever.
Need to first remove all its usage from Firefox / Gecko / Thunderbird / etc. then start
warn about its usage, and then remove it.
But yes,  we should try to remove it.
OS: Linux → All
Hardware: x86 → All
Version: 7 Branch → Trunk
Depends on: 707677
Keywords: dev-doc-needed
Keywords: addon-compat
Depends on: 708702
Depends on: 708703
Depends on: 714601
Depends on: 714602
Depends on: 715110
Depends on: 726933
Keywords: site-compat
(In reply to Olli Pettay from comment #1)
> Need to first remove all its usage from Firefox / Gecko / Thunderbird / etc.
> then start warn about its usage, and then remove it.
> But yes,  we should try to remove it.

Looks like we started warning about it when there are still 11 in-tree callers...
Oops, I didn't realize the existence of C++ callers. Reverting for now.
Depends on: 876040
Depends on: 876054
It appears that wikipedia still uses this.
Depends on: 1024488
Are there any estimates on when getPreventDefault will finally be removed?
Olli, thoughts on removing this?

Telemetry is moderately useless, because some old jQuery versions have:

        this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
            src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;

which will call the method any for any event for which default is _not_ prevented.  That said, no one else implements this, and it feels somewhat safe to try removing...
Flags: needinfo?(bugs)
I guess we could try to remove this early in a cycle. So, next week?
Flags: needinfo?(bugs)
MozReview-Commit-ID: FQ3LzP7rW6e
Attachment #8928179 - Flags: review?(bugs)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #8928179 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/3b3a7055f264
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Updated Firefox 59 for developers. This method was never documented; its only mention is a note on defaultPrevented that you shouldn't use getPreventdefault().
So it seems. Wanna fix?
Depends on: 1433404
Sure. Filed bug 1433404.
You need to log in before you can comment on or make changes to this bug.