Use defaultPrevented instead of the deprecated getPreventDefault() in front-end code

VERIFIED FIXED in mozilla11

Status

()

Core
General
--
trivial
VERIFIED FIXED
6 years ago
2 years ago

People

(Reporter: dao, Assigned: Jan)

Tracking

(Blocks: 1 bug)

Trunk
mozilla11
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [good first bug][mentor=dao][lang=js])

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

6 years ago
event.getPreventDefault is deprecated, we should use event.defaultPrevented instead.

Affected files:

http://mxr.mozilla.org/mozilla-central/search?string=getPreventDefault&case=1&find=&findi=&filter=\.%28js|xml|xul|html%29&hitlimit=&tree=mozilla-central
(Assignee)

Updated

6 years ago
Assignee: nobody → jan.bambach
Status: NEW → ASSIGNED
(Assignee)

Comment 1

6 years ago
Created attachment 579132 [details] [diff] [review]
This patch should fix Bug 707677.
(Assignee)

Updated

6 years ago
Attachment #579132 - Flags: review?
(Assignee)

Updated

6 years ago
Attachment #579132 - Flags: review? → review?(dao)
(Reporter)

Comment 2

6 years ago
Did you intentionally leave out content/events/test/test_bug508906.html and content/xul/content/test/test_bug486990.xul?

In browser/base/content/browser-places.js and content/events/test/test_bug493251.html there are comments referring to getPreventDefault(), by the way -- those should be updated as well.
(Reporter)

Comment 3

6 years ago
Also, you seem to have missed one instance in toolkit/content/widgets/wizard.xml as well as toolkit/content/widgets/dialog.xml.
(Assignee)

Updated

6 years ago
Attachment #579132 - Attachment is obsolete: true
Attachment #579132 - Flags: review?(dao)
(Assignee)

Comment 4

6 years ago
Created attachment 579799 [details] [diff] [review]
This patch should fix Bug 707677.
Attachment #579799 - Flags: review?(dao)
(Assignee)

Comment 5

6 years ago
Created attachment 579801 [details] [diff] [review]
Adding the name to the contributors section. (Optional)
Attachment #579801 - Flags: review?(dao)
(Reporter)

Comment 6

6 years ago
Comment on attachment 579799 [details] [diff] [review]
This patch should fix Bug 707677.

Thanks!
Attachment #579799 - Flags: review?(dao) → review+
(Reporter)

Comment 7

6 years ago
Comment on attachment 579801 [details] [diff] [review]
Adding the name to the contributors section. (Optional)

I think we probably shouldn't do this for non-invasive search-and-replace changes. For instance, when another contributor wants to do something in b2g/chrome/content/shell.js and is looking for guidance, you probably wouldn't want that contributor to contact you just because you're in the contributors section of that file.
Attachment #579801 - Attachment is obsolete: true
Attachment #579801 - Flags: review?(dao)
(Reporter)

Comment 8

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/ccc5f03e6dd2
Target Milestone: --- → mozilla11

Comment 9

6 years ago
https://hg.mozilla.org/mozilla-central/rev/ccc5f03e6dd2
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Comment 10

6 years ago
Thanks a lot! :-) -> Verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.