backout 4149244358fd and 5ad0e08799d9 (bug 851520) for b2g bustage on a CLOSED TREE
authorJonathan Kew <jkew@mozilla.com>
Tue, 09 Apr 2013 21:57:12 +0100
changeset 128221 9a624a23c88ac6a0387dc8b6ae01ba4c120f5ec3
parent 128220 e6d6b388ef60cbfc842daf0be7deacaa394bec5e
child 128222 3f8a9cfdc0557205ccf92c17ddfa71eee5d5fcf2
push id24523
push useremorley@mozilla.com
push dateWed, 10 Apr 2013 12:12:44 +0000
treeherdermozilla-central@ee5ca214e87c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs851520
milestone23.0a1
backs out4149244358fd3854149a433e2538abf62431a7bf
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
backout 4149244358fd and 5ad0e08799d9 (bug 851520) for b2g bustage on a CLOSED TREE
browser/components/nsBrowserGlue.js
widget/android/nsScreenManagerAndroid.cpp
widget/cocoa/nsScreenManagerCocoa.mm
widget/gtk2/nsScreenManagerGtk.cpp
widget/nsIScreenManager.idl
widget/os2/nsScreenManagerOS2.cpp
widget/qt/nsScreenManagerQt.cpp
widget/windows/nsScreenManagerWin.cpp
widget/xpwidgets/PuppetWidget.cpp
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1218,17 +1218,17 @@ BrowserGlue.prototype = {
     var notifyBox = win.gBrowser.getNotificationBox();
     var notification = notifyBox.appendNotification(text, title, null,
                                                     notifyBox.PRIORITY_CRITICAL_MEDIUM,
                                                     buttons);
     notification.persistence = -1; // Until user closes it
   },
 
   _migrateUI: function BG__migrateUI() {
-    const UI_VERSION = 10;
+    const UI_VERSION = 9;
     const BROWSER_DOCURL = "chrome://browser/content/browser.xul#";
     let currentUIVersion = 0;
     try {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
     } catch(ex) {}
     if (currentUIVersion >= UI_VERSION)
       return;
 
@@ -1361,31 +1361,16 @@ BrowserGlue.prototype = {
         }
         this._setPersist(toolbarResource, currentsetResource, currentset);
       }
 
       Services.prefs.clearUserPref("browser.download.useToolkitUI");
       Services.prefs.clearUserPref("browser.library.useNewDownloadsView");
     }
 
-#ifdef XP_WIN
-    if (currentUIVersion < 10) {
-      // For Windows systems with display set to > 96dpi (i.e. systemDefaultScale
-      // will return a value > 1.0), we want to discard any saved full-zoom settings,
-      // as we'll now be scaling the content according to the system resolution
-      // scale factor (Windows "logical DPI" setting)
-      let sm = Cc["@mozilla.org/gfx/screenmanager;1"].getService(Ci.nsIScreenManager);
-      if (sm.systemDefaultScale > 1.0) {
-        let cps2 = Cc["@mozilla.org/content-pref/service;1"].
-                   getService(Ci.nsIContentPrefService2);
-        cps2.removeByName("browser.content.full-zoom", null);
-      }
-    }
-#endif
-
     if (this._dirty)
       this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();
 
     delete this._rdf;
     delete this._dataSource;
 
     // Update the migration version.
     Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
--- a/widget/android/nsScreenManagerAndroid.cpp
+++ b/widget/android/nsScreenManagerAndroid.cpp
@@ -100,14 +100,8 @@ nsScreenManagerAndroid::ScreenForNativeW
 
 NS_IMETHODIMP
 nsScreenManagerAndroid::GetNumberOfScreens(uint32_t *aNumberOfScreens)
 {
     *aNumberOfScreens = 1;
     return NS_OK;
 }
 
-NS_IMETHODIMP
-nsScreenManagerAndroid::GetSystemDefaultScale(float *aDefaultScale)
-{
-    *aDefaultScale = 1.0f;
-    return NS_OK;
-}
--- a/widget/cocoa/nsScreenManagerCocoa.mm
+++ b/widget/cocoa/nsScreenManagerCocoa.mm
@@ -92,23 +92,16 @@ nsScreenManagerCocoa::GetNumberOfScreens
     *aNumberOfScreens = [ss count];
 
     return NS_OK;
 
     NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP
-nsScreenManagerCocoa::GetSystemDefaultScale(float *aDefaultScale)
-{
-    *aDefaultScale = 1.0f;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
 nsScreenManagerCocoa::ScreenForNativeWidget (void *nativeWidget, nsIScreen **outScreen)
 {
     NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
     NSWindow *window = static_cast<NSWindow*>(nativeWidget);
     if (window) {
         nsIScreen *screen = ScreenForCocoaScreen([window screen]);
         *outScreen = screen;
--- a/widget/gtk2/nsScreenManagerGtk.cpp
+++ b/widget/gtk2/nsScreenManagerGtk.cpp
@@ -280,23 +280,16 @@ nsScreenManagerGtk :: GetNumberOfScreens
     return rv;
   }
   *aNumberOfScreens = mCachedScreenArray.Count();
   return NS_OK;
   
 } // GetNumberOfScreens
 
 NS_IMETHODIMP
-nsScreenManagerGtk::GetSystemDefaultScale(float *aDefaultScale)
-{
-  *aDefaultScale = 1.0f;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsScreenManagerGtk :: ScreenForNativeWidget (void *aWidget, nsIScreen **outScreen)
 {
   nsresult rv;
   rv = EnsureInit();
   if (NS_FAILED(rv)) {
     NS_ERROR("nsScreenManagerGtk::EnsureInit() failed from ScreenForNativeWidget");
     return rv;
   }
--- a/widget/nsIScreenManager.idl
+++ b/widget/nsIScreenManager.idl
@@ -2,17 +2,17 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "nsIScreen.idl"
 
-[scriptable, uuid(1C195990-FF9E-412B-AFE7-67D1C660BB27)]
+[scriptable, uuid(B92319E6-9A84-4ca7-A2CC-EEC22EA9854E)]
 interface nsIScreenManager : nsISupports
 {
     //
     // Returns the screen that contains the rectangle. If the rect overlaps
     // multiple screens, it picks the screen with the greatest area of intersection.
     //
     // The coordinates are in pixels (not twips) and in screen coordinates.
     //
@@ -20,36 +20,16 @@ interface nsIScreenManager : nsISupports
   
     // The screen with the menubar/taskbar. This shouldn't be needed very
     // often.
   readonly attribute nsIScreen primaryScreen;
   
     // Holds the number of screens that are available
   readonly attribute unsigned long numberOfScreens;
 
-    // The default DPI scaling factor of the screen environment (number of
-    // screen pixels corresponding to 1 CSS px, at the default zoom level).
-    //
-    // This is currently fixed at 1.0 on most platforms, but varies on Windows
-    // if the "logical DPI" scaling option in the Display control panel is set
-    // to a value other than 100% (e.g. 125% or 150% are increasingly common
-    // defaults on laptops with high-dpi screens). See bug 851520.
-    //
-    // NOTE that on OS X, this does -not- reflect the "backing scale factor"
-    // used to support Retina displays, which is a per-display property,
-    // not a system-wide scaling factor. The default ratio of CSS pixels to
-    // Cocoa points remains 1:1, even on a Retina screen where one Cocoa point
-    // corresponds to two device pixels. (This is exposed via other APIs:
-    // see window.devicePixelRatio).
-    //
-    // NOTE also that on Linux, this does -not- currently reflect changes
-    // to the system-wide (X11 or Gtk2) DPI value, as Firefox does not yet
-    // honor these settings. See bug 798362 and bug 712898.
-  readonly attribute float systemDefaultScale;
-
     // Returns the nsIScreen instance for the given native widget pointer;
     // the pointer is specific to the particular widget implementation,
     // and is generally of the same type that NS_NATIVE_WINDOW is.
   [noscript] nsIScreen screenForNativeWidget ( in voidPtr nativeWidget );
 };
 
 
 %{ C++
--- a/widget/os2/nsScreenManagerOS2.cpp
+++ b/widget/os2/nsScreenManagerOS2.cpp
@@ -87,20 +87,13 @@ NS_IMETHODIMP
 nsScreenManagerOS2 :: GetNumberOfScreens(uint32_t *aNumberOfScreens)
 {
   *aNumberOfScreens = 1;
   return NS_OK;
   
 } // GetNumberOfScreens
 
 NS_IMETHODIMP
-nsScreenManagerOS2::GetSystemDefaultScale(float *aDefaultScale)
-{
-  *aDefaultScale = 1.0f;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsScreenManagerOS2 :: ScreenForNativeWidget(void *nativeWidget, nsIScreen **aScreen)
 {
   *aScreen = CreateNewScreenObject();    // addrefs
   return NS_OK;
 }
--- a/widget/qt/nsScreenManagerQt.cpp
+++ b/widget/qt/nsScreenManagerQt.cpp
@@ -95,22 +95,15 @@ nsScreenManagerQt::GetNumberOfScreens(ui
     if (!desktop)
         init();
 
     *aNumberOfScreens = desktop->numScreens();
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsScreenManagerQt::GetSystemDefaultScale(float *aDefaultScale)
-{
-    *aDefaultScale = 1.0f;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
 nsScreenManagerQt :: ScreenForNativeWidget (void *aWidget, nsIScreen **outScreen)
 {
     // I don't know how to go from GtkWindow to nsIScreen, especially
     // given xinerama and stuff, so let's just do this
     QRect rect = static_cast<QWidget*>(aWidget)->geometry();
     return ScreenForRect(rect.x(), rect.y(), rect.width(), rect.height(), outScreen);
 }
--- a/widget/windows/nsScreenManagerWin.cpp
+++ b/widget/windows/nsScreenManagerWin.cpp
@@ -150,21 +150,14 @@ nsScreenManagerWin :: GetNumberOfScreens
     *aNumberOfScreens = mNumberOfScreens = count;
   }
 
   return NS_OK;
   
 } // GetNumberOfScreens
 
 NS_IMETHODIMP
-nsScreenManagerWin::GetSystemDefaultScale(float *aDefaultScale)
-{
-  *aDefaultScale = float(gfxWindowsPlatform::GetPlatform()->GetDPIScale());
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsScreenManagerWin :: ScreenForNativeWidget(void *aWidget, nsIScreen **outScreen)
 {
   HMONITOR mon = MonitorFromWindow ((HWND) aWidget, MONITOR_DEFAULTTOPRIMARY);
   *outScreen = CreateNewScreenObject (mon);
   return NS_OK;
 }
--- a/widget/xpwidgets/PuppetWidget.cpp
+++ b/widget/xpwidgets/PuppetWidget.cpp
@@ -757,17 +757,10 @@ PuppetScreenManager::ScreenForNativeWidg
 
 NS_IMETHODIMP
 PuppetScreenManager::GetNumberOfScreens(uint32_t* aNumberOfScreens)
 {
   *aNumberOfScreens = 1;
   return NS_OK;
 }
 
-NS_IMETHODIMP
-PuppetScreenManager::GetSystemDefaultScale(float *aDefaultScale)
-{
-  *aDefaultScale = 1.0f;
-  return NS_OK;
-}
-
 }  // namespace widget
 }  // namespace mozilla