Bug 961047 - Ensure all mozbrowser iframes use APZ when APZ is enabled. r=kats, r=fabrice, a=1.3+
authorVivien Nicolas <vnicolas@mozilla.com>
Thu, 23 Jan 2014 18:45:00 +0100
changeset 175026 f10161f83105c7c281ef0142f3d71dca18df8e93
parent 175025 573b19cdae30c4208a361ac380f4e48850c7ca22
child 175027 800bcd3cc7ebbf566a306fca2ca960c56ce608d3
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, fabrice, 1
bugs961047
milestone28.0a2
Bug 961047 - Ensure all mozbrowser iframes use APZ when APZ is enabled. r=kats, r=fabrice, a=1.3+
b2g/app/b2g.js
b2g/chrome/content/settings.js
content/base/src/nsFrameLoader.cpp
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -385,16 +385,17 @@ pref("browser.link.open_newwindow.restri
 // work), but make in-process browser frames the default.
 pref("dom.mozBrowserFramesEnabled", true);
 
 // Enable a (virtually) unlimited number of mozbrowser processes.
 // We'll run out of PIDs on UNIX-y systems before we hit this limit.
 pref("dom.ipc.processCount", 100000);
 
 pref("dom.ipc.browser_frames.oop_by_default", false);
+pref("dom.browser_frames.useAsyncPanZoom", false);
 
 // SMS/MMS
 pref("dom.sms.enabled", true);
 
 //The waiting time in network manager.
 pref("network.gonk.ms-release-mms-connection", 30000);
 
 // WebContacts
--- a/b2g/chrome/content/settings.js
+++ b/b2g/chrome/content/settings.js
@@ -560,8 +560,15 @@ SettingsListener.observe("layers.draw-bo
       Services.prefs.setBoolPref("layers.composer2d.enabled", value);
     });
   };
   req.onerror = function() {
     dump("Error configuring layers.composer2d.enabled setting");
   };
 
 })();
+
+// =================== AsyncPanZoom ======================
+
+SettingsListener.observe('apz.force-enable', false, function(value) {
+  Services.prefs.setBoolPref('dom.browser_frames.useAsyncPanZoom', value);
+});
+
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -2080,17 +2080,19 @@ nsFrameLoader::TryRemoteBrowser()
   }
 
   PROFILER_LABEL("nsFrameLoader", "CreateRemoteBrowser");
 
   MutableTabContext context;
   nsCOMPtr<mozIApplication> ownApp = GetOwnApp();
   nsCOMPtr<mozIApplication> containingApp = GetContainingApp();
   ScrollingBehavior scrollingBehavior = DEFAULT_SCROLLING;
-  if (mOwnerContent->AttrValueIs(kNameSpaceID_None,
+
+  if (Preferences::GetBool("dom.browser_frames.useAsyncPanZoom", false) ||
+      mOwnerContent->AttrValueIs(kNameSpaceID_None,
                                  nsGkAtoms::mozasyncpanzoom,
                                  nsGkAtoms::_true,
                                  eCaseMatters)) {
     scrollingBehavior = ASYNC_PAN_ZOOM;
   }
 
   bool rv = true;
   if (ownApp) {