merge m-c to fx-team
authorTim Taubert <tim.taubert@gmx.de>
Mon, 16 Jan 2012 11:20:19 +0100
changeset 85780 a895ecb782e1da97478a33d06e78b012cc9b87b2
parent 85768 047c8ba7d2e405845a1e7940b23c6a9e6407a395 (current diff)
parent 85779 2cba23414a5c8b89add15ed70ffbf4a9c8069ee6 (diff)
child 85781 93d7303c1684c0f48220269e88465cb98f548818
child 85833 027cfe0bb45e603c506060d994c8a5b98e3ea3ed
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone12.0a1
merge m-c to fx-team
editor/libeditor/base/tests/test_selection_move_commands.xul
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -232,17 +232,17 @@ pref("lightweightThemes.update.enabled",
 pref("keyword.enabled", true);
 // Override the default keyword.URL. Empty value means
 // "use the search service's default engine"
 pref("keyword.URL", "");
 
 pref("general.useragent.locale", "@AB_CD@");
 pref("general.skins.selectedSkin", "classic/1.0");
 
-pref("general.smoothScroll", false);
+pref("general.smoothScroll", true);
 #ifdef UNIX_BUT_NOT_MAC
 pref("general.autoScroll", false);
 #else
 pref("general.autoScroll", true);
 #endif
 
 // Whether or not the application should check at startup each time if it 
 // is the default browser.
--- a/browser/devtools/sourceeditor/orion/mozilla.css
+++ b/browser/devtools/sourceeditor/orion/mozilla.css
@@ -3,16 +3,17 @@
 
 .viewContainer {
   background: #cddae5; /* This will be seen as the continuation of the ruler */
   font-family: monospace;
   font-size: inherit; /* inherit browser's default monospace font size */
 }
 
 .view {
+  color: black; /* Default text color */
   background: #f0f0ff; /* Background of the editor */
   padding-left: 0;
 }
 
 .readonly > .view {
   background: #f0f0ff;
 }
 
--- a/browser/devtools/styleeditor/StyleEditor.jsm
+++ b/browser/devtools/styleeditor/StyleEditor.jsm
@@ -746,80 +746,38 @@ StyleEditor.prototype = {
   /**
    * Load source from the HTTP cache.
    *
    * @param string aHref
    *        URL for the stylesheet.
    */
   _loadSourceFromCache: function SE__loadSourceFromCache(aHref)
   {
-    try {
-      let cacheService = Cc["@mozilla.org/network/cache-service;1"]
-                           .getService(Ci.nsICacheService);
-      let session = cacheService.createSession("HTTP", Ci.nsICache.STORE_ANYWHERE, true);
-      session.doomEntriesIfExpired = false;
-      session.asyncOpenCacheEntry(aHref, Ci.nsICache.ACCESS_READ, {
-        onCacheEntryAvailable: this._onCacheEntryAvailable.bind(this)
-      });
-    } catch (ex) {
-      this._signalError(LOAD_ERROR);
-    }
-  },
-
-   /**
-    * The nsICacheListener.onCacheEntryAvailable method implementation used when
-    * the style sheet source is loaded from the browser cache.
-    *
-    * @param nsICacheEntryDescriptor aEntry
-    * @param nsCacheAccessMode aMode
-    * @param integer aStatus
-    */
-  _onCacheEntryAvailable: function SE__onCacheEntryAvailable(aEntry, aMode, aStatus)
-  {
-    if (!Components.isSuccessCode(aStatus)) {
-      return this._signalError(LOAD_ERROR);
-    }
-
-    let stream = aEntry.openInputStream(0);
+    let channel = Services.io.newChannel(aHref, null, null);
     let chunks = [];
     let streamListener = { // nsIStreamListener inherits nsIRequestObserver
       onStartRequest: function (aRequest, aContext, aStatusCode) {
-      },
+        if (!Components.isSuccessCode(aStatusCode)) {
+          return this._signalError(LOAD_ERROR);
+        }
+      }.bind(this),
       onDataAvailable: function (aRequest, aContext, aStream, aOffset, aCount) {
         chunks.push(NetUtil.readInputStreamToString(aStream, aCount));
       },
       onStopRequest: function (aRequest, aContext, aStatusCode) {
+        if (!Components.isSuccessCode(aStatusCode)) {
+          return this._signalError(LOAD_ERROR);
+        }
+
         this._onSourceLoad(chunks.join(""));
-      }.bind(this),
+      }.bind(this)
     };
 
-    let head = aEntry.getMetaDataElement("response-head");
-    if (/^Content-Encoding:\s*gzip/mi.test(head)) {
-      let converter = Cc["@mozilla.org/streamconv;1?from=gzip&to=uncompressed"]
-                        .createInstance(Ci.nsIStreamConverter);
-      converter.asyncConvertData("gzip", "uncompressed", streamListener, null);
-      streamListener = converter; // proxy original listener via converter
-    }
-
-    try {
-      streamListener.onStartRequest(null, null);
-      while (stream.available()) {
-        streamListener.onDataAvailable(null, null, stream, 0, stream.available());
-      }
-      streamListener.onStopRequest(null, null, 0);
-    } catch (ex) {
-      this._signalError(LOAD_ERROR);
-    } finally {
-      try {
-        stream.close();
-      } catch (ex) {
-        // swallow (some stream implementations can auto-close at eos)
-      }
-      aEntry.close();
-    }
+    channel.loadFlags = channel.LOAD_FROM_CACHE;
+    channel.asyncOpen(streamListener, null);
   },
 
   /**
    * Called when source has been loaded.
    *
    * @param string aSourceText
    */
   _onSourceLoad: function SE__onSourceLoad(aSourceText)
--- a/browser/devtools/styleinspector/CssRuleView.jsm
+++ b/browser/devtools/styleinspector/CssRuleView.jsm
@@ -1137,17 +1137,18 @@ TextPropertyEditor.prototype = {
  *    {function} start:
  *       Will be called when the inplace editor is initialized.
  *    {function} change:
  *       Will be called when the text input changes.  Will be called
  *       with the current value of the text input.
  *    {function} done:
  *       Called when input is committed or blurred.  Called with
  *       current value and a boolean telling the caller whether to
- *       commit the change.
+ *       commit the change.  This function is called after the editor
+ *       has been torn down.
  *    {string} advanceChars:
  *       If any characters in advanceChars are typed, focus will advance
  *       to the next element.
  */
 function editableField(aOptions)
 {
   aOptions.element.addEventListener("focus", function() {
     new InplaceEditor(aOptions);
@@ -1281,21 +1282,21 @@ InplaceEditor.prototype = {
   },
 
   /**
    * Handle loss of focus by calling the client's done handler and
    * clearing out.
    */
   _onBlur: function InplaceEditor_onBlur(aEvent)
   {
+    let val = this.input.value.trim();
+    this._clear();
     if (this.done) {
-      this.done(this.cancelled ? this.initial : this.input.value.trim(),
-                !this.cancelled);
+      this.done(this.cancelled ? this.initial : val, !this.cancelled);
     }
-    this._clear();
   },
 
   _onKeyPress: function InplaceEditor_onKeyPress(aEvent)
   {
     let prevent = false;
     if (aEvent.charCode in this._advanceCharCodes
        || aEvent.keyCode === Ci.nsIDOMKeyEvent.DOM_VK_RETURN) {
       // Focus the next element, triggering a blur which
--- a/browser/devtools/styleinspector/StyleInspector.jsm
+++ b/browser/devtools/styleinspector/StyleInspector.jsm
@@ -76,19 +76,19 @@ StyleInspector.prototype = {
 
     // Were we invoked from the Highlighter?
     if (this.IUI) {
       this.openDocked = true;
       let isOpen = this.isOpen.bind(this);
 
       this.registrationObject = {
         id: "styleinspector",
-        label: this.l10n("style.highlighter.button.label1"),
+        label: this.l10n("style.highlighter.button.label2"),
         tooltiptext: this.l10n("style.highlighter.button.tooltip"),
-        accesskey: this.l10n("style.highlighter.accesskey1"),
+        accesskey: this.l10n("style.highlighter.accesskey2"),
         context: this,
         get isOpen() isOpen(),
         onSelect: this.selectNode,
         onChanged: this.updateNode,
         show: this.open,
         hide: this.close,
         dim: this.dimTool,
         panel: null,
--- a/browser/devtools/styleinspector/styleinspector.css
+++ b/browser/devtools/styleinspector/styleinspector.css
@@ -37,8 +37,12 @@
 
 .ruleview {
   overflow: auto;
 }
 
 .ruleview-computedlist:not(.styleinspector-open) {
   display: none;
 }
+
+.ruleview-code {
+  direction: ltr;
+}
--- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties
+++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties
@@ -28,18 +28,19 @@ rule.sourceElement=element
 
 # LOCALIZATION NOTE (rule.inheritedSource): Shown for CSS rules
 # that were inherited from a parent node.  Will be passed a node
 # identifier and a source location.
 # e.g "Inherited from body#bodyID (styles.css:20)"
 rule.inheritedSource=Inherited from %S (%S)
 
 # LOCALIZATION NOTE (style.highlighter.button): These strings are used inside
-# sidebar of the Highlighter for the style inspector button
-style.highlighter.button.label1=Properties
-style.highlighter.accesskey1=P
-style.highlighter.button.tooltip=Inspect element styles
+# sidebar of the Highlighter for the style inspector button.
+# "Computed" refers to the Computed Style of the element.
+style.highlighter.button.label2=Computed
+style.highlighter.accesskey2=C
+style.highlighter.button.tooltip=Inspect element computed styles
 
 # LOCALIZATION NOTE (helpLinkTitle): For each style property
 # the user can hover it and get a help link button which allows one to
 # quickly jump to the documentation from the Mozilla Developer Network site.
 # This is the link title shown in the hover tooltip.
 helpLinkTitle=Read the documentation for this property
--- a/browser/themes/gnomestripe/browser.css
+++ b/browser/themes/gnomestripe/browser.css
@@ -1998,16 +1998,20 @@ panel[dimmed="true"] {
   -moz-border-start: 1px solid #242b33;
   min-width: 0;
   width: 3px;
   background-color: transparent;
   -moz-margin-end: -3px;
   position: relative;
 }
 
+#devtools-sidebar-box {
+  background-color: -moz-Field;
+}
+
 /* Highlighter - toolbar resizers */
 
 .inspector-resizer {
   -moz-appearance: none;
   cursor: n-resize;
 }
 
 #inspector-top-resizer {
--- a/browser/themes/gnomestripe/devtools/csshtmltree.css
+++ b/browser/themes/gnomestripe/devtools/csshtmltree.css
@@ -229,20 +229,16 @@
   width: 8px;
   height: 8px;
   background: url("chrome://browser/skin/devtools/arrows.png") 24px 0;
   cursor: pointer;
   -moz-margin-start: 2px;
   -moz-margin-end: 5px;
 }
 
-.ruleview-expander:-moz-locale-dir(rtl) {
-  background-position: 16px 0;
-}
-
 .ruleview-expander.styleinspector-open {
   background-position: 8px 0;
 }
 
 .ruleview-newproperty {
   /* (enable checkbox width: 12px) + (expander width: 15px) */
   -moz-margin-start: 27px;
 }
--- a/browser/themes/pinstripe/browser.css
+++ b/browser/themes/pinstripe/browser.css
@@ -2735,16 +2735,20 @@ panel[dimmed="true"] {
   -moz-border-start: 1px solid #242b33;
   min-width: 0;
   width: 3px;
   background-color: transparent;
   -moz-margin-end: -3px;
   position: relative;
 }
 
+#devtools-sidebar-box {
+  background-color: -moz-Field;
+}
+
 /* Highlighter - toolbar resizers */
 
 .inspector-resizer {
   -moz-appearance: none;
   cursor: n-resize;
 }
 
 #inspector-top-resizer {
--- a/browser/themes/pinstripe/devtools/csshtmltree.css
+++ b/browser/themes/pinstripe/devtools/csshtmltree.css
@@ -231,20 +231,16 @@
   width: 8px;
   height: 8px;
   background: url("chrome://browser/skin/devtools/arrows.png") 24px 0;
   cursor: pointer;
   -moz-margin-start: 2px;
   -moz-margin-end: 5px;
 }
 
-.ruleview-expander:-moz-locale-dir(rtl) {
-  background-position: 16px 0;
-}
-
 .ruleview-expander.styleinspector-open {
   background-position: 8px 0;
 }
 
 .ruleview-newproperty {
   /* (enable checkbox width: 12px) + (expander width: 15px) */
   -moz-margin-start: 27px;
 }
--- a/browser/themes/winstripe/browser.css
+++ b/browser/themes/winstripe/browser.css
@@ -2678,16 +2678,20 @@ panel[dimmed="true"] {
   -moz-border-start: 1px solid #242b33;
   min-width: 0;
   width: 3px;
   background-color: transparent;
   -moz-margin-end: -3px;
   position: relative;
 }
 
+#devtools-sidebar-box {
+  background-color: -moz-Field;
+}
+
 /* Highlighter - toolbar resizers */
 
 .inspector-resizer {
   -moz-appearance: none;
   cursor: n-resize;
 }
 
 #inspector-top-resizer {
--- a/browser/themes/winstripe/devtools/common.css
+++ b/browser/themes/winstripe/devtools/common.css
@@ -69,17 +69,17 @@
 
 .devtools-toolbarbutton[checked] {
   border-color: hsla(211,68%,6%,.6);
   background: -moz-linear-gradient(hsla(211,68%,6%,.1), hsla(211,68%,6%,.2));
   box-shadow: 0 1px 3px hsla(211,68%,6%,.5) inset, 0 0 0 1px hsla(209,29%,72%,.1), 0 1px 0 hsla(210,16%,76%,.1);
   color: hsl(200,100%,60%) !important;
 }
 
-.devtools-toolbarbutton:[checked]:hover:active {
+.devtools-toolbarbutton[checked]:hover:active {
   background-color: hsla(211,68%,6%,.2);
 }
 
 /* Search input */
 
 .devtools-searchinput {
   -moz-appearance: none;
   margin: 0 3px;
--- a/browser/themes/winstripe/devtools/csshtmltree.css
+++ b/browser/themes/winstripe/devtools/csshtmltree.css
@@ -229,20 +229,16 @@
   width: 8px;
   height: 8px;
   background: url("chrome://browser/skin/devtools/arrows.png") 24px 0;
   cursor: pointer;
   -moz-margin-start: 2px;
   -moz-margin-end: 5px;
 }
 
-.ruleview-expander:-moz-locale-dir(rtl) {
-  background-position: 16px 0;
-}
-
 .ruleview-expander.styleinspector-open {
   background-position: 8px 0;
 }
 
 .ruleview-newproperty {
   /* (enable checkbox width: 12px) + (expander width: 15px) */
   -moz-margin-start: 27px;
 }
--- a/content/events/test/test_bug350471.xul
+++ b/content/events/test/test_bug350471.xul
@@ -17,18 +17,16 @@ https://bugzilla.mozilla.org/show_bug.cg
 <div id="content" style="display: none">
 </div>
 </body>
 
 <script class="testbody" type="application/javascript;version=1.7"><![CDATA[
 
 /** Test for Bug 350471 **/
 
-// This test depends on general.smoothScroll being off.
-
 const minLineHeight = 10, maxLineHeight = 20;
 
 function between(x, min, max) (min <= max) ? (min <= x && x <= max) : (max <= x && x <= min);
 function isbetween(x, min, max, msg) ok(between(x, min, max), msg + " - Expected " + min + " to " + max + ", got " + x);
 
 function testEventDispatching(aWin) {
   function helper(aAxis, aDelta, aKind, aShiftKey, aCtrlKey, aAltKey, aMetaKey) {
     let expectedEvents = [];
@@ -223,28 +221,28 @@ function testDefaultHandling(aWin, andTh
 function initPrefs()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
                   getService(Components.interfaces.nsIPrefBranch2);
   // Disables the app level scroll acceleration
   prefSvc.setIntPref("mousewheel.acceleration.start", -1);
   prefSvc.setBoolPref("mousewheel.system_scroll_override_on_root_content.enabled", false);
+  prefSvc.setBoolPref("general.smoothScroll", false);
 }
 
 function clearPrefs()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
                   getService(Components.interfaces.nsIPrefBranch2);
 
-  if (prefSvc.prefHasUserValue("mousewheel.acceleration.start"))
-    prefSvc.clearUserPref("mousewheel.acceleration.start");
-  if (prefSvc.prefHasUserValue("mousewheel.system_scroll_override_on_root_content.enabled"))
-    prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled");
+  prefSvc.clearUserPref("mousewheel.acceleration.start");
+  prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled");
+  prefSvc.clearUserPref("general.smoothScroll");
 }
 
 window.onload = function () {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
   let win = window.open('data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?><?xml-stylesheet href="chrome://global/skin" type="text/css"?><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><vbox style="height: 150px; background: cyan; overflow: auto;" id="scrollbox"><hbox style="height: 8000px;"><vbox style="width: 8000px;"/></hbox></vbox></window>', '_blank', 'chrome,width=400,height=200');
   win.onload = function() {
     setTimeout(function() {
--- a/content/events/test/test_bug574663.html
+++ b/content/events/test/test_bug574663.html
@@ -15,18 +15,16 @@ https://bugzilla.mozilla.org/show_bug.cg
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 <script type="application/javascript;version=1.7">
 
 /** Test for Bug 574663 **/
 
-// This test depends on general.smoothScroll being off.
-
 function sendTouchpadScrollMotion(scrollbox, direction, ctrl, momentum) {
   var win = scrollbox.ownerDocument.defaultView;
   let event = {
     'type': "DOMMouseScroll",
     'axis': "vertical",
     'delta': direction,
     'hasPixels': true,
     'ctrlKey': ctrl,
@@ -102,35 +100,34 @@ function runTest() {
   }, win);
 }
 
 function initPrefs()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
                   getService(Components.interfaces.nsIPrefBranch2);
+  prefSvc.setBoolPref("general.smoothScroll", false);
   // Disables the app level scroll acceleration
   prefSvc.setIntPref("mousewheel.acceleration.start", -1);
   prefSvc.setBoolPref("mousewheel.system_scroll_override_on_root_content.enabled", false);
   // Enable zooming for ctrl-scrolling
   prefSvc.setIntPref("mousewheel.withcontrolkey.action", 3);
 }
 
 function clearPrefs()
 {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
                   getService(Components.interfaces.nsIPrefBranch2);
 
-  if (prefSvc.prefHasUserValue("mousewheel.acceleration.start"))
-    prefSvc.clearUserPref("mousewheel.acceleration.start");
-  if (prefSvc.prefHasUserValue("mousewheel.system_scroll_override_on_root_content.enabled"))
-    prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled");
-  if (prefSvc.prefHasUserValue("mousewheel.withcontrolkey.action"))
-    prefSvc.clearUserPref("mousewheel.withcontrolkey.action");
+  prefSvc.clearUserPref("general.smoothScroll");
+  prefSvc.clearUserPref("mousewheel.acceleration.start");
+  prefSvc.clearUserPref("mousewheel.system_scroll_override_on_root_content.enabled");
+  prefSvc.clearUserPref("mousewheel.withcontrolkey.action");
 }
 
 window.onload = function () {
   initPrefs();
   SimpleTest.executeSoon(runTest);
 }
 
 SimpleTest.waitForExplicitFinish();
--- a/content/html/document/src/ImageDocument.cpp
+++ b/content/html/document/src/ImageDocument.cpp
@@ -608,41 +608,16 @@ ImageDocument::HandleEvent(nsIDOMEvent* 
       }
       mShouldResize = false;
       RestoreImageTo(x, y);
     }
     else if (mImageIsOverflowing) {
       ShrinkToFit();
     }
   }
-  else if (eventType.EqualsLiteral("keypress")) {
-    nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aEvent);
-    PRUint32 charCode;
-    bool ctrlKey, metaKey, altKey;
-    keyEvent->GetCharCode(&charCode);
-    keyEvent->GetCtrlKey(&ctrlKey);
-    keyEvent->GetMetaKey(&metaKey);
-    keyEvent->GetAltKey(&altKey);
-    // plus key
-    if (charCode == 0x2B && !ctrlKey && !metaKey && !altKey) {
-      mShouldResize = false;
-      if (mImageIsResized) {
-        ResetZoomLevel();
-        RestoreImage();
-      }
-    }
-    // minus key
-    else if (charCode == 0x2D && !ctrlKey && !metaKey && !altKey) {
-      mShouldResize = true;
-      if (mImageIsOverflowing) {
-        ResetZoomLevel();
-        ShrinkToFit();
-      }
-    }
-  }
 
   return NS_OK;
 }
 
 nsresult
 ImageDocument::CreateSyntheticDocument()
 {
   // Synthesize an html document that refers to the image
--- a/docshell/test/navigation/test_bug430723.html
+++ b/docshell/test/navigation/test_bug430723.html
@@ -38,17 +38,19 @@ var gTallBlueBoxURI = "data:text/html;ch
 // </div></body></html>
 
 
 window.onload = runTest;
 
 var testWindow;
 var testNum = 0;
 
+var smoothScrollPref = "general.smoothScroll";
 function runTest() {
+  SpecialPowers.setBoolPref(smoothScrollPref, false);
   testWindow = window.open(gTallRedBoxURI, "testWindow", "width=300,height=300,location=yes,scrollbars=yes");
 }
 
 var nextTest =function() {
   testNum++;
   switch (testNum) {
     case 1: setTimeout(step1, 0); break;
     case 2: setTimeout(step2, 0); break;
@@ -117,16 +119,17 @@ var step3 =function() {
      "Page1Again: Ensure scroll pane at top before we scroll.");  
   testWindow.addEventListener("scroll", function () {
     testWindow.removeEventListener("scroll", arguments.callee, true);
 
     isnot(testWindow.document.body.scrollTop, 0,
           "Page2Again: Ensure we can still scroll.");  
 
     testWindow.close();
+    SpecialPowers.clearUserPref(smoothScrollPref);
     window.SimpleTest.finish();
   }, true);
   sendKey('DOWN', testWindow);
 }
 
 SimpleTest.waitForExplicitFinish();
 
 //]]>
--- a/editor/libeditor/base/tests/test_selection_move_commands.xul
+++ b/editor/libeditor/base/tests/test_selection_move_commands.xul
@@ -4,16 +4,20 @@
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         title="Test for nsSelectionMoveCommands">
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
 <script class="testbody" type="application/javascript">
 <![CDATA[
 
+var prefs = Components.classes["@mozilla.org/preferences-service;1"]
+                      .getService(Components.interfaces.nsIPrefBranch);
+prefs.setBoolPref("general.smoothScroll", false);
+
 function runTest() {
   var tests = execTests();
   function execNext() {
     try {
       tests.next();
       setTimeout(execNext, 0);
     } catch (e) {}
   }
@@ -181,26 +185,24 @@ function execTests() {
 
     doCommand("cmd_moveTop");
     is(testPageSelectCommand("cmd_selectPageDown", 0), lineNum, "cmd_selectPageDown");
     doCommand("cmd_moveBottom");
     doCommand("cmd_beginLine");
     is(testPageSelectCommand("cmd_selectPageUp", 0), 22 - lineNum, "cmd_selectPageUp");
   }
 
-  var prefs = Components.classes["@mozilla.org/preferences-service;1"]
-                          .getService(Components.interfaces.nsIPrefBranch);
-  var origPrefValue = prefs.getBoolPref("layout.word_select.eat_space_to_next_word");
   try {
     prefs.setBoolPref("layout.word_select.eat_space_to_next_word", false);
     runSelectionTests(body, 1);
     prefs.setBoolPref("layout.word_select.eat_space_to_next_word", true);
     runSelectionTests(node(2), 0);
   } finally {
-    prefs.setBoolPref("layout.word_select.eat_space_to_next_word", origPrefValue);
+    prefs.clearUserPref("general.smoothScroll");
+    prefs.clearUserPref("layout.word_select.eat_space_to_next_word");
   }
 
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(runTest);
 ]]>
--- a/editor/libeditor/html/tests/test_bug549262.html
+++ b/editor/libeditor/html/tests/test_bug549262.html
@@ -14,16 +14,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 <p id="display"></p>
 <div id="content">
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 549262 **/
 
+var smoothScrollPref = "general.smoothScroll";
+SpecialPowers.setBoolPref(smoothScrollPref, false);
 SimpleTest.waitForExplicitFinish();
 var win = window.open("file_bug549262.html", "_blank", 
                       "width=600,height=600,scrollbars=yes");
 SimpleTest.waitForFocus(function() {
   // Make sure that pressing Space when a contenteditable element is not focused
   // will scroll the page.
   var ed = win.document.getElementById("editor");
   var sc = win.document.querySelector("a");
@@ -85,16 +87,17 @@ SimpleTest.waitForFocus(function() {
                     oldY = win.scrollY;
                     synthesizeKey("VK_DOWN", {}, win);
                     setTimeout(function() {
                       is(win.scrollY, oldY, "Page is not scrolled down");
                       is(win.getSelection().focusNode, ed.firstChild, "Correct element selected");
                       is(win.getSelection().focusOffset, ed.textContent.length, "Selection should be moved to the end");
 
                       win.close();
+                      SpecialPowers.clearUserPref(smoothScrollPref);
                       SimpleTest.finish();
                     }, 0);
                   }, 0);
                 }, 0);
               }, 0);
             }, 0);
           }, 0);
         }, 0);
--- a/editor/libeditor/html/tests/test_bug620906.html
+++ b/editor/libeditor/html/tests/test_bug620906.html
@@ -29,20 +29,22 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 /** Test for Bug 620906 **/
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(function() {
   var iframe = document.querySelector("iframe");
   is(iframe.contentWindow.scrollY, 0, "Sanity check");
   var rect = iframe.getBoundingClientRect();
   setTimeout(function() {
-    synthesizeMouse(iframe, rect.width - 5, rect.height / 2, {});
-    setTimeout(function() {
+    var onscroll = function () {
+      iframe.contentWindow.removeEventListener("scroll", onscroll, false);
       isnot(iframe.contentWindow.scrollY, 0, "The scrollbar should work");
       SimpleTest.finish();
-    }, 0);
+    }
+    iframe.contentWindow.addEventListener("scroll", onscroll, false);
+    synthesizeMouse(iframe, rect.width - 5, rect.height / 2, {});
   }, 0);
 });
 
 </script>
 </pre>
 </body>
 </html>
--- a/layout/generic/test/test_bug633762.html
+++ b/layout/generic/test/test_bug633762.html
@@ -37,18 +37,21 @@ function runTests() {
   sendKey("UP");
 
   setTimeout("finish();", 0);
 }
 
 function finish() {
   // assert that scroll top is now less than before
   ok(scrollTopBefore > doc.body.scrollTop, "pressing up arrow should scroll up");
+  SpecialPowers.clearUserPref(smoothScrollPref);
   SimpleTest.finish();
 }
 
+var smoothScrollPref = "general.smoothScroll";
+SpecialPowers.setBoolPref(smoothScrollPref, false);
 SimpleTest.waitForExplicitFinish();
 SimpleTest.waitForFocus(runTests);
 </script>
 </pre>
 
 </body>
 </html>
--- a/layout/style/TopLevelImageDocument.css
+++ b/layout/style/TopLevelImageDocument.css
@@ -44,16 +44,18 @@ body {
 
 /* We must declare the image as a block element. If we stay as
 an inline element, our parent LineBox will be inline too and
 ignore the available height during reflow.
 This is bad during printing, it means tall image frames won't know
 the size of the paper and cannot break into continuations along
 multiple pages. */
 img {
+  color: #eee;
+  text-align: center;
   display: block;
   position: absolute;
   margin: auto;
   top: 0;
   right: 0;
   bottom: 0;
   left: 0;
 }
--- a/toolkit/content/tests/chrome/test_mousescroll.xul
+++ b/toolkit/content/tests/chrome/test_mousescroll.xul
@@ -68,16 +68,18 @@ https://bugzilla.mozilla.org/show_bug.cg
       <vbox style="width:100px; height:40px; background:black;"/>
   </arrowscrollbox>
 
   <!-- test code goes here -->
   <script type="application/javascript"><![CDATA[
 
 /** Test for Bug 378028 **/
 /*   and for Bug 350471 **/
+var smoothScrollPref = "general.smoothScroll";
+SpecialPowers.setBoolPref(smoothScrollPref, false);
 SimpleTest.waitForExplicitFinish();
 
 /* There are three kinds of scroll events:
     1. line scrolls without hasPixels
     2. line scrolls with hasPixels
     3. pixel scrolls
    Listboxes and arrowscrollboxes (DOM event scrolling) should only react to
    line scrolls and ignore hasPixels.
@@ -225,15 +227,16 @@ function testArrowScrollbox(id)
 }
 
 function runTests()
 {
   testRichListbox("richlistbox", function() {
     testListbox("listbox");
     testArrowScrollbox("hscrollbox");
     testArrowScrollbox("vscrollbox");
+    SpecialPowers.clearUserPref(smoothScrollPref);
     SimpleTest.finish();
   });
 }
 
 window.onload = function() { setTimeout(runTests, 0); };
   ]]></script>
 </window>
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -814,31 +814,25 @@
                     // since the controls span the width of the video and are always located
                     // at the bottom of the video.
                     if (event.clientY < this.controlBar.getBoundingClientRect().top) {
                         this._hideControlsTimeout = setTimeout(this._hideControlsFn, this.HIDE_CONTROLS_TIMEOUT_MS);
                     }
                 },
 
                 onMouseInOut : function (event) {
+                    if (this.isTouchControl)
+                        return;
+
                     // If the controls are static, don't change anything.
                     if (!this.dynamicControls)
                         return;
 
                     clearTimeout(this._hideControlsTimeout);
-
-                    // Ignore events caused by transitions between child nodes.
-                    // Note that the videocontrols element is the same
-                    // size as the *content area* of the video element,
-                    // but this is not the same as the video element's
-                    // border area if the video has border or padding.
-                    if (this.isEventWithin(event, this.videocontrols))
-                        return;
-
-                    var isMouseOver = (event.type == "mouseover");
+                    var isMouseOver = (event.type == "mouseenter");
 
                     // Suppress fading out the controls until the video has rendered
                     // its first frame. But since autoplay videos start off with no
                     // controls, let them fade-out so the controls don't get stuck on.
                     if (!this.firstFrameShown && !isMouseOver &&
                         !(this.video.autoplay && this.video.mozAutoplayEnabled))
                         return;
 
@@ -1275,17 +1269,18 @@
                     // from the <source> children, which don't bubble.
                     for each (let event in this.videoEvents)
                         this.video.addEventListener(event, this, (event == "error") ? true : false);
 
                     var self = this;
                     this.muteButton.addEventListener("command", function() { self.toggleMute(); }, false);
                     this.playButton.addEventListener("command", function() { self.togglePause(); }, false);
                     this.fullscreenButton.addEventListener("command", function() { self.toggleFullscreen(); }, false );
-
+                    this.video.addEventListener("mouseenter", function(e) { self.onMouseInOut(e) }, false, true);
+                    this.video.addEventListener("mouseleave", function(e) { self.onMouseInOut(e) }, false, true);
                     this.controlsSpacer.addEventListener("click", function spacerClickHandler(e) {
                       if (e.button != 0 || self.hasError())
                         return;
                       // Read defaultPrevented asynchronously, since Web content
                       // may want to consume the "click" event but will only
                       // receive it after us (bug 693014).
                       setTimeout(function togglePauseCallback() {
                         if (!e.defaultPrevented)
@@ -1313,24 +1308,16 @@
             }) ]]>
         </field>
 
         <field readonly="true" name="isTouchControl">false</field>
 
     </implementation>
 
     <handlers>
-        <handler event="mouseover">
-            if (!this.isTouchControl)
-                this.Utils.onMouseInOut(event);
-        </handler>
-        <handler event="mouseout">
-            if (!this.isTouchControl)
-                this.Utils.onMouseInOut(event);
-        </handler>
         <handler event="mousemove">
             if (!this.isTouchControl)
                 this.Utils.onMouseMove(event);
         </handler>
     </handlers>
   </binding>
   
   <binding id="touchControls" extends="chrome://global/content/bindings/videocontrols.xml#videoControls">
--- a/widget/tests/window_bug478536.xul
+++ b/widget/tests/window_bug478536.xul
@@ -73,19 +73,22 @@ var gTests = [
  { scrollToForward: false, shouldScroll: true },
  { scrollToForward: false, shouldScroll: false }
 ];
 var gCurrentTestIndex = -1;
 var gIgnoreScrollEvent = true;
 
 var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"].
                getService(Components.interfaces.nsIPrefBranch2);
+const kPrefSmoothScroll = "general.smoothScroll";
 const kPrefNameTimeout = "mousewheel.transaction.timeout";
 const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout);
 
+gPrefSvc.setBoolPref(kPrefSmoothScroll, false);
+
 var gTimeout = kDefaultTimeout;
 
 gBody.addEventListener("MozMouseScrollFailed", onMouseScrollFailed, false);
 gBody.addEventListener("MozMouseScrollTransactionTimeout",
                        onTransactionTimeout, false);
 
 function setTimeoutPrefs(aTimeout)
 {
@@ -112,16 +115,17 @@ function onload()
   disableNonTestMouseEvents(true);
   setTimeout(runNextTest, 0);
 }
 
 function onunload()
 {
   resetTimeoutPrefs();
   disableNonTestMouseEvents(false);
+  gPrefSvc.clearUserPref(kPrefSmoothScroll);
   window.opener.wrappedJSObject.SimpleTest.finish();
 }
 
 function finish()
 {
   window.close();
 }
 
--- a/widget/tests/window_wheeltransaction.xul
+++ b/widget/tests/window_wheeltransaction.xul
@@ -105,21 +105,24 @@ var gLitesnEvents = kListenEvent_None;
  * only one timer at one time.  For that, we must store the timer id to this
  * variable.  And the functions which may be called via a timer must clear the
  * current timer by |_clearTimer| function.
  */
 var gTimer;
 
 var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"].
                getService(Components.interfaces.nsIPrefBranch2);
+const kPrefSmoothScroll = "general.smoothScroll";
 const kPrefNameTimeout = "mousewheel.transaction.timeout";
 const kPrefNameIgnoreMoveDelay = "mousewheel.transaction.ignoremovedelay";
 
 const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout);
-const kDefaultIgnoreMoveDelay = gPrefSvc.getIntPref(kPrefNameIgnoreMoveDelay)
+const kDefaultIgnoreMoveDelay = gPrefSvc.getIntPref(kPrefNameIgnoreMoveDelay);
+
+gPrefSvc.setBoolPref(kPrefSmoothScroll, false);
 
 var gTimeout, gIgnoreMoveDelay;
 var gEnoughForTimeout, gEnoughForIgnoreMoveDelay;
 
 function setTimeoutPrefs(aTimeout, aIgnoreMoveDelay)
 {
   gPrefSvc.setIntPref(kPrefNameTimeout, aTimeout);
   gPrefSvc.setIntPref(kPrefNameIgnoreMoveDelay, aIgnoreMoveDelay);
@@ -166,16 +169,17 @@ function finish()
 function onload()
 {
   runNextTestList();
 }
 
 function onunload()
 {
   resetTimeoutPrefs();
+  gPrefSvc.clearUserPref(kPrefSmoothScroll);
   disableNonTestMouseEvents(false);
   window.opener.wrappedJSObject.SimpleTest.finish();
 }
 
 const kSubView1Offset = { x: 20, y: 20 };
 const kSubView2Offset = { x: 20, y: 20 + 100 + 20 };
 const kSubView3Offset = { x: 20, y: 20 + (100 + 20) * 2 };