Last Comment Bug 708702 - Use defaultPrevented instead of the deprecated getPreventDefault() in front-end code
: Use defaultPrevented instead of the deprecated getPreventDefault() in front-e...
[good first bug][lang=js]
Product: Thunderbird
Classification: Client Software
Component: General (show other bugs)
: Trunk
: All All
-- trivial (vote)
: Thunderbird 13.0
Assigned To: Nguyen Ngoc Trung
Depends on:
Blocks: 691151
  Show dependency treegraph
Reported: 2011-12-08 10:09 PST by Dão Gottwald [:dao]
Modified: 2012-02-13 13:00 PST (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

Propose patch (4.64 KB, patch)
2012-01-31 12:40 PST, Nguyen Ngoc Trung
standard8: review+
Details | Diff | Splinter Review

Description User image Dão Gottwald [:dao] 2011-12-08 10:09:22 PST
+++ This bug was initially created as a clone of Bug #707677 +++

event.getPreventDefault is deprecated, event.defaultPrevented should be used instead.

Affected files:^[^\0]*%24&hitlimit=&tree=comm-central
Comment 1 User image Nguyen Ngoc Trung 2012-01-19 09:38:07 PST
I would like to try this bug.
Comment 2 User image Dão Gottwald [:dao] 2012-01-19 09:43:08 PST
Great! Let me know if you need help.
Comment 3 User image Nguyen Ngoc Trung 2012-01-25 11:13:56 PST
Hi Gottwald,
I changed all the depreciated methods except for the file jquery-1.6.4.min.js
Can you help me with this file, I don't fully understand the part that need changing:
* The part is:
f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?D:C):this.type=a,b&&f.extend(this,b),,this[f.expando]=!0}

I'm just wondering if changing only the a.getPreventDefault&&a.getPreventDefault()?D:C into a.defaultPrevented?D:C  is okay or not?
Comment 4 User image Dão Gottwald [:dao] 2012-01-25 11:19:19 PST
You can just leave out jquery-1.6.4.min.js. It will automatically use defaultPrevented if getPreventDefault isn't defined.
Comment 5 User image Nguyen Ngoc Trung 2012-01-31 12:40:00 PST
Created attachment 593188 [details] [diff] [review]
Propose patch

Please check if I did this right. Thank you.
Comment 6 User image Dão Gottwald [:dao] 2012-01-31 12:51:34 PST
Comment on attachment 593188 [details] [diff] [review]
Propose patch

Looks good to me.
Comment 7 User image Mark Banner (:standard8) 2012-02-08 15:22:01 PST
Comment on attachment 593188 [details] [diff] [review]
Propose patch

Looks good, thanks for the patch.
Comment 8 User image Mark Banner (:standard8) 2012-02-13 13:00:54 PST
Checked in:

Thanks for the patch.

Note You need to log in before you can comment on or make changes to this bug.