Bug 707677 - Use defaultPrevented instead of the deprecated getPreventDefault() in front-end code. r=dao
authorJan Bambach <jan.bambach@hotmail.de>
Thu, 08 Dec 2011 10:21:32 +0100
changeset 82242 ccc5f03e6dd2c1f70fa8f643dc8af53bc8692253
parent 82241 647b56f040f1ead84500f9bbdef54551e6be5a42
child 82243 a31949628a7e971ecef6d25aca4bc633f3d4cfd4
push id21587
push userbmo@edmorley.co.uk
push dateThu, 08 Dec 2011 15:13:43 +0000
treeherdermozilla-central@98db2311a44c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs707677
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 707677 - Use defaultPrevented instead of the deprecated getPreventDefault() in front-end code. r=dao
b2g/chrome/content/shell.js
b2g/chrome/content/touch.js
browser/base/content/browser-places.js
browser/base/content/browser.js
browser/base/content/tabbrowser.xml
browser/base/content/test/browser_contentAreaClick.js
browser/base/content/test/browser_ctrlTab.js
browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js
content/events/test/test_bug493251.html
content/events/test/test_bug508906.html
content/xul/content/test/test_bug486990.xul
editor/libeditor/html/tests/test_htmleditor_keyevent_handling.html
editor/libeditor/text/tests/test_bug569988.html
editor/libeditor/text/tests/test_texteditor_keyevent_handling.html
mobile/xul/chrome/content/content.js
toolkit/components/prompts/content/tabprompts.xml
toolkit/content/WindowDraggingUtils.jsm
toolkit/content/tests/chrome/test_datepicker.xul
toolkit/content/widgets/autocomplete.xml
toolkit/content/widgets/browser.xml
toolkit/content/widgets/dialog.xml
toolkit/content/widgets/findbar.xml
toolkit/content/widgets/listbox.xml
toolkit/content/widgets/menulist.xml
toolkit/content/widgets/text.xml
toolkit/content/widgets/wizard.xml
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -122,17 +122,17 @@ var shell = {
         switch (evt.keyCode) {
           case evt.DOM_VK_HOME:
             this.sendEvent(this.home.contentWindow, 'home');
             break;
           case evt.DOM_VK_SLEEP:
             screen.mozEnabled = !screen.mozEnabled;
             break;
           case evt.DOM_VK_ESCAPE:
-            if (evt.getPreventDefault())
+            if (evt.defaultPrevented)
               return;
             this.doCommand('cmd_close');
             break;
         }
         break;
       case 'load':
         this.home.removeEventListener('load', this, true);
         this.sendEvent(window, 'ContentStart');
--- a/b2g/chrome/content/touch.js
+++ b/b2g/chrome/content/touch.js
@@ -168,17 +168,17 @@
             debug('click: fire');
           }
           return;
       }
 
       let target = eventTarget || this.target;
       if (target && type) {
         let touchEvent = this.sendTouchEvent(evt, target, type);
-        if (touchEvent.getPreventDefault() && canPreventMouseEvents)
+        if (touchEvent.defaultPrevented && canPreventMouseEvents)
           preventMouseEvents = true;
       }
 
       if (preventMouseEvents) {
         evt.preventDefault();
         evt.stopPropagation();
 
         if (type != 'touchmove')
@@ -199,17 +199,17 @@
       evt.initMouseEvent('contextmenu', true, true, doc.defaultView,
                          0, x, y, x, y, false, false, false, false,
                          0, null);
 
       let timeout = window.setTimeout((function contextMenu() {
         debug('fire context-menu');
 
         target.dispatchEvent(evt);
-        if (!evt.getPreventDefault())
+        if (!evt.defaultPrevented)
           return;
 
         doc.releaseCapture();
         this.target = null;
 
         isNewTouchAction = false;
       }).bind(this), delay);
       return timeout;
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -122,30 +122,30 @@ var StarUI = {
               PlacesUIUtils.ptm.endBatch();
               break;
             }
           }
           this._actionOnHide = "";
         }
         break;
       case "keypress":
-        if (aEvent.getPreventDefault()) {
+        if (aEvent.defaultPrevented) {
           // The event has already been consumed inside of the panel.
           break;
         }
         switch (aEvent.keyCode) {
           case KeyEvent.DOM_VK_ESCAPE:
             if (!this._element("editBookmarkPanelContent").hidden)
               this.cancelButtonOnCommand();
             break;
           case KeyEvent.DOM_VK_RETURN:
             if (aEvent.target.className == "expander-up" ||
                 aEvent.target.className == "expander-down" ||
                 aEvent.target.id == "editBMPanel_newFolderButton") {
-              //XXX Why is this necessary? The getPreventDefault() check should
+              //XXX Why is this necessary? The defaultPrevented check should
               //    be enough.
               break;
             }
             this.panel.hidePopup();
             break;
         }
         break;
     }
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5760,17 +5760,17 @@ function hrefAndLinkNodeForClickEvent(ev
  * @param event
  *        The click event.
  * @param isPanelClick
  *        Whether the event comes from a web panel.
  * @note default event is prevented if the click is handled.
  */
 function contentAreaClick(event, isPanelClick)
 {
-  if (!event.isTrusted || event.getPreventDefault() || event.button == 2)
+  if (!event.isTrusted || event.defaultPrevented || event.button == 2)
     return true;
 
   let [href, linkNode] = hrefAndLinkNodeForClickEvent(event);
   if (!href) {
     // Not a link, handle middle mouse navigation.
     if (event.button == 1 &&
         gPrefService.getBoolPref("middlemouse.contentLoadURL") &&
         !gPrefService.getBoolPref("general.autoScroll")) {
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2409,17 +2409,17 @@
           if (aEvent.altKey)
             return;
 
           // We need to take care of FAYT-watching as long as the findbar
           // isn't initialized.  The checks on aEvent are copied from
           // _shouldFastFind (see findbar.xml).
           if (!gFindBarInitialized &&
               !(aEvent.ctrlKey || aEvent.metaKey) &&
-              !aEvent.getPreventDefault()) {
+              !aEvent.defaultPrevented) {
             let charCode = aEvent.charCode;
             if (charCode) {
               let char = String.fromCharCode(charCode);
               if (char == "'" || char == "/" ||
                   Services.prefs.getBoolPref("accessibility.typeaheadfind")) {
                 gFindBar._onBrowserKeypress(aEvent);
                 return;
               }
--- a/browser/base/content/test/browser_contentAreaClick.js
+++ b/browser/base/content/test/browser_contentAreaClick.js
@@ -228,19 +228,19 @@ function test() {
 let gClickHandler = {
   handleEvent: function (event) {
     let linkId = event.target.id || event.target.localName;
     is(event.type, "click",
        gCurrentTest.desc + ":Handler received a click event on " + linkId);
 
     let isPanelClick = linkId == "panellink";
     let returnValue = gTestWin.contentAreaClick(event, isPanelClick);
-    let prevent = event.getPreventDefault();
+    let prevent = event.defaultPrevented;
     is(prevent, gCurrentTest.preventDefault,
-       gCurrentTest.desc + ": event.getPreventDefault() is correct (" + prevent + ")")
+       gCurrentTest.desc + ": event.defaultPrevented is correct (" + prevent + ")")
 
     // Check that all required methods have been called.
     gCurrentTest.expectedInvokedMethods.forEach(function(aExpectedMethodName) {
       isnot(gInvokedMethods.indexOf(aExpectedMethodName), -1,
             gCurrentTest.desc + ":" + aExpectedMethodName + " was invoked");
     });
     
     if (gInvokedMethods.length != gCurrentTest.expectedInvokedMethods.length) {
--- a/browser/base/content/test/browser_ctrlTab.js
+++ b/browser/base/content/test/browser_ctrlTab.js
@@ -69,17 +69,17 @@ function test() {
 
   gBrowser.removeTab(gBrowser.tabContainer.lastChild);
   checkTabs(1);
 
   { // test for bug 445768
     let focusedWindow = document.commandDispatcher.focusedWindow;
     let eventConsumed = true;
     let detectKeyEvent = function (event) {
-      eventConsumed = event.getPreventDefault();
+      eventConsumed = event.defaultPrevented;
     };
     document.addEventListener("keypress", detectKeyEvent, false);
     pressCtrlTab();
     document.removeEventListener("keypress", detectKeyEvent, false);
     ok(eventConsumed, "Ctrl+Tab consumed by the tabbed browser if one tab is open");
     is(focusedWindow, document.commandDispatcher.focusedWindow,
        "Ctrl+Tab doesn't change focus if one tab is open");
   }
--- a/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js
+++ b/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js
@@ -78,17 +78,17 @@ function synthesizeDragWithDirection(aEl
            "Flavor " + types[f] + " for item " + t + " should be the same.");
         is(dataTransfer.mozGetDataAt(types[f], t),
            expecteditem[f].substring(types[f].length + 2),
            "Contents for item " + t + " with flavor " + types[f] + " should be the same.");
       }
     }
 
     if (!aExpectedDragData.length)
-      ok(event.getPreventDefault(), "Drag has been canceled.");
+      ok(event.defaultPrevented, "Drag has been canceled.");
 
     event.preventDefault();
     event.stopPropagation();
 
     gBookmarksToolbar.removeEventListener("dragstart", arguments.callee, false);
 
     // This is likely to cause a click event, and, in case we are dragging a
     // bookmark, an unwanted page visit.  Prevent the click event.
--- a/content/events/test/test_bug493251.html
+++ b/content/events/test/test_bug493251.html
@@ -55,18 +55,18 @@ https://bugzilla.mozilla.org/show_bug.cg
     ok(true, "Dipatching mouse event: aType=" + aType + ", aX=" + aX + ", aY" +
                aY + ", aButton=" + aButton + ", aClickCount=" + aClickCount +
                ", aModifiers=" + aModifiers);
     utils.sendMouseEvent(aType, aX, aY, aButton, aClickCount, aModifiers);
   }
 
   function dumpEvent(aEvent) {
     var detail = "target=" + aEvent.target + ", originalTarget=" +
-                 aEvent.originalTarget + ", getPreventDefault()=" +
-                 aEvent.getPreventDefault() + ", isTrusted=" + aEvent.isTrusted;
+                 aEvent.originalTarget + ", defaultPrevented=" +
+                 aEvent.defaultPrevented + ", isTrusted=" + aEvent.isTrusted;
     switch (aEvent.type) {
       case "keydown":
       case "keypress":
       case "keyup":
         detail += ", charCode=0x" + aEvent.charCode.toString(16) +
           ", keyCode=0x" + aEvent.keyCode.toString(16) +
           ", altKey=" + (aEvent.altKey ? "PRESSED" : "no") +
           ", ctrlKey=" + (aEvent.ctrlKey ? "PRESSED" : "no") +
--- a/content/events/test/test_bug508906.html
+++ b/content/events/test/test_bug508906.html
@@ -125,17 +125,17 @@ function testStopPropagation() {
 
 function testPreventDefault() {
   let event = document.createEvent("MozTouchEvent");
   event.initMozTouchEvent("MozTouchDown", true, true, window, 0, 0, 0, 0, 0,
                           false, false, false, false, 0, null, 0);
 
   parent.addEventListener("MozTouchDown", function(ev) {
     parent.removeEventListener("MozTouchDown", arguments.callee, false);
-    is(ev.getPreventDefault(), true, "preventDefault can be called");
+    is(ev.defaultPrevented, true, "preventDefault can be called");
     nextTest();
   }, false);
 
   testTarget.addEventListener("MozTouchDown", function(ev) {
     testTarget.removeEventListener("MozTouchDown", arguments.callee, false);
     ev.preventDefault();
   }, false);
 
@@ -144,17 +144,17 @@ function testPreventDefault() {
 
 function testBlockPreventDefault() {
   let event = document.createEvent("MozTouchEvent");
   event.initMozTouchEvent("MozTouchDown", true, false, window, 0, 0, 0, 0, 0,
                           false, false, false, false, 0, null, 0);
 
   parent.addEventListener("MozTouchDown", function(ev) {
     parent.removeEventListener("MozTouchDown", arguments.callee, false);
-    is(ev.getPreventDefault(), false, "aCancelableArg works");
+    is(ev.defaultPrevented, false, "aCancelableArg works");
     nextTest();
   }, false);
 
   testTarget.addEventListener("MozTouchDown", function(ev) {
     testTarget.removeEventListener("MozTouchDown", arguments.callee, false);
     ev.preventDefault();
   }, false);
 
--- a/content/xul/content/test/test_bug486990.xul
+++ b/content/xul/content/test/test_bug486990.xul
@@ -46,17 +46,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   SimpleTest.waitForExplicitFinish();
 
   var prevented = false;
   var eventCount = 0;
 
   function fooListener(evt) {
     evt.preventDefault();
-    prevented = evt.getPreventDefault();
+    prevented = evt.defaultPrevented;
     ++eventCount;
   };
 
   var clickCount = 0;
   var mouseDownCount = 0;
   var mouseUpCount = 0;
   function clickListener(evt) {
     ++clickCount;
--- a/editor/libeditor/html/tests/test_htmleditor_keyevent_handling.html
+++ b/editor/libeditor/html/tests/test_htmleditor_keyevent_handling.html
@@ -41,21 +41,21 @@ function runTests()
 
   var listener = {
     handleEvent: function _hv(aEvent)
     {
       is(aEvent.type, "keypress", "unexpected event is handled");
       switch (aEvent.eventPhase) {
       case aEvent.CAPTURING_PHASE:
         capturingPhase.fired = true;
-        capturingPhase.prevented = aEvent.getPreventDefault();
+        capturingPhase.prevented = aEvent.defaultPrevented;
         break;
       case aEvent.BUBBLING_PHASE:
         bubblingPhase.fired = true;
-        bubblingPhase.prevented = aEvent.getPreventDefault();
+        bubblingPhase.prevented = aEvent.defaultPrevented;
         aEvent.preventDefault(); // prevent the browser default behavior
         break;
       default:
         ok(false, "event is handled in unexpected phase");
       }
     }
   };
 
--- a/editor/libeditor/text/tests/test_bug569988.html
+++ b/editor/libeditor/text/tests/test_bug569988.html
@@ -57,17 +57,17 @@ function onPromptLoad(subject, topic, da
 function onPromptFocus() {
   ok(true, "onPromptFocus is called");
   netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
   gPromptInput.removeEventListener("focus", onPromptFocus, false);
 
   var listener = {
     handleEvent: function _hv(aEvent)
     {
-      var isPrevented = aEvent.getPreventDefault();
+      var isPrevented = aEvent.defaultPrevented;
       ok(!isPrevented, "ESC key event is prevented by editor");
       SpecialPowers.removeSystemEventListener(gPromptInput, "keypress",
                                               listener, false);
       SimpleTest.finish();
     }
   };
   SpecialPowers.addSystemEventListener(gPromptInput, "keypress", listener,
                                        false);
--- a/editor/libeditor/text/tests/test_texteditor_keyevent_handling.html
+++ b/editor/libeditor/text/tests/test_texteditor_keyevent_handling.html
@@ -45,21 +45,21 @@ function runTests()
 
   var listener = {
     handleEvent: function _hv(aEvent)
     {
       is(aEvent.type, "keypress", "unexpected event is handled");
       switch (aEvent.eventPhase) {
       case aEvent.CAPTURING_PHASE:
         capturingPhase.fired = true;
-        capturingPhase.prevented = aEvent.getPreventDefault();
+        capturingPhase.prevented = aEvent.defaultPrevented;
         break;
       case aEvent.BUBBLING_PHASE:
         bubblingPhase.fired = true;
-        bubblingPhase.prevented = aEvent.getPreventDefault();
+        bubblingPhase.prevented = aEvent.defaultPrevented;
         aEvent.preventDefault(); // prevent the browser default behavior
         break;
       default:
         ok(false, "event is handled in unexpected phase");
       }
     }
   };
 
--- a/mobile/xul/chrome/content/content.js
+++ b/mobile/xul/chrome/content/content.js
@@ -301,17 +301,17 @@ let Content = {
         let timer = new Util.Timeout(function() {
           let eventData = {
             ctrlKey: aEvent.ctrlKey,
             altKey: aEvent.altKey,
             shiftKey: aEvent.shiftKey,
             metaKey: aEvent.metaKey,
             keyCode: aEvent.keyCode,
             charCode: aEvent.charCode,
-            preventDefault: aEvent.getPreventDefault()
+            preventDefault: aEvent.defaultPrevented
           };
           sendAsyncMessage("Browser:KeyPress", eventData);
         });
         timer.once(0);
         break;
 
       case "DOMActivate": {
         // In a local tab, open remote links in new tabs.
@@ -849,17 +849,17 @@ var ContextHandler = {
         break;
       case "pagehide":
         this.reset();
         break;
     }
   },
 
   onContextMenu: function ch_onContextMenu(aEvent) {
-    if (aEvent.getPreventDefault())
+    if (aEvent.defaultPrevented)
       return;
 
     let state = {
       types: [],
       label: "",
       linkURL: "",
       linkTitle: "",
       linkProtocol: null,
--- a/toolkit/components/prompts/content/tabprompts.xml
+++ b/toolkit/components/prompts/content/tabprompts.xml
@@ -263,17 +263,17 @@
             </body>
         </method>
 
         <method name="onKeyAction">
             <parameter name="action"/>
             <parameter name="event"/>
             <body>
             <![CDATA[
-                if (event.getPreventDefault())
+                if (event.defaultPrevented)
                     return;
 
                 event.stopPropagation();
                 if (action == "default") {
                     let bnum = this.args.defaultButtonNum || 0;
                     let button = this.ui["button" + bnum];
                     this.onButtonClick(bnum);
                 } else { // action == "cancel"
--- a/toolkit/content/WindowDraggingUtils.jsm
+++ b/toolkit/content/WindowDraggingUtils.jsm
@@ -51,17 +51,17 @@ WindowDraggingElement.prototype = {
   mouseDownCheck: function(e) { return true; },
   dragTags: ["box", "hbox", "vbox", "spacer", "label", "statusbarpanel", "stack",
              "toolbaritem", "toolbarseparator", "toolbarspring", "toolbarspacer",
              "radiogroup", "deck", "scrollbox", "arrowscrollbox", "tabs"],
   shouldDrag: function(aEvent) {
     if (aEvent.button != 0 ||
         this._window.fullScreen ||
         !this.mouseDownCheck.call(this._elem, aEvent) ||
-        aEvent.getPreventDefault())
+        aEvent.defaultPrevented)
       return false;
 
     let target = aEvent.originalTarget, parent = aEvent.originalTarget;
 
     // The target may be inside an embedded iframe or browser. (bug 615152)
     if (target.ownerDocument.defaultView != this._window)
       return false;
 
--- a/toolkit/content/tests/chrome/test_datepicker.xul
+++ b/toolkit/content/tests/chrome/test_datepicker.xul
@@ -9,17 +9,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>  
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>  
 
 <hbox onpopupshown="testtag_datepicker_UI_popup()"
       onpopuphidden="testtag_finish()">
 <datepicker id="datepicker"/>
 <datepicker id="datepicker-popup" type="popup"/>
-<hbox onDOMMouseScroll="mouseScrolled = event.getPreventDefault();">
+<hbox onDOMMouseScroll="mouseScrolled = event.defaultPrevented;">
   <datepicker id="datepicker-grid" type="grid"/>
 </hbox>
 </hbox>
 
 <!-- Test-only key bindings, but must not conflict with the application. -->
 <keyset id="mainKeyset">
   <key id="key_alt_z" key="Z" oncommand="return" modifiers="alt"/>
   <key id="key_ctrl_q" key="Q" oncommand="return" modifiers="control"/>
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -436,17 +436,17 @@
 
       <method name="onKeyPress">
         <parameter name="aEvent"/>
         <body><![CDATA[
           if (aEvent.target.localName != "textbox")
             return;  // Let child buttons of autocomplete take input
 
           //XXXpch this is so bogus...
-          if (aEvent.getPreventDefault())
+          if (aEvent.defaultPrevented)
             return false;
 
           var cancel = false;
 
           // Catch any keys that could potentially move the caret. Ctrl can be
           // used in combination with these keys on Windows and Linux; and Alt
           // can be used on OS X, so make sure the unused one isn't used.
           if (!this.disableKeyNavigation &&
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -1209,17 +1209,17 @@
         ]]>
         </body>
       </method>
     </implementation>
 
     <handlers>
       <handler event="keypress" keycode="VK_F7" group="system">
         <![CDATA[
-          if (event.getPreventDefault() || !event.isTrusted)
+          if (event.defaultPrevented || !event.isTrusted)
             return;
 
           var isEnabled = this.mPrefs.getBoolPref("accessibility.browsewithcaret_shortcut.enabled");
           if (!isEnabled)
             return;
 
           // Toggle browse with caret mode
           var browseWithCaretOn = false;
@@ -1270,17 +1270,17 @@
               return;
 
             this.startScroll(event);
           }
         ]]>
       </handler>
       <handler event="dragover" group="system">
       <![CDATA[
-        if (!this.droppedLinkHandler || event.getPreventDefault())
+        if (!this.droppedLinkHandler || event.defaultPrevented)
           return;
 
         // For drags that appear to be internal text (for example, tab drags),
         // set the dropEffect to 'none'. This prevents the drop even if some
         // other listener cancelled the event.
         var types = event.dataTransfer.types;
         if (types.contains("text/x-moz-text-internal") && !types.contains("text/plain")) {
           event.dataTransfer.dropEffect = "none";
@@ -1291,17 +1291,17 @@
         let linkHandler = Components.classes["@mozilla.org/content/dropped-link-handler;1"].
                             getService(Components.interfaces.nsIDroppedLinkHandler);
         if (linkHandler.canDropLink(event, false))
           event.preventDefault();
       ]]>
       </handler>
       <handler event="drop" group="system">
       <![CDATA[
-        if (!this.droppedLinkHandler || event.getPreventDefault())
+        if (!this.droppedLinkHandler || event.defaultPrevented)
           return;
 
         let name = { };
         let linkHandler = Components.classes["@mozilla.org/content/dropped-link-handler;1"].
                             getService(Components.interfaces.nsIDroppedLinkHandler);
         try {
           var uri = linkHandler.dropLink(event, name);
         } catch (ex) {
--- a/toolkit/content/widgets/dialog.xml
+++ b/toolkit/content/widgets/dialog.xml
@@ -386,17 +386,17 @@
         ]]>
         </body>
       </method>
 
       <method name="_hitEnter">
         <parameter name="evt"/>
         <body>
         <![CDATA[
-          if (evt.getPreventDefault())
+          if (evt.defaultPrevented)
             return;
 
           var btn = this.getButton(this.defaultButton);
           if (btn)
             this._doButtonCommand(this.defaultButton);
         ]]>
         </body>
       </method>
@@ -404,17 +404,17 @@
     </implementation>
     
     <handlers>
       <handler event="keypress" keycode="VK_ENTER"
                group="system" action="this._hitEnter(event);"/>
       <handler event="keypress" keycode="VK_RETURN"
                group="system" action="this._hitEnter(event);"/>
       <handler event="keypress" keycode="VK_ESCAPE" group="system">
-        if (!event.getPreventDefault())
+        if (!event.defaultPrevented)
           this.cancelDialog();
       </handler>
 #ifdef XP_MACOSX
       <handler event="keypress" key="." modifiers="meta" phase="capturing" action="this.cancelDialog();"/>
 #else
       <handler event="focus" phase="capturing">
         var btn = this.getButton(this.defaultButton);
         if (btn)
--- a/toolkit/content/widgets/findbar.xml
+++ b/toolkit/content/widgets/findbar.xml
@@ -1344,17 +1344,17 @@
       <!--
         - Returns whether FAYT can be used for the given event in
         - the current content state.
         -->
       <method name="_shouldFastFind">
         <parameter name="aEvent"/>
         <body><![CDATA[
           if (aEvent.ctrlKey || aEvent.altKey || aEvent.metaKey ||
-              aEvent.getPreventDefault())
+              aEvent.defaultPrevented)
             return false;
 
           var elt = document.commandDispatcher.focusedElement;
           if (elt) {
             if (elt instanceof HTMLInputElement && elt.mozIsTextField(false))
               return false;
 
             if (elt instanceof HTMLTextAreaElement ||
--- a/toolkit/content/widgets/listbox.xml
+++ b/toolkit/content/widgets/listbox.xml
@@ -542,17 +542,17 @@
         </body>
       </method>
 
       <method name="_moveByOffsetFromUserEvent">
         <parameter name="aOffset"/>
         <parameter name="aEvent"/>
         <body>
         <![CDATA[
-          if (!aEvent.getPreventDefault()) {
+          if (!aEvent.defaultPrevented) {
             this._userSelecting = true;
             this._mayReverse = true;
             this.moveByOffset(aOffset, !aEvent.ctrlKey, aEvent.shiftKey);
             this._userSelecting = false;
             this._mayReverse = false;
             aEvent.preventDefault();
           }
         ]]>
--- a/toolkit/content/widgets/menulist.xml
+++ b/toolkit/content/widgets/menulist.xml
@@ -37,17 +37,17 @@
               // For now, only do this when the outermost menupopup opens.
               this.menuBoxObject.activeChild = this.mSelectedInternal;
           }
         ]]>
       </handler>
 
       <handler event="keypress" modifiers="shift any" group="system">
         <![CDATA[
-          if (!event.getPreventDefault() &&
+          if (!event.defaultPrevented &&
               (event.keyCode == KeyEvent.DOM_VK_UP ||
                event.keyCode == KeyEvent.DOM_VK_DOWN ||
                event.keyCode == KeyEvent.DOM_VK_PAGE_UP ||
                event.keyCode == KeyEvent.DOM_VK_PAGE_DOWN ||
                event.keyCode == KeyEvent.DOM_VK_HOME ||
                event.keyCode == KeyEvent.DOM_VK_END ||
                event.keyCode == KeyEvent.DOM_VK_BACK_SPACE ||
                event.charCode > 0)) {
--- a/toolkit/content/widgets/text.xml
+++ b/toolkit/content/widgets/text.xml
@@ -294,17 +294,17 @@
       </property>
       <property name="href" onget="return this.getAttribute('href');"
                             onset="this.setAttribute('href', val); return val;" />
       <method name="open">
         <parameter name="aEvent"/>
         <body>
         <![CDATA[
           var href = this.href;
-          if (!href || this.disabled || aEvent.getPreventDefault())
+          if (!href || this.disabled || aEvent.defaultPrevented)
             return;
 
           var uri = null;
           try {
             const nsISSM = Components.interfaces.nsIScriptSecurityManager;
             const secMan =
                      Components.classes["@mozilla.org/scriptsecuritymanager;1"]
                                .getService(nsISSM);
--- a/toolkit/content/widgets/wizard.xml
+++ b/toolkit/content/widgets/wizard.xml
@@ -403,17 +403,17 @@
           this._wizardHeader.setAttribute("description", this.currentPage.getAttribute("description"));
         ]]></body>
       </method>
 
       <method name="_hitEnter">
         <parameter name="evt"/>
         <body>
         <![CDATA[
-          if (!evt.getPreventDefault())
+          if (!evt.defaultPrevented)
             this.advance();
         ]]>
         </body>
       </method>
 
       <method name="_fireEvent">
         <parameter name="aTarget"/>
         <parameter name="aType"/>
@@ -442,17 +442,17 @@
     </implementation>
 
     <handlers>
       <handler event="keypress" keycode="VK_ENTER"
                group="system" action="this._hitEnter(event)"/>
       <handler event="keypress" keycode="VK_RETURN"
                group="system" action="this._hitEnter(event)"/>
       <handler event="keypress" keycode="VK_ESCAPE" group="system">
-        if (!event.getPreventDefault())
+        if (!event.defaultPrevented)
           this.cancel();
       </handler>
     </handlers>
   </binding>
 
   <binding id="wizardpage" extends="chrome://global/content/bindings/wizard.xml#wizard-base">
     <implementation>
       <field name="pageIndex">-1</field>