Merge m-c to fx-team.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 12 Mar 2014 11:32:46 -0400
changeset 190469 e6636696d6de5f4b2f32812eeff731aae7341c96
parent 190468 56ac183ad1e21219994a080f3f65454b945b9bb0 (current diff)
parent 190376 b1b1f0e5f8da0e9d7766578784bfcce4c36f925d (diff)
child 190470 8de8e275a35bb7c6946780cf82063445bc390a4d
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone30.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
Merge m-c to fx-team.
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,9 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Update CLOBBER for bug 978784 because it touches the ICU build system.
+Intermittent Android startup crashes leading to test bustage.
--- a/content/canvas/test/webgl/mochitest.ini
+++ b/content/canvas/test/webgl/mochitest.ini
@@ -12,9 +12,9 @@ support-files =
   failing_tests_windows.txt
   skipped_tests_android.txt
   skipped_tests_android_x86.txt
   skipped_tests_linux_mesa.txt
   skipped_tests_win_vista.txt
   skipped_tests_winxp.txt
 
 [test_webgl_conformance_test_suite.html]
-skip-if = buildapp == 'b2g'
+skip-if = (toolkit == 'android') || (buildapp == 'b2g') #android(bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests)
--- a/content/canvas/test/webgl/non-conf-tests/mochitest.ini
+++ b/content/canvas/test/webgl/non-conf-tests/mochitest.ini
@@ -5,12 +5,17 @@ support-files =
 
 [test_depth_readpixels.html]
 [test_fb_param.html]
 [test_fb_param_crash.html]
 [test_highp_fs.html]
 [test_no_arr_points.html]
 [test_privileged_exts.html]
 [test_webgl_available.html]
+skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests
 [test_webgl_conformance.html]
+skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests
 [test_webgl_request_context.html]
+skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests
 [test_webgl_request_mismatch.html]
+skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests
 [test_webgl2_not_exposed.html]
+skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests
--- a/content/media/test/mochitest.ini
+++ b/content/media/test/mochitest.ini
@@ -470,25 +470,25 @@ skip-if = buildapp == 'b2g'
 # about reenabling it on any platform unless you *know* that you have fixed
 # that. Then don't think about reenabling it on Windows until you know that
 # you have fixed the timeouts of bug 832768, bug 814533, bug 840742
 
 [test_play_twice.html]
 skip-if = appname == "seamonkey" # See bug 598252
 
 [test_buffered.html]
-skip-if = os == "win" # See bug 832768 and 864682
+skip-if = toolkit == 'android' || os == "win" # See bug 832768 and 864682
 [test_bug465498.html]
 skip-if = os == "win" # See bug 832768 and 864682
 [test_bug493187.html]
 skip-if = os == "win" || (buildapp=='b2g'&&debug) # See bug 707777, #b2g-emulator-debug - process crash
 [test_media_selection.html]
 skip-if = os == "win" # See bug 897843
 [test_seek.html]
-skip-if = os == "win" # See bug 832678, 795271, and 857424
+skip-if = toolkit == 'android' || os == "win" # See bug 832678, 795271, and 857424 # android(bug 845162) androidx86(bug 845162)
 
 # The tests below contain backend-specific tests. Write backend independent
 # tests rather than adding to this list.
 
 [test_can_play_type_webm.html]
 run-if = webm
 [test_can_play_type_no_webm.html]
 skip-if = webm
--- a/content/svg/content/src/SVGFETurbulenceElement.cpp
+++ b/content/svg/content/src/SVGFETurbulenceElement.cpp
@@ -135,18 +135,17 @@ SVGFETurbulenceElement::GetPrimitiveDesc
     return FilterPrimitiveDescription(FilterPrimitiveDescription::eNone);
   }
 
   // We interpret the base frequency as relative to user space units. In other
   // words, we consider one turbulence base period to be 1 / fX user space
   // units wide and 1 / fY user space units high. We do not scale the frequency
   // depending on the filter primitive region.
   gfxRect firstPeriodInUserSpace(0, 0, 1 / fX, 1 / fY);
-  gfxMatrix m = aInstance->GetUserSpaceToFilterSpaceTransform();
-  gfxRect firstPeriodInFilterSpace = m.TransformBounds(firstPeriodInUserSpace);
+  gfxRect firstPeriodInFilterSpace = aInstance->UserSpaceToFilterSpace(firstPeriodInUserSpace);
   Size frequencyInFilterSpace(1 / firstPeriodInFilterSpace.width,
                               1 / firstPeriodInFilterSpace.height);
   gfxPoint offset = firstPeriodInFilterSpace.TopLeft();
 
   FilterPrimitiveDescription descr(FilterPrimitiveDescription::eTurbulence);
   descr.Attributes().Set(eTurbulenceOffset, IntPoint(offset.x, offset.y));
   descr.Attributes().Set(eTurbulenceBaseFrequency, frequencyInFilterSpace);
   descr.Attributes().Set(eTurbulenceSeed, seed);
--- a/content/test/reftest/reftest.list
+++ b/content/test/reftest/reftest.list
@@ -10,11 +10,11 @@ include ../../base/test/reftest/reftest.
 == bug456008.xhtml bug456008-ref.html
 == bug439965.html bug439965-ref.html
 == bug427779.xml bug427779-ref.xml
 skip-if(B2G) == bug559996.html bug559996-ref.html # bug 773482
 skip-if(B2G) == bug591981-1.html bug591981-ref.html
 == bug591981-2.html bug591981-ref.html
 == bug592366-1.html bug592366-ref.html
 skip-if(B2G) == bug592366-2.html bug592366-ref.html
-== bug592366-1.xhtml bug592366-ref.xhtml
+skip-if(B2G&&browserIsRemote) == bug592366-1.xhtml bug592366-ref.xhtml
 skip-if(B2G) == bug592366-2.xhtml bug592366-ref.xhtml
 == bug798068.xhtml bug798068-ref.xhtml
--- a/dom/browser-element/BrowserElementParent.jsm
+++ b/dom/browser-element/BrowserElementParent.jsm
@@ -710,27 +710,34 @@ BrowserElementParent.prototype = {
       throw Components.Exception("Invalid argument",
                                  Cr.NS_ERROR_INVALID_ARG);
     }
 
     let req = Services.DOMRequest.createRequest(this._window);
 
     // Deactivate the old input method if needed.
     if (activeInputFrame && isActive) {
-      let reqOld = XPCNativeWrapper.unwrap(activeInputFrame)
-                                   .setInputMethodActive(false);
-      reqOld.onsuccess = function() {
+      if (Cu.isDeadWrapper(activeInputFrame)) {
+        // If the activeInputFrame is already a dead object,
+        // we should simply set it to null directly.
         activeInputFrame = null;
         this._sendSetInputMethodActiveDOMRequest(req, isActive);
-      }.bind(this);
-      reqOld.onerror = function() {
-        Services.DOMRequest.fireErrorAsync(req,
-          'Failed to deactivate the old input method: ' +
-          reqOld.error + '.');
-      };
+      } else {
+        let reqOld = XPCNativeWrapper.unwrap(activeInputFrame)
+                                     .setInputMethodActive(false);
+        reqOld.onsuccess = function() {
+          activeInputFrame = null;
+          this._sendSetInputMethodActiveDOMRequest(req, isActive);
+        }.bind(this);
+        reqOld.onerror = function() {
+          Services.DOMRequest.fireErrorAsync(req,
+            'Failed to deactivate the old input method: ' +
+            reqOld.error + '.');
+        };
+      }
     } else {
       this._sendSetInputMethodActiveDOMRequest(req, isActive);
     }
     return req;
   },
 
   _sendSetInputMethodActiveDOMRequest: function(req, isActive) {
     let id = 'req_' + this._domRequestCounter++;
--- a/dom/browser-element/mochitest/browserElement_SetInputMethodActive.js
+++ b/dom/browser-element/mochitest/browserElement_SetInputMethodActive.js
@@ -5,92 +5,174 @@
 // system set the active IME app.
 'use strict';
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function setup() {
+  let appInfo = SpecialPowers.Cc['@mozilla.org/xre/app-info;1']
+                .getService(SpecialPowers.Ci.nsIXULAppInfo);
+  if (appInfo.name != 'B2G') {
+    SpecialPowers.Cu.import("resource://gre/modules/Keyboard.jsm", window);
+  }
+
   SpecialPowers.setBoolPref("dom.mozInputMethod.enabled", true);
   SpecialPowers.setBoolPref("dom.mozInputMethod.testing", true);
   SpecialPowers.addPermission('input-manage', true, document);
 }
 
 function tearDown() {
   SpecialPowers.setBoolPref("dom.mozInputMethod.enabled", false);
   SpecialPowers.setBoolPref("dom.mozInputMethod.testing", false);
-  SpecialPowers.removePermission("input-manage", document);
+  SpecialPowers.removePermission('input-manage', document);
   SimpleTest.finish();
 }
 
 function runTest() {
-  // Create an input field to receive string from input method iframes.
-  let input = document.createElement('input');
-  input.type = 'text';
-  document.body.appendChild(input);
+  let path = location.pathname;
+  let imeUrl = location.protocol + '//' + location.host +
+               path.substring(0, path.lastIndexOf('/')) +
+               '/file_inputmethod.html';
+  SpecialPowers.pushPermissions([{
+    type: 'input',
+    allow: true,
+    context: {
+      url: imeUrl,
+      appId: SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
+      isInBrowserElement: true
+    }
+  }], createFrames);
+}
+
+var gFrames = [];
+var gInputFrame;
+
+function createFrames() {
+  // Create two input method iframes.
+  let loadendCount = 0;
+  let countLoadend = function() {
+    ok(this.setInputMethodActive, 'Can access setInputMethodActive.');
+
+    if (this === gInputFrame) {
+      // The frame script running in the frame where the input is hosted.
+      let appFrameScript = function appFrameScript() {
+        let input = content.document.body.firstElementChild;
+        input.oninput = function() {
+          sendAsyncMessage('test:InputMethod:oninput', this.value);
+        };
 
-  // Create two input method iframes.
-  let frames = [];
+        /*
+         * Bug 957213. Sometimes we need to refocus the input field to avoid
+         * intermittent test failure.
+         */
+        content.setInterval(function() {
+          input.focus();
+        }, 500);
+      }
+
+      // Inject frame script to receive input.
+      let mm = SpecialPowers.getBrowserFrameMessageManager(gInputFrame);
+      mm.loadFrameScript('data:,(' + appFrameScript.toString() + ')();', false);
+      mm.addMessageListener("test:InputMethod:oninput", next);
+    }
+
+    loadendCount++;
+    if (loadendCount === 3) {
+      startTest();
+    }
+  };
+
+  // Create an input field to receive string from input method iframes.
+  gInputFrame = document.createElement('iframe');
+  SpecialPowers.wrap(gInputFrame).mozbrowser = true;
+  gInputFrame.src =
+    'data:text/html,<input autofocus value="hello" />' +
+    '<p>This is targetted mozbrowser frame.</p>';
+  document.body.appendChild(gInputFrame);
+  gInputFrame.addEventListener('mozbrowserloadend', countLoadend);
+
   for (let i = 0; i < 2; i++) {
-    frames[i] = document.createElement('iframe');
-    SpecialPowers.wrap(frames[i]).mozbrowser = true;
+    let frame = gFrames[i] = document.createElement('iframe');
+    SpecialPowers.wrap(gFrames[i]).mozbrowser = true;
     // When the input method iframe is activated, it will send the URL
     // hash to current focused element. We set different hash to each
     // iframe so that iframes can be differentiated by their hash.
-    frames[i].src = 'file_inputmethod.html#' + i;
-    frames[i].setAttribute('mozapp', location.href.replace(/[^/]+$/, 'file_inputmethod.webapp'));
-    document.body.appendChild(frames[i]);
+    frame.src = 'file_inputmethod.html#' + i;
+    document.body.appendChild(frame);
+    frame.addEventListener('mozbrowserloadend', countLoadend);
   }
+}
 
-  let count = 0;
-
+function startTest() {
   // Set focus to the input field and wait for input methods' inputting.
-  SpecialPowers.DOMWindowUtils.focus(input);
-  var timerId = null;
-  input.oninput = function() {
-    // The texts sent from the first and the second input method are '#0' and
-    // '#1' respectively.
-    switch (count) {
-      case 1:
-        is(input.value, '#0', 'Failed to get correct input from the first iframe.');
-        testNextInputMethod();
-        break;
-      case 2:
-        is(input.value, '#0#1', 'Failed to get correct input from the second iframe.');
-        // Do nothing and wait for the next input from the second iframe.
-        count++;
-        break;
-      case 3:
-        is(input.value, '#0#1#1', 'Failed to get correct input from the second iframe.');
-        // Receive the second input from the second iframe.
-        count++;
-        // Deactive the second iframe.
-        frames[1].setInputMethodActive(false);
-        // Wait for a short while to ensure the second iframe is not active any
-        // more.
-        timerId = setTimeout(function() {
-          ok(true, 'Successfully deactivate the second iframe.');
-          tearDown();
-        }, 1000);
-        break;
-      default:
-        ok(false, 'Failed to deactivate the second iframe.');
-        clearTimeout(timerId);
+  SpecialPowers.DOMWindowUtils.focus(gInputFrame);
+
+  let req0 = gFrames[0].setInputMethodActive(true);
+  req0.onsuccess = function() {
+    ok(true, 'setInputMethodActive succeeded (0).');
+  };
+
+  req0.onerror = function() {
+    ok(false, 'setInputMethodActive failed (0): ' + this.error.name);
+  };
+}
+
+var gTimerId = null;
+var gCount = 0;
+
+function next(msg) {
+  gCount++;
+  let wrappedMsg = SpecialPowers.wrap(msg);
+  let value = wrappedMsg.data;
+  // The texts sent from the first and the second input method are '#0' and
+  // '#1' respectively.
+  switch (gCount) {
+    case 1:
+      is(value, '#0hello',
+         'Failed to get correct input from the first iframe.');
+      let req1 = gFrames[1].setInputMethodActive(true);
+      req1.onsuccess = function() {
+       ok(true, 'setInputMethodActive succeeded (1).');
+      };
+      req1.onerror = function() {
+       ok(false, 'setInputMethodActive failed (1): ' + this.error.name);
+      };
+      break;
+
+    case 2:
+      is(value, '#0#1hello',
+         'Failed to get correct input from the second iframe.');
+      // Do nothing and wait for the next input from the second iframe.
+      break;
+
+    case 3:
+      is(value, '#0#1#1hello',
+         'Failed to get correct input from the second iframe.');
+      // Receive the second input from the second iframe.
+      // Deactive the second iframe.
+      let req3 = gFrames[1].setInputMethodActive(false);
+      req3.onsuccess = function() {
+        ok(true, 'setInputMethodActive(false) succeeded (3).');
+      };
+      req3.onerror = function() {
+        ok(false, 'setInputMethodActive(false) failed (3): ' + this.error.name);
+      };
+
+      // Wait for a short while to ensure the second iframe is not active any
+      // more.
+      gTimerId = setTimeout(function() {
+        ok(true, 'Successfully deactivate the second iframe.');
         tearDown();
-        break;
-    }
-  }
-
-  ok(frames[0].setInputMethodActive, 'Cannot access setInputMethodActive.');
+      }, 1000);
+      break;
 
-  function testNextInputMethod() {
-    frames[count++].setInputMethodActive(true);
+    case 4:
+      ok(false, 'Failed to deactivate the second iframe in time.');
+      clearTimeout(gTimerId);
+      tearDown();
+      break;
   }
-
-  // Wait for a short while to let input method get ready.
-  setTimeout(function() {
-    testNextInputMethod();
-  }, 500);
 }
 
 setup();
 addEventListener('testready', runTest);
--- a/dom/browser-element/mochitest/file_inputmethod.html
+++ b/dom/browser-element/mochitest/file_inputmethod.html
@@ -1,21 +1,26 @@
+<!DOCTYPE HTML>
 <html>
 <body>
 <script>
   var im = navigator.mozInputMethod;
   if (im) {
     var intervalId = null;
     // Automatically append location hash to current input field.
     im.oninputcontextchange = function() {
       var ctx = im.inputcontext;
       if (ctx) {
+        dump('inputcontext is received for input method ' + location.hash + '\n');
         intervalId = setInterval(function() {
+          dump('sending text in input method ' + location.hash + '\n');
           ctx.replaceSurroundingText(location.hash);
         }, 500);
       } else {
+        dump('inputcontext is removed for input method ' + location.hash + '\n');
         clearInterval(intervalId);
       }
     };
   }
 </script>
+<p>This frame representing the input method frame.</p>
 </body>
 </html>
--- a/dom/browser-element/mochitest/mochitest-oop.ini
+++ b/dom/browser-element/mochitest/mochitest-oop.ini
@@ -45,17 +45,19 @@ skip-if = toolkit=='gonk'
 [test_browserElement_oop_PromptCheck.html]
 [test_browserElement_oop_PromptConfirm.html]
 [test_browserElement_oop_PurgeHistory.html]
 [test_browserElement_oop_Reload.html]
 [test_browserElement_oop_ReloadPostRequest.html]
 [test_browserElement_oop_RemoveBrowserElement.html]
 [test_browserElement_oop_ScrollEvent.html]
 [test_browserElement_oop_SecurityChange.html]
+skip-if = toolkit == 'android' #TIMED_OUT, bug 766586
 [test_browserElement_oop_SendEvent.html]
+[test_browserElement_oop_SetInputMethodActive.html]
 [test_browserElement_oop_SetVisible.html]
 [test_browserElement_oop_SetVisibleFrames.html]
 [test_browserElement_oop_SetVisibleFrames2.html]
 [test_browserElement_oop_Stop.html]
 [test_browserElement_oop_TargetBlank.html]
 [test_browserElement_oop_TargetTop.html]
 [test_browserElement_oop_Titlechange.html]
 [test_browserElement_oop_TopBarrier.html]
@@ -69,11 +71,8 @@ skip-if = toolkit=='gonk'
 disabled = bug 930449
 # Disabled until bug 924771 makes them stop timing out
 [test_browserElement_oop_CloseFromOpener.html]
 disabled = bug 924771
 [test_browserElement_oop_CloseApp.html]
 disabled = bug 924771
 [test_browserElement_oop_ExposableURI.html]
 disabled = bug 924771
-# Disabled until we fix bug 906096.
-[test_browserElement_oop_SetInputMethodActive.html]
-disabled = bug 906096
--- a/dom/browser-element/mochitest/mochitest.ini
+++ b/dom/browser-element/mochitest/mochitest.ini
@@ -42,16 +42,17 @@ support-files =
   browserElement_PromptConfirm.js
   browserElement_PurgeHistory.js
   browserElement_Reload.js
   browserElement_ReloadPostRequest.js
   browserElement_RemoveBrowserElement.js
   browserElement_ScrollEvent.js
   browserElement_SecurityChange.js
   browserElement_SendEvent.js
+  browserElement_SetInputMethodActive.js
   browserElement_SetVisible.js
   browserElement_SetVisibleFrames.js
   browserElement_SetVisibleFrames2.js
   browserElement_Stop.js
   browserElement_TargetBlank.js
   browserElement_TargetTop.js
   browserElement_Titlechange.js
   browserElement_TopBarrier.js
@@ -92,42 +93,43 @@ support-files =
   file_browserElement_XFrameOptionsDeny.html
   file_browserElement_XFrameOptionsSameOrigin.html
   file_bug709759.sjs
   file_bug741717.sjs
   file_empty.html
   file_empty_script.js
   file_focus.html
   file_http_401_response.sjs
+  file_inputmethod.html
   file_post_request.html
   file_wyciwyg.html
 
 # Note: browserElementTestHelpers.js looks at the test's filename to determine
 # whether the test should be OOP.  "_oop_" signals OOP, "_inproc_" signals in
 # process.  Default is OOP.
 [test_browserElement_NoAttr.html]
 [test_browserElement_NoPref.html]
 [test_browserElement_NoPermission.html]
 [test_browserElement_inproc_Alert.html]
 skip-if = buildapp == 'b2g'
 [test_browserElement_inproc_AlertInFrame.html]
 [test_browserElement_inproc_AppFramePermission.html]
-skip-if = buildapp == 'b2g'
+skip-if = toolkit == 'android' || buildapp == 'b2g'
 [test_browserElement_inproc_AppWindowNamespace.html]
-skip-if = buildapp == 'b2g'
+skip-if = toolkit == 'android' || buildapp == 'b2g' # android(TIMED_OUT, bug 783509) androidx86(TIMED_OUT, bug 783509)
 [test_browserElement_inproc_Auth.html]
 skip-if = buildapp == 'b2g'
 [test_browserElement_inproc_BackForward.html]
 [test_browserElement_inproc_BadScreenshot.html]
 [test_browserElement_inproc_BrowserWindowNamespace.html]
 skip-if = buildapp == 'b2g'
 [test_browserElement_inproc_BrowserWindowResize.html]
 [test_browserElement_inproc_Close.html]
 [test_browserElement_inproc_CloseApp.html]
-skip-if = buildapp == 'b2g'
+skip-if = toolkit == 'android' || buildapp == 'b2g' # android(FAILS, bug 796982) androidx86(FAILS, bug 796982)
 [test_browserElement_inproc_CloseFromOpener.html]
 skip-if = buildapp == 'b2g'
 [test_browserElement_inproc_ContextmenuEvents.html]
 [test_browserElement_inproc_CookiesNotThirdParty.html]
 [test_browserElement_inproc_DOMRequestError.html]
 [test_browserElement_inproc_DataURI.html]
 [test_browserElement_inproc_DocumentFirstPaint.html]
 [test_browserElement_inproc_ExposableURI.html]
@@ -156,37 +158,36 @@ skip-if = (toolkit == 'gonk' && !debug)
 [test_browserElement_inproc_Opensearch.html]
 [test_browserElement_inproc_PromptCheck.html]
 [test_browserElement_inproc_PromptConfirm.html]
 [test_browserElement_inproc_PurgeHistory.html]
 [test_browserElement_inproc_ReloadPostRequest.html]
 [test_browserElement_inproc_RemoveBrowserElement.html]
 [test_browserElement_inproc_ScrollEvent.html]
 [test_browserElement_inproc_SecurityChange.html]
-skip-if = (toolkit == 'gonk' && !debug)
+skip-if = toolkit == 'android' || (toolkit == 'gonk' && !debug) # android(TIMED_OUT, bug 766586) androidx86(TIMED_OUT, bug 766586)
 [test_browserElement_inproc_SendEvent.html]
+# The setInputMethodActive() tests will timed out on Android
+[test_browserElement_inproc_SetInputMethodActive.html]
+skip-if = (os == "android")
 [test_browserElement_inproc_SetVisible.html]
 [test_browserElement_inproc_SetVisibleFrames.html]
 [test_browserElement_inproc_SetVisibleFrames2.html]
 [test_browserElement_inproc_Stop.html]
 [test_browserElement_inproc_TargetBlank.html]
 skip-if = (toolkit == 'gonk' && !debug)
 [test_browserElement_inproc_TargetTop.html]
 [test_browserElement_inproc_Titlechange.html]
 [test_browserElement_inproc_TopBarrier.html]
 [test_browserElement_inproc_VisibilityChange.html]
 [test_browserElement_inproc_XFrameOptions.html]
 [test_browserElement_inproc_XFrameOptionsAllowFrom.html]
 [test_browserElement_inproc_XFrameOptionsDeny.html]
 [test_browserElement_inproc_XFrameOptionsSameOrigin.html]
 [test_browserElement_oop_NextPaint.html]
-# Disabled until we fix bug 906096.
-[test_browserElement_inproc_SetInputMethodActive.html]
-disabled = bug 906096
-support-files = browserElement_SetInputMethodActive.js file_inputmethod.html
 # Disabled due to https://bugzilla.mozilla.org/show_bug.cgi?id=774100
 [test_browserElement_inproc_Reload.html]
 disabled = bug 774100
 # Disabled due to focus issues (no bug that I'm aware of)
 [test_browserElement_oop_KeyEvents.html]
 disabled =
 # Disable due to certificate issue (no bug that I'm aware of)
 [test_browserElement_inproc_ErrorSecurity.html]
--- a/dom/devicestorage/ipc/mochitest.ini
+++ b/dom/devicestorage/ipc/mochitest.ini
@@ -1,5 +1,6 @@
 [DEFAULT]
+skip-if = toolkit == 'android' #bug 781789 & bug 782275
 support-files = ../test/devicestorage_common.js
 
 [test_ipc.html]
 skip-if = buildapp == 'b2g' # b2g(nested ipc not working) b2g-debug(nested ipc not working) b2g-desktop(nested ipc not working)
--- a/dom/devicestorage/test/mochitest.ini
+++ b/dom/devicestorage/test/mochitest.ini
@@ -1,9 +1,10 @@
 [DEFAULT]
+skip-if = toolkit == 'android' #bug 781789 & bug 782275
 support-files = devicestorage_common.js
 
 [test_823965.html]
 # [test_add.html]
 # man, our mime database sucks hard.  followup bug # 788273
 [test_addCorrectType.html]
 [test_available.html]
 [test_basic.html]
--- a/dom/identity/DOMIdentity.jsm
+++ b/dom/identity/DOMIdentity.jsm
@@ -5,24 +5,16 @@
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const PREF_FXA_ENABLED = "identity.fxaccounts.enabled";
-let _fxa_enabled = false;
-try {
-  if (Services.prefs.getPrefType(PREF_FXA_ENABLED) === Ci.nsIPrefBranch.PREF_BOOL) {
-    _fxa_enabled = Services.prefs.getBoolPref(PREF_FXA_ENABLED);
-  }
-} catch(noPref) {
-}
-const FXA_ENABLED = _fxa_enabled;
 
 // This is the parent process corresponding to nsDOMIdentity.
 this.EXPORTED_SYMBOLS = ["DOMIdentity"];
 
 XPCOMUtils.defineLazyModuleGetter(this, "objectCopy",
                                   "resource://gre/modules/identity/IdentityUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "IdentityService",
@@ -115,24 +107,16 @@ function RPWatchContext(aOptions, aTarge
   }
 
   // default for no loggedInUser is undefined, not null
   this.loggedInUser = aOptions.loggedInUser;
 
   // Maybe internal.  For hosted b2g identity shim.
   this._internal = aOptions._internal;
 
-  // By default, set the audience of the assertion to the origin of the RP. Bug
-  // 947374 will make it possible for certified apps and packaged apps on
-  // FirefoxOS to request a different audience from their origin.
-  //
-  // For BrowserID on b2g, this audience value is consumed by a hosted identity
-  // shim, set up by b2g/components/SignInToWebsite.jsm.
-  this.audience = this.origin;
-
   this._mm = aTargetMM;
 }
 
 RPWatchContext.prototype = {
   doLogin: function RPWatchContext_onlogin(aAssertion, aMaybeInternalParams) {
     log("doLogin: " + this.id);
     let message = new IDDOMMessage({id: this.id, assertion: aAssertion});
     if (aMaybeInternalParams) {
@@ -155,17 +139,17 @@ RPWatchContext.prototype = {
 
   doCancel: function RPWatchContext_oncancel() {
     log("doCancel: " + this.id);
     let message = new IDDOMMessage({id: this.id});
     this._mm.sendAsyncMessage("Identity:RP:Watch:OnCancel", message);
   },
 
   doError: function RPWatchContext_onerror(aMessage) {
-    log("doError: " + this.id + ": " + aMessage);
+    log("doError: " + this.id + ": " + JSON.stringify(aMessage));
     let message = new IDDOMMessage({id: this.id, message: aMessage});
     this._mm.sendAsyncMessage("Identity:RP:Watch:OnError", message);
   }
 };
 
 this.DOMIdentity = {
   /*
    * When relying parties (RPs) invoke the watch() method, they can request
@@ -204,17 +188,18 @@ this.DOMIdentity = {
    */
   getService: function(message) {
     if (!this._serviceContexts.has(message.id)) {
       throw new Error("getService called before newContext for " + message.id);
     }
 
     let context = this._serviceContexts.get(message.id);
     if (context.wantIssuer == "firefox-accounts") {
-      if (FXA_ENABLED) {
+      if (Services.prefs.getPrefType(PREF_FXA_ENABLED) === Ci.nsIPrefBranch.PREF_BOOL
+          && Services.prefs.getBoolPref(PREF_FXA_ENABLED)) {
         return FirefoxAccounts;
       }
       log("WARNING: Firefox Accounts is not enabled; Defaulting to BrowserID");
     }
     return IdentityService;
   },
 
   /*
--- a/dom/identity/nsDOMIdentity.js
+++ b/dom/identity/nsDOMIdentity.js
@@ -33,16 +33,24 @@ XPCOMUtils.defineLazyServiceGetter(this,
                                    "@mozilla.org/uuid-generator;1",
                                    "nsIUUIDGenerator");
 
 // This is the child process corresponding to nsIDOMIdentity
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
                                    "@mozilla.org/childprocessmessagemanager;1",
                                    "nsIMessageSender");
 
+
+const ERRORS = {
+  "ERROR_NOT_AUTHORIZED_FOR_FIREFOX_ACCOUNTS":
+    "Only privileged and certified apps may use Firefox Accounts",
+  "ERROR_INVALID_ASSERTION_AUDIENCE":
+    "Assertion audience may not differ from origin",
+};
+
 function nsDOMIdentity(aIdentityInternal) {
   this._identityInternal = aIdentityInternal;
 }
 nsDOMIdentity.prototype = {
   __exposedProps__: {
     // Relying Party (RP)
     watch: 'r',
     request: 'r',
@@ -59,22 +67,39 @@ nsDOMIdentity.prototype = {
     // Authentication
     beginAuthentication: 'r',
     completeAuthentication: 'r',
     raiseAuthenticationFailure: 'r'
   },
 
   // require native events unless syntheticEventsOk is set
   get nativeEventsRequired() {
-    if (Services.prefs.prefHasUserValue(PREF_SYNTHETIC_EVENTS_OK)) {
+    if (Services.prefs.prefHasUserValue(PREF_SYNTHETIC_EVENTS_OK) &&
+        (Services.prefs.getPrefType(PREF_SYNTHETIC_EVENTS_OK) ===
+         Ci.nsIPrefBranch.PREF_BOOL)) {
       return !Services.prefs.getBoolPref(PREF_SYNTHETIC_EVENTS_OK);
     }
     return true;
   },
 
+  reportErrors: function(message) {
+    let onerror = function() {};
+    if (this._rpWatcher && this._rpWatcher.onerror) {
+      onerror = this._rpWatcher.onerror;
+    }
+
+    message.errors.forEach((error) => {
+      // Report an error string to content
+      Cu.reportError(ERRORS[error]);
+
+      // Report error code to RP callback, if available
+      onerror(error);
+    });
+  },
+
   /**
    * Relying Party (RP) APIs
    */
 
   watch: function nsDOMIdentity_watch(aOptions) {
     if (this._rpWatcher) {
       // For the initial release of Firefox Accounts, we support callers who
       // invoke watch() either for Firefox Accounts, or Persona, but not both.
@@ -101,17 +126,17 @@ nsDOMIdentity.prototype = {
     //
     // To accomodate the more and less lenient uses of the API, we will simply
     // be strict about checking for onlogin here.
     if (typeof(aOptions["onlogin"]) != "function") {
       throw new Error("onlogin() callback is required.");
     }
 
     // Optional callbacks
-    for (let cb of ["onready", "onlogout"]) {
+    for (let cb of ["onready", "onerror", "onlogout"]) {
       if (aOptions[cb] && typeof(aOptions[cb]) != "function") {
         throw new Error(cb + " must be a function");
       }
     }
 
     let message = this.DOMIdentityMessage(aOptions);
 
     // loggedInUser vs loggedInEmail
@@ -135,20 +160,29 @@ nsDOMIdentity.prototype = {
         throw new Error("loggedInUser is not valid");
       }
       // Set loggedInUser in this block that "undefined" doesn't get through.
       message.loggedInUser = aOptions.loggedInUser;
     }
     this._log("loggedInUser: " + message.loggedInUser);
 
     this._rpWatcher = aOptions;
+    this._rpWatcher.audience = message.audience;
+
+    if (message.errors.length) {
+      this.reportErrors(message);
+      // We don't delete the rpWatcher object, because we don't want the
+      // broken client to be able to call watch() any more.  It's broken.
+      return;
+    }
     this._identityInternal._mm.sendAsyncMessage("Identity:RP:Watch", message);
   },
 
   request: function nsDOMIdentity_request(aOptions = {}) {
+    this._log("request: " + JSON.stringify(aOptions));
     let util = this._window.QueryInterface(Ci.nsIInterfaceRequestor)
                            .getInterface(Ci.nsIDOMWindowUtils);
 
     // The only time we permit calling of request() outside of a user
     // input handler is when we are handling the (deprecated) get() or
     // getVerifiedEmail() calls, which make use of an RP context
     // marked as _internal.
     if (this.nativeEventsRequired && !util.isHandlingUserInput && !aOptions._internal) {
@@ -161,16 +195,22 @@ nsDOMIdentity.prototype = {
       throw new Error("navigator.id.request called before navigator.id.watch");
     }
     if (this._rpCalls > MAX_RP_CALLS) {
       throw new Error("navigator.id.request called too many times");
     }
 
     let message = this.DOMIdentityMessage(aOptions);
 
+    // Report and fail hard on any errors.
+    if (message.errors.length) {
+      this.reportErrors(message);
+      return;
+    }
+
     if (aOptions) {
       // Optional string properties
       let optionalStringProps = ["privacyPolicy", "termsOfService"];
       for (let propName of optionalStringProps) {
         if (!aOptions[propName] || aOptions[propName] === "undefined")
           continue;
         if (typeof(aOptions[propName]) !== "string") {
           throw new Error(propName + " must be a string representing a URL.");
@@ -199,16 +239,23 @@ nsDOMIdentity.prototype = {
       throw new Error("navigator.id.logout called before navigator.id.watch");
     }
     if (this._rpCalls > MAX_RP_CALLS) {
       throw new Error("navigator.id.logout called too many times");
     }
 
     this._rpCalls++;
     let message = this.DOMIdentityMessage();
+
+    // Report and fail hard on any errors.
+    if (message.errors.length) {
+      this.reportErrors(message);
+      return;
+    }
+
     this._identityInternal._mm.sendAsyncMessage("Identity:RP:Logout", message);
   },
 
   /*
    * Get an assertion.  This function is deprecated.  RPs are
    * encouraged to use the observer API instead (watch + request).
    */
   get: function nsDOMIdentity_get(aCallback, aOptions) {
@@ -389,16 +436,17 @@ nsDOMIdentity.prototype = {
   _init: function nsDOMIdentity__init(aWindow) {
 
     this._initializeState();
 
     // Store window and origin URI.
     this._window = aWindow;
     this._origin = aWindow.document.nodePrincipal.origin;
     this._appStatus = aWindow.document.nodePrincipal.appStatus;
+    this._appId = aWindow.document.nodePrincipal.appId;
 
     // Setup identifiers for current window.
     let util = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                       .getInterface(Ci.nsIDOMWindowUtils);
 
     // We need to inherit the id from the internalIdentity service.
     // See comments below in that service's init.
     this._id = this._identityInternal._id;
@@ -542,35 +590,71 @@ nsDOMIdentity.prototype = {
       function nsDOMIdentity__callBeginAuthenticationCallback(message) {
     let identity = message.identity;
     this._beginAuthenticationCallback(identity);
   },
 
   /**
    * Helper to create messages to send using a message manager.
    * Pass through user options if they are not functions.  Always
-   * overwrite id and origin.  Caller does not get to set those.
+   * overwrite id, origin, audience, and appStatus.  The caller
+   * does not get to set those.
    */
   DOMIdentityMessage: function DOMIdentityMessage(aOptions) {
     aOptions = aOptions || {};
-    let message = {};
+    let message = {
+      errors: []
+    };
+    let principal = Ci.nsIPrincipal;
 
     objectCopy(aOptions, message);
 
     // outer window id
     message.id = this._id;
 
     // window origin
     message.origin = this._origin;
 
     // On b2g, an app's status can be NOT_INSTALLED, INSTALLED, PRIVILEGED, or
     // CERTIFIED.  Compare the appStatus value to the constants enumerated in
     // Ci.nsIPrincipal.APP_STATUS_*.
     message.appStatus = this._appStatus;
 
+    // Currently, we only permit certified and privileged apps to use
+    // Firefox Accounts.
+    if (this._appStatus !== principal.APP_STATUS_PRIVILEGED &&
+        this._appStatus !== principal.APP_STATUS_CERTIFIED) {
+      message.errors.push("ERROR_NOT_AUTHORIZED_FOR_FIREFOX_ACCOUNTS");
+    }
+
+    // Normally the window origin will be the audience in assertions.  On b2g,
+    // certified apps have the power to override this and declare any audience
+    // the want.  Privileged apps can also declare a different audience, as
+    // long as it is the same as the origin specified in their manifest files.
+    // All other apps are stuck with b2g origins of the form app://{guid}.
+    // Since such an origin is meaningless for the purposes of verification,
+    // they will have to jump through some hoops to sign in: Specifically, they
+    // will have to host their sign-in flows and DOM API requests in an iframe,
+    // have the iframe xhr post assertions up to their server for verification,
+    // and then post-message the results down to their app.
+    let _audience = message.origin;
+    if (message.audience && message.audience != message.origin) {
+      if (this._appStatus === principal.APP_STATUS_CERTIFIED) {
+        _audience = message.audience;
+        this._log("Certified app setting assertion audience: " + _audience);
+      } else {
+        message.errors.push("ERROR_INVALID_ASSERTION_AUDIENCE");
+      }
+    }
+
+    // Replace any audience supplied by the RP with one that has been sanitised
+    message.audience = _audience;
+
+    this._log("Generated message: " + JSON.stringify(message));
+
     return message;
   },
 
   uninit: function DOMIdentity_uninit() {
     this._log("nsDOMIdentity uninit()");
     this._identityInternal._mm.sendAsyncMessage(
       "Identity:RP:Unwatch",
       { id: this._id }
new file mode 100644
--- /dev/null
+++ b/dom/identity/tests/mochitest/chrome.ini
@@ -0,0 +1,6 @@
+[DEFAULT]
+
+support-files=
+  file_declareAudience.html
+
+[test_declareAudience.html]
new file mode 100644
--- /dev/null
+++ b/dom/identity/tests/mochitest/file_declareAudience.html
@@ -0,0 +1,51 @@
+<!--
+  * 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/. */
+ -->
+<!DOCTYPE html>
+<html>
+  <!--
+  Certified and packaged apps should be able to declare assertion audience.
+  https://bugzilla.mozilla.org/show_bug.cgi?id=947374
+  -->
+<head>
+  <meta charset="utf-8">
+  <title>Test app for bug 947374</title>
+</head>
+
+<body>
+    <div id='test'>
+<script type="application/javascript;version=1.8">
+
+  function postResults(message) {
+    window.realParent.postMessage(JSON.stringify(message), "*");
+  }
+
+  function onready() {
+    navigator.mozId.request();
+  }
+
+  function onlogin(backedAssertion) {
+    postResults({success: true, backedAssertion: backedAssertion});
+  }
+
+  function onerror(error) {
+    postResults({success: false, error: error});
+  }
+
+  onmessage = function(event) {
+    navigator.mozId.watch({
+      wantIssuer: "firefox-accounts",
+      audience: event.data.audience,
+      onready: onready,
+      onlogin: onlogin,
+      onerror: onerror,
+      onlogout: function() {},
+    });
+  };
+
+</script>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/identity/tests/mochitest/test_declareAudience.html
@@ -0,0 +1,270 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+  https://bugzilla.mozilla.org/show_bug.cgi?id=947374
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Certified apps can changed the default audience of an assertion -- Bug 947374</title>
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=947374">Mozilla Bug 947374</a>
+<p id="display"></p>
+<div id="content">
+
+</div>
+<pre id="test">
+<script type="application/javascript;version=1.8">
+
+SimpleTest.waitForExplicitFinish();
+
+Components.utils.import("resource://gre/modules/Promise.jsm");
+Components.utils.import("resource://gre/modules/Services.jsm");
+Components.utils.import("resource://gre/modules/identity/jwcrypto.jsm");
+Components.utils.import("resource://gre/modules/identity/FirefoxAccounts.jsm");
+
+// quick check to make sure we can test apps:
+is("appStatus" in document.nodePrincipal, true,
+   "appStatus should be present in nsIPrincipal, if not the rest of this test will fail");
+
+// Mock the Firefox Accounts manager to generate a keypair and provide a fake
+// cert for the caller on each getAssertion request.
+function MockFXAManager() {}
+
+MockFXAManager.prototype = {
+  getAssertion: function(audience) {
+    let deferred = Promise.defer();
+    jwcrypto.generateKeyPair("DS160", (err, kp) => {
+      if (err) {
+        return deferred.reject(err);
+      }
+      jwcrypto.generateAssertion("fake-cert", kp, audience, (err, assertion) => {
+        if (err) {
+          return deferred.reject(err);
+        }
+        return deferred.resolve(assertion);
+      });
+    });
+    return deferred.promise;
+  }
+};
+
+let originalManager = FirefoxAccounts.fxAccountsManager;
+FirefoxAccounts.fxAccountsManager = new MockFXAManager();
+
+// The manifests for these apps are all declared in
+// /testing/profiles/webapps_mochitest.json.  They are injected into the profile
+// by /testing/mochitest/runtests.py with the appropriate appStatus.  So we don't
+// have to manually install any apps.
+//
+// For each app, we will use the file_declareAudience.html content to populate an
+// iframe.  The iframe will request() a firefox accounts assertion.  It will then
+// postMessage the results of this experiment back down to us, and we will
+// compare it with the expected results.
+let apps = [
+  {
+    title: "an installed app, which should neither be able to use FxA, nor change audience",
+    manifest: "https://example.com/manifest.webapp",
+    appStatus: Components.interfaces.nsIPrincipal.APP_STATUS_INSTALLED,
+    origin: "https://example.com",
+    wantAudience: "https://i-cant-have-this.com",
+    uri: "https://example.com/chrome/dom/identity/tests/mochitest/file_declareAudience.html",
+    expected: {
+      success: false,
+      underprivileged: true,
+    },
+  },
+  {
+    title: "an app's assertion audience should be its origin by default",
+    manifest: "https://example.com/manifest_priv.webapp",
+    appStatus: Components.interfaces.nsIPrincipal.APP_STATUS_PRIVILEGED,
+    origin: "https://example.com",
+    uri: "https://example.com/chrome/dom/identity/tests/mochitest/file_declareAudience.html",
+    expected: {
+      success: true,
+      underprivileged: false,
+    },
+  },
+  {
+    title: "a privileged app, which may not have an audience other than its origin",
+    manifest: "https://example.com/manifest_priv.webapp",
+    appStatus: Components.interfaces.nsIPrincipal.APP_STATUS_PRIVILEGED,
+    origin: "https://example.com",
+    wantAudience: "https://i-like-pie.com",
+    uri: "https://example.com/chrome/dom/identity/tests/mochitest/file_declareAudience.html",
+    expected: {
+      success: false,
+      underprivileged: false,
+    },
+  },
+  {
+    title: "a privileged app, which may declare an audience the same as its origin",
+    manifest: "https://example.com/manifest_priv.webapp",
+    appStatus: Components.interfaces.nsIPrincipal.APP_STATUS_PRIVILEGED,
+    origin: "https://example.com",
+    wantAudience: "https://example.com",
+    uri: "https://example.com/chrome/dom/identity/tests/mochitest/file_declareAudience.html",
+    expected: {
+      success: true,
+    },
+  },
+  {
+    title: "a certified app, which may do whatever it damn well pleases",
+    manifest: "https://example.com/manifest_cert.webapp",
+    appStatus: Components.interfaces.nsIPrincipal.APP_STATUS_CERTIFIED,
+    origin: "https://example.com",
+    wantAudience: "https://whatever-i-want.com",
+    uri: "https://example.com/chrome/dom/identity/tests/mochitest/file_declareAudience.html",
+    expected: {
+      success: true,
+    },
+  },
+];
+
+let appIndex = 0;
+let expectedErrors = 0;
+let receivedErrors = [];
+let testRunner = runTest();
+
+// Successful tests will send exactly one message.  But for error tests, we may
+// have more than one message from the onerror handler in the client.  So we keep
+// track of received errors; once they reach the expected count, we are done.
+function receiveMessage(event) {
+  let result = JSON.parse(event.data);
+  let app = apps[appIndex];
+  let expected = app.expected;
+
+  is(result.success, expected.success,
+     "Assertion request " + (expected.success ? "succeeds" : "fails"));
+
+  if (expected.success) {
+    // Confirm that the assertion audience and origin are as expected
+    let components = extractAssertionComponents(result.backedAssertion);
+    is(components.payload.aud, app.wantAudience || app.origin,
+       "Got desired assertion audience");
+
+  } else {
+    receivedErrors.push(result.error);
+  }
+
+  if (receivedErrors.length === expectedErrors) {
+
+    if (expected.underprivileged) {
+      ok(receivedErrors.indexOf("ERROR_NOT_AUTHORIZED_FOR_FIREFOX_ACCOUNTS") > -1,
+         "Expect a complaint that this app cannot use FxA.");
+    }
+    if (!expected.success) {
+      ok(receivedErrors.indexOf("ERROR_INVALID_ASSERTION_AUDIENCE") > -1,
+         "Expect an error getting an assertion");
+    }
+
+    appIndex += 1;
+
+    if (appIndex === apps.length) {
+      window.removeEventListener("message", receiveMessage);
+
+      FirefoxAccounts.fxAccountsManager = originalManager;
+
+      SimpleTest.finish();
+      return;
+    }
+
+    testRunner.next();
+  }
+}
+
+window.addEventListener("message", receiveMessage, false, true);
+
+function runTest() {
+  for (let app of apps) {
+    dump("** Testing " + app.title + "\n");
+
+    // Set up state for message handler
+    expectedErrors = 0;
+    receivedErrors = [];
+    if (!app.expected.success) {
+      expectedErrors += 1;
+    }
+    if (app.expected.underprivileged) {
+      expectedErrors += 1;
+    }
+
+    let iframe = document.createElement("iframe");
+
+    iframe.setAttribute("mozapp", app.manifest);
+    iframe.setAttribute("mozbrowser", "true");
+    iframe.src = app.uri;
+
+    document.getElementById("content").appendChild(iframe);
+
+    iframe.addEventListener("load", function onLoad() {
+      iframe.removeEventListener("load", onLoad);
+
+      let principal = iframe.contentDocument.nodePrincipal;
+      is(principal.appStatus, app.appStatus,
+         "Iframe's document.nodePrincipal has expected appStatus");
+
+      // Because the <iframe mozapp> can't parent its way back to us, we
+      // provide this handle to our window so it can postMessage to us.
+      iframe.contentWindow.wrappedJSObject.realParent = window;
+
+      // Test what we want to test, viz. whether or not the app can request
+      // an assertion with an audience the same as or different from its
+      // origin.  The client will post back its success or failure in procuring
+      // an identity assertion from Firefox Accounts.
+      iframe.contentWindow.postMessage({audience: app.wantAudience}, "*");
+    }, false);
+
+    yield undefined;
+  }
+}
+
+function extractAssertionComponents(backedAssertion) {
+  let [_, signedObject] = backedAssertion.split("~");
+  let parts = signedObject.split(".");
+
+  let headerSegment = parts[0];
+  let payloadSegment = parts[1];
+  let cryptoSegment = parts[2];
+
+  let header = JSON.parse(base64UrlDecode(headerSegment));
+  let payload = JSON.parse(base64UrlDecode(payloadSegment));
+
+  return {header: header,
+          payload: payload,
+          headerSegment: headerSegment,
+          payloadSegment: payloadSegment,
+          cryptoSegment: cryptoSegment};
+};
+
+function base64UrlDecode(s) {
+  s = s.replace(/-/g, "+");
+  s = s.replace(/_/g, "/");
+  // Don't need to worry about reintroducing padding ('=='), since
+  // jwcrypto provides that.
+  return atob(s);
+}
+
+SpecialPowers.pushPrefEnv({"set":
+  [
+    ["dom.mozBrowserFramesEnabled", true],
+    ["dom.identity.enabled", true],
+    ["identity.fxaccounts.enabled", true],
+    ["toolkit.identity.debug", true],
+    ["dom.identity.syntheticEventsOk", true],
+
+    ["security.apps.privileged.CSP.default", ""],
+    ["security.apps.certified.CSP.default", ""],
+  ]},
+  function() {
+    testRunner.next();
+  }
+);
+
+
+</script>
+</pre>
+</body>
+</html>
--- a/dom/identity/tests/moz.build
+++ b/dom/identity/tests/moz.build
@@ -1,6 +1,8 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
+MOCHITEST_CHROME_MANIFESTS += ['mochitest/chrome.ini']
+
--- a/dom/imptests/editing/mochitest.ini
+++ b/dom/imptests/editing/mochitest.ini
@@ -5,18 +5,20 @@ support-files =
   css/reset.css
   implementation.js
   selecttest/common.js
   selecttest/test-iframe.html
   tests.js
 
 [conformancetest/test_event.html]
 [conformancetest/test_runtest.html]
+skip-if = toolkit == 'android'
 [selecttest/test_Document-open.html]
 [selecttest/test_addRange.html]
+skip-if = toolkit == 'android' #bug 775227
 [selecttest/test_collapse.html]
 [selecttest/test_collapseToStartEnd.html]
 [selecttest/test_deleteFromDocument.html]
 [selecttest/test_extend.html]
 [selecttest/test_getRangeAt.html]
 [selecttest/test_getSelection.html]
 [selecttest/test_interfaces.html]
 [selecttest/test_isCollapsed.html]
--- a/dom/imptests/html/mochitest.ini
+++ b/dom/imptests/html/mochitest.ini
@@ -266,13 +266,19 @@ skip-if = true # bug 859075
 [js/builtins/test_Array.prototype.join-order.html]
 [js/builtins/test_Math.max.html]
 [js/builtins/test_Math.min.html]
 [js/builtins/test_Object.prototype.hasOwnProperty-order.html]
 [js/builtins/test_WeakMap.prototype-properties.html]
 [microdata/microdata-dom-api/test_001.html]
 [typedarrays/test_constructors.html]
 [webgl/test_bufferSubData.html]
+skip-if = toolkit == 'android' #WebGL
 [webgl/test_compressedTexImage2D.html]
+skip-if = toolkit == 'android' #WebGL
 [webgl/test_compressedTexSubImage2D.html]
+skip-if = toolkit == 'android' #WebGL
 [webgl/test_texImage2D.html]
+skip-if = toolkit == 'android' #WebGL
 [webgl/test_texSubImage2D.html]
+skip-if = toolkit == 'android' #WebGL
 [webgl/test_uniformMatrixNfv.html]
+skip-if = toolkit == 'android' #WebGL
--- a/dom/imptests/webapps/mochitest.ini
+++ b/dom/imptests/webapps/mochitest.ini
@@ -22,16 +22,17 @@ support-files =
 [WebStorage/tests/submissions/Infraware/test_event_session_newvalue.html]
 [WebStorage/tests/submissions/Infraware/test_event_session_oldvalue.html]
 [WebStorage/tests/submissions/Infraware/test_event_session_storagearea.html]
 [WebStorage/tests/submissions/Infraware/test_event_session_storageeventinit.html]
 [WebStorage/tests/submissions/Infraware/test_event_session_url.html]
 [WebStorage/tests/submissions/Infraware/test_storage_local_clear.html]
 [WebStorage/tests/submissions/Infraware/test_storage_local_getitem.html]
 [WebStorage/tests/submissions/Infraware/test_storage_local_key.html]
+skip-if = toolkit == 'android' #bug 775227
 [WebStorage/tests/submissions/Infraware/test_storage_local_length.html]
 [WebStorage/tests/submissions/Infraware/test_storage_local_removeitem.html]
 [WebStorage/tests/submissions/Infraware/test_storage_local_security.html]
 [WebStorage/tests/submissions/Infraware/test_storage_local_setitem.html]
 [WebStorage/tests/submissions/Infraware/test_storage_session_clear.html]
 [WebStorage/tests/submissions/Infraware/test_storage_session_getitem.html]
 [WebStorage/tests/submissions/Infraware/test_storage_session_key.html]
 [WebStorage/tests/submissions/Infraware/test_storage_session_length.html]
--- a/dom/inputmethod/mochitest/mochitest.ini
+++ b/dom/inputmethod/mochitest/mochitest.ini
@@ -1,9 +1,10 @@
 [DEFAULT]
+skip-if = toolkit == 'android' #Not supported on Android
 support-files =
   inputmethod_common.js
   file_inputmethod.html
   file_test_app.html
   file_test_sendkey_cancel.html
 
 [test_basic.html]
 [test_bug944397.html]
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -667,17 +667,18 @@ CairoImage::GetTextureClient(Compositabl
   if (textureClient) {
     return textureClient;
   }
 
   RefPtr<SourceSurface> surface = GetAsSourceSurface();
   MOZ_ASSERT(surface);
 
   textureClient = aClient->CreateTextureClientForDrawing(surface->GetFormat(),
-                                                         TEXTURE_FLAGS_DEFAULT);
+                                                         TEXTURE_FLAGS_DEFAULT,
+                                                         surface->GetSize());
   MOZ_ASSERT(textureClient->AsTextureClientDrawTarget());
   if (!textureClient->AsTextureClientDrawTarget()->AllocateForSurface(surface->GetSize()) ||
       !textureClient->Lock(OPEN_WRITE_ONLY)) {
     return nullptr;
   }
 
   {
     // We must not keep a reference to the DrawTarget after it has been unlocked.
--- a/gfx/layers/client/CompositableClient.cpp
+++ b/gfx/layers/client/CompositableClient.cpp
@@ -172,20 +172,22 @@ CompositableClient::CreateBufferTextureC
                                               TextureFlags aTextureFlags)
 {
   return TextureClient::CreateBufferTextureClient(GetForwarder(), aFormat,
                                                   aTextureFlags | mTextureFlags);
 }
 
 TemporaryRef<TextureClient>
 CompositableClient::CreateTextureClientForDrawing(SurfaceFormat aFormat,
-                                                  TextureFlags aTextureFlags)
+                                                  TextureFlags aTextureFlags,
+                                                  const IntSize& aSizeHint)
 {
   return TextureClient::CreateTextureClientForDrawing(GetForwarder(), aFormat,
-                                                      aTextureFlags | mTextureFlags);
+                                                      aTextureFlags | mTextureFlags,
+                                                      aSizeHint);
 }
 
 bool
 CompositableClient::AddTextureClient(TextureClient* aClient)
 {
   return aClient->InitIPDLActor(mForwarder);
 }
 
--- a/gfx/layers/client/CompositableClient.h
+++ b/gfx/layers/client/CompositableClient.h
@@ -88,17 +88,18 @@ public:
   TemporaryRef<BufferTextureClient>
   CreateBufferTextureClient(gfx::SurfaceFormat aFormat,
                             TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
 
   // If we return a non-null TextureClient, then AsTextureClientDrawTarget will
   // always be non-null.
   TemporaryRef<TextureClient>
   CreateTextureClientForDrawing(gfx::SurfaceFormat aFormat,
-                                TextureFlags aTextureFlags);
+                                TextureFlags aTextureFlags,
+                                const gfx::IntSize& aSizeHint);
 
   virtual void SetDescriptorFromReply(TextureIdentifier aTextureId,
                                       const SurfaceDescriptor& aDescriptor)
   {
     MOZ_CRASH("If you want to call this, you should have implemented it");
   }
 
   /**
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -164,24 +164,26 @@ ContentClientRemoteBuffer::EndPaint()
   }
 }
 
 bool
 ContentClientRemoteBuffer::CreateAndAllocateTextureClient(RefPtr<TextureClient>& aClient,
                                                           TextureFlags aFlags)
 {
   aClient = CreateTextureClientForDrawing(mSurfaceFormat,
-                                          mTextureInfo.mTextureFlags | aFlags);
+                                          mTextureInfo.mTextureFlags | aFlags,
+                                          mSize);
   if (!aClient) {
     return false;
   }
 
   if (!aClient->AsTextureClientDrawTarget()->AllocateForSurface(mSize, ALLOC_CLEAR_BUFFER)) {
     aClient = CreateTextureClientForDrawing(mSurfaceFormat,
-                mTextureInfo.mTextureFlags | TEXTURE_ALLOC_FALLBACK | aFlags);
+                mTextureInfo.mTextureFlags | TEXTURE_ALLOC_FALLBACK | aFlags,
+                mSize);
     if (!aClient) {
       return false;
     }
     if (!aClient->AsTextureClientDrawTarget()->AllocateForSurface(mSize, ALLOC_CLEAR_BUFFER)) {
       NS_WARNING("Could not allocate texture client");
       aClient = nullptr;
       return false;
     }
--- a/gfx/layers/client/ImageClient.cpp
+++ b/gfx/layers/client/ImageClient.cpp
@@ -235,17 +235,17 @@ ImageClientSingle::UpdateImageInternal(I
       mFrontBuffer = nullptr;
     }
 
     bool bufferCreated = false;
     if (!mFrontBuffer) {
       gfxImageFormat format
         = gfxPlatform::GetPlatform()->OptimalFormatForContent(gfx::ContentForFormat(surface->GetFormat()));
       mFrontBuffer = CreateTextureClientForDrawing(gfx::ImageFormatToSurfaceFormat(format),
-                                                   mTextureFlags);
+                                                   mTextureFlags, size);
       MOZ_ASSERT(mFrontBuffer->AsTextureClientDrawTarget());
       if (!mFrontBuffer->AsTextureClientDrawTarget()->AllocateForSurface(size)) {
         mFrontBuffer = nullptr;
         return false;
       }
 
       bufferCreated = true;
     }
--- a/gfx/layers/client/SimpleTextureClientPool.cpp
+++ b/gfx/layers/client/SimpleTextureClientPool.cpp
@@ -67,17 +67,17 @@ SimpleTextureClientPool::GetTextureClien
     mAvailableTextureClients.pop();
     RECYCLE_LOG("%s Skip allocate (%i left), returning %p\n", (mFormat == SurfaceFormat::B8G8R8A8?"poolA":"poolX"), mAvailableTextureClients.size(), textureClient.get());
 
   } else {
     // No unused clients in the pool, create one
     if (gfxPrefs::ForceShmemTiles()) {
       textureClient = TextureClient::CreateBufferTextureClient(mSurfaceAllocator, mFormat, TEXTURE_IMMEDIATE_UPLOAD | TEXTURE_RECYCLE);
     } else {
-      textureClient = TextureClient::CreateTextureClientForDrawing(mSurfaceAllocator, mFormat, TEXTURE_FLAGS_DEFAULT | TEXTURE_RECYCLE);
+      textureClient = TextureClient::CreateTextureClientForDrawing(mSurfaceAllocator, mFormat, TEXTURE_FLAGS_DEFAULT | TEXTURE_RECYCLE, mSize);
     }
     if (!textureClient->AsTextureClientDrawTarget()->AllocateForSurface(mSize, ALLOC_DEFAULT)) {
       NS_WARNING("TextureClient::AllocateForSurface failed!");
     }
     RECYCLE_LOG("%s Must allocate (0 left), returning %p\n", (mFormat == SurfaceFormat::B8G8R8A8?"poolA":"poolX"), textureClient.get());
   }
 
   if (aAutoRecycle) {
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -273,17 +273,18 @@ DisableGralloc(SurfaceFormat aFormat)
 #endif
 }
 #endif
 
 // static
 TemporaryRef<TextureClient>
 TextureClient::CreateTextureClientForDrawing(ISurfaceAllocator* aAllocator,
                                              SurfaceFormat aFormat,
-                                             TextureFlags aTextureFlags)
+                                             TextureFlags aTextureFlags,
+                                             const gfx::IntSize& aSizeHint)
 {
   RefPtr<TextureClient> result;
 
 #ifdef XP_WIN
   LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
   if (parentBackend == LayersBackend::LAYERS_D3D11 && gfxWindowsPlatform::GetPlatform()->GetD2DDevice() &&
       !(aTextureFlags & TEXTURE_ALLOC_FALLBACK)) {
     result = new TextureClientD3D11(aFormat, aTextureFlags);
@@ -322,17 +323,22 @@ TextureClient::CreateTextureClientForDra
     result = new TextureClientX11(aFormat, aTextureFlags);
   }
 #endif
 #endif
 #endif
 
 #ifdef MOZ_WIDGET_GONK
   if (!DisableGralloc(aFormat)) {
-    result = new GrallocTextureClientOGL(aAllocator, aFormat, aTextureFlags);
+    // Don't allow Gralloc texture clients to exceed the maximum texture size.
+    // BufferTextureClients have code to handle tiling the surface client-side.
+    int32_t maxTextureSize = aAllocator->GetMaxTextureSize();
+    if (aSizeHint.width <= maxTextureSize && aSizeHint.height <= maxTextureSize) {
+      result = new GrallocTextureClientOGL(aAllocator, aFormat, aTextureFlags);
+    }
   }
 #endif
 
   // Can't do any better than a buffer texture client.
   if (!result) {
     result = CreateBufferTextureClient(aAllocator, aFormat, aTextureFlags);
   }
 
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -202,17 +202,18 @@ public:
   static TemporaryRef<BufferTextureClient>
   CreateBufferTextureClient(ISurfaceAllocator* aAllocator,
                             gfx::SurfaceFormat aFormat,
                             TextureFlags aTextureFlags);
 
   static TemporaryRef<TextureClient>
   CreateTextureClientForDrawing(ISurfaceAllocator* aAllocator,
                                 gfx::SurfaceFormat aFormat,
-                                TextureFlags aTextureFlags);
+                                TextureFlags aTextureFlags,
+                                const gfx::IntSize& aSizeHint);
 
   virtual TextureClientSurface* AsTextureClientSurface() { return nullptr; }
   virtual TextureClientDrawTarget* AsTextureClientDrawTarget() { return nullptr; }
   virtual TextureClientYCbCr* AsTextureClientYCbCr() { return nullptr; }
 
   /**
    * Locks the shared data, allowing the caller to get access to it.
    *
--- a/gfx/layers/client/TextureClientPool.cpp
+++ b/gfx/layers/client/TextureClientPool.cpp
@@ -46,17 +46,17 @@ TextureClientPool::GetTextureClient()
   // We're increasing the number of outstanding TextureClients without reusing a
   // client, we may need to free a deferred-return TextureClient.
   ShrinkToMaximumSize();
 
   // No unused clients in the pool, create one
   if (gfxPrefs::ForceShmemTiles()) {
     textureClient = TextureClient::CreateBufferTextureClient(mSurfaceAllocator, mFormat, TEXTURE_IMMEDIATE_UPLOAD);
   } else {
-    textureClient = TextureClient::CreateTextureClientForDrawing(mSurfaceAllocator, mFormat, TEXTURE_IMMEDIATE_UPLOAD);
+    textureClient = TextureClient::CreateTextureClientForDrawing(mSurfaceAllocator, mFormat, TEXTURE_IMMEDIATE_UPLOAD, mSize);
   }
   textureClient->AsTextureClientDrawTarget()->AllocateForSurface(mSize, ALLOC_DEFAULT);
 
   return textureClient;
 }
 
 void
 TextureClientPool::ReturnTextureClient(TextureClient *aClient)
--- a/gfx/layers/ipc/CompositableForwarder.h
+++ b/gfx/layers/ipc/CompositableForwarder.h
@@ -208,20 +208,20 @@ public:
    * it can react accordingly (upload textures, etc.).
    */
   virtual void UpdatedTexture(CompositableClient* aCompositable,
                               TextureClient* aTexture,
                               nsIntRegion* aRegion) = 0;
 
   void IdentifyTextureHost(const TextureFactoryIdentifier& aIdentifier);
 
-  /**
-   * Returns the maximum texture size supported by the compositor.
-   */
-  virtual int32_t GetMaxTextureSize() const { return mTextureFactoryIdentifier.mMaxTextureSize; }
+  virtual int32_t GetMaxTextureSize() const MOZ_OVERRIDE
+  {
+    return mTextureFactoryIdentifier.mMaxTextureSize;
+  }
 
   bool IsOnCompositorSide() const MOZ_OVERRIDE { return false; }
 
   /**
    * Returns the type of backend that is used off the main thread.
    * We only don't allow changing the backend type at runtime so this value can
    * be queried once and will not change until Gecko is restarted.
    */
--- a/gfx/layers/ipc/ISurfaceAllocator.h
+++ b/gfx/layers/ipc/ISurfaceAllocator.h
@@ -120,16 +120,21 @@ public:
                                       SurfaceDescriptor* aBuffer);
 
   // was AllocBufferWithCaps
   virtual bool AllocSurfaceDescriptorWithCaps(const gfx::IntSize& aSize,
                                               gfxContentType aContent,
                                               uint32_t aCaps,
                                               SurfaceDescriptor* aBuffer);
 
+  /**
+   * Returns the maximum texture size supported by the compositor.
+   */
+  virtual int32_t GetMaxTextureSize() const { return INT32_MAX; }
+
   virtual void DestroySharedSurface(SurfaceDescriptor* aSurface);
 
   // method that does the actual allocation work
   virtual PGrallocBufferChild* AllocGrallocBuffer(const gfx::IntSize& aSize,
                                                   uint32_t aFormat,
                                                   uint32_t aUsage,
                                                   MaybeMagicGrallocBufferHandle* aHandle)
   {
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -921,29 +921,26 @@ js_fun_call(JSContext *cx, unsigned argc
     CallArgs args = CallArgsFromVp(argc, vp);
 
     HandleValue fval = args.thisv();
     if (!js_IsCallable(fval)) {
         ReportIncompatibleMethod(cx, args, &JSFunction::class_);
         return false;
     }
 
-    InvokeArgs args2(cx);
-    if (!args2.init(args.length() ? args.length() - 1 : 0))
-        return false;
+    args.setCallee(fval);
+    args.setThis(args.get(0));
 
-    args2.setCallee(fval);
-    args2.setThis(args.get(0));
-    PodCopy(args2.array(), args.array() + 1, args2.length());
+    if (args.length() > 0) {
+        for (size_t i = 0; i < args.length() - 1; i++)
+            args[i].set(args[i + 1]);
+        args = CallArgsFromVp(args.length() - 1, vp);
+    }
 
-    if (!Invoke(cx, args2))
-        return false;
-
-    args.rval().set(args2.rval());
-    return true;
+    return Invoke(cx, args);
 }
 
 // ES5 15.3.4.3
 bool
 js_fun_apply(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
--- a/layout/generic/test/mochitest.ini
+++ b/layout/generic/test/mochitest.ini
@@ -1,9 +1,10 @@
 [DEFAULT]
+skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM, ONLY IN CHUNK 10
 support-files =
   ../../reftests/backgrounds/blue-32x32.png
   ../../reftests/backgrounds/fuchsia-32x32.png
   ../../base/tests/enableTestPlugin.js
   plugin_clipping_helper.xhtml
   plugin_clipping_helper2.xhtml
   plugin_clipping_helper_transformed.xhtml
   plugin_clipping_helper_table.xhtml
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1,11 +1,10 @@
 # Please keep this list sorted by bug number (but feel free to use a
 # logical order for the tests for each bug).
-
 == 105-1.html 105-1-ref.html
 == 647-1.html 647-1-ref.html
 == 9458-basic-1.html 9458-basic-1-ref.html
 == 9458-valign-1.html 9458-valign-1-ref.html
 == 9458-valign-2.html 9458-valign-2-ref.html
 == 9458-height-1.html 9458-height-1-ref.html
 == 9458-height-2.html 9458-height-2-ref.html
 == 9458-width-1a.html 9458-width-1-ref.html
@@ -161,30 +160,30 @@ skip-if(B2G) == 192767-06.xul 192767-16.
 skip-if(B2G) == 192767-07.xul 192767-17.xul
 skip-if(B2G) == 192767-21.xul 192767-31.xul
 skip-if(B2G) == 192767-22.xul 192767-32.xul
 skip-if(B2G) == 192767-23.xul 192767-33.xul
 skip-if(B2G) == 192767-24.xul 192767-34.xul
 skip-if(B2G) == 192767-25.xul 192767-35.xul
 skip-if(B2G) == 192767-26.xul 192767-36.xul
 skip-if(B2G) == 192767-27.xul 192767-37.xul
-!= 192767-01.xul 192767-21.xul
-!= 192767-02.xul 192767-22.xul
-skip-if(B2G) fails-if(Android) != 192767-03.xul 192767-23.xul
-!= 192767-04.xul 192767-24.xul
-!= 192767-05.xul 192767-25.xul
-skip-if(B2G) fails-if(Android) != 192767-06.xul 192767-26.xul
-skip-if(B2G) fails-if(Android) != 192767-07.xul 192767-27.xul
-!= 192767-11.xul 192767-31.xul
-!= 192767-12.xul 192767-32.xul
-skip-if(B2G) fails-if(Android) != 192767-13.xul 192767-33.xul
-!= 192767-14.xul 192767-34.xul
-!= 192767-15.xul 192767-35.xul
-skip-if(B2G) fails-if(Android) != 192767-16.xul 192767-36.xul
-skip-if(B2G) fails-if(Android) != 192767-17.xul 192767-37.xul
+skip-if(B2G&&browserIsRemote) != 192767-01.xul 192767-21.xul # bug 974780
+skip-if(B2G&&browserIsRemote) != 192767-02.xul 192767-22.xul # bug 974780
+fails-if(Android) skip-if(B2G) != 192767-03.xul 192767-23.xul
+skip-if(B2G&&browserIsRemote) != 192767-04.xul 192767-24.xul # bug 974780
+skip-if(B2G&&browserIsRemote) != 192767-05.xul 192767-25.xul # bug 974780
+fails-if(Android) skip-if(B2G) != 192767-06.xul 192767-26.xul
+fails-if(Android) skip-if(B2G) != 192767-07.xul 192767-27.xul
+skip-if(B2G&&browserIsRemote) != 192767-11.xul 192767-31.xul # bug 974780
+skip-if(B2G&&browserIsRemote) != 192767-12.xul 192767-32.xul # bug 974780
+fails-if(Android) skip-if(B2G) != 192767-13.xul 192767-33.xul
+skip-if(B2G&&browserIsRemote) != 192767-14.xul 192767-34.xul # bug 974780
+skip-if(B2G&&browserIsRemote) != 192767-15.xul 192767-35.xul # bug 974780
+fails-if(Android) skip-if(B2G) != 192767-16.xul 192767-36.xul
+fails-if(Android) skip-if(B2G) != 192767-17.xul 192767-37.xul
 != 200774-1.html about:blank
 == 201215-1.html 201215-1-ref.html
 == 201293-1a.html 201293-1-ref.html
 == 201293-1b.html 201293-1-ref.html
 == 201293-1c.html 201293-1-ref.html
 == 201293-1d.html 201293-1-ref.html
 == 203727.html 203727-ref.html
 == 206516-1.html 206516-1-ref.html
@@ -196,24 +195,24 @@ skip-if(B2G) fails-if(Android) != 192767
 == 210876-1.html 210876-1-ref.html
 == 211931-1.html 211931-1-ref.html
 == 212563-1.html 212563-1-ref.html
 == 212563-2.html 212563-2-ref.html
 == 213834-1.html 213834-1-ref.html
 == 214077-1a.html 214077-1-ref.html
 == 214077-1b.html 214077-1-ref.html
 == 218473-1.html 218473-1-ref.html
-== 220165-1.svg 220165-1-ref.svg
+skip-if(B2G&&browserIsRemote) == 220165-1.svg 220165-1-ref.svg # bug 974780
 == 223809-1.html 223809-1-ref.html
 == 228856-1.html 228856-1-ref.html
 == 228856-2.html 228856-2-ref.html
 == 229591-1.html 229591-1-ref.html
 # == 231823-1.html 231823-1-ref.html
 == 232990-1a.xhtml 232990-1-ref.xhtml
-== 232990-1b.xhtml 232990-1-ref.xhtml
+skip-if(B2G&&browserIsRemote) == 232990-1b.xhtml 232990-1-ref.xhtml
 == 233094-1.html 233094-1-ref.html
 == 233094-2a.html 233094-2-ref.html
 == 233094-2b.html 233094-2-ref.html
 == 233094-2c.html 233094-2-ref.html
 == 234686-1.html 234686-ref.html
 == 234686-2.html 234686-ref.html
 == 234686-3.html 234686-ref.html
 == 234686-4.html 234686-ref.html
@@ -269,55 +268,55 @@ skip-if(B2G) == 243519-7.html 243519-7-r
 == 244932-1.html 244932-1-ref.html
 == 246669-1.html 246669-1-ref.html
 skip-if(B2G) == 249141.xul 249141-ref.xul
 == 249982-1.html 249982-1-ref.html
 == 252920-1.html 252920-1-ref.html
 == 253701-1.html 253701-1-ref.html
 == 255820-1.html 255820-1-ref.html
 == 260406-1.html 260406-1-ref.html
-== 261826-1.xul 261826-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 261826-1.xul 261826-1-ref.xul # bug 974780
 == 262151-1.html 262151-1-ref.html
 == 262998-1.html 262998-1-ref.html
 == 267353-1.html 267353-1-ref.html
 == 269908-1.html 269908-1-ref.html
 == 269908-2.html 269908-2-ref.html
 == 269908-3.html 269908-3-ref.html
 == 269908-4.html 269908-4-ref.html
 == 269908-5.html 269908-5-ref.html
 == 271747-1a.html 271747-1-ref.html
 == 271747-1b.html 271747-1-ref.html
-== 272646-1.xul 272646-1-ref.xul
-== 272646-2a.xul 272646-2-ref.xul
-== 272646-2b.xul 272646-2-ref.xul
-== 272646-2c.xul 272646-2-ref.xul
+skip-if(B2G&&browserIsRemote) == 272646-1.xul 272646-1-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 272646-2a.xul 272646-2-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 272646-2b.xul 272646-2-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 272646-2c.xul 272646-2-ref.xul # bug 974780
 skip-if(B2G) == 273681-1.html 273681-1-ref.html
 == 278266-1a.html 278266-1-ref.html
 == 278266-1b.html 278266-1-ref.html
 == 280708-1a.html 280708-1-ref.html
 == 280708-1b.html 280708-1-ref.html
 == 281241-1.html 281241-1-ref.html
 == 281241-2.xhtml 281241-1-ref.html
 == 283686-1.html about:blank
 == 283686-2.html 283686-2-ref.html
 == 283686-3.html about:blank
 == 289384-1.xhtml 289384-ref.xhtml
-random-if(d2d) fuzzy-if(Android&&AndroidVersion>=15,8,1439) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the d2d failures
+random-if(d2d) fuzzy-if(Android&&AndroidVersion>=15,8,1439) skip-if(B2G&&browserIsRemote) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the d2d failures
 == 290129-1.html 290129-1-ref.html
 skip-if(B2G) == 291078-1.html 291078-1-ref.html
 == 291078-2.html 291078-2-ref.html
 == 291262-1.html 291262-1-ref.html
 == 294306-1.html 294306-1a-ref.html
 != 294306-1.html 294306-1b-ref.html
 == 296361-1.html 296361-ref.html
 == 296904-1.html 296904-1-ref.html
 skip-if(B2G) == 299136-1.html 299136-1-ref.html
 == 299837-1.html 299837-1-ref.html
-== 299837-2.xul 299837-2-ref.xul
-random-if(d2d) == 299837-3.xul 299837-3-ref.xul # bug 587631
+skip-if(B2G&&browserIsRemote) == 299837-2.xul 299837-2-ref.xul # bug 974780
+random-if(d2d) skip-if(B2G&&browserIsRemote) == 299837-3.xul 299837-3-ref.xul # bug 587631, 974780
 == 300691-1a.html 300691-1-ref.html
 == 300691-1b.html 300691-1-ref.html
 == 300691-1c.html 300691-1-ref.html
 == 300691-1d.html 300691-1-ref.html
 == 300691-1e.html 300691-1-ref.html
 == 300691-1f.html 300691-1-ref.html
 skip-if(B2G) == 301726-1.html 301726-1-ref.html
 skip-if(B2G) fails-if(Android) != 301726-2.html 301726-2-ref.html
@@ -329,17 +328,17 @@ skip-if(B2G) fails-if(Android) != 301726
 skip-if(B2G) == 307076-1.html 307076-1-ref.html
 == 307102-1.html 307102-1-ref.html
 == 307102-2.html 307102-2-ref.html
 == 307102-3.html 307102-3-ref.html
 == 307102-4.html 307102-4-ref.html
 == 308406-1.html 308406-1-ref.html
 == 308406-2.html 308406-2-ref.html
 == 309550-1.html 309550-1-ref.html
-== 309914-1.xul 309914-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 309914-1.xul 309914-1-ref.xul # bug 974780
 == 311366-unknown-inline-1.html 311366-unknown-inline-1-ref.html
 == 311366-unknown-block-1.html 311366-unknown-block-1-ref.html
 == 311366-unknown-block-3.html 311366-unknown-block-3-ref.html
 == 311366-unknown-block-2.html 311366-unknown-block-2-ref.html
 == 311366-unknown-inline-2.html 311366-unknown-inline-2-ref.html
 == 311822-1.html 311822-1-ref-a.html
 == 311822-1.html 311822-1-ref-b.html
 == 315620-1a.html 315620-1-ref.html
@@ -402,20 +401,20 @@ skip-if(B2G) == 307076-1.html 307076-1-r
 == 315920-28c.html 315920-28-ref.html
 == 315920-29a.html 315920-29-ref.html
 == 315920-29b.html 315920-29-ref.html
 == 315920-30.html 315920-30-ref.html
 == 316057-1.html 316057-1-ref.html
 == 320979-1.html 320979-1-ref.html
 != 321402-1.html about:blank
 != 321402-2.html about:blank
-== 321402-3.xul 321402-3-ref.xul
-== 321402-4.xul 321402-4-ref.xul
-== 321402-5.xul 321402-5-ref.xul
-== 321402-6.xul 321402-6-ref.xul
+skip-if(B2G&&browserIsRemote) == 321402-3.xul 321402-3-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 321402-4.xul 321402-4-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 321402-5.xul 321402-5-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 321402-6.xul 321402-6-ref.xul # bug 974780
 == 321738-1.html 321738-1-ref.html
 == 322436-1.html 322436-1-ref.html
 == 322461-1.xml 322461-1-ref.html
 == 323656-1.html 323656-1-ref.html
 == 323656-2.html 323656-2-ref.html
 == 323656-3.html 323656-3-ref.html
 == 323656-4.html 323656-4-ref.html
 == 323656-5.svg 323656-5-ref.svg
@@ -432,42 +431,42 @@ skip-if(B2G) == 331809-1.html 331809-1-r
 == 332360-width.html 332360-ref.html
 == 332360-width-ltr.html 332360-ltr-ref.html
 skip-if(B2G) == 332557-1.html 332557-1-ref.html
 == 332975-1.html 332975-1-ref.html
 == 333970-1.html 333970-1-ref.html
 == 334829-1a.xhtml 334829-1-ref.xhtml
 == 334829-1b.xhtml 334829-1-ref.xhtml
 == 335628-1.html 335628-1-ref.html
-!= 335628-2.xul 335628-2-ref.xul
-== 336096-1.xul 336096-1-ref.xul
+skip-if(B2G&&browserIsRemote) != 335628-2.xul 335628-2-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 336096-1.xul 336096-1-ref.xul # bug 974780
 == 336147-1.html 336147-1-ref.html
 skip-if(B2G) == 336153-1.html 336153-1-ref.html
 != 338251-p.html about:blank
 == 338251-p-oh.html 338251-p-oh-ref.html
 != 338251-pre.html about:blank
 == 338251-pre-oh.html 338251-pre-oh-ref.html
 == 339289-1.html 339289-1-ref.html
 == 341043-1a.html 341043-1-ref.html
 != 341043-1b.html 341043-1-ref.html
 == 343538-1.html 343538-1-ref.html
 == 343540-1.html 343540-1-ref.html
 == 345267-1a.html 345267-1-ref.html
 == 345267-1b.html 345267-1-ref.html
 == 345267-1c.html 345267-1-ref.html
 == 345267-1d.html 345267-1-ref.html
 != 345563-sub.xhtml 345563-sup.xhtml
-== 346189-1.xul 346189-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 346189-1.xul 346189-1-ref.xul # bug 974780
 == 346774-1a.html 346774-1-ref.html
 == 346774-1b.html 346774-1-ref.html
 == 346774-1c.html 346774-1-ref.html
 == 347348-1.xhtml 347348-1-ref.xhtml
 == 347496-1.xhtml 347496-1-ref.xhtml
 == 347912-1.html 347912-1-ref.html
-== 348049-1.xhtml 348049-1-ref.xhtml
+skip-if(B2G&&browserIsRemote) == 348049-1.xhtml 348049-1-ref.xhtml
 == 348516-1.html 348516-1-ref.html
 == 348516-2.html 348516-2-ref.html
 != 348516-2.html 348516-2-notref.html
 != 348516-3.html 348516-3-notref.html
 == 348597-1.html 348597-ref.html
 == 348809-1a.html 348809-1-ref.html
 == 348809-1b.html 348809-1-ref.html
 == 348809-1c.html 348809-1-ref.html
@@ -561,18 +560,18 @@ fuzzy-if(OSX==10.8,45,2) == 363858-6a.ht
 == 364066-1.html 364066-1-ref.html
 == 364079-1.html 364079-1-ref.html
 == 364318-1.xhtml 364318-1-ref.xhtml
 == 364861-1.html 364861-1-ref.html
 skip-if(B2G) == 364862-1.html 364862-1-ref.html
 skip-if(B2G) == 364968-1.xul 364968-1-ref.html
 == 364989-1.html 364989-1-ref.html
 == 365173-1.html 365173-1-ref.html
-== 366207-1.xul 366207-1-ref.xul
-== 366616-1.xul 366616-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 366207-1.xul 366207-1-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 366616-1.xul 366616-1-ref.xul # bug 974780
 == 367220-1.html 367220-1-ref.html
 == 367247-s-visible.html 367247-s-hidden.html
 == 367247-s-hidden.html 367247-s-auto.html
 skip-if(B2G) fails-if(Android) != 367247-s-auto.html 367247-s-scroll.html
 != 367247-l-visible.html 367247-l-hidden.html
 skip-if(B2G) fails-if(Android) != 367247-l-hidden.html 367247-l-scroll.html
 skip-if(B2G) == 367247-l-scroll.html 367247-l-auto.html
 == 367332-1a.html 367332-1-ref.html
@@ -611,17 +610,17 @@ asserts(4) == 368155-negative-margins-1.
 == 368504-3b.html 368504-3-ref.html
 == 368504-4.html 368504-4-ref.html
 == 368504-5.html 368504-5-ref.html
 == 368504-6.html 368504-6-ref.html
 == 368622-1.html 368622-1-ref.html
 == 368651-1.html 368651-1-ref.html
 == 369361-1.html 369361-1-ref.html
 == 369361-2.html 369361-2-ref.html
-== 369882.xul 369882-ref.xul
+skip-if(B2G&&browserIsRemote) == 369882.xul 369882-ref.xul # bug 974780
 == 369975-1.html 369975-1.html
 == 370353-1.html 370353-1-ref.html
 == 370422-1.html 370422-1-ref.html
 == 370525-1.html 370525-1-ref.html
 != 370525-1.html 370525-1-notref.html
 == 370525-2.html 370525-2-ref.html
 != 370525-2.html 370525-2-notref.html
 == 370525-rowspan-1a.html 370525-rowspan-1a-ref.html
@@ -636,17 +635,17 @@ asserts(4) == 368155-negative-margins-1.
 == 370629-1.html 370629-1-ref.html
 skip-if(B2G) == 370629-2.html 370629-2-ref.html
 == 370692-1.xhtml 370692-1-ref.xhtml
 == 371041-1.html 371041-1-ref.html
 == 371043-1.html 371043-1-ref.html
 == 371354-1.html 371354-1-ref.html
 == 371483-1.html about:blank # assertion test
 fails-if(Android) == 371561-1.html 371561-1-ref.html
-!= 371681-1.xhtml about:blank
+skip-if(B2G&&browserIsRemote) != 371681-1.xhtml about:blank # bug 974780
 == 371925-1a.html 371925-1-ref.html
 == 371925-1b.html 371925-1-ref.html
 skip-if(B2G) == 372037-1.html 372037-1-ref.html
 == 372062-1.html 372062-1-ref.html
 == 372063-1.html 372063-1-ref.html
 == 372323-1.xhtml 372323-1-ref.xhtml
 == 372553-1.html 372553-1-ref.html
 == 372632-1.html 372632-1-ref.html
@@ -654,22 +653,22 @@ skip-if(B2G) == 372037-1.html 372037-1-r
 == 373295-1.html 373295-1-ref.html
 == 373298-1.html 373298-1-ref.html
 skip-if(B2G) fails-if(Android) == 373381-1.html 373381-1-ref.html
 skip-if(B2G) fails-if(Android) == 373381-2.html 373381-2-ref.html
 skip-if(B2G) fails-if(Android) random-if(d2d) == 373381-3.html 373381-3-ref.html
 skip-if(B2G) fails-if(Android) == 373381-4.html 373381-4-ref.html
 == 373383-1.html 373383-1-ref.html
 == 373433-1.html 373433-1-ref.html
-== 373533-1.xhtml about:blank
-== 373533-2.xhtml about:blank
-== 373533-3.xhtml about:blank
-== 374038-1.xul 374038-1-ref.xul
-== 374038-2.xul 374038-2-ref.xul
-random-if(d2d) == 374719-1.xul 374719-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 373533-1.xhtml about:blank # bug 974780
+skip-if(B2G&&browserIsRemote) == 373533-2.xhtml about:blank # bug 974780
+skip-if(B2G&&browserIsRemote) == 373533-3.xhtml about:blank # bug 974780
+skip-if(B2G&&browserIsRemote) == 374038-1.xul 374038-1-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 374038-2.xul 374038-2-ref.xul # bug 974780
+random-if(d2d) skip-if(B2G&&browserIsRemote) == 374719-1.xul 374719-1-ref.xul # bug 974780
 fails == 374927-1.html 374927-1-ref.html # Was broken by patch for bug 368600; fails until bug 400776 is fixed
 == 375508-1.html 375508-1-ref.html
 == 375716-1.html 375716-1-ref.html
 == 375827-1.html 375827-1-ref.html
 == 376375-1.html 376375-1-ref.html
 == 376484-1.html 376484-1-ref.html
 == 376532-1.html 376532-1-ref.html
 skip-if(B2G) fails-if(Android) != 376532-2.html 376532-2-ref.html
@@ -761,17 +760,17 @@ fails == 387344-1.html 387344-1-ref.html
 == 387876-3a.html 387876-3-ref.html
 == 387876-3b.html 387876-3-ref.html
 == 388026-1.html 388026-1-ref.html
 == 389074-1.html 389074-1-ref.html
 == 389224-1.html 389224-1-ref.html
 == 389224-2.html about:blank
 skip-if(B2G) == 389468-1.html 389468-1-ref.html
 == 389623-1.html 389623-1-ref.html
-== 389636-1.html about:blank  # assertion test
+skip-if(B2G&&browserIsRemote) == 389636-1.html about:blank  # assertion test # bug 975911
 == 389924-1a.html 389924-1-ref.html
 == 389924-1b.html 389924-1-ref.html
 != 389924-1a.html about:blank
 == 390318-1a.html 390318-1-ref.html
 == 390318-1b.html 390318-1-ref.html
 == 390318-1c.html 390318-1-ref.html
 == 390318-1d.html 390318-1-ref.html
 == 390318-1e.html 390318-1-ref.html
@@ -782,39 +781,39 @@ skip-if(!winWidget) == 391045.html 39104
 == 391412-1b.html 391412-1-ref.html
 == 391909-1.html 391909-1-ref.html
 skip-if(Android) == 391979.html 391979-ref.html
 == 391994-1.html 391994-1-ref.html
 == 392047.html 392047-ref.html
 == 392435-1.html 392435-1-ref.html
 == 393330-1.html 393330-1-ref.html
 == 393490-1.html 393490-1-ref.html
-== 393517-1.xhtml about:blank  # crash test
+skip-if(B2G&&browserIsRemote) == 393517-1.xhtml about:blank  # crash test # bug 974780
 == 393649-1.html 393649-1-ref.html
 == 393655-1.html 393655-1-ref.html
 == 393655-2.html 393655-2-ref.html
 == 393655-3.html 393655-3-ref.html
 == 393655-4.html 393655-4-ref.html
 == 393655-5.html 393655-5-ref.html
 == 393671-1.html 393671-1-ref.html
 == 393671-2.html 393671-2-ref.html
 == 393671-3.html 393671-3-ref.html
 == 393760-1.xml 393760-1-ref.xml
 == 393760-2.xml 393760-2-ref.xml
 == 394111-1.html about:blank  # Really an assertion test rather than a rendering test
 == 394534-1.html 394534-1-ref.html
-== 394676-1.xhtml 394676-1-ref.xhtml
+skip-if(B2G&&browserIsRemote) == 394676-1.xhtml 394676-1-ref.xhtml # bug 975911
 == 395107-1.html 395107-1-ref.html
 == 395107-2.html 395107-2-ref.html
 == 395107-3.html 395107-3-ref.html
 == 395107-4.html 395107-4-ref.html
 == 395107-5.html 395107-5-ref.html
 == 395130-1.html 395130-1-ref.html
 == 395130-2.html 395130-2-ref.html
-== 395331-1.xml 395331-1-ref.xml
+skip-if(B2G&&browserIsRemote) == 395331-1.xml 395331-1-ref.xml # bug 974780
 == 395390-1.html 395390-1-ref.html
 == 396286-1.html about:blank  # crash test
 == 397428-1.html 397428-1-ref.html
 == 397844-1.xhtml 397844-1-ref.xhtml
 == 398092-1.html 398092-1-ref.html
 == 398101-1.html 398101-1-ref.html
 == 398144-1.html 398144-1-ref.html
 == 398682-1.html 398682-1-ref.html
@@ -837,17 +836,17 @@ fails-if(winWidget) fails-if(cocoaWidget
 == 400171-1b.html 400171-1-ref.html
 == 400171-1c.html 400171-1-ref.html
 == 400171-2a.html 400171-2-ref.html
 == 400171-2b.html 400171-2-ref.html
 == 400171-2c.html 400171-2-ref.html
 == 400421-1.html 400421-1-ref.html
 == 400813-1.html 400813-1-ref.html
 == 400826-1.html 400826-1-ref.html
-== 401946-1.xul about:blank
+skip-if(B2G&&browserIsRemote) == 401946-1.xul about:blank # bug 974780
 == 402338-1.html 402338-1-ref.html
 == 402567-1.html 402567-1-ref.html
 == 402567-2.html 402567-2-ref.html
 == 402567-3.html 402567-3-ref.html
 skip-if(B2G) == 402567-4.html 402567-4-ref.html
 == 402629-1.html 402629-1-ref.html
 == 402629-2.html 402629-2-ref.html
 == 402629-3.html 402629-3-ref.html
@@ -865,17 +864,17 @@ random == 403134-1.html 403134-1-ref.htm
 skip-if(B2G) fails-if(Android) == 403181-1.xml 403181-1-ref.xml
 == 403249-1a.html 403249-1-ref.html
 == 403249-1b.html 403249-1-ref.html
 == 403249-2a.html 403249-2-ref.html
 == 403249-2b.html 403249-2-ref.html
 == 403328-1.html 403328-1-ref.html
 == 403426-1.html 403426-1-ref.html
 == 403455-1.html 403455-1-ref.html
-== 403505-1.xml 403505-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 403505-1.xml 403505-1-ref.xul # bug 974780
 #== 403519-1.html 403519-1-ref.html # Fails on Mac, see also discussion in bug
 == 403519-2.html 403519-2-ref.html
 == 403656-1.html 403656-1-ref.html
 == 403656-2.html 403656-2-ref.html
 == 403656-3.html 403656-3-ref.html
 == 403656-4.html 403656-4-ref.html
 == 403656-5.html 403656-5-ref.html
 #== 403657-1.html 403657-1-ref.html  # Fails depending on the fonts...
@@ -883,17 +882,17 @@ skip-if(B2G) fails-if(Android) == 403181
 == 403962-1.xhtml 403962-1-ref.xhtml
 == 404030-1.html 404030-1-ref.html
 != 404030-1-notref.html 404030-1.html
 != 404030-1-notref2.html 404030-1.html
 == 404123-1.html 404123-1-ref.html
 == 404123-2.html 404123-2-ref.html
 != 404123-3.html 404123-3-ref.html
 # may fail "randomly" on OS X, doesn't seem to be rendering usefully anyhow - bug 602469
-random-if(cocoaWidget) HTTP(..) == 404149-1.xul 404149-1-ref.xul # HTTP for fonts directory access
+random-if(cocoaWidget) skip-if(B2G&&browserIsRemote) HTTP(..) == 404149-1.xul 404149-1-ref.xul # HTTP for fonts directory access # bug 974780
 == 404180-1.html 404180-1-ref.html
 == 404301-1.html 404301-1-ref.html
 == 404309-1a.html 404309-1-ref.html
 == 404309-1b.html 404309-1-ref.html
 # Disabled due to compartments for now.
 #!= data:application/xml,<foo/> data:text/plain, # ensure we pretty-print this XML instead of letting it appear blank (test for bug 404419)
 fuzzy-if(Android&&AndroidVersion>=15,8,50) == 404553-1.html 404553-1-ref.html  # assertion test, also tests that marquee binding is applied correctly
 == 404666-1.html 404666-1-ref.html
@@ -986,26 +985,26 @@ asserts(1) == 418574-2.html 418574-2-ref
 == 418766-1a.html 418766-1-ref.html
 == 418766-1b.html 418766-1-ref.html
 == 419060.html 419060-ref.html
 == 419285-1.html 419285-1-ref.html
 == 419531-1.html 419531-1-ref.html
 == 420069-1.html 420069-1-ref.html
 == 420069-2.html 420069-2-ref.html
 == 420351-1.html 420351-1-ref.html
-== 420790-1.xhtml 420790-1-ref.xhtml
+skip-if(B2G&&browserIsRemote) == 420790-1.xhtml 420790-1-ref.xhtml
 == 421069.html 421069-ref.html
 == 421069.html 421069-ref2.html
 == 421069-ref.html 421069-ref2.html
-== 421203-1.xul 421203-1-ref.html
-== 421203-2.xul 421203-1-ref.html
-== 421203-3.xul 321402-3-ref.xul
-== 421203-4.xul 321402-4-ref.xul
-== 421203-5.xul 321402-5-ref.xul
-== 421203-6.xul 321402-6-ref.xul
+skip-if(B2G&&browserIsRemote) == 421203-1.xul 421203-1-ref.html # bug 974780
+skip-if(B2G&&browserIsRemote) == 421203-2.xul 421203-1-ref.html # bug 974780
+skip-if(B2G&&browserIsRemote) == 421203-3.xul 321402-3-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 421203-4.xul 321402-4-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 421203-5.xul 321402-5-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 421203-6.xul 321402-6-ref.xul # bug 974780
 skip-if(B2G) == 421234-1.html 421234-1-ref.html
 == 421239-1.html 421239-1-ref.html
 == 421239-2.html 421239-2-ref.html
 == 421419-1.html 421419-1-ref.html
 == 421436-1a.html 421436-1-ref.html
 == 421436-1b.html 421436-1-ref.html
 == 421632-1.html 421632-1-ref.html
 != 421710-1.html about:blank
@@ -1016,17 +1015,17 @@ skip-if(B2G) == 422249-1.html 422249-1-r
 == 422678-1.html 422678-1-ref.html
 == 423130-1.html 423130-1-ref.html
 == 423385-1.html 423385-1-ref.html
 == 423599-1.html 423599-1-ref.html
 == 423676-1.html 423676-1-ref.html
 fails == 423823-1.html 423823-1-ref.html # scrolling rowgroups were removed in bug 28800
 skip-if(B2G) == 424074-1.xul 424074-1-ref.xul
 skip-if(B2G) fails-if(Android) != 424074-1.xul 424074-1-ref2.xul
-random-if(gtk2Widget) == 424074-1-ref2.xul 424074-1-ref3.xul
+random-if(gtk2Widget) skip-if(B2G&&browserIsRemote) == 424074-1-ref2.xul 424074-1-ref3.xul # bug 974780
 == 424236-1.html 424236-1-ref.html
 == 424236-2.html 424236-2-ref.html
 == 424236-3.html 424236-3-ref.html
 == 424236-4.html 424236-4-ref.html
 == 424236-5.html 424236-5-ref.html
 == 424236-6.html 424236-6-ref.html
 == 424236-7.html 424236-7-ref.html
 == 424236-8.html 424236-8-ref.html
@@ -1158,20 +1157,20 @@ random == 445004-1.html 445004-1-ref.htm
 == 445142-1b.html 445142-1-ref.html
 == 445142-1c.html 445142-1-ref.html
 == 445142-2a.html 445142-2-ref.html
 == 445142-2b.html 445142-2-ref.html
 == 446100-1a.html about:blank
 skip-if(B2G) fails-if(Android) == 446100-1b.html about:blank
 skip-if(B2G) fails-if(Android) == 446100-1c.html about:blank
 == 446100-1d.html about:blank
-== 446100-1e.html about:blank
-== 446100-1f.html about:blank
+skip-if(B2G&&browserIsRemote) == 446100-1e.html about:blank
+skip-if(B2G&&browserIsRemote) == 446100-1f.html about:blank
 skip-if(B2G) fails-if(Android) == 446100-1g.html about:blank
-== 446100-1h.html about:blank
+skip-if(B2G&&browserIsRemote) == 446100-1h.html about:blank
 skip-if(B2G) == 447749-1.html 447749-1-ref.html
 fuzzy(127,2) == 448193.html 448193-ref.html
 != 449149-1a.html about:blank
 != 449149-1b.html about:blank
 # Retry the above with XBL scopes
 test-pref(dom.use_xbl_scopes_for_remote_xul,true) != 449149-1a.html about:blank
 test-pref(dom.use_xbl_scopes_for_remote_xul,true) != 449149-1b.html about:blank
 == 449149-2.html 449149-2-ref.html
@@ -1223,40 +1222,40 @@ skip-if(B2G) == 458296-1d.html 458296-1-
 == 460012-1.html 460012-1-ref.html
 == 461266-1.html 461266-1-ref.html
 == 461512-1.html 461512-1-ref.html
 == 462844-1.html 462844-ref.html
 == 462844-2.html 462844-ref.html
 == 462844-3.html 462844-ref.html
 == 462844-4.html 462844-ref.html
 == 463204-1.html 463204-1-ref.html
-== 463217-1.xul 463217-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 463217-1.xul 463217-1-ref.xul # bug 974780
 skip-if(B2G) == 463952-1.html 463952-1-ref.html
 == 464811-1.html 464811-1-ref.html
 == 466258-1.html 466258-1-ref.html
 == 466395-1.html 466395-1-ref.html
 == 466395-2.html 466395-2-ref.html
 == 467084-1.html 467084-1-ref.html
 == 467084-2.html 467084-2-ref.html
 == 467444-1.html 467444-1-ref.html
 == 467460-1.html 467460-1-ref.html
-== 468473-1.xul 468473-1-ref.xul
-== 468546-1.xhtml 468546-1-ref.xhtml
+skip-if(B2G&&browserIsRemote) == 468473-1.xul 468473-1-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 468546-1.xhtml 468546-1-ref.xhtml
 == 471356-1.html 471356-1-ref.html
-== 471594-1.xhtml 471594-1-ref.html
-fuzzy(255,15) == 472020-1a.xul 472020-1-ref.xul
-fails == 472020-1b.xul 472020-1-ref.xul
-fails == 472020-2.xul 472020-2-ref.xul
-== 472500-1.xul 472500-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 471594-1.xhtml 471594-1-ref.html
+fuzzy(255,15) skip-if(B2G&&browserIsRemote) == 472020-1a.xul 472020-1-ref.xul # bug 974780
+fails skip-if(B2G&&browserIsRemote) == 472020-1b.xul 472020-1-ref.xul # bug 974780
+fails skip-if(B2G&&browserIsRemote) == 472020-2.xul 472020-2-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 472500-1.xul 472500-1-ref.xul # bug 974780
 == 472769-1a.html 472769-1-ref.html
 == 472769-1b.html 472769-1-ref.html
 == 472769-2.html 472769-2-ref.html
 == 472769-3.html 472769-3-ref.html
-== 473847-1.xul 473847-1-ref.xul
-== 474336-1.xul 474336-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 473847-1.xul 473847-1-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 474336-1.xul 474336-1-ref.xul # bug 974780
 skip-if(B2G) == 474417-1.html 474417-1-ref.html
 == 474472-1.html 474472-1-ref.html
 == 475986-1a.html 475986-1-ref.html
 == 475986-1b.html 475986-1-ref.html
 == 475986-1c.html 475986-1-ref.html
 == 475986-1d.html 475986-1-ref.html
 == 475986-1e.html 475986-1-ref.html
 == 475986-1f.html 475986-1-ref.html
@@ -1278,17 +1277,17 @@ skip-if(B2G) != 476063-3.html 476063-3-r
 skip-if(B2G) == 476063-4.xhtml 476063-4-ref.xhtml
 == 476357-1.html 476357-1-ref.html
 == 476598-1a.html 476598-1-ref.html
 == 476598-1a.html 476598-1-ref2.html
 == 476598-1b.html 476598-1-ref.html
 == 476598-1b.html 476598-1-ref2.html
 != 476598-1-ref.html about:blank
 == 476856-1.html 476856-1-ref.html
-random-if(d2d) == 478377-1.xul 478377-1-ref.xul
+random-if(d2d) skip-if(B2G&&browserIsRemote) == 478377-1.xul 478377-1-ref.xul # bug 974780
 == 478614-1.html 478614-1-ref.html
 == 478614-2.html 478614-1-ref.html
 == 478614-3.html 478614-3-ref.html
 == 478614-4.html 478614-4-ref.html
 == 478614-5.html 478614-5-ref.html
 == 478614-6.html 478614-6-ref.html
 == 478614-7.html 478614-7-ref.html
 skip-if(B2G) == 478811-1.html 478811-1-ref.html
@@ -1310,82 +1309,82 @@ skip-if(B2G) fails-if(Android) == 481024
 skip-if(B2G) fails-if(Android) == 481024-1b.html 481024-1-ref.html
 skip-if(B2G) fails-if(Android) == 481024-1c.html 481024-1-ref.html
 == 481024-1d.html 481024-1-ref.html
 == 481024-1e.html 481024-1-ref.html
 != 481948-1.html 481948-1-ref.html
 != 481948-2.html 481948-2-ref.html
 skip-if(B2G) fails-if(Android) random-if(winWidget) fails-if(gtk2Widget) == 481948-3.html 481948-3-ref.html # questionable test, see bug 488364
 == 482398-1.html 482398-1-ref.html
-random-if(d2d) == 482592-1a.xhtml 482592-1-ref.html # bug 586771
-random-if(d2d) == 482592-1b.xhtml 482592-1-ref.html # bug 586771
+random-if(d2d) skip-if(B2G&&browserIsRemote) == 482592-1a.xhtml 482592-1-ref.html # bug 586771
+random-if(d2d) skip-if(B2G&&browserIsRemote) == 482592-1b.xhtml 482592-1-ref.html # bug 586771
 random-if(winWidget) == 482659-1a.html 482659-1-ref.html
 == 482659-1b.html 482659-1-ref.html
 == 482659-1c.html 482659-1-ref.html
 == 482659-1d.html 482659-1-ref.html
-== 483565.xul 483565-ref.xul
+skip-if(B2G&&browserIsRemote) == 483565.xul 483565-ref.xul # bug 974780
 == 484256-1.html 484256-1-ref.html
 == 484256-2.html 484256-1-ref.html
 == 485012-1.html 485012-1-ref.html
 == 485275-1.html 485275-1-ref.html
 == 485275-1.svg 485275-1-ref.html
 == 486052-1.html 486052-1-ref.html
 == 486052-2a.html 486052-2-ref.html
 == 486052-2b.html 486052-2-ref.html
 == 486052-2c.html 486052-2-ref.html
 == 486052-2d.html 486052-2-ref.html
 == 486052-2e.html 486052-2-ref.html
 == 486052-2f.html 486052-2-ref.html
 == 486052-2g.html 486052-2-ref.html
 == 486065-1.html 486065-1-ref.html
-== 486848-1.xul 486848-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 486848-1.xul 486848-1-ref.xul # bug 974780
 == 487539-1.html about:blank
 == 488390-1.html 488390-1-ref.html
 == 488649-1.html 488649-1-ref.html
 == 488685-1.html 488685-1-ref.html
 == 488692-1.html 488692-1-ref.html
 == 489868-1.svg 489868-1-ref.svg
 == 490173-1.html 490173-1-ref.html
 == 490173-2.html 490173-2-ref.html
 == 490176-1.html 490176-1-ref.html
 == 490177-1.svg 490177-1-ref.svg
 == 490182-1a.html 490182-1-ref.html
 == 490182-1b.html 490182-1-ref.html
 == 491180-1.html 491180-1-ref.html
 == 491180-2.html 491180-2-ref.html
-== 491323-1.xul 491323-1-ref.xul
-== 492239-1.xul 492239-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 491323-1.xul 491323-1-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 492239-1.xul 492239-1-ref.xul # bug 974780
 == 492661-1.html 492661-1-ref.html
 == 493968-1.html 493968-1-ref.html
 == 494667-1.html 494667-1-ref.html
 == 494667-2.html 494667-2-ref.html
 == 495274-1.html 495274-1-ref.html
-== 495354-1a.xhtml 495354-1-ref.xhtml
-== 495354-1b.xhtml 495354-1-ref.xhtml
+skip-if(B2G&&browserIsRemote) == 495354-1a.xhtml 495354-1-ref.xhtml # bug 974780
+skip-if(B2G&&browserIsRemote) == 495354-1b.xhtml 495354-1-ref.xhtml # bug 974780
 == 495385-1a.html 495385-1-ref.html
 == 495385-1b.html 495385-1-ref.html
 == 495385-1c.html 495385-1-ref.html
 == 495385-1d.html 495385-1-ref.html
 == 495385-1e.html 495385-1-ref.html
 == 495385-1f.html 495385-1-ref.html
 == 495385-2a.html 495385-2-ref.html
 == 495385-2b.html 495385-2-ref.html
 == 495385-2c.html 495385-2-ref.html
 == 495385-2d.html 495385-2-ref.html
 == 495385-2e.html 495385-2-ref.html
-pref(dom.use_xbl_scopes_for_remote_xul,true) == 495385-2f.xhtml 495385-2-ref.html
+pref(dom.use_xbl_scopes_for_remote_xul,true) skip-if(B2G&&browserIsRemote) == 495385-2f.xhtml 495385-2-ref.html
 == 495385-2g.html 495385-2-ref.html
 == 495385-2h.html 495385-2-ref.html
 == 495385-2i.html 495385-2-ref.html
 == 495385-3.html 495385-3-ref.html
 == 495385-4.html 495385-4-ref.html
 == 495385-5.html 495385-5-ref.html
 asserts(1) == 496032-1.html 496032-1-ref.html # bug 399262
 == 496840-1.html 496840-1-ref.html
-== 498228-1.xul 498228-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 498228-1.xul 498228-1-ref.xul # bug 974780
 == 501037.html 501037-ref.html
 == 501257-1a.html 501257-1-ref.html
 == 501257-1b.html 501257-1-ref.html
 == 501257-1.xhtml 501257-1-ref.xhtml
 == 501627-1.html 501627-1-ref.html
 == 502288-1.html 502288-1-ref.html
 skip-if(B2G) == 502447-1.html 502447-1-ref.html
 == 502795-1.html 502795-1-ref.html
@@ -1403,26 +1402,26 @@ skip-if(B2G) == 506481-1.html 506481-1-r
 == 507487-1.html 507487-1-ref.html
 == 507487-2.xhtml 507487-2-ref.xhtml
 == 507762-1.html 507762-1-ref.html
 == 507762-2.html 507762-2-ref.html
 == 507762-3.html 507762-1-ref.html
 == 507762-4.html 507762-2-ref.html
 skip-if(B2G) random-if(cocoaWidget) == 508816-1.xul 508816-1-ref.xul # Bug 631982
 skip-if(B2G) == 508816-2.html 508816-2-ref.html
-== 508908-1.xul 508908-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 508908-1.xul 508908-1-ref.xul # bug 974780
 == 508919-1.xhtml 508919-1-ref.xhtml
 == 509155-1.xhtml 509155-1-ref.xhtml
 skip-if(B2G) == 512410.html 512410-ref.html
 == 512631-1.html 512631-1-ref.html
 == 513153-1a.html 513153-1-ref.html
 == 513153-1b.html 513153-1-ref.html
 == 513153-2a.html 513153-2-ref.html
 == 513153-2b.html 513153-2-ref.html
-== 513318-1.xul 513318-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 513318-1.xul 513318-1-ref.xul # bug 974780
 skip-if(B2G) fails-if(Android) != 513318-2.xul 513318-2-ref.xul
 == 514917-1.html 514917-1-ref.html
 HTTP(..) == 518172-1a.html 518172-a-ref.html
 HTTP(..) == 518172-1b.html 518172-b-ref.html
 HTTP(..) == 518172-2a.html 518172-a-ref.html
 HTTP(..) == 518172-2b.html 518172-b-ref.html
 == 520421-1.html 520421-1-ref.html
 == 520563-1.xhtml 520563-1-ref.xhtml
@@ -1453,34 +1452,34 @@ skip-if(B2G) == 530686-1.html 530686-1-r
 == 534526-1a.html 534526-1-ref.html
 == 534526-1b.html 534526-1-ref.html
 == 534804-1.html 534804-1-ref.html
 == 534808-1.html 534808-1-ref.html
 == 534808-2.html 534808-2-ref.html
 fails-if(OSX==10.7) == 534919-1.html 534919-1-ref.html # Bug 705044
 random == 536061.html 536061-ref.html # fixedpoint division in blur code makes this fail
 == 537471-1.html 537471-1-ref.html
-== 537507-1.xul 537507-1-ref.xul
-== 537507-2.html 537507-2-ref.html
+skip-if(B2G&&browserIsRemote) == 537507-1.xul 537507-1-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == 537507-2.html 537507-2-ref.html # bug 974780
 == 538909-1.html 538909-1-ref.html
 == 538935-1.html 538935-1-ref.html
 == 539226-1.html about:blank
 == 539323-1.html 539323-1-ref.html
 == 539323-2.html 539323-2-ref.html
 == 539323-3.html 539323-3-ref.html
 == 539880-1.html 539880-1-ref.html
 == 539880-1-dynamic.html 539880-1-ref.html
 skip-if(B2G) fuzzy-if(Android&&AndroidVersion>=15,12,1000) == 539949-1.html#test2 539949-1-ref.html#test2
 == 541382-1.html 541382-1-ref.html
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)||!haveTestPlugin) == 541406-1.html 541406-1-ref.html
 needs-focus != 542116-1.html 542116-1-ref.html
 needs-focus != 542116-2.html 542116-2-ref.html
 needs-focus != 542116-3.html 542116-3-ref.html
 == 542317-1.html 542317-1-ref.html
-fuzzy-if(Android,17,2) == 542605-hidden-unscrollable.xul 542605-hidden-unscrollable-ref.xul
+fuzzy-if(Android,17,2) skip-if(B2G&&browserIsRemote) == 542605-hidden-unscrollable.xul 542605-hidden-unscrollable-ref.xul # bug 974780
 == 542620-1.html 542620-1-ref.html
 == 545049-1.html 545049-1-ref.html
 == 546033-1.html 546033-1-ref.html
 random-if(!haveTestPlugin) == 546071-1.html 546071-1-ref.html
 == 549184-1.html 549184-1-ref.html
 == 550325-1.html 550325-1-ref.html
 == 550325-2.html 550325-1-ref.html
 == 550325-3.html 550325-1-ref.html
@@ -1495,17 +1494,17 @@ skip-if(B2G) fuzzy-if(Android&&AndroidVe
 # Marked "random" rather than "fails" because it may (spuriously) appear to pass
 # on B2G or Android devices that completely lack any Sinhala font support.
 random != 553571-1.html 553571-1-notref.html # expect dotted circle in test, not in ref: "fails" under harfbuzz, which doesn't consider the sequence invalid
 fuzzy-if(!contentSameGfxBackendAsCanvas,128,91) random-if(d2d) skip-if(azureSkiaGL) == 555388-1.html 555388-1-ref.html
 == 556661-1.html 556661-1-ref.html
 skip-if(B2G) fails-if(Android) == 557087-1.html 557087-ref.html
 skip-if(B2G) fails-if(Android) == 557087-2.html 557087-ref.html
 == 557736-1.html 557736-1-ref.html
-!= 558011-1.xul 558011-1-ref.xul
+skip-if(B2G&&browserIsRemote) != 558011-1.xul 558011-1-ref.xul # bug 974780
 == 559284-1.html 559284-1-ref.html
 skip-if(B2G) fails-if(Android) == 560455-1.xul 560455-1-ref.xul
 == 561981-1.html 561981-1-ref.html
 == 561981-2.html 561981-2-ref.html
 == 561981-3.html 561981-3-ref.html
 == 561981-4.html 561981-4-ref.html
 == 561981-5.html 561981-5-ref.html
 == 561981-6.html 561981-6-ref.html
@@ -1629,18 +1628,18 @@ needs-focus == 613433-3.html 613433-2-re
 needs-focus == 613433-3.html 613433-3-ref.html
 == 614272-1.svg  614272-1-ref.svg
 HTTP(..) == 615121-1.html 615121-1-ref.html
 HTTP(..) != 615121-2.html 615121-2-notref.html
 fails-if(Android&&AndroidVersion!=17) == 617242-1.html 617242-1-ref.html
 != 618071.html 618071-notref.html
 == 619117-1.html 619117-1-ref.html
 HTTP(..) == 619511-1.html 619511-1-ref.html
-skip-if(Android) HTTP(..) == 621253-1-externalFilter.html 621253-1-ref.html
-skip-if(Android) == 621253-1-internalFilter.html 621253-1-ref.html
+skip-if(Android||(B2G&&browserIsRemote)) HTTP(..) == 621253-1-externalFilter.html 621253-1-ref.html
+skip-if(Android||(B2G&&browserIsRemote)) == 621253-1-internalFilter.html 621253-1-ref.html
 HTTP(..) == 621253-2-externalFilter.html 621253-2-ref.html
 == 621253-2-internalFilter.html 621253-2-ref.html
 skip-if(B2G) random-if(winWidget) fuzzy-if(OSX==10.8,19,17) == 621918-1.svg 621918-1-ref.svg # 1-pixel diacritic positioning discrepancy in rotated text (may depend on platform fonts)
 random-if(winWidget) HTTP(..) == 621918-2.svg 621918-2-ref.svg # same 1px issue as above, and HTTP(..) for filters.svg, used to mask antialiasing issues where glyphs touch
 fuzzy-if(d2d,5,1) == 622585-1.html 622585-1-ref.html # bug 789402
 fuzzy-if(Android&&AndroidVersion>=15,8,300) == 625409-1.html 625409-1-ref.html
 == 627393-1.html about:blank
 == 630835-1.html about:blank
@@ -1671,21 +1670,21 @@ needs-focus == 652301-1b.html 652301-1-r
 == 653930-1.html 653930-1-ref.html
 HTTP(..) == 654057-1.html 654057-1-ref.html
 fails-if(layersGPUAccelerated&&cocoaWidget) fails-if(Android&&AndroidVersion!=17) == 654950-1.html 654950-1-ref.html # Quartz alpha blending doesn't match GL alpha blending
 == 655549-1.html 655549-1-ref.html
 == 655836-1.html 655836-1-ref.html
 != 656875.html about:blank
 == 658952.html 658952-ref.html
 == 660682-1.html 660682-1-ref.html
-== 664127-1.xul 664127-1-ref.xul
+skip-if(B2G&&browserIsRemote) == 664127-1.xul 664127-1-ref.xul # bug 974780
 skip-if(B2G) == 665597-1.html 665597-1-ref.html
 skip-if(B2G) == 665597-2.html 665597-2-ref.html
-== 668319-1.xul about:blank
-!= 669015-1.xul 669015-1-notref.xul
+skip-if(B2G&&browserIsRemote) == 668319-1.xul about:blank # bug 974780
+skip-if(B2G&&browserIsRemote) != 669015-1.xul 669015-1-notref.xul # bug 974780
 skip-if(azureSkiaGL) == 670442-1.html 670442-1-ref.html
 == 670467-1.html 670467-1-ref.html
 == 670467-2.html 670467-2-ref.html
 == 690164-1.html 690164-1-ref.html
 == 690643-1.html 690643-1-ref.html
 != 691087-1.html 691087-1-ref.html
 == 691571-1.html 691571-1-ref.html
 == 696307-1.html 696307-1-ref.html
@@ -1736,17 +1735,17 @@ random-if(Android&&AndroidVersion<15) ==
 == 787947-1.html 787947-1-ref.html
 == 796847-1.svg 796847-1-ref.svg
 fuzzy(40,850) fuzzy-if(azureQuartz,73,542) == 797797-1.html 797797-1-ref.html # 'opacity:N' and rgba(,,,N) text don't match precisely
 fuzzy(40,850) fuzzy-if(azureQuartz,68,586) == 797797-2.html 797797-2-ref.html # 'opacity:N' and rgba(,,,N) text don't match precisely
 == 801681-1.html 801681-1-ref.html
 == 801681-2.html 801681-2-ref.html
 == 801994-1.html 801994-1-ref.html
 == 804323-1.html 804323-1-ref.html
-fuzzy-if(Android,8,608) == 811301-1.html 811301-1-ref.html
+fuzzy-if(Android,8,608) skip-if(B2G&&browserIsRemote) == 811301-1.html 811301-1-ref.html
 == 812824-1.html 812824-1-ref.html
 == 814677.html 814677-ref.html
 skip-if(B2G) == 814952-1.html 814952-1-ref.html
 skip-if(B2G) fuzzy-if(Android,4,400) == 815593-1.html 815593-1-ref.html
 == 816359-1.html 816359-1-ref.html
 == 816458-1.html 816458-1-ref.html
 == 816948-1.html 816948-1-ref.html
 == 817019-1.html about:blank
@@ -1759,17 +1758,17 @@ skip-if(B2G) == 818276-1.html 818276-1-r
 == 836844-1.html 836844-1-ref.html
 == 841192-1.html 841192-1-ref.html
 == 844178.html 844178-ref.html
 == 846144-1.html 846144-1-ref.html
 == 847850-1.html 847850-1-ref.html
 == 848421-1.html 848421-1-ref.html
 random-if(B2G) == 849407-1.html 849407-1-ref.html
 == 849996-1.html 849996-1-ref.html
-== 858803-1.html 858803-1-ref.html
+skip-if(B2G&&browserIsRemote) == 858803-1.html 858803-1-ref.html # bug 974780
 == 860242-1.html 860242-1-ref.html
 != 860370.html 860370-notref.html
 == 871338-1.html 871338-1-ref.html
 == 875060-1.html 875060-1-ref.html
 == 883987-1a.html 883987-1-ref.html
 == 883987-1b.html 883987-1-ref.html
 == 883987-1c.html 883987-1-ref.html
 == 883987-1d.html 883987-1-ref.html
@@ -1781,17 +1780,17 @@ random-if(B2G) == 849407-1.html 849407-1
 == 897491-2.html 897491-2-ref.html
 fuzzy(1,10000) fuzzy-if(Android&&AndroidVersion>=15,5,10000) == 902330-1.html 902330-1-ref.html
 fuzzy-if(Android,8,400) == 906199-1.html 906199-1-ref.html
 == 921716-1.html 921716-1-ref.html
 fuzzy-if(cocoaWidget,1,40) == 928607-1.html 928607-1-ref.html
 == 931464-1.html 931464-1-ref.html
 == 931853.html 931853-ref.html
 == 931853-quirks.html 931853-quirks-ref.html
-fuzzy-if(OSX==10.6,2,30) == 933264-1.html 933264-1-ref.html
+fuzzy-if(OSX==10.6,2,30) skip-if(B2G&&browserIsRemote) == 933264-1.html 933264-1-ref.html
 == 936670-1.svg 936670-1-ref.svg
 == 941940-1.html 941940-1-ref.html
 == 942017.html 942017-ref.html
 == 942672-1.html 942672-1-ref.html
 == 953334-win32-clipping.html 953334-win32-clipping-ref.html
 == 956513-1.svg 956513-1-ref.svg
 == 944291-1.html 944291-1-ref.html
 == 957770-1.svg 957770-1-ref.svg
--- a/layout/reftests/css-selectors/reftest.list
+++ b/layout/reftests/css-selectors/reftest.list
@@ -1,4 +1,4 @@
 == state-dependent-in-any.html state-dependent-in-any-ref.html
 == attr-case-insensitive-1.html attr-case-insensitive-1-ref.html
-== sibling-combinators-on-anon-content-1.xhtml sibling-combinators-on-anon-content-ref.xhtml
-== sibling-combinators-on-anon-content-2.xhtml sibling-combinators-on-anon-content-ref.xhtml
+skip-if(B2G&&browserIsRemote) == sibling-combinators-on-anon-content-1.xhtml sibling-combinators-on-anon-content-ref.xhtml
+skip-if(B2G&&browserIsRemote) == sibling-combinators-on-anon-content-2.xhtml sibling-combinators-on-anon-content-ref.xhtml
--- a/layout/reftests/forms/fieldset/reftest.list
+++ b/layout/reftests/forms/fieldset/reftest.list
@@ -3,11 +3,11 @@
 == fieldset-intrinsic-width-1.html fieldset-intrinsic-width-1-ref.html
 == fieldset-percentage-padding-1.html fieldset-percentage-padding-1-ref.html
 == fieldset-scroll-1.html fieldset-scroll-1-ref.html
 == fieldset-scrolled-1.html fieldset-scrolled-1-ref.html
 random-if(B2G) == fieldset-overflow-auto-1.html fieldset-overflow-auto-1-ref.html
 == positioned-container-1.html positioned-container-1-ref.html
 == relpos-legend-1.html relpos-legend-1-ref.html
 == relpos-legend-2.html relpos-legend-2-ref.html
-test-pref(layout.css.sticky.enabled,true) == sticky-legend-1.html sticky-legend-1-ref.html
+test-pref(layout.css.sticky.enabled,true) skip-if(B2G&&browserIsRemote) == sticky-legend-1.html sticky-legend-1-ref.html
 == abs-pos-child-sizing.html abs-pos-child-sizing-ref.html
 == overflow-hidden.html overflow-hidden-ref.html
--- a/layout/reftests/forms/input/file/reftest.list
+++ b/layout/reftests/forms/input/file/reftest.list
@@ -1,8 +1,8 @@
 # B2G failures: bug 855352.
-fails-if(B2G) fuzzy-if(OSX==10.6,8,128) == simple.html simple-ref.xul
-fails-if(B2G) fuzzy-if(OSX==10.6,8,64) == rtl.html rtl-ref.xul
-fails-if(B2G) fuzzy-if(OSX==10.6,8,128) == size.html simple-ref.xul
-fails-if(B2G) fuzzy-if(OSX==10.6,8,64) == background.html background-ref.xul
-fails-if(B2G) == style.html style-ref.xul
+fails-if(B2G) fuzzy-if(OSX==10.6,8,128) skip-if(B2G&&browserIsRemote) == simple.html simple-ref.xul # bug 974780
+fails-if(B2G) fuzzy-if(OSX==10.6,8,64) skip-if(B2G&&browserIsRemote) == rtl.html rtl-ref.xul # bug 974780
+fails-if(B2G) fuzzy-if(OSX==10.6,8,128) skip-if(B2G&&browserIsRemote) == size.html simple-ref.xul # bug 974780
+fails-if(B2G) fuzzy-if(OSX==10.6,8,64) skip-if(B2G&&browserIsRemote) == background.html background-ref.xul # bug 974780
+fails-if(B2G)  skip-if(B2G&&browserIsRemote) == style.html style-ref.xul # bug 974780
 != width-clip.html width-clip-ref.html
 fails-if(B2G) == color-inherit.html color-inherit-ref.html
--- a/layout/reftests/forms/input/text/reftest.list
+++ b/layout/reftests/forms/input/text/reftest.list
@@ -1,8 +1,8 @@
 == bounds-1.html bounds-1-ref.html
 == size-1.html size-1-ref.html
 skip-if(B2G) fails-if(Android) == size-2.html size-2-ref.html
 HTTP(..) == baseline-1.html baseline-1-ref.html
-HTTP(..) == centering-1.xul centering-1-ref.xul
-== dynamic-height-1.xul dynamic-height-1-ref.xul
+skip-if(B2G&&browserIsRemote) HTTP(..) == centering-1.xul centering-1-ref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == dynamic-height-1.xul dynamic-height-1-ref.xul # bug 974780
 needs-focus == select.html select-ref.html
 == intrinsic-size.html intrinsic-size-ref.html
--- a/layout/reftests/forms/placeholder/reftest.list
+++ b/layout/reftests/forms/placeholder/reftest.list
@@ -22,14 +22,14 @@ skip-if(B2G) == placeholder-6-textarea.h
 # needs-focus == placeholder-8.html placeholder-focus-ref.html
 # needs-focus == placeholder-9.html placeholder-focus-ref.html
 needs-focus == placeholder-10.html placeholder-visible-ref.html
 == placeholder-11.html placeholder-visible-ref.html
 == placeholder-12.html placeholder-visible-ref.html
 == placeholder-13.html placeholder-visible-ref.html
 == placeholder-14.html placeholder-visible-ref.html
 == placeholder-18.html placeholder-overridden-ref.html
-random-if(winWidget) == placeholder-19.xul  placeholder-overridden-ref.xul
+random-if(winWidget) skip-if(B2G&&browserIsRemote) == placeholder-19.xul  placeholder-overridden-ref.xul # bug 974780
 # needs-focus == placeholder-20.html placeholder-focus-ref.html
 needs-focus == placeholder-21.html placeholder-blank-ref.html
 needs-focus == placeholder-22.html placeholder-blank-ref.html
 == placeholder-rtl.html placeholder-rtl-ref.html
 pref(dom.placeholder.show_on_focus,false) needs-focus == placeholder-focus-pref.html placeholder-blank-ref.html
--- a/layout/reftests/forms/textbox/reftest.list
+++ b/layout/reftests/forms/textbox/reftest.list
@@ -1,10 +1,10 @@
 # access-key tests are no use on OS X because access keys are not indicated visually
-skip-if(cocoaWidget) != accesskey-1.xul accesskey-1-notref.xul
-skip-if(cocoaWidget) == accesskey-2.xul accesskey-2-ref.xul
+skip-if(cocoaWidget||(B2G&&browserIsRemote)) != accesskey-1.xul accesskey-1-notref.xul # bug 974780
+skip-if(cocoaWidget||(B2G&&browserIsRemote)) == accesskey-2.xul accesskey-2-ref.xul # bug 974780
 # accesskey-3 fails because of defects in XUL bidi support
-skip-if(cocoaWidget) fails-if(!cocoaWidget) == accesskey-3.xul accesskey-3-ref.xul
-skip-if(cocoaWidget) != accesskey-3.xul accesskey-3-notref.xul
-skip-if(cocoaWidget) == accesskey-4.xul accesskey-4-ref.xul
-skip-if(cocoaWidget) != accesskey-4.xul accesskey-4-notref.xul
-== align-baseline-1.xul align-baseline-1-ref.xul # test for bug 494901
-skip-if(B2G) fails-if(Android) == setsize.xul setsize-ref.xul
+fails-if(!cocoaWidget) skip-if(cocoaWidget||(B2G&&browserIsRemote)) == accesskey-3.xul accesskey-3-ref.xul # bug 974780
+skip-if(cocoaWidget||(B2G&&browserIsRemote)) != accesskey-3.xul accesskey-3-notref.xul # bug 974780
+skip-if(cocoaWidget||(B2G&&browserIsRemote)) == accesskey-4.xul accesskey-4-ref.xul # bug 974780
+skip-if(cocoaWidget||(B2G&&browserIsRemote)) != accesskey-4.xul accesskey-4-notref.xul # bug 974780
+skip-if(B2G&&browserIsRemote) == align-baseline-1.xul align-baseline-1-ref.xul # test for bug 494901
+fails-if(Android) skip-if(B2G) == setsize.xul setsize-ref.xul # bug 974780
--- a/layout/reftests/image/reftest.list
+++ b/layout/reftests/image/reftest.list
@@ -1,15 +1,15 @@
 fuzzy-if(Android,8,30) == background-image-zoom-1.html background-image-zoom-1-ref.html
 == background-image-zoom-2.html about:blank
 == image-seam-1a.html image-seam-1-ref.html
 == image-seam-1b.html image-seam-1-ref.html
 fails-if(cocoaWidget) == image-seam-2.html image-seam-2-ref.html # Quartz doesn't support EXTEND_PAD (bug 567370)
-== image-zoom-1.html image-zoom-1-ref.html
-== image-zoom-2.html image-zoom-1-ref.html
+skip-if(B2G&&browserIsRemote) == image-zoom-1.html image-zoom-1-ref.html
+skip-if(B2G&&browserIsRemote) == image-zoom-2.html image-zoom-1-ref.html
 == invalid-url-image-1.html invalid-url-image-1-ref.html
 random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == sync-image-switch-1a.html sync-image-switch-1-ref.html # bug 855050 for WinXP
 random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == sync-image-switch-1b.html sync-image-switch-1-ref.html # bug 855050 for WinXP
 random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == sync-image-switch-1c.html sync-image-switch-1-ref.html # bug 855050 for WinXP
 random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == sync-image-switch-1d.html sync-image-switch-1-ref.html # bug 855050 for WinXP
 
 # Tests for image-orientation used with 'from-image' (note that all
 # image-orientation tests are fuzzy because the JPEG images do not perfectly
--- a/layout/reftests/invalidation/reftest.list
+++ b/layout/reftests/invalidation/reftest.list
@@ -1,10 +1,10 @@
 == table-repaint-a.html table-repaint-a-ref.html
 == table-repaint-b.html table-repaint-b-ref.html
 == table-repaint-c.html table-repaint-c-ref.html
 == table-repaint-d.html table-repaint-d-ref.html
-== 540247-1.xul 540247-1-ref.xul
-== 543681-1.html 543681-1-ref.html
+skip-if(B2G&&browserIsRemote) == 540247-1.xul 540247-1-ref.xul  # bug 974780
+skip-if(B2G&&browserIsRemote) == 543681-1.html 543681-1-ref.html
 == test-image-layers.html test-image-layers-ref.html
 pref(layout.animated-image-layers.enabled,true) == test-animated-image-layers.html test-animated-image-layers-ref.html
 pref(layout.animated-image-layers.enabled,true) == test-animated-image-layers-background.html test-animated-image-layers-ref.html
 == box-shadow-border-radius.html box-shadow-border-radius-ref.html
--- a/layout/reftests/position-sticky/reftest.list
+++ b/layout/reftests/position-sticky/reftest.list
@@ -43,11 +43,11 @@ fuzzy-if(Android,4,810) == containing-bl
 == overconstrained-3.html overconstrained-3-ref.html
 == inline-1.html inline-1-ref.html
 == inline-2.html inline-2-ref.html
 fuzzy-if(OSX==10.6||OSX==10.7,64,100) fuzzy-if(OSX==10.8,99,210) == inline-3.html inline-3-ref.html
 fails == column-contain-1a.html column-contain-1-ref.html
 == column-contain-1b.html column-contain-1-ref.html
 == column-contain-2.html column-contain-2-ref.html
 == block-in-inline-1.html block-in-inline-1-ref.html
-fuzzy-if(Android,8,1533) == block-in-inline-2.html block-in-inline-2-ref.html
-fuzzy-if(Android,8,630) fuzzy-if(OSX==10.8,1,11) == block-in-inline-3.html block-in-inline-3-ref.html
+fuzzy-if(Android,8,1533) skip-if(B2G&&browserIsRemote) == block-in-inline-2.html block-in-inline-2-ref.html
+fuzzy-if(Android,8,630) fuzzy-if(OSX==10.8,1,11) skip-if(B2G&&browserIsRemote) == block-in-inline-3.html block-in-inline-3-ref.html
 == inner-table-1.html inner-table-1-ref.html
--- a/layout/reftests/reftest-sanity/reftest.list
+++ b/layout/reftests/reftest-sanity/reftest.list
@@ -88,17 +88,17 @@ needs-focus load needs-focus.html
 # Bug 632636
 fails == data:text/plain,HELLO about:blank
 needs-focus == data:text/plain, about:blank
 
 # Sanity check of viewport+displayport overrides
 random-if(!browserIsRemote) == test-displayport.html test-displayport-ref.html # bug 593168
 skip-if(!browserIsRemote) != test-displayport-2.html test-displayport-ref.html # bug 593168
 skip-if(!browserIsRemote) fails-if(OSX&&layersGPUAccelerated) fuzzy-if(layersOMTC,1,1390) random-if(Android&&AndroidVersion<15) random-if(B2G||B2GDT) == 647192-1.html 647192-1-ref.html
-skip-if(!browserIsRemote) == 656041-1.html 656041-1-ref.html
+skip-if(!browserIsRemote||(B2G&&browserIsRemote)) == 656041-1.html 656041-1-ref.html
 skip-if(!browserIsRemote||layersOMTC) == test-displayport-bg.html test-displayport-ref.html # bug 694706
 
 # IPC Position-fixed frames/layers test
 # Fixed layers are temporarily disabled (bug 656167).
 #skip-if(!browserIsRemote) == test-pos-fixed.html test-pos-fixed-ref.html
 #skip-if(!browserIsRemote) == test-bg-attachment-fixed.html test-bg-attachment-fixed-ref.html
 skip-if(!browserIsRemote) == test-pos-fixed-transform.html test-pos-fixed-transform-ref.html
 
--- a/layout/reftests/reftest.list
+++ b/layout/reftests/reftest.list
@@ -158,17 +158,17 @@ skip-if(B2G) include floats/reftest.list
 
 # font-face
 include font-face/reftest.list
 
 # font features (opentype)
 skip-if(B2G) include font-features/reftest.list
 
 # mobile font size inflation
-include font-inflation/reftest.list
+skip-if(B2G&&browserIsRemote) include font-inflation/reftest.list
 
 # font matching
 skip-if(B2G) include font-matching/reftest.list
 
 # forms
 skip-if(Android) include forms/reftest.list
 
 # gfx
--- a/layout/reftests/scrolling/reftest.list
+++ b/layout/reftests/scrolling/reftest.list
@@ -1,25 +1,25 @@
-HTTP == deferred-anchor.xhtml#d deferred-anchor-ref.xhtml#d
+skip-if(B2G&&browserIsRemote) HTTP == deferred-anchor.xhtml#d deferred-anchor-ref.xhtml#d
 HTTP == fixed-1.html fixed-1.html?ref
 HTTP == fixed-opacity-1.html fixed-opacity-1.html?ref
 skip-if(B2G) HTTP == fixed-opacity-2.html fixed-opacity-2.html?ref
 skip-if(B2G) random-if(gtk2Widget) fuzzy-if(Android,3,60) HTTP == fixed-text-1.html fixed-text-1.html?ref
 HTTP == fixed-text-2.html fixed-text-2.html?ref
-random-if(Android&&!browserIsRemote) == iframe-border-radius.html iframe-border-radius-ref.html # bug 760269
+random-if(Android&&!browserIsRemote) skip-if(B2G&&browserIsRemote) == iframe-border-radius.html iframe-border-radius-ref.html # bug 760269
 random-if(Android) HTTP == image-1.html image-1.html?ref
 random-if(Android&&!browserIsRemote) HTTP == opacity-mixed-scrolling-1.html opacity-mixed-scrolling-1.html?ref # bug 760269
 skip-if(B2G) random-if(cocoaWidget) HTTP == opacity-mixed-scrolling-2.html opacity-mixed-scrolling-2.html?ref # see bug 625357
-HTTP == simple-1.html simple-1.html?ref
+skip-if(B2G&&browserIsRemote) HTTP == simple-1.html simple-1.html?ref
 skip-if(B2G) HTTP == subpixel-1.html#d subpixel-1-ref.html#d
 fuzzy-if(Android,4,120) HTTP == text-1.html text-1.html?ref
 fuzzy-if(Android,4,120) HTTP == text-2.html?up text-2.html?ref
 skip-if(B2G) fuzzy-if(Android&&AndroidVersion<15,251,722) fails-if(Android&&AndroidVersion>=15) HTTP == transformed-1.html transformed-1.html?ref #Bug 900607
 HTTP == transformed-1.html?up transformed-1.html?ref
 fuzzy-if(Android,5,20000) == uncovering-1.html uncovering-1-ref.html
 fuzzy-if(Android,5,20000) == uncovering-2.html uncovering-2-ref.html
 skip-if(B2G) == less-than-scrollbar-height.html less-than-scrollbar-height-ref.html
 skip-if(B2G) == huge-horizontal-overflow.html huge-horizontal-overflow-ref.html
 skip-if(B2G) == huge-vertical-overflow.html huge-vertical-overflow-ref.html
 == iframe-scrolling-attr-1.html iframe-scrolling-attr-ref.html
-== iframe-scrolling-attr-2.html iframe-scrolling-attr-ref.html
+skip-if(B2G&&browserIsRemote) == iframe-scrolling-attr-2.html iframe-scrolling-attr-ref.html
 == frame-scrolling-attr-1.html frame-scrolling-attr-ref.html
 == frame-scrolling-attr-2.html frame-scrolling-attr-ref.html
--- a/layout/reftests/svg/as-image/zoom/reftest.list
+++ b/layout/reftests/svg/as-image/zoom/reftest.list
@@ -1,12 +1,12 @@
 # Tests related to SVG being used as an image, with zooming
 
 # Simple <img> tests
 == img-zoomIn-1.html   squaredCircle-150x150-ref.html
 
 == img-zoomOut-1.html  squaredCircle-50x50-ref.html
 
 # Ensure that scaled SVG images aren't fuzzy when tiled.
-== img-fuzzy-zoomOut-1.html           img-fuzzy-zoomOut-1-ref.html
+skip-if(B2G&&browserIsRemote) == img-fuzzy-zoomOut-1.html           img-fuzzy-zoomOut-1-ref.html
 == img-fuzzy-zoomIn-1.html            img-fuzzy-zoomIn-1-ref.html
 == img-fuzzy-transform-zoomOut-1.html img-fuzzy-zoomOut-1-ref.html
 == img-fuzzy-transform-zoomIn-1.html  img-fuzzy-zoomIn-1-ref.html
--- a/layout/reftests/svg/image/reftest.list
+++ b/layout/reftests/svg/image/reftest.list
@@ -10,24 +10,24 @@ fuzzy-if(Android,4,34) == image-opacity-
 == image-rotate-02b.svg                       image-rotate-02-ref.svg
 == image-scaling-01.svg                       ../pass.svg
 == image-scaling-02.svg                       ../pass.svg
 == image-svg-inline-01.html                   ../pass.svg
 == image-svg-inline-zoom-in-01a.html          ../pass.svg
 == image-svg-inline-zoom-in-01b.html          ../pass.svg
 == image-svg-inline-zoom-in-01c.html          ../pass.svg
 == image-svg-inline-zoom-in-01d.html          ../pass.svg
-== image-svg-inline-zoom-out-01a.html         ../pass.svg
-== image-svg-inline-zoom-out-01b.html         ../pass.svg
-== image-svg-inline-zoom-out-01c.html         ../pass.svg
-== image-svg-inline-zoom-out-01d.html         ../pass.svg
-== image-svg-inline-sprite-zoom-in-01a.html   image-svg-inline-sprite-zoom-in-01-ref.html
-== image-svg-inline-sprite-zoom-in-01b.html   image-svg-inline-sprite-zoom-in-01-ref.html
-== image-svg-inline-sprite-zoom-out-01a.html  image-svg-inline-sprite-zoom-out-01-ref.html
-== image-svg-inline-sprite-zoom-out-01b.html  image-svg-inline-sprite-zoom-out-01-ref.html
+skip-if(B2G&&browserIsRemote) == image-svg-inline-zoom-out-01a.html         ../pass.svg
+skip-if(B2G&&browserIsRemote) == image-svg-inline-zoom-out-01b.html         ../pass.svg
+skip-if(B2G&&browserIsRemote) == image-svg-inline-zoom-out-01c.html         ../pass.svg
+skip-if(B2G&&browserIsRemote) == image-svg-inline-zoom-out-01d.html         ../pass.svg
+skip-if(B2G&&browserIsRemote) == image-svg-inline-sprite-zoom-in-01a.html   image-svg-inline-sprite-zoom-in-01-ref.html
+skip-if(B2G&&browserIsRemote) == image-svg-inline-sprite-zoom-in-01b.html   image-svg-inline-sprite-zoom-in-01-ref.html
+skip-if(B2G&&browserIsRemote) == image-svg-inline-sprite-zoom-out-01a.html  image-svg-inline-sprite-zoom-out-01-ref.html
+skip-if(B2G&&browserIsRemote) == image-svg-inline-sprite-zoom-out-01b.html  image-svg-inline-sprite-zoom-out-01-ref.html
 == image-translate-01.svg                     image-translate-01-ref.svg
 == image-x-01.svg                             image-x-01-ref.svg
 == image-xy-01.svg                            image-xy-01-ref.svg
 == image-y-01.svg                             image-y-01-ref.svg
 == image-zoom-02.svg                          image-zoom-02-ref.svg
 == imported-image-01.svg                      imported-image-ref.svg
 == imported-image-02.svg                      imported-image-ref.svg
 
--- a/layout/reftests/svg/moz-only/reftest.list
+++ b/layout/reftests/svg/moz-only/reftest.list
@@ -1,22 +1,22 @@
 
 # XBL tests
-== xbl-basic-01.svg                             pass.svg
-== xbl-basic-02.svg                             pass.svg
+skip-if(B2G&&browserIsRemote) == xbl-basic-01.svg                             pass.svg
+skip-if(B2G&&browserIsRemote) == xbl-basic-02.svg                             pass.svg
 skip-if(B2G) == xbl-basic-03.svg                             pass.svg # bug 773482
 skip-if(B2G) == xbl-grad-ref--grad-in-binding-01.svg         pass.svg
-== xbl-grad-ref--grad-in-binding-02.svg         pass.svg
-== xbl-grad-ref--grad-in-bound-01.svg           pass.svg
+skip-if(B2G&&browserIsRemote) == xbl-grad-ref--grad-in-binding-02.svg         pass.svg
+skip-if(B2G&&browserIsRemote) == xbl-grad-ref--grad-in-bound-01.svg           pass.svg
 fails == xbl-grad-ref--grad-in-bound-02.svg     pass-black.svg
 fails == xbl-grad-ref--grad-in-resources-01.svg pass.svg
 fails == xbl-grad-ref--grad-in-resources-02.svg pass.svg
-== xbl-grad-ref--grad-in-binding-03.svg         pass.svg
-== xbl-grad-ref--grad-in-bound-03.svg           pass.svg
-== xbl-grad-ref--grad-in-binding-04.svg         pass.svg
-== xbl-grad-ref--grad-in-bound-04.svg           pass.svg
+skip-if(B2G&&browserIsRemote) == xbl-grad-ref--grad-in-binding-03.svg         pass.svg
+skip-if(B2G&&browserIsRemote) == xbl-grad-ref--grad-in-bound-03.svg           pass.svg
+skip-if(B2G&&browserIsRemote) == xbl-grad-ref--grad-in-binding-04.svg         pass.svg
+skip-if(B2G&&browserIsRemote) == xbl-grad-ref--grad-in-bound-04.svg           pass.svg
 
 # Tests for zooming with the full page zoom UI
 skip-if(B2G) random-if(d2d) == feImage-zoom-01a.svg          feImage-zoom-01-ref.svg # bug 773482
 skip-if(B2G) random-if(d2d) == feImage-zoom-01b.svg          feImage-zoom-01-ref.svg # bug 773482
 skip-if(B2G) == foreignObject-zoom-01.svg                    pass.svg # bug 773482
 skip-if(B2G) == zoom-invalidation-01.svg                     pass.svg # bug 773482
 fuzzy-if(winWidget,12,7) == zoomed-svg-with-viewBox-01.svg   zoomed-svg-with-viewBox-01-ref.svg
--- a/layout/reftests/svg/svg-integration/reftest.list
+++ b/layout/reftests/svg/svg-integration/reftest.list
@@ -23,14 +23,14 @@ skip-if(B2G) == clipPath-html-06-extref.
 == dynamic-conditions-outer-svg-04.xhtml ../pass.svg
 == filter-html-01.xhtml filter-html-01-ref.svg
 skip-if(B2G) == filter-html-01-extref.xhtml filter-html-01-ref.svg
 == filter-html-zoomed-01.xhtml filter-html-01-ref.svg
 == mask-html-01.xhtml mask-html-01-ref.svg
 skip-if(B2G) == mask-html-01-extref-01.xhtml mask-html-01-ref.svg
 skip-if(B2G) == mask-html-01-extref-02.xhtml mask-html-01-ref.svg
 == mask-html-zoomed-01.xhtml mask-html-01-ref.svg
-== mask-html-xbl-bound-01.html mask-html-01-ref.svg
+skip-if(B2G&&browserIsRemote) == mask-html-xbl-bound-01.html mask-html-01-ref.svg
 == mask-transformed-html-01.xhtml ../pass.svg
 == mask-transformed-html-02.xhtml ../pass.svg
 == patterned-svg-under-transformed-html-01.xhtml ../pass.svg
 == patterned-svg-under-transformed-html-02.xhtml ../pass.svg
 
--- a/layout/reftests/text/reftest.list
+++ b/layout/reftests/text/reftest.list
@@ -104,17 +104,17 @@ HTTP(..) == synthetic-bold-papyrus-01.ht
 == text-align-left-in-rtl-block.html text-align-left-in-rtl-block-ref.html
 HTTP(..) == variation-selector-unsupported-1.html variation-selector-unsupported-1-ref.html
 == white-space-1a.html white-space-1-ref.html
 == white-space-1b.html white-space-1-ref.html
 == white-space-2.html white-space-2-ref.html
 == wordbreak-1.html wordbreak-1-ref.html
 == wordbreak-2.html wordbreak-2-ref.html
 == wordbreak-3.html wordbreak-3-ref.html
-skip-if(Android&&AndroidVersion==17) == wordbreak-4a.html wordbreak-4a-ref.html
+skip-if((Android&&AndroidVersion==17)||(B2G&&browserIsRemote)) == wordbreak-4a.html wordbreak-4a-ref.html
 == wordbreak-4b.html wordbreak-4b-ref.html
 == wordbreak-5.html wordbreak-5-ref.html
 == wordbreak-6.html wordbreak-6-ref.html
 skip-if(B2G) HTTP(..) == wordbreak-7a.html wordbreak-7a-ref.html
 fails HTTP(..) == wordbreak-7b.html wordbreak-7b-ref.html # bug 479829
 == wordbreak-8.html wordbreak-8-ref.html
 pref(gfx.font_rendering.graphite.enabled,true) HTTP(..) == wordbreak-9.html wordbreak-9-ref.html
 == wordwrap-01.html wordwrap-01-ref.html
--- a/layout/svg/nsFilterInstance.cpp
+++ b/layout/svg/nsFilterInstance.cpp
@@ -210,16 +210,22 @@ nsFilterInstance::BuildPrimitivesForFilt
     }
 
     // For now, we use the last SVG filter region as the overall filter region
     // for the filter chain. Eventually, we will compute the overall filter
     // using all of the generated FilterPrimitiveDescriptions.
     mFilterRegion = svgFilterInstance.GetFilterRegion();
     mFilterSpaceBounds = svgFilterInstance.GetFilterSpaceBounds();
 
+    // If this overflows, we can at least paint the maximum surface size.
+    bool overflow;
+    gfxIntSize surfaceSize =
+      nsSVGUtils::ConvertToSurfaceSize(mFilterSpaceBounds.Size(), &overflow);
+    mFilterSpaceBounds.SizeTo(surfaceSize);
+
     return svgFilterInstance.BuildPrimitives(mPrimitiveDescriptions, mInputImages);
   }
 
   // Eventually, we will build primitives for CSS filters, too.
   return NS_ERROR_FAILURE;
 }
 
 void
--- a/layout/svg/nsSVGFilterInstance.cpp
+++ b/layout/svg/nsSVGFilterInstance.cpp
@@ -43,76 +43,97 @@ nsSVGFilterInstance::nsSVGFilterInstance
   if (!mFilterElement) {
     NS_NOTREACHED("filter frame should have a related element");
     return;
   }
 
   mPrimitiveUnits =
     mFilterFrame->GetEnumValue(SVGFilterElement::PRIMITIVEUNITS);
 
-  // Get the filter region (in the filtered element's user space):
+  nsresult rv = ComputeUserSpaceToIntermediateSpaceScale();
+  if (NS_FAILED(rv)) {
+    return;
+  }
+
+  rv = ComputeBounds();
+  if (NS_FAILED(rv)) {
+    return;
+  }
+
+  mInitialized = true;
+}
 
+nsresult
+nsSVGFilterInstance::ComputeUserSpaceToIntermediateSpaceScale()
+{
+  gfxMatrix canvasTransform =
+    nsSVGUtils::GetCanvasTM(mTargetFrame, nsISVGChildFrame::FOR_OUTERSVG_TM);
+  if (canvasTransform.IsSingular()) {
+    // Nothing should be rendered.
+    return NS_ERROR_FAILURE;
+  }
+  mUserSpaceToIntermediateSpaceScale = canvasTransform.ScaleFactors(true);
+  mIntermediateSpaceToUserSpaceScale = gfxSize(1.0 / mUserSpaceToIntermediateSpaceScale.width,
+                                               1.0 / mUserSpaceToIntermediateSpaceScale.height);
+  return NS_OK;
+}
+
+nsresult
+nsSVGFilterInstance::ComputeBounds()
+{
   // XXX if filterUnits is set (or has defaulted) to objectBoundingBox, we
   // should send a warning to the error console if the author has used lengths
   // with units. This is a common mistake and can result in the filter region
   // being *massive* below (because we ignore the units and interpret the number
   // as a factor of the bbox width/height). We should also send a warning if the
   // user uses a number without units (a future SVG spec should really
   // deprecate that, since it's too confusing for a bare number to be sometimes
   // interpreted as a fraction of the bounding box and sometimes as user-space
   // units). So really only percentage values should be used in this case.
   
+  // Set the user space bounds (i.e. the filter region in user space).
   nsSVGLength2 XYWH[4];
   NS_ABORT_IF_FALSE(sizeof(mFilterElement->mLengthAttributes) == sizeof(XYWH),
                     "XYWH size incorrect");
   memcpy(XYWH, mFilterElement->mLengthAttributes, 
     sizeof(mFilterElement->mLengthAttributes));
   XYWH[0] = *mFilterFrame->GetLengthValue(SVGFilterElement::ATTR_X);
   XYWH[1] = *mFilterFrame->GetLengthValue(SVGFilterElement::ATTR_Y);
   XYWH[2] = *mFilterFrame->GetLengthValue(SVGFilterElement::ATTR_WIDTH);
   XYWH[3] = *mFilterFrame->GetLengthValue(SVGFilterElement::ATTR_HEIGHT);
   uint16_t filterUnits =
     mFilterFrame->GetEnumValue(SVGFilterElement::FILTERUNITS);
-  // The filter region in user space, in user units:
-  mFilterRegion = nsSVGUtils::GetRelativeRect(filterUnits,
+  mUserSpaceBounds = nsSVGUtils::GetRelativeRect(filterUnits,
     XYWH, mTargetBBox, mTargetFrame);
 
-  if (mFilterRegion.Width() <= 0 || mFilterRegion.Height() <= 0) {
+  // Temporarily transform the user space bounds to intermediate space, so we
+  // can align them with the pixel boundries of the offscreen surface.
+  // The offscreen surface has the same scale as intermediate space.
+  mUserSpaceBounds = UserSpaceToIntermediateSpace(mUserSpaceBounds);
+  mUserSpaceBounds.RoundOut();
+  if (mUserSpaceBounds.Width() <= 0 || mUserSpaceBounds.Height() <= 0) {
     // 0 disables rendering, < 0 is error. dispatch error console warning
     // or error as appropriate.
-    return;
+    return NS_ERROR_FAILURE;
   }
 
-  // Calculate the width and height of the pixel buffer of the
-  // temporary offscreen surface that we would/will create to paint into when
-  // painting the entire filtered element and, if necessary, adjust
-  // mFilterRegion out slightly so that it aligns with pixel boundaries of this
-  // buffer:
-
-  // Match filter space as closely as possible to the pixel density of the
-  // nearest outer 'svg' device space:
-  gfxMatrix canvasTM =
-    nsSVGUtils::GetCanvasTM(mTargetFrame, nsISVGChildFrame::FOR_OUTERSVG_TM);
-  if (canvasTM.IsSingular()) {
-    // nothing to draw
-    return;
+  // Set the intermediate space bounds.
+  if (!gfxUtils::GfxRectToIntRect(mUserSpaceBounds, &mIntermediateSpaceBounds)) {
+    // The filter region is way too big if there is float -> int overflow.
+    return NS_ERROR_FAILURE;
   }
 
-  gfxSize scale = canvasTM.ScaleFactors(true);
-  mFilterRegion.Scale(scale.width, scale.height);
-  mFilterRegion.RoundOut();
+  // Set the filter space bounds.
+  mFilterSpaceBounds = mIntermediateSpaceBounds;
+  mFilterSpaceBounds.MoveTo(0, 0);
 
-  // We don't care if this overflows, because we can handle upscaling/
-  // downscaling to filter space.
-  bool overflow;
-  mFilterSpaceBounds.SetRect(nsIntPoint(0, 0),
-    nsSVGUtils::ConvertToSurfaceSize(mFilterRegion.Size(), &overflow));
-  mFilterRegion.Scale(1.0 / scale.width, 1.0 / scale.height);
+  // Undo the temporary transformation of the user space bounds.
+  mUserSpaceBounds = IntermediateSpaceToUserSpace(mUserSpaceBounds);
 
-  mInitialized = true;
+  return NS_OK;
 }
 
 nsSVGFilterFrame*
 nsSVGFilterInstance::GetFilterFrame()
 {
   if (mFilter.GetType() != NS_STYLE_FILTER_URL) {
     // The filter is not an SVG reference filter.
     return nullptr;
@@ -163,24 +184,24 @@ nsSVGFilterInstance::GetPrimitiveNumber(
   if (mPrimitiveUnits == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
     value = nsSVGUtils::ObjectSpace(mTargetBBox, &val);
   } else {
     value = nsSVGUtils::UserSpace(mTargetFrame, &val);
   }
 
   switch (aCtxType) {
   case SVGContentUtils::X:
-    return value * mFilterSpaceBounds.width / mFilterRegion.Width();
+    return value * mUserSpaceToIntermediateSpaceScale.width;
   case SVGContentUtils::Y:
-    return value * mFilterSpaceBounds.height / mFilterRegion.Height();
+    return value * mUserSpaceToIntermediateSpaceScale.height;
   case SVGContentUtils::XY:
   default:
     return value * SVGContentUtils::ComputeNormalizedHypotenuse(
-                     mFilterSpaceBounds.width / mFilterRegion.Width(),
-                     mFilterSpaceBounds.height / mFilterRegion.Height());
+                     mUserSpaceToIntermediateSpaceScale.width,
+                     mUserSpaceToIntermediateSpaceScale.height);
   }
 }
 
 Point3D
 nsSVGFilterInstance::ConvertLocation(const Point3D& aPoint) const
 {
   nsSVGLength2 val[4];
   val[0].Init(SVGContentUtils::X, 0xff, aPoint.x,
@@ -195,32 +216,37 @@ nsSVGFilterInstance::ConvertLocation(con
 
   gfxRect feArea = nsSVGUtils::GetRelativeRect(mPrimitiveUnits,
     val, mTargetBBox, mTargetFrame);
   gfxRect r = UserSpaceToFilterSpace(feArea);
   return Point3D(r.x, r.y, GetPrimitiveNumber(SVGContentUtils::XY, aPoint.z));
 }
 
 gfxRect
-nsSVGFilterInstance::UserSpaceToFilterSpace(const gfxRect& aRect) const
+nsSVGFilterInstance::UserSpaceToFilterSpace(const gfxRect& aUserSpaceRect) const
 {
-  gfxRect r = aRect - mFilterRegion.TopLeft();
-  r.Scale(mFilterSpaceBounds.width / mFilterRegion.Width(),
-          mFilterSpaceBounds.height / mFilterRegion.Height());
-  return r;
+  return IntermediateSpaceToUserSpace(aUserSpaceRect - mUserSpaceBounds.TopLeft());
 }
 
-gfxMatrix
-nsSVGFilterInstance::GetUserSpaceToFilterSpaceTransform() const
+gfxRect
+nsSVGFilterInstance::UserSpaceToIntermediateSpace(const gfxRect& aUserSpaceRect) const
 {
-  gfxFloat widthScale = mFilterSpaceBounds.width / mFilterRegion.Width();
-  gfxFloat heightScale = mFilterSpaceBounds.height / mFilterRegion.Height();
-  return gfxMatrix(widthScale, 0.0f,
-                   0.0f, heightScale,
-                   -mFilterRegion.X() * widthScale, -mFilterRegion.Y() * heightScale);
+  gfxRect intermediateSpaceRect = aUserSpaceRect;
+  intermediateSpaceRect.Scale(mUserSpaceToIntermediateSpaceScale.width,
+                              mUserSpaceToIntermediateSpaceScale.height);
+  return intermediateSpaceRect;
+}
+
+gfxRect
+nsSVGFilterInstance::IntermediateSpaceToUserSpace(const gfxRect& aIntermediateSpaceRect) const
+{
+  gfxRect userSpaceRect = aIntermediateSpaceRect;
+  userSpaceRect.Scale(mIntermediateSpaceToUserSpaceScale.width,
+                      mIntermediateSpaceToUserSpaceScale.height);
+  return userSpaceRect;
 }
 
 IntRect
 nsSVGFilterInstance::ComputeFilterPrimitiveSubregion(nsSVGFE* aFilterElement,
                                                      const nsTArray<FilterPrimitiveDescription>& aPrimitiveDescrs,
                                                      const nsTArray<int32_t>& aInputIndices)
 {
   nsSVGFE* fE = aFilterElement;
--- a/layout/svg/nsSVGFilterInstance.h
+++ b/layout/svg/nsSVGFilterInstance.h
@@ -26,16 +26,48 @@ class SVGFilterElement;
 
 /**
  * This class helps nsFilterInstance build its filter graph by processing a
  * single SVG reference filter.
  *
  * In BuildPrimitives, this class iterates through the referenced <filter>
  * element's primitive elements, creating a FilterPrimitiveDescription for
  * each one.
+ *
+ * This class uses several different coordinate spaces, defined as follows:
+ *
+ * "user space"
+ *   The filtered SVG element's user space or the filtered HTML element's
+ *   CSS pixel space. The origin for an HTML element is the top left corner of
+ *   its border box.
+ *
+ * "intermediate space"
+ *   User space scaled to device pixels. Shares the same origin as user space.
+ *   This space is the same across chained SVG and CSS filters. To compute the
+ *   overall filter space for a chain, we first need to build each filter's
+ *   FilterPrimitiveDescriptions in some common space. That space is
+ *   intermediate space.
+ *
+ * "filter space"
+ *   Intermediate space translated to the origin of this SVG filter's
+ *   filter region. This space may be different for each filter in a chain.
+ *
+ * To understand the spaces better, let's take an example filter that defines a
+ * filter region:
+ *   <filter id="f" x="-15" y="-15" width="130" height="130">...</filter>
+ *
+ * And apply the filter to a div element:
+ *   <div style="filter: url(#f); ...">...</div>
+ *
+ * And let's say there are 2 device pixels for every 1 CSS pixel.
+ *
+ * Then:
+ *   "user space" = the CSS pixel space of the <div>
+ *   "intermediate space" = "user space" * 2
+ *   "filter space" = "intermediate space" + 15
  */
 class nsSVGFilterInstance
 {
   typedef mozilla::gfx::Point3D Point3D;
   typedef mozilla::gfx::IntRect IntRect;
   typedef mozilla::gfx::SourceSurface SourceSurface;
   typedef mozilla::gfx::FilterPrimitiveDescription FilterPrimitiveDescription;
 
@@ -65,17 +97,17 @@ public:
                            nsTArray<mozilla::RefPtr<SourceSurface>>& aInputImages);
 
   /**
    * Returns the user specified "filter region", in the filtered element's user
    * space, after it has been adjusted out (if necessary) so that its edges
    * coincide with pixel boundaries of the offscreen surface into which the
    * filtered output would/will be painted.
    */
-  gfxRect GetFilterRegion() const { return mFilterRegion; }
+  gfxRect GetFilterRegion() const { return mUserSpaceBounds; }
 
   /**
    * Returns the size of the user specified "filter region", in filter space.
    */
   nsIntRect GetFilterSpaceBounds() const { return mFilterSpaceBounds; }
 
   float GetPrimitiveNumber(uint8_t aCtxType, const nsSVGNumber2 *aNumber) const
   {
@@ -90,20 +122,19 @@ public:
   /**
    * Converts a userSpaceOnUse/objectBoundingBoxUnits unitless point
    * into filter space, depending on the value of mPrimitiveUnits. (For
    * objectBoundingBoxUnits, the bounding box offset is applied to the point.)
    */
   Point3D ConvertLocation(const Point3D& aPoint) const;
 
   /**
-   * Returns the transform from the filtered element's user space to filter
-   * space. This will be a simple translation and/or scale.
+   * Transform a rect between user space and filter space.
    */
-  gfxMatrix GetUserSpaceToFilterSpaceTransform() const;
+  gfxRect UserSpaceToFilterSpace(const gfxRect& aUserSpaceRect) const;
 
 private:
   /**
    * Finds the filter frame associated with this SVG filter.
    */
   nsSVGFilterFrame* GetFilterFrame();
 
   /**
@@ -122,17 +153,21 @@ private:
                            nsTArray<bool>& aOutInputsAreTainted);
 
   /**
    * Scales a numeric filter primitive length in the X, Y or "XY" directions
    * into a length in filter space (no offset is applied).
    */
   float GetPrimitiveNumber(uint8_t aCtxType, float aValue) const;
 
-  gfxRect UserSpaceToFilterSpace(const gfxRect& aUserSpace) const;
+  /**
+   * Transform a rect between user space and intermediate space.
+   */
+  gfxRect UserSpaceToIntermediateSpace(const gfxRect& aUserSpaceRect) const;
+  gfxRect IntermediateSpaceToUserSpace(const gfxRect& aIntermediateSpaceRect) const;
 
   /**
    * Returns the transform from frame space to the coordinate space that
    * GetCanvasTM transforms to. "Frame space" is the origin of a frame, aka the
    * top-left corner of its border box, aka the top left corner of its mRect.
    */
   gfxMatrix GetUserSpaceToFrameSpaceInCSSPxTransform() const;
 
@@ -144,16 +179,27 @@ private:
    * FilterPrimitiveDescription representing "another-primitive".
    */
   nsresult GetSourceIndices(nsSVGFE* aPrimitiveElement,
                             const nsTArray<FilterPrimitiveDescription>& aPrimitiveDescrs,
                             const nsDataHashtable<nsStringHashKey, int32_t>& aImageTable,
                             nsTArray<int32_t>& aSourceIndices);
 
   /**
+   * Compute the scale factors between user space and intermediate space.
+   */
+  nsresult ComputeUserSpaceToIntermediateSpaceScale();
+
+  /**
+   * Compute the filter region in user space, intermediate space, and filter
+   * space.
+   */
+  nsresult ComputeBounds();
+
+  /**
    * The SVG reference filter originally from the style system.
    */
   const nsStyleFilter mFilter;
 
   /**
    * The frame for the element that is currently being filtered.
    */
   nsIFrame*               mTargetFrame;
@@ -169,22 +215,29 @@ private:
   nsSVGFilterFrame* mFilterFrame;
 
   /**
    * The SVG bbox of the element that is being filtered, in user space.
    */
   gfxRect                 mTargetBBox;
 
   /**
-   * The "filter region", in the filtered element's user space.
+   * The "filter region" in various spaces.
    */
-  gfxRect                 mFilterRegion;
+  gfxRect                 mUserSpaceBounds;
+  nsIntRect               mIntermediateSpaceBounds;
   nsIntRect               mFilterSpaceBounds;
 
   /**
+   * The scale factors between user space and intermediate space.
+   */
+  gfxSize                 mUserSpaceToIntermediateSpaceScale;
+  gfxSize                 mIntermediateSpaceToUserSpaceScale;
+
+  /**
    * The 'primitiveUnits' attribute value (objectBoundingBox or userSpaceOnUse).
    */
   uint16_t                mPrimitiveUnits;
 
   /**
    * The index of the FilterPrimitiveDescription that this SVG filter should use
    * as its SourceGraphic, or the SourceGraphic keyword index if this is the
    * first filter in a chain.
--- a/mfbt/CheckedInt.h
+++ b/mfbt/CheckedInt.h
@@ -592,17 +592,17 @@ struct NegateImpl<T, true>
 template<typename T>
 class CheckedInt
 {
   protected:
     T mValue;
     bool mIsValid;
 
     template<typename U>
-    CheckedInt(U value, bool isValid) : mValue(value), mIsValid(isValid)
+    CheckedInt(U aValue, bool aIsValid) : mValue(aValue), mIsValid(aIsValid)
     {
       static_assert(detail::IsSupported<T>::value &&
                     detail::IsSupported<U>::value,
                     "This type is not supported by CheckedInt");
     }
 
     friend struct detail::NegateImpl<T>;
 
@@ -614,19 +614,19 @@ class CheckedInt
      *
      * This constructor is not explicit. Instead, the type of its argument is a
      * separate template parameter, ensuring that no conversion is performed
      * before this constructor is actually called. As explained in the above
      * documentation for class CheckedInt, this constructor checks that its
      * argument is valid.
      */
     template<typename U>
-    CheckedInt(U value)
-      : mValue(T(value)),
-        mIsValid(detail::IsInRange<T>(value))
+    CheckedInt(U aValue)
+      : mValue(T(aValue)),
+        mIsValid(detail::IsInRange<T>(aValue))
     {
       static_assert(detail::IsSupported<T>::value &&
                     detail::IsSupported<U>::value,
                     "This type is not supported by CheckedInt");
     }
 
     template<typename U>
     friend class CheckedInt;
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -1251,17 +1251,17 @@ pref("network.dns.disableIPv6", false);
 
 // This is the number of dns cache entries allowed
 pref("network.dnsCacheEntries", 400);
 
 // In the absence of OS TTLs, the DNS cache TTL value
 pref("network.dnsCacheExpiration", 60);
 
 // The grace period allows the DNS cache to use expired entries, while kicking off
-// a revalidation in the background. In seconds, but rounded to minutes in gecko.
+// a revalidation in the background.
 pref("network.dnsCacheExpirationGracePeriod", 60);
 
 // This preference can be used to turn off DNS prefetch.
 pref("network.dns.disablePrefetch", false);
 
 // This preference controls whether or not URLs with UTF-8 characters are
 // escaped.  Set this preference to TRUE for strict RFC2396 conformance.
 pref("network.standard-url.escape-utf8", true);
--- a/netwerk/base/src/nsSocketTransportService2.cpp
+++ b/netwerk/base/src/nsSocketTransportService2.cpp
@@ -117,18 +117,18 @@ nsSocketTransportService::GetThreadSafel
 }
 
 NS_IMETHODIMP
 nsSocketTransportService::Dispatch(nsIRunnable *event, uint32_t flags)
 {
     SOCKET_LOG(("STS dispatch [%p]\n", event));
 
     nsCOMPtr<nsIThread> thread = GetThreadSafely();
-    NS_ENSURE_TRUE(thread, NS_ERROR_NOT_INITIALIZED);
-    nsresult rv = thread->Dispatch(event, flags);
+    nsresult rv;
+    rv = thread ? thread->Dispatch(event, flags) : NS_ERROR_NOT_INITIALIZED;
     if (rv == NS_ERROR_UNEXPECTED) {
         // Thread is no longer accepting events. We must have just shut it
         // down on the main thread. Pretend we never saw it.
         rv = NS_ERROR_NOT_INITIALIZED;
     }
     return rv;
 }
 
--- a/netwerk/dns/nsDNSService2.cpp
+++ b/netwerk/dns/nsDNSService2.cpp
@@ -452,35 +452,35 @@ NS_IMETHODIMP
 nsDNSService::Init()
 {
     if (mResolver)
         return NS_OK;
     NS_ENSURE_TRUE(!mResolver, NS_ERROR_ALREADY_INITIALIZED);
 
     // prefs
     uint32_t maxCacheEntries  = 400;
-    uint32_t maxCacheLifetime = 2; // minutes
-    uint32_t lifetimeGracePeriod = 1;
+    uint32_t maxCacheLifetime = 120; // seconds
+    uint32_t lifetimeGracePeriod = 60; // seconds
     bool     disableIPv6      = false;
     bool     disablePrefetch  = false;
     int      proxyType        = nsIProtocolProxyService::PROXYCONFIG_DIRECT;
 
     nsAdoptingCString ipv4OnlyDomains;
     nsAdoptingCString localDomains;
 
     // read prefs
     nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
     if (prefs) {
         int32_t val;
         if (NS_SUCCEEDED(prefs->GetIntPref(kPrefDnsCacheEntries, &val)))
             maxCacheEntries = (uint32_t) val;
         if (NS_SUCCEEDED(prefs->GetIntPref(kPrefDnsCacheExpiration, &val)))
-            maxCacheLifetime = val / 60; // convert from seconds to minutes
+            maxCacheLifetime = val;
         if (NS_SUCCEEDED(prefs->GetIntPref(kPrefDnsCacheGrace, &val)))
-            lifetimeGracePeriod = val / 60; // convert from seconds to minutes
+            lifetimeGracePeriod = val;
 
         // ASSUMPTION: pref branch does not modify out params on failure
         prefs->GetBoolPref(kPrefDisableIPv6, &disableIPv6);
         prefs->GetCharPref(kPrefIPv4OnlyDomains, getter_Copies(ipv4OnlyDomains));
         prefs->GetCharPref(kPrefDnsLocalDomains, getter_Copies(localDomains));
         prefs->GetBoolPref(kPrefDisablePrefetch, &disablePrefetch);
 
         // If a manual proxy is in use, disable prefetch implicitly
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -410,18 +410,18 @@ HostDB_RemoveEntry(PLDHashTable *table,
 }
 
 //----------------------------------------------------------------------------
 
 nsHostResolver::nsHostResolver(uint32_t maxCacheEntries,
                                uint32_t maxCacheLifetime,
                                uint32_t lifetimeGracePeriod)
     : mMaxCacheEntries(maxCacheEntries)
-    , mMaxCacheLifetime(TimeDuration::FromSeconds(maxCacheLifetime * 60))
-    , mGracePeriod(lifetimeGracePeriod)
+    , mMaxCacheLifetime(TimeDuration::FromSeconds(maxCacheLifetime))
+    , mGracePeriod(TimeDuration::FromSeconds(lifetimeGracePeriod))
     , mLock("nsHostResolver.mLock")
     , mIdleThreadCV(mLock, "nsHostResolver.mIdleThreadCV")
     , mNumIdleThreads(0)
     , mThreadCount(0)
     , mActiveAnyThreadCount(0)
     , mEvictionQSize(0)
     , mPendingCount(0)
     , mShutdown(true)
@@ -591,17 +591,17 @@ nsHostResolver::ResolveHost(const char  
             // if the record is null, then HostDB_InitEntry failed.
             if (!he || !he->rec) {
                 LOG(("  Out of memory: no cache entry for [%s].\n", host));
                 rv = NS_ERROR_OUT_OF_MEMORY;
             }
             // do we have a cached result that we can reuse?
             else if (!(flags & RES_BYPASS_CACHE) &&
                      he->rec->HasUsableResult(flags) &&
-                     TimeStamp::NowLoRes() <= (he->rec->expiration + TimeDuration::FromSeconds(mGracePeriod * 60))) {
+                     TimeStamp::NowLoRes() <= (he->rec->expiration + mGracePeriod)) {
                 LOG(("  Using cached record for host [%s].\n", host));
                 // put reference to host record on stack...
                 result = he->rec;
                 Telemetry::Accumulate(Telemetry::DNS_LOOKUP_METHOD2, METHOD_HIT);
 
                 // For entries that are in the grace period
                 // or all cached negative entries, use the cache but start a new
                 // lookup in the background
@@ -663,18 +663,17 @@ nsHostResolver::ResolveHost(const char  
                         (PL_DHashTableOperate(&mDB, &unspecKey, PL_DHASH_LOOKUP));
                     NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(unspecHe) ||
                                  (PL_DHASH_ENTRY_IS_BUSY(unspecHe) &&
                                   unspecHe->rec),
                                 "Valid host entries should contain a record");
                     if (PL_DHASH_ENTRY_IS_BUSY(unspecHe) &&
                         unspecHe->rec &&
                         unspecHe->rec->HasUsableResult(flags) &&
-                        TimeStamp::NowLoRes() <= (he->rec->expiration +
-                            TimeDuration::FromSeconds(mGracePeriod * 60))) {
+                        TimeStamp::NowLoRes() <= (he->rec->expiration + mGracePeriod)) {
 
                         MOZ_ASSERT(unspecHe->rec->addr_info || unspecHe->rec->negative,
                                    "Entry should be resolved or negative.");
 
                         LOG(("  Trying AF_UNSPEC entry for [%s] af: %s.\n",
                             host, (af == PR_AF_INET) ? "AF_INET" : "AF_INET6"));
 
                         he->rec->addr_info = nullptr;
--- a/netwerk/dns/nsHostResolver.h
+++ b/netwerk/dns/nsHostResolver.h
@@ -168,18 +168,18 @@ public:
      * host resolver instances are reference counted.
      */
     NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsHostResolver)
 
     /**
      * creates an addref'd instance of a nsHostResolver object.
      */
     static nsresult Create(uint32_t         maxCacheEntries,  // zero disables cache
-                           uint32_t         maxCacheLifetime, // minutes
-                           uint32_t         lifetimeGracePeriod, // minutes
+                           uint32_t         maxCacheLifetime, // seconds
+                           uint32_t         lifetimeGracePeriod, // seconds
                            nsHostResolver **resolver);
     
     /**
      * puts the resolver in the shutdown state, which will cause any pending
      * callbacks to be detached.  any future calls to ResolveHost will fail.
      */
     void Shutdown();
 
@@ -234,17 +234,17 @@ public:
         RES_SPECULATE     = 1 << 4,
         //RES_DISABLE_IPV6 = 1 << 5, // Not used
         RES_OFFLINE       = 1 << 6
     };
 
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
 
 private:
-    nsHostResolver(uint32_t maxCacheEntries = 50, uint32_t maxCacheLifetime = 1,
+    nsHostResolver(uint32_t maxCacheEntries = 50, uint32_t maxCacheLifetime = 60,
                    uint32_t lifetimeGracePeriod = 0);
    ~nsHostResolver();
 
     nsresult Init();
     nsresult IssueLookup(nsHostRecord *);
     bool     GetHostToLookup(nsHostRecord **m);
     void     OnLookupComplete(nsHostRecord *, nsresult, mozilla::net::AddrInfo *);
     void     DeQueue(PRCList &aQ, nsHostRecord **aResult);
@@ -267,18 +267,18 @@ private:
         METHOD_NEGATIVE_HIT = 3,
         METHOD_LITERAL = 4,
         METHOD_OVERFLOW = 5,
         METHOD_NETWORK_FIRST = 6,
         METHOD_NETWORK_SHARED = 7
     };
 
     uint32_t      mMaxCacheEntries;
-    mozilla::TimeDuration mMaxCacheLifetime;
-    uint32_t      mGracePeriod;
+    mozilla::TimeDuration mMaxCacheLifetime; // granularity seconds
+    mozilla::TimeDuration mGracePeriod; // granularity seconds
     mutable Mutex mLock;    // mutable so SizeOfIncludingThis can be const
     CondVar       mIdleThreadCV;
     uint32_t      mNumIdleThreads;
     uint32_t      mThreadCount;
     uint32_t      mActiveAnyThreadCount;
     PLDHashTable  mDB;
     PRCList       mHighQ;
     PRCList       mMediumQ;
--- a/testing/mochitest/android.json
+++ b/testing/mochitest/android.json
@@ -1,35 +1,6 @@
 {
 "runtests": {},
 "excludetests": {
-  "content/canvas/test/webgl": "bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests",
-  "robocop": "TIMED_OUT",
-  "Harness_sanity/test_bug816847.html": "No test app installed",
-  "dom/imptests/html/webgl": "WebGL",
-  "editor/libeditor/text/tests/test_texteditor_keyevent_handling.html": "",
-  "Harness_sanity/test_sanitySimpletest.html": "bug 688052",
-  "toolkit/content/tests/widgets/test_contextmenu_nested.xul": "",
-  "dom/browser-element/mochitest/test_browserElement_inproc_AppWindowNamespace.html": "TIMED_OUT, bug 783509",
-  "layout/generic": "CRASH_DUMP, RANDOM, ONLY IN CHUNK 10",
-  "dom/browser-element/mochitest/test_browserElement_oop_SecurityChange.html": "TIMED_OUT, bug 766586",
-  "dom/browser-element/mochitest/test_browserElement_inproc_SecurityChange.html": "TIMED_OUT, bug 766586",
-  "content/base/test/test_copypaste.xul": "bug 904183",
-  "content/media/test/test_played.html": "bug 751539",
-  "content/media/test/test_playback_rate.html": "bug 845162",
-  "content/media/test/test_seek.html": "bug 845162",
-  "dom/devicestorage": "bug 781789 & bug 782275",
-  "dom/imptests/editing/conformancetest/test_runtest.html": "",
-  "toolkit/content/tests/widgets/test_menubar.xul": "W/SharedBufferStack(21799): waitForCondition(LockCondition) timed out (identity=34, status=0). CPU may be pegged. trying again",
-  "content/media/test/test_buffered.html": "",
-  "toolkit/components/satchel/test/test_form_autocomplete.html": "TIMED_OUT",
-  "dom/browser-element/mochitest/test_browserElement_inproc_CloseApp.html": "FAILS, bug 796982",
-  "dom/tests/mochitest/geolocation/test_timeoutWatch.html": "TIMED_OUT",
-  "dom/imptests/editing/selecttest/test_addRange.html": "bug 775227",
-  "editor/libeditor/text/tests/test_bug569988.html": "TIMED_OUT",
-  "dom/browser-element/mochitest/test_browserElement_inproc_AppFramePermission.html": "",
-  "toolkit/components/places/tests/test_bug_411966.html": "RANDOM",
-  "dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_key.html": "bug 775227",
-  "toolkit/components/passwordmgr/test/test_privbrowsing_perwindowpb.html": "",
-  "dom/inputmethod": "Not supported on Android",
-  "Harness_sanity/test_sanityEventUtils.html": "bug 688052"
+  "robocop": "TIMED_OUT"
   }
 }
--- a/testing/mochitest/android23.json
+++ b/testing/mochitest/android23.json
@@ -1,41 +1,12 @@
 {
 "runtests": {},
 "excludetests": {
-  "content/canvas/test/webgl": "bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests",
   "robocop": "TIMED_OUT",
-  "Harness_sanity/test_bug816847.html": "No test app installed",
-  "dom/imptests/html/webgl": "WebGL",
-  "editor/libeditor/text/tests/test_texteditor_keyevent_handling.html": "",
-  "Harness_sanity/test_sanitySimpletest.html": "bug 688052",
-  "toolkit/content/tests/widgets/test_contextmenu_nested.xul": "",
-  "dom/browser-element/mochitest/test_browserElement_inproc_AppWindowNamespace.html": "TIMED_OUT, bug 783509",
-  "layout/generic": "CRASH_DUMP, RANDOM, ONLY IN CHUNK 10",
-  "dom/browser-element/mochitest/test_browserElement_oop_SecurityChange.html": "TIMED_OUT, bug 766586",
-  "dom/browser-element/mochitest/test_browserElement_inproc_SecurityChange.html": "TIMED_OUT, bug 766586",
-  "content/base/test/test_copypaste.xul": "bug 904183",
-  "content/media/test/test_played.html": "bug 751539",
-  "content/media/test/test_playback_rate.html": "bug 845162",
-  "content/media/test/test_seek.html": "bug 845162",
-  "dom/devicestorage": "bug 781789 & bug 782275",
-  "dom/imptests/editing/conformancetest/test_runtest.html": "",
-  "toolkit/content/tests/widgets/test_menubar.xul": "W/SharedBufferStack(21799): waitForCondition(LockCondition) timed out (identity=34, status=0). CPU may be pegged. trying again",
-  "content/media/test/test_buffered.html": "",
-  "toolkit/components/satchel/test/test_form_autocomplete.html": "TIMED_OUT",
-  "dom/browser-element/mochitest/test_browserElement_inproc_CloseApp.html": "FAILS, bug 796982",
-  "dom/tests/mochitest/geolocation/test_timeoutWatch.html": "TIMED_OUT",
-  "dom/imptests/editing/selecttest/test_addRange.html": "bug 775227",
-  "editor/libeditor/text/tests/test_bug569988.html": "TIMED_OUT",
-  "dom/browser-element/mochitest/test_browserElement_inproc_AppFramePermission.html": "",
-  "toolkit/components/places/tests/test_bug_411966.html": "RANDOM",
-  "dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_key.html": "bug 775227",
-  "toolkit/components/passwordmgr/test/test_privbrowsing_perwindowpb.html": "",
-  "dom/inputmethod": "Not supported on Android",
-  "Harness_sanity/test_sanityEventUtils.html": "bug 688052",
   "content/html/content/test/test_ignoreuserfocus.html": "Android 2.3 only; bug 981895",
   "content/media/test/test_audio_event_adopt.html": "Android 2.3 only; bug 981898",
   "content/media/test/test_autoplay.html": "Android 2.3 only; bug 981898",
   "content/media/test/test_autoplay_contentEditable.html": "Android 2.3 only; bug 981898",
   "content/media/test/test_chaining.html": "Android 2.3 only; bug 981898",
   "content/media/test/test_loop.html": "Android 2.3 only; bug 981898",
   "content/media/test/test_mediarecorder_record_4ch_audiocontext.html": "Android 2.3 only; bug 981898",
   "content/media/test/test_mediarecorder_record_immediate_stop.html": "Android 2.3 only; bug 981898",
--- a/testing/mochitest/androidx86.json
+++ b/testing/mochitest/androidx86.json
@@ -1,120 +1,111 @@
 {
 "runtests": {},
 "excludetests": {
-  "content/canvas/test/webgl": "bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests",
-  "dom/imptests/html/webgl": "WebGL",
+  "content/base/test/test_ipc_messagemanager_blob.html": "x86 only bug 936226",
   "content/base/test/test_copypaste.xul": "bug 904183",
-  "toolkit/content/tests/widgets/test_contextmenu_nested.xul": "",
-  "dom/browser-element/mochitest/test_browserElement_inproc_AppWindowNamespace.html": "TIMED_OUT, bug 783509",
-  "layout/generic": "CRASH_DUMP, RANDOM, ONLY IN CHUNK 10",
-  "dom/browser-element/mochitest/test_browserElement_inproc_SecurityChange.html": "TIMED_OUT, bug 766586",
+  "content/canvas/test/test_2d.composite.canvas.luminosity.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.source-in.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.uncovered.image.destination-atop.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.image.source-in.html": "x86 only bug 913662",
+  "content/canvas/test/webgl": "bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests",
+  "content/canvas/test/test_2d.composite.canvas.multiply.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.lighten.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.color-dodge.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.destination-in.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.screen.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.image.source-out.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.exclusion.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.source-out.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.soft-light.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.destination-atop.html": "x86 only bug 913662",
+  "content/canvas/test/test_canvas.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.overlay.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.darken.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.uncovered.image.source-in.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.saturation.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.image.destination-atop.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.uncovered.image.source-out.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.color.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.image.destination-in.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.hue.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.difference.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.color-burn.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.uncovered.image.destination-in.html": "x86 only bug 913662",
+  "content/canvas/test/test_2d.composite.canvas.hard-light.html": "x86 only bug 913662",
+  "content/html/content/test/forms/test_input_textarea_set_value_no_scroll.html": "x86 only",
+  "content/media/test/test_media_selection.html": "x86 only bug 914439",
+  "content/media/test/test_bug495300.html": "x86 only bug 914439",
+  "content/media/test/test_new_audio.html": "x86 only bug 914439",
+  "content/media/test/test_seeked.html": "x86 only bug 914439",
+  "content/media/test/test_played.html": "bug 751539",
+  "content/media/test/test_playback_rate.html": "bug 845162",
+  "content/media/test/test_playback_rate_playpause.html": "x86 only bug 914439",
+  "content/media/test/test_loop.html": "x86 only bug 914439",
+  "content/media/test/test_play_twice.html": "x86 only bug 914439",
+  "content/media/test/test_bug495145.html": "x86 only bug 914439",
+  "content/media/test/test_bug465498.html": "",
+  "content/media/test/test_play_events_2.html": "x86 only bug 914439",
+  "content/media/test/test_media_sniffer.html": "x86 only bug 914439",
+  "content/media/test/test_seek_out_of_range.html": "x86 only bug 914439"
+  "content/media/test/test_load_same_resource.html": "x86 only bug 914439",
+  "content/media/test/test_bug493187.html": "x86 only bug 914439",
+  "content/media/test/test_autoplay_contentEditable.html": "x86 only",
+  "content/media/test/test_audio2.html": "x86 only bug 914439",
+  "content/media/test/test_can_play_type_mpeg.html": "x86 only bug 914439",
+  "content/media/test/test_bug686942.html": "x86 only bug 914439",
+  "content/media/test/test_standalone.html": "x86 only bug 914439",
+  "content/media/test/test_bug448534.html": "x86 only bug 914439",
+  "content/media/test/test_video_to_canvas.html": "x86 only bug 914439",
+  "content/media/test/test_load_candidates.html": "x86 only bug 914439",
+  "content/media/test/test_streams_element_capture_createObjectURL.html": "x86 only bug 914439",
+  "content/media/test/test_progress.html": "x86 only bug 914439",
+  "content/media/test/test_seekable1.html": "timeout x86 only bug 914439",
+  "content/media/test/test_play_events.html": "x86 only bug 914439",
+  "content/media/test/test_reactivate.html": "x86 only bug 914439",
+  "content/media/test/test_referer.html": "x86 only",
+  "content/media/webaudio/test/test_audioBufferSourceNodeNeutered.html": "x86 only",
+  "content/media/test/test_load.html": "x86 only bug 914439",
+  "content/media/test/test_streams_element_capture.html": "x86 only bug 914439",
+  "content/media/test/test_replay_metadata.html": "x86 only bug 914439",
+  "content/media/test/test_unseekable.html": "x86 only",
+  "content/media/test/test_paused_after_ended.html": "x86 only bug 914439",
+  "content/media/test/test_timeupdate_small_files.html": "x86 only bug 914439",
+  "content/media/test/test_playback.html": "x86 only bug 914439",
+  "docshell/test/navigation/test_not-opener.html": "x86 only",
+  "dom/apps/tests/test_packaged_app_update.html": "x86 only",
+  "dom/apps/tests/test_packaged_app_install.html": "x86 only",
+  "dom/browser-element/mochitest/test_browserElement_oop_NextPaint.html": "x86 only bug 936226",
+  "dom/browser-element/mochitest/test_browserElement_inproc_GetScreenshot.html": "x86 only",
+  "dom/browser-element/mochitest/test_browserElement_NoWhitelist.html": "x86 only bug 936226",
   "dom/browser-element/mochitest/test_browserElement_oop_SecurityChange.html": "TIMED_OUT, bug 766586",
-  "content/media/test/test_played.html": "bug 751539",
-  "content/media/test/test_seek.html": "bug 845162",
+  "dom/contacts/tests/test_contacts_getall.html": "x86 only",
+  "dom/datastore/tests/test_oop.html": "x86 only bug 936226",
+  "dom/datastore/tests/test_sync.html": "x86 only bug 936226",
+  "dom/datastore/tests/test_readonly.html": "x86 only bug 936226",
   "dom/devicestorage": "bug 781789 & bug 782275",
+  "dom/imptests/editing/selecttest/test_addRange.html": "bug 775227",
   "dom/imptests/editing/conformancetest/test_runtest.html": "",
-  "toolkit/content/tests/widgets/test_menubar.xul": "W/SharedBufferStack(21799): waitForCondition(LockCondition) timed out (identity=34, status=0). CPU may be pegged. trying again",
-  "content/media/test/test_playback_rate.html": "bug 845162",
-  "content/media/test/test_buffered.html": "",
-  "toolkit/components/satchel/test/test_form_autocomplete.html": "TIMED_OUT",
-  "dom/browser-element/mochitest/test_browserElement_inproc_CloseApp.html": "FAILS, bug 796982",
+  "dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_key.html": "bug 775227",
+  "dom/imptests/html/webgl": "WebGL",
+  "dom/inputmethod": "Not supported on Android",
+  "dom/tests/mochitest/geolocation/test_timeoutWatch.html": "TIMED_OUT",
+  "editor/libeditor/text/tests/test_bug569988.html": "TIMED_OUT",
   "editor/libeditor/text/tests/test_texteditor_keyevent_handling.html": "",
-  "dom/imptests/editing/selecttest/test_addRange.html": "bug 775227",
-  "editor/libeditor/text/tests/test_bug569988.html": "TIMED_OUT",
-  "dom/browser-element/mochitest/test_browserElement_inproc_AppFramePermission.html": "",
-  "toolkit/components/places/tests/test_bug_411966.html": "RANDOM",
-  "dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_key.html": "bug 775227",
-  "toolkit/components/passwordmgr/test/test_privbrowsing_perwindowpb.html": "",
-  "dom/tests/mochitest/geolocation/test_timeoutWatch.html": "TIMED_OUT",
-  "dom/inputmethod": "Not supported on Android",
+  "Harness_sanity/test_sanityWindowSnapshot.html": "x86 only",
+  "image/test/mochitest/test_bug671906.html": "x86 only",
+  "image/test/mochitest/test_bug89419-2.html": "x86 only",
+  "image/test/mochitest/test_bug490949.html": "x86 only",
+  "image/test/mochitest/test_bug497665.html": "x86 only",
+  "image/test/mochitest/test_bug601470.html": "x86 only",
+  "image/test/mochitest/test_bug89419-1.html": "x86 only",
+  "layout/generic": "CRASH_DUMP, RANDOM, ONLY IN CHUNK 10",
+  "MochiKit-1.4.2/tests/test_MochiKit-Async.html": "x86 only",
   "robocop": "TIMED_OUT",
-  "Harness_sanity/test_bug816847.html": "No test app installed",
-  "Harness_sanity/test_sanityEventUtils.html": "bug 688052",
-  "Harness_sanity/test_sanitySimpletest.html": "bug 688052",
- "MochiKit-1.4.2/tests/test_MochiKit-Async.html": "x86 only",
- "content/base/test/test_ipc_messagemanager_blob.html" : "x86 only bug 936226",
- "content/canvas/test/test_2d.composite.canvas.color-burn.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.color-dodge.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.color.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.darken.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.destination-atop.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.destination-in.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.difference.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.exclusion.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.hard-light.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.hue.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.lighten.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.luminosity.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.multiply.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.overlay.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.saturation.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.screen.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.soft-light.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.source-in.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.canvas.source-out.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.image.destination-atop.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.image.destination-in.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.image.source-in.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.image.source-out.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.uncovered.image.destination-atop.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.uncovered.image.destination-in.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.uncovered.image.source-in.html": "x86 only bug 913662",
- "content/canvas/test/test_2d.composite.uncovered.image.source-out.html": "x86 only bug 913662",
- "content/canvas/test/test_canvas.html": "x86 only bug 913662",
- "content/html/content/test/forms/test_input_textarea_set_value_no_scroll.html": "x86 only",
- "content/media/test/test_autoplay_contentEditable.html": "x86 only",
- "content/media/test/test_bug465498.html": "",
- "content/media/test/test_bug448534.html": "x86 only bug 914439",
- "content/media/test/test_bug493187.html": "x86 only bug 914439",
- "content/media/test/test_bug495145.html": "x86 only bug 914439",
- "content/media/test/test_bug495300.html": "x86 only bug 914439",
- "content/media/test/test_bug686942.html": "x86 only bug 914439",
- "content/media/test/test_can_play_type_mpeg.html": "x86 only bug 914439",
- "content/media/test/test_audio2.html": "x86 only bug 914439",
- "content/media/test/test_load.html": "x86 only bug 914439",
- "content/media/test/test_load_candidates.html": "x86 only bug 914439",
- "content/media/test/test_load_same_resource.html": "x86 only bug 914439",
- "content/media/test/test_loop.html": "x86 only bug 914439",
- "content/media/test/test_media_selection.html": "x86 only bug 914439",
- "content/media/test/test_media_sniffer.html": "x86 only bug 914439",
- "content/media/test/test_new_audio.html": "x86 only bug 914439",
- "content/media/test/test_paused_after_ended.html": "x86 only bug 914439",
- "content/media/test/test_play_events.html": "x86 only bug 914439",
- "content/media/test/test_play_events_2.html": "x86 only bug 914439",
- "content/media/test/test_play_twice.html": "x86 only bug 914439",
- "content/media/test/test_playback.html": "x86 only bug 914439",
- "content/media/test/test_playback_rate_playpause.html": "x86 only bug 914439",
- "content/media/test/test_progress.html": "x86 only bug 914439",
- "content/media/test/test_reactivate.html": "x86 only bug 914439",
- "content/media/test/test_referer.html": "x86 only",
- "content/media/test/test_replay_metadata.html": "x86 only bug 914439",
- "content/media/test/test_seek_out_of_range.html": "x86 only bug 914439",
- "content/media/test/test_seekable1.html": "timeout x86 only bug 914439",
- "content/media/test/test_seeked.html": "x86 only bug 914439",
- "content/media/test/test_standalone.html": "x86 only bug 914439",
- "content/media/test/test_streams_element_capture.html": "x86 only bug 914439",
- "content/media/test/test_streams_element_capture_createObjectURL.html": "x86 only bug 914439",
- "content/media/test/test_timeupdate_small_files.html": "x86 only bug 914439",
- "content/media/test/test_unseekable.html": "x86 only",
- "content/media/test/test_video_to_canvas.html": "x86 only bug 914439",
- "content/media/webaudio/test/test_audioBufferSourceNodeNeutered.html": "x86 only",
- "docshell/test/navigation/test_not-opener.html": "x86 only",
- "dom/apps/tests/test_packaged_app_install.html": "x86 only",
- "dom/apps/tests/test_packaged_app_update.html": "x86 only",
- "dom/browser-element/mochitest/test_browserElement_inproc_GetScreenshot.html": "x86 only",
- "dom/browser-element/mochitest/test_browserElement_NoWhitelist.html": "x86 only bug 936226",
- "dom/browser-element/mochitest/test_browserElement_oop_NextPaint.html": "x86 only bug 936226",
- "dom/contacts/tests/test_contacts_getall.html": "x86 only",
- "dom/datastore/tests/test_oop.html": "x86 only bug 936226",
- "dom/datastore/tests/test_readonly.html": "x86 only bug 936226",
- "dom/datastore/tests/test_sync.html": "x86 only bug 936226",
- "image/test/mochitest/test_bug490949.html": "x86 only",
- "image/test/mochitest/test_bug497665.html": "x86 only",
- "image/test/mochitest/test_bug601470.html": "x86 only",
- "image/test/mochitest/test_bug671906.html": "x86 only",
- "image/test/mochitest/test_bug89419-1.html": "x86 only",
- "image/test/mochitest/test_bug89419-2.html": "x86 only",
- "toolkit/components/alerts/test/test_alerts_noobserve.html": "x86 only",
- "Harness_sanity/test_sanityWindowSnapshot.html": "x86 only"
- }
+  "toolkit/components/satchel/test/test_form_autocomplete.html": "TIMED_OUT",
+  "toolkit/components/alerts/test/test_alerts_noobserve.html": "x86 only",
+  "toolkit/components/places/tests/test_bug_411966.html": "RANDOM",
+  "toolkit/components/passwordmgr/test/test_privbrowsing_perwindowpb.html": "",
+  "toolkit/content/tests/widgets/test_menubar.xul": "W/SharedBufferStack(21799",
+  "toolkit/content/tests/widgets/test_contextmenu_nested.xul": ""
+  }
 }
--- a/testing/mochitest/tests/Harness_sanity/mochitest.ini
+++ b/testing/mochitest/tests/Harness_sanity/mochitest.ini
@@ -6,13 +6,15 @@
 [test_SpecialPowersExtension2.html]
 support-files = file_SpecialPowersFrame1.html
 [test_SpecialPowersPushPermissions.html]
 [test_SpecialPowersPushPrefEnv.html]
 [test_SimpleTestGetTestFileURL.html]
 [test_SpecialPowersLoadChromeScript.html]
 support-files = SpecialPowersLoadChromeScript.js
 [test_bug816847.html]
+skip-if = toolkit == 'android' #No test app installed
 [test_sanity_cleanup.html]
 [test_sanity_cleanup2.html]
 [test_sanityEventUtils.html]
+skip-if = toolkit == 'android' #bug 688052
 [test_sanitySimpletest.html]
-
+skip-if = toolkit == 'android' #bug 688052
--- a/toolkit/identity/FirefoxAccounts.jsm
+++ b/toolkit/identity/FirefoxAccounts.jsm
@@ -123,17 +123,17 @@ FxAccountsService.prototype = {
 
     let options = makeMessageObject(rp);
     objectCopy(aOptions, options);
 
     log.debug("get assertion for " + rp.audience);
 
     this.fxAccountsManager.getAssertion(rp.audience, options).then(
       data => {
-        log.debug("got assertion: " + JSON.stringify(data));
+        log.debug("got assertion for " + rp.audience + ": " + data);
         this.doLogin(aRPId, data);
       },
       error => {
         log.error("get assertion failed: " + JSON.stringify(error));
         this.doError(aRPId, error);
       }
     );
   },
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1310,16 +1310,30 @@ GetMessageName(UINT aMessage)
     case WM_NULL:        return "WM_NULL";
     default:             return "Unknown";
   }
 }
 
 #endif // #ifdef MOZ_CRASHREPORTER
 
 bool
+NativeKey::MayBeSameCharMessage(const MSG& aCharMsg1,
+                                const MSG& aCharMsg2) const
+{
+  // NOTE: Although, we don't know when this case occurs, the scan code value
+  //       in lParam may be changed from 0 to something.  The changed value
+  //       is different from the scan code of handling keydown message.
+  static const LPARAM kScanCodeMask = 0x00FF0000;
+  return
+    aCharMsg1.message == aCharMsg2.message &&
+    aCharMsg1.wParam == aCharMsg2.wParam &&
+    (aCharMsg1.lParam & ~kScanCodeMask) == (aCharMsg2.lParam & ~kScanCodeMask);
+}
+
+bool
 NativeKey::GetFollowingCharMessage(MSG& aCharMsg) const
 {
   MOZ_ASSERT(IsKeyDownMessage());
 
   aCharMsg.message = WM_NULL;
 
   if (mFakeCharMsgs) {
     FakeCharMsg& fakeCharMsg = mFakeCharMsgs->ElementAt(0);
@@ -1346,44 +1360,54 @@ NativeKey::GetFollowingCharMessage(MSG& 
       !IsCharMessage(nextKeyMsg)) {
     return false;
   }
 
   // On Metrofox, PeekMessage() sometimes returns WM_NULL even if we specify
   // the message range.  So, if it returns WM_NULL, we should retry to get
   // the following char message it was found above.
   for (uint32_t i = 0; i < 5; i++) {
-    static const LPARAM kScanCodeMask = 0x00FF0000;
-
-    MSG removedMsg;
+    MSG removedMsg, nextKeyMsgInAllWindows;
+    bool doCrash = false;
     if (!WinUtils::PeekMessage(&removedMsg, mMsg.hwnd,
                                nextKeyMsg.message, nextKeyMsg.message,
                                PM_REMOVE | PM_NOYIELD)) {
-      MSG nextKeyMsgInAllWindows;
+      // We meets unexpected case.  We should collect the message queue state
+      // and crash for reporting the bug.
+      doCrash = true;
       // The char message is redirected to different thread's window by focus
       // move or something or just cancelled by external application.
       if (!WinUtils::PeekMessage(&nextKeyMsgInAllWindows, 0,
                                  WM_KEYFIRST, WM_KEYLAST,
                                  PM_NOREMOVE | PM_NOYIELD)) {
         return true;
       }
-      // The char message is redirected to different window created by our
-      // thread.
-      if (nextKeyMsgInAllWindows.message == nextKeyMsg.message &&
-          nextKeyMsgInAllWindows.wParam == nextKeyMsg.wParam &&
-          (nextKeyMsgInAllWindows.lParam & ~kScanCodeMask) ==
-            (nextKeyMsg.lParam & ~kScanCodeMask) &&
-          nextKeyMsgInAllWindows.hwnd != mMsg.hwnd) {
-        aCharMsg = nextKeyMsgInAllWindows;
-        return true;
+      if (MayBeSameCharMessage(nextKeyMsgInAllWindows, nextKeyMsg)) {
+        // The char message is redirected to different window created by our
+        // thread.
+        if (nextKeyMsgInAllWindows.hwnd != mMsg.hwnd) {
+          aCharMsg = nextKeyMsgInAllWindows;
+          return true;
+        }
+        // The found char message still in the queue, but PeekMessage() failed
+        // to remove it only with PM_REMOVE.  Although, we don't know why this
+        // occurs.  However, this occurs acctually.
+        // Try to remove the char message with GetMessage() again.
+        if (WinUtils::GetMessage(&removedMsg, mMsg.hwnd,
+                                 nextKeyMsg.message, nextKeyMsg.message)) {
+          // Cancel to crash, but we need to check the removed message value.
+          doCrash = false;
+        }
       }
-      // Otherwise, perhaps, we meet a PeekMessage()'s bug.  Let's crash and
-      // collect the detail.
+    }
+
+    if (doCrash) {
 #ifdef MOZ_CRASHREPORTER
-      nsPrintfCString info("\nHandling message: %s (0x%08X), wParam: 0x%08X, "
+      nsPrintfCString info("\nPeekMessage() failed to remove char message! "
+                           "\nHandling message: %s (0x%08X), wParam: 0x%08X, "
                            "lParam: 0x%08X, hwnd=0x%p, InSendMessageEx()=%s, \n"
                            "Found message: %s (0x%08X), wParam: 0x%08X, "
                            "lParam: 0x%08X, hwnd=0x%p, "
                            "\nWM_NULL has been removed: %d, "
                            "\nNext key message in all windows: %s (0x%08X), "
                            "wParam: 0x%08X, lParam: 0x%08X, hwnd=0x%p, "
                            "time=%d, ",
                            GetMessageName(mMsg.message),
@@ -1421,22 +1445,20 @@ NativeKey::GetFollowingCharMessage(MSG& 
     // Retry for the strange case.
     if (removedMsg.message == WM_NULL) {
       continue;
     }
 
     // NOTE: Although, we don't know when this case occurs, the scan code value
     //       in lParam may be changed from 0 to something.  The changed value
     //       is different from the scan code of handling keydown message.
-    if (removedMsg.message != nextKeyMsg.message ||
-        removedMsg.wParam != nextKeyMsg.wParam ||
-        (removedMsg.lParam & ~kScanCodeMask) !=
-          (nextKeyMsg.lParam & ~kScanCodeMask)) {
+    if (!MayBeSameCharMessage(removedMsg, nextKeyMsg)) {
 #ifdef MOZ_CRASHREPORTER
-      nsPrintfCString info("\nHandling message: %s (0x%08X), wParam: 0x%08X, "
+      nsPrintfCString info("\nPeekMessage() removed unexpcted char message! "
+                           "\nHandling message: %s (0x%08X), wParam: 0x%08X, "
                            "lParam: 0x%08X, hwnd=0x%p, InSendMessageEx()=%s, "
                            "\nFound message: %s (0x%08X), wParam: 0x%08X, "
                            "lParam: 0x%08X, hwnd=0x%p, "
                            "\nRemoved message: %s (0x%08X), wParam: 0x%08X, "
                            "lParam: 0x%08X, hwnd=0x%p, ",
                            GetMessageName(mMsg.message),
                            mMsg.message, mMsg.wParam, mMsg.lParam, mMsg.hwnd,
                            GetResultOfInSendMessageEx().get(),
@@ -1484,17 +1506,18 @@ NativeKey::GetFollowingCharMessage(MSG& 
 #endif // #ifdef MOZ_CRASHREPORTER
       MOZ_CRASH("PeekMessage() removed unexpected message");
     }
 
     aCharMsg = removedMsg;
     return true;
   }
 #ifdef MOZ_CRASHREPORTER
-  nsPrintfCString info("\nHandling message: %s (0x%08X), wParam: 0x%08X, "
+  nsPrintfCString info("\nWe lost following char message! "
+                       "\nHandling message: %s (0x%08X), wParam: 0x%08X, "
                        "lParam: 0x%08X, InSendMessageEx()=%s, \n"
                        "Found message: %s (0x%08X), wParam: 0x%08X, "
                        "lParam: 0x%08X, removed a lot of WM_NULL",
                        GetMessageName(mMsg.message),
                        mMsg.message, mMsg.wParam, mMsg.lParam,
                        GetResultOfInSendMessageEx().get(),
                        GetMessageName(nextKeyMsg.message),
                        nextKeyMsg.message, nextKeyMsg.wParam,
@@ -1512,43 +1535,45 @@ NativeKey::DispatchPluginEventsAndDiscar
 
   // Remove a possible WM_CHAR or WM_SYSCHAR messages from the message queue.
   // They can be more than one because of:
   //  * Dead-keys not pairing with base character
   //  * Some keyboard layouts may map up to 4 characters to the single key
   bool anyCharMessagesRemoved = false;
   MSG msg;
   while (GetFollowingCharMessage(msg)) {
-    if (mWidget->Destroyed()) {
-      MOZ_CRASH(
-        "NativeKey tries to dispatch a plugin event on destroyed widget");
+    if (msg.message == WM_NULL) {
+      continue;
     }
+    anyCharMessagesRemoved = true;
+    // If the window handle is changed, focused window must be changed.
+    // So, plugin shouldn't handle it anymore.
+    if (msg.hwnd != mMsg.hwnd) {
+      break;
+    }
+    MOZ_RELEASE_ASSERT(!mWidget->Destroyed(),
+      "NativeKey tries to dispatch a plugin event on destroyed widget");
     mWidget->DispatchPluginEvent(msg);
     if (mWidget->Destroyed()) {
       return true;
     }
-
-    anyCharMessagesRemoved = true;
   }
 
   if (!mFakeCharMsgs && !anyCharMessagesRemoved &&
       mDOMKeyCode == NS_VK_BACK && IsIMEDoingKakuteiUndo()) {
     // This is for a hack for ATOK and WXG.  So, PeekMessage() must scceed!
     while (WinUtils::PeekMessage(&msg, mMsg.hwnd, WM_CHAR, WM_CHAR,
                                  PM_REMOVE | PM_NOYIELD)) {
       if (msg.message != WM_CHAR) {
-        if (msg.message != WM_NULL) {
-          MOZ_CRASH("Unexpected message was removed");
-        }
+        MOZ_RELEASE_ASSERT(msg.message == WM_NULL,
+                           "Unexpected message was removed");
         continue;
       }
-      if (mWidget->Destroyed()) {
-        MOZ_CRASH(
-          "NativeKey tries to dispatch a plugin event on destroyed widget");
-      }
+      MOZ_RELEASE_ASSERT(!mWidget->Destroyed(),
+        "NativeKey tries to dispatch a plugin event on destroyed widget");
       mWidget->DispatchPluginEvent(msg);
       return mWidget->Destroyed();
     }
     MOZ_CRASH("NativeKey failed to get WM_CHAR for ATOK or WXG");
   }
 
   return false;
 }
--- a/widget/windows/KeyboardLayout.h
+++ b/widget/windows/KeyboardLayout.h
@@ -363,16 +363,17 @@ private:
   bool IsSysCharMessage(const MSG& aMSG) const
   {
     return IsSysCharMessage(aMSG.message);
   }
   bool IsSysCharMessage(UINT aMessage) const
   {
     return (aMessage == WM_SYSCHAR || aMessage == WM_SYSDEADCHAR);
   }
+  bool MayBeSameCharMessage(const MSG& aCharMsg1, const MSG& aCharMsg2) const;
   bool IsFollowedByDeadCharMessage() const;
 
   /**
    * GetFollowingCharMessage() returns following char message of handling
    * keydown event.  If the message is found, this method returns true.
    * Otherwise, returns false.
    *
    * WARNING: Even if this returns true, aCharMsg may be WM_NULL or its