Merge m-i to m-c, a=merge
authorPhil Ringnalda <philringnalda@gmail.com>
Sat, 26 Aug 2017 18:18:02 -0700
changeset 426590 f819969d7619f01e806e2685b8b3196f64624551
parent 426579 30ee0dcda8836389c0165ae3fb66a236fdfc51ea (current diff)
parent 426589 57b909b8223715bde6c5cd7c9a66c6d1a5625318 (diff)
child 426591 91321db7087c904375977451e4fd25f1b4a5ebd2
child 426599 2e8de6c35cf264ddf25914d5e91b0e9b65696033
child 426617 c691c8de2367fa414e653df8d8ddcdb2c44434c7
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone57.0a1
first release with
nightly linux32
f819969d7619 / 57.0a1 / 20170827100428 / files
nightly linux64
f819969d7619 / 57.0a1 / 20170827100428 / files
nightly mac
f819969d7619 / 57.0a1 / 20170827100428 / files
nightly win32
f819969d7619 / 57.0a1 / 20170827100428 / files
nightly win64
f819969d7619 / 57.0a1 / 20170827100428 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-i to m-c, a=merge MozReview-Commit-ID: AYBlGJan6UL
testing/web-platform/meta/css/css-transforms-2/transform3d-sorting-001.html.ini
--- a/browser/base/content/test/tabcrashed/browser.ini
+++ b/browser/base/content/test/tabcrashed/browser.ini
@@ -1,15 +1,12 @@
 [DEFAULT]
+skip-if = (!e10s || !crashreporter)
 support-files =
   head.js
-[browser_shown.js]
-skip-if = !e10s || !crashreporter
+
+[browser_autoSubmitRequest.js]
 [browser_clearEmail.js]
-skip-if = !e10s || !crashreporter
+[browser_noPermanentKey.js]
+skip-if = (os == "linux" && bits == 32 && debug) # Bug 1383315
 [browser_showForm.js]
-skip-if = !e10s || !crashreporter
+[browser_shown.js]
 [browser_withoutDump.js]
-skip-if = !e10s || !crashreporter
-[browser_autoSubmitRequest.js]
-skip-if = !e10s || !crashreporter
-[browser_noPermanentKey.js]
-skip-if = !e10s || !crashreporter || (os == "linux" && bits == 32 && debug) # Bug 1383315
--- a/browser/components/preferences/in-content-new/privacy.js
+++ b/browser/components/preferences/in-content-new/privacy.js
@@ -245,17 +245,17 @@ var gPrivacyPane = {
 
     this.initDataCollection();
     if (AppConstants.MOZ_CRASHREPORTER) {
       this.initSubmitCrashes();
     }
     this.initSubmitHealthReport();
     setEventListener("submitHealthReportBox", "command",
                      gPrivacyPane.updateSubmitHealthReport);
-
+    this._initA11yState();
     let bundlePrefs = document.getElementById("bundlePreferences");
     let signonBundle = document.getElementById("signonBundle");
     let pkiBundle = document.getElementById("pkiBundle");
     appendSearchKeywords("passwordExceptions", [
       bundlePrefs.getString("savedLoginsExceptions_title"),
       bundlePrefs.getString("savedLoginsExceptions_desc2"),
     ]);
     appendSearchKeywords("showPasswords", [
@@ -1593,9 +1593,36 @@ var gPrivacyPane = {
 
       case "sitedatamanager:sites-updated":
         this.toggleSiteData(true);
         SiteDataManager.getTotalUsage()
           .then(this.updateTotalDataSizeLabel.bind(this));
         break;
     }
   },
+
+  // Accessibility checkbox helpers
+  _initA11yState() {
+    this._initA11yString();
+    let checkbox = document.getElementById("a11yPrivacyCheckbox");
+    switch (Services.prefs.getIntPref("accessibility.force_disabled")) {
+      case 1: // access blocked
+        checkbox.checked = true;
+        break;
+      case -1: // a11y is forced on for testing
+      case 0: // access allowed
+        checkbox.checked = false;
+        break;
+    }
+  },
+
+  _initA11yString() {
+    let a11yLearnMoreLink =
+      Services.urlFormatter.formatURLPref("app.support.baseURL") +
+        "accessibility";
+    document.getElementById("a11yLearnMoreLink")
+            .setAttribute("href", a11yLearnMoreLink);
+  },
+
+  updateA11yPrefs(checked) {
+    Services.prefs.setIntPref("accessibility.force_disabled", checked ? 1 : 0);
+  }
 };
--- a/browser/components/preferences/in-content-new/privacy.xul
+++ b/browser/components/preferences/in-content-new/privacy.xul
@@ -661,16 +661,26 @@
               searchkeywords="&address2.label;
                               &allow.label;
                               &removepermission2.label;
                               &removeallpermissions2.label;
                               &button.cancel.label;
                               &button.ok.label;"/>
     </hbox>
   </hbox>
+
+  <vbox id="a11yPermissionsBox">
+    <description flex="1">
+      <checkbox id="a11yPrivacyCheckbox" label="&a11yPrivacy.checkbox.label;"
+                accesskey="&a11yPrivacy.checkbox.accesskey;"
+                oncommand="return gPrivacyPane.updateA11yPrefs(this.checked)"/>
+      <label id="a11yLearnMoreLink" class="learnMore text-link"
+              value="&a11yPrivacy.learnmore.label;"></label>
+    </description>
+  </vbox>
 </groupbox>
 
 <hbox id="dataCollectionCategory"
       class="subcategory"
       hidden="true"
       data-category="panePrivacy"
       data-subcategory="reports">
   <label class="header-name" flex="1">&dataCollection.label;</label>
--- a/browser/extensions/pdfjs/README.mozilla
+++ b/browser/extensions/pdfjs/README.mozilla
@@ -1,5 +1,5 @@
 This is the PDF.js project output, https://github.com/mozilla/pdf.js
 
-Current extension version is: 1.9.456
+Current extension version is: 1.9.476
 
-Taken from upstream commit: cb10c03d
+Taken from upstream commit: 26c45369
--- a/browser/extensions/pdfjs/content/PdfJs.jsm
+++ b/browser/extensions/pdfjs/content/PdfJs.jsm
@@ -371,8 +371,9 @@ var PdfJs = {
     }
     this._pdfStreamConverterFactory.unregister();
     Cu.unload("resource://pdf.js/PdfStreamConverter.jsm");
     delete this._pdfStreamConverterFactory;
 
     this._registered = false;
   },
 };
+
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -1221,16 +1221,17 @@ MessageHandler.prototype = {
           chunk,
           transfers
         });
       },
       close() {
         if (this.isCancelled) {
           return;
         }
+        this.isCancelled = true;
         sendStreamRequest({ stream: 'close' });
         delete self.streamSinks[streamId];
       },
       error(reason) {
         if (this.isCancelled) {
           return;
         }
         this.isCancelled = true;
@@ -2972,17 +2973,17 @@ class LoopbackPort {
         } else if (transferable) {
           result = new value.constructor(buffer, value.byteOffset, value.byteLength);
         } else {
           result = new value.constructor(value);
         }
         cloned.set(value, result);
         return result;
       }
-      result = (0, _util.isArray)(value) ? [] : {};
+      result = Array.isArray(value) ? [] : {};
       cloned.set(value, result);
       for (var i in value) {
         var desc,
             p = value;
         while (!(desc = Object.getOwnPropertyDescriptor(p, i))) {
           p = Object.getPrototypeOf(p);
         }
         if (typeof desc.value === 'undefined' || typeof desc.value === 'function') {
@@ -3840,18 +3841,18 @@ var _UnsupportedManager = function Unsup
       for (var i = 0, ii = listeners.length; i < ii; i++) {
         listeners[i](featureId);
       }
     }
   };
 }();
 var version, build;
 {
-  exports.version = version = '1.9.456';
-  exports.build = build = 'cb10c03d';
+  exports.version = version = '1.9.476';
+  exports.build = build = '26c45369';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
 exports.PDFDataRangeTransport = PDFDataRangeTransport;
 exports.PDFWorker = PDFWorker;
 exports.PDFDocumentProxy = PDFDocumentProxy;
 exports.PDFPageProxy = PDFPageProxy;
 exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass;
@@ -4897,18 +4898,18 @@ var _svg = __w_pdfjs_require__(5);
 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 var isWorker = typeof window === 'undefined';
 if (!_global_scope2.default.PDFJS) {
   _global_scope2.default.PDFJS = {};
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.456';
-  PDFJS.build = 'cb10c03d';
+  PDFJS.version = '1.9.476';
+  PDFJS.build = '26c45369';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {
   (0, _util.setVerbosityLevel)(PDFJS.verbosity);
 }
 delete PDFJS.verbosity;
 Object.defineProperty(PDFJS, 'verbosity', {
   get() {
@@ -10464,18 +10465,18 @@ exports.PDFDataTransportStream = PDFData
 
 /***/ }),
 /* 15 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '1.9.456';
-var pdfjsBuild = 'cb10c03d';
+var pdfjsVersion = '1.9.476';
+var pdfjsBuild = '26c45369';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
 var pdfjsDisplayAPI = __w_pdfjs_require__(4);
 var pdfjsDisplayTextLayer = __w_pdfjs_require__(6);
 var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(3);
 var pdfjsDisplayDOMUtils = __w_pdfjs_require__(1);
 var pdfjsDisplaySVG = __w_pdfjs_require__(5);
 ;
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -1221,16 +1221,17 @@ MessageHandler.prototype = {
           chunk,
           transfers
         });
       },
       close() {
         if (this.isCancelled) {
           return;
         }
+        this.isCancelled = true;
         sendStreamRequest({ stream: 'close' });
         delete self.streamSinks[streamId];
       },
       error(reason) {
         if (this.isCancelled) {
           return;
         }
         this.isCancelled = true;
@@ -4477,53 +4478,59 @@ var Parser = function ParserClosure() {
         var str = buf1;
         if (cipherTransform) {
           str = cipherTransform.decryptString(str);
         }
         return str;
       }
       return buf1;
     },
-    findDefaultInlineStreamEnd: function Parser_findDefaultInlineStreamEnd(stream) {
-      var E = 0x45,
-          I = 0x49,
-          SPACE = 0x20,
-          LF = 0xA,
-          CR = 0xD;
-      var startPos = stream.pos,
+    findDefaultInlineStreamEnd(stream) {
+      const E = 0x45,
+            I = 0x49,
+            SPACE = 0x20,
+            LF = 0xA,
+            CR = 0xD,
+            n = 5;
+      let startPos = stream.pos,
           state = 0,
           ch,
-          i,
-          n,
-          followingBytes;
+          maybeEIPos;
       while ((ch = stream.getByte()) !== -1) {
         if (state === 0) {
           state = ch === E ? 1 : 0;
         } else if (state === 1) {
           state = ch === I ? 2 : 0;
         } else {
           (0, _util.assert)(state === 2);
           if (ch === SPACE || ch === LF || ch === CR) {
-            n = 5;
-            followingBytes = stream.peekBytes(n);
-            for (i = 0; i < n; i++) {
+            maybeEIPos = stream.pos;
+            let followingBytes = stream.peekBytes(n);
+            for (let i = 0; i < n; i++) {
               ch = followingBytes[i];
               if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) {
                 state = 0;
                 break;
               }
             }
             if (state === 2) {
               break;
             }
           } else {
             state = 0;
           }
         }
       }
+      if (ch === -1) {
+        (0, _util.warn)('findDefaultInlineStreamEnd: ' + 'Reached the end of the stream without finding a valid EI marker');
+        if (maybeEIPos) {
+          (0, _util.warn)('... trying to recover by using the last "EI" occurrence.');
+          stream.skip(-(stream.pos - maybeEIPos));
+        }
+      }
       return stream.pos - 4 - startPos;
     },
     findDCTDecodeInlineStreamEnd: function Parser_findDCTDecodeInlineStreamEnd(stream) {
       var startPos = stream.pos,
           foundEOI = false,
           b,
           markerLength,
           length;
@@ -22514,19 +22521,26 @@ var XRef = function XRefClosure() {
       }
       if (dict) {
         return dict;
       }
       throw new _util.InvalidPDFException('Invalid PDF structure');
     },
     readXRef: function XRef_readXRef(recoveryMode) {
       var stream = this.stream;
+      let startXRefParsedCache = Object.create(null);
       try {
         while (this.startXRefQueue.length) {
           var startXRef = this.startXRefQueue[0];
+          if (startXRefParsedCache[startXRef]) {
+            (0, _util.warn)('readXRef - skipping XRef table since it was already parsed.');
+            this.startXRefQueue.shift();
+            continue;
+          }
+          startXRefParsedCache[startXRef] = true;
           stream.pos = startXRef + stream.start;
           var parser = new _parser.Parser(new _parser.Lexer(stream), true, this);
           var obj = parser.getObj();
           var dict;
           if ((0, _primitives.isCmd)(obj, 'xref')) {
             dict = this.processXRefTable(parser);
             if (!this.topDict) {
               this.topDict = dict;
@@ -40032,18 +40046,18 @@ exports.Type1Parser = Type1Parser;
 
 /***/ }),
 /* 35 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '1.9.456';
-var pdfjsBuild = 'cb10c03d';
+var pdfjsVersion = '1.9.476';
+var pdfjsBuild = '26c45369';
 var pdfjsCoreWorker = __w_pdfjs_require__(17);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
 /***/ }),
 /* 36 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
--- a/browser/extensions/pdfjs/content/web/viewer.js
+++ b/browser/extensions/pdfjs/content/web/viewer.js
@@ -1217,51 +1217,47 @@ let PDFViewerApplication = {
   },
   open(file, args) {
     if (this.pdfLoadingTask) {
       return this.close().then(() => {
         this.preferences.reload();
         return this.open(file, args);
       });
     }
-    let parameters = Object.create(null),
-        scale;
+    let parameters = Object.create(null);
     if (typeof file === 'string') {
       this.setTitleUsingUrl(file);
       parameters.url = file;
     } else if (file && 'byteLength' in file) {
       parameters.data = file;
     } else if (file.url && file.originalUrl) {
       this.setTitleUsingUrl(file.originalUrl);
       parameters.url = file.url;
     }
     parameters.docBaseUrl = this.baseUrl;
     if (args) {
       for (let prop in args) {
+        if (prop === 'length') {
+          this.pdfDocumentProperties.setFileSize(args[prop]);
+        }
         parameters[prop] = args[prop];
       }
-      if (args.scale) {
-        scale = args.scale;
-      }
-      if (args.length) {
-        this.pdfDocumentProperties.setFileSize(args.length);
-      }
     }
     let loadingTask = (0, _pdfjsLib.getDocument)(parameters);
     this.pdfLoadingTask = loadingTask;
     loadingTask.onPassword = (updateCallback, reason) => {
       this.passwordPrompt.setUpdateCallback(updateCallback, reason);
       this.passwordPrompt.open();
     };
     loadingTask.onProgress = ({ loaded, total }) => {
       this.progress(loaded / total);
     };
     loadingTask.onUnsupportedFeature = this.fallback.bind(this);
     return loadingTask.promise.then(pdfDocument => {
-      this.load(pdfDocument, scale);
+      this.load(pdfDocument);
     }, exception => {
       let message = exception && exception.message;
       let loadingErrorMessage;
       if (exception instanceof _pdfjsLib.InvalidPDFException) {
         loadingErrorMessage = this.l10n.get('invalid_file_error', null, 'Invalid or corrupted PDF file.');
       } else if (exception instanceof _pdfjsLib.MissingPDFException) {
         loadingErrorMessage = this.l10n.get('missing_file_error', null, 'Missing PDF file.');
       } else if (exception instanceof _pdfjsLib.UnexpectedResponseException) {
@@ -1345,18 +1341,17 @@ let PDFViewerApplication = {
         this.loadingBar.show();
         this.disableAutoFetchLoadingBarTimeout = setTimeout(() => {
           this.loadingBar.hide();
           this.disableAutoFetchLoadingBarTimeout = null;
         }, DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT);
       }
     }
   },
-  load(pdfDocument, scale) {
-    scale = scale || _ui_utils.UNKNOWN_SCALE;
+  load(pdfDocument) {
     this.pdfDocument = pdfDocument;
     pdfDocument.getDownloadInfo().then(() => {
       this.downloadComplete = true;
       this.loadingBar.hide();
       firstPagePromise.then(() => {
         this.eventBus.dispatch('documentload', { source: this });
       });
     });
@@ -1412,20 +1407,17 @@ let PDFViewerApplication = {
         if (pageMode && !this.viewerPrefs['disablePageMode']) {
           sidebarView = sidebarView || apiPageModeToSidebarView(pageMode);
         }
         return {
           hash,
           sidebarView
         };
       }).then(({ hash, sidebarView }) => {
-        this.setInitialView(hash, {
-          sidebarView,
-          scale
-        });
+        this.setInitialView(hash, { sidebarView });
         initialParams.hash = hash;
         if (!this.isViewerEmbedded) {
           pdfViewer.focus();
         }
         return pagesPromise;
       }).then(() => {
         if (!initialParams.destination && !initialParams.bookmark && !initialParams.hash) {
           return;
@@ -1528,32 +1520,28 @@ let PDFViewerApplication = {
       this.externalServices.reportTelemetry({
         type: 'documentInfo',
         version: versionId,
         generator: generatorId,
         formType
       });
     });
   },
-  setInitialView(storedHash, options = {}) {
-    let { scale = 0, sidebarView = _pdf_sidebar.SidebarView.NONE } = options;
+  setInitialView(storedHash, { sidebarView } = {}) {
     this.isInitialViewSet = true;
     this.pdfSidebar.setInitialView(sidebarView);
     if (this.initialDestination) {
       this.pdfLinkService.navigateTo(this.initialDestination);
       this.initialDestination = null;
     } else if (this.initialBookmark) {
       this.pdfLinkService.setHash(this.initialBookmark);
       this.pdfHistory.push({ hash: this.initialBookmark }, true);
       this.initialBookmark = null;
     } else if (storedHash) {
       this.pdfLinkService.setHash(storedHash);
-    } else if (scale) {
-      this.pdfViewer.currentScaleValue = scale;
-      this.page = 1;
     }
     this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel);
     this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber);
     if (!this.pdfViewer.currentScaleValue) {
       this.pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;
     }
   },
   cleanup() {
@@ -5679,17 +5667,17 @@ class PDFSidebar {
     return this.isOpen && this.active === SidebarView.THUMBS;
   }
   get isOutlineViewVisible() {
     return this.isOpen && this.active === SidebarView.OUTLINE;
   }
   get isAttachmentsViewVisible() {
     return this.isOpen && this.active === SidebarView.ATTACHMENTS;
   }
-  setInitialView(view) {
+  setInitialView(view = SidebarView.NONE) {
     if (this.isInitialViewSet) {
       return;
     }
     this.isInitialViewSet = true;
     if (this.isOpen && view === SidebarView.NONE) {
       this._dispatchEvent();
       return;
     }
--- a/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -108,8 +108,12 @@
 <!ENTITY  clearOnCloseSettings.label     "Settingsā€¦">
 <!ENTITY  clearOnCloseSettings.accesskey "t">
 
 <!ENTITY  browserContainersLearnMore.label      "Learn more">
 <!ENTITY  browserContainersEnabled.label        "Enable Container Tabs">
 <!ENTITY  browserContainersEnabled.accesskey    "n">
 <!ENTITY  browserContainersSettings.label        "Settingsā€¦">
 <!ENTITY  browserContainersSettings.accesskey    "i">
+
+<!ENTITY  a11yPrivacy.checkbox.label     "Prevent accessibility services from accessing your browser">
+<!ENTITY  a11yPrivacy.checkbox.accesskey "a">
+<!ENTITY  a11yPrivacy.learnmore.label    "Learn more">
--- a/devtools/shared/locales/en-US/styleinspector.properties
+++ b/devtools/shared/locales/en-US/styleinspector.properties
@@ -68,17 +68,17 @@ rule.filterProperty.title=Filter rules c
 rule.empty=No element selected.
 
 # LOCALIZATION NOTE (ruleView.selectorHighlighter.tooltip): Text displayed in a
 # tooltip when the mouse is over a selector highlighter icon in the rule view.
 rule.selectorHighlighter.tooltip=Highlight all elements matching this selector
 
 # LOCALIZATION NOTE (rule.colorSwatch.tooltip): Text displayed in a tooltip
 # when the mouse is over a color swatch in the rule view.
-rule.colorSwatch.tooltip=Click to open the color picker, shift+click to change the color format
+rule.colorSwatch.tooltip=Click to open the color picker, Shift+click to change the color format
 
 # LOCALIZATION NOTE (rule.bezierSwatch.tooltip): Text displayed in a tooltip
 # when the mouse is over a cubic-bezier swatch in the rule view.
 rule.bezierSwatch.tooltip=Click to open the timing-function editor
 
 # LOCALIZATION NOTE (rule.filterSwatch.tooltip): Text displayed in a tooltip
 # when the mouse is over a filter swatch in the rule view.
 rule.filterSwatch.tooltip=Click to open the filter editor
--- a/dom/media/gmp/ChromiumCDMAdapter.cpp
+++ b/dom/media/gmp/ChromiumCDMAdapter.cpp
@@ -10,30 +10,45 @@
 #include "gmp-api/gmp-entrypoints.h"
 #include "gmp-api/gmp-decryption.h"
 #include "gmp-api/gmp-video-codec.h"
 #include "gmp-api/gmp-platform.h"
 #include "WidevineUtils.h"
 #include "GMPLog.h"
 #include "mozilla/Move.h"
 
-#ifndef XP_WIN
+#ifdef XP_WIN
+#include "WinUtils.h"
+#include "nsWindowsDllInterceptor.h"
+#include <windows.h>
+#include <strsafe.h>
+#include <unordered_map>
+#include <vector>
+#else
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
 #endif
 
 // Declared in WidevineAdapter.cpp.
 extern const GMPPlatformAPI* sPlatform;
 
 namespace mozilla {
 
+#ifdef XP_WIN
+static void
+InitializeHooks();
+#endif
+
 ChromiumCDMAdapter::ChromiumCDMAdapter(nsTArray<Pair<nsCString, nsCString>>&& aHostPathPairs)
 {
+#ifdef XP_WIN
+  InitializeHooks();
+#endif
   PopulateHostFiles(Move(aHostPathPairs));
 }
 
 void
 ChromiumCDMAdapter::SetAdaptee(PRLibrary* aLib)
 {
   mLib = aLib;
 }
@@ -164,16 +179,109 @@ ChromiumCDMAdapter::Supports(int32_t aMo
                              int32_t aInterfaceVersion,
                              int32_t aHostVersion)
 {
   return aModuleVersion == CDM_MODULE_VERSION &&
          aInterfaceVersion == cdm::ContentDecryptionModule_8::kVersion &&
          aHostVersion == cdm::Host_8::kVersion;
 }
 
+#ifdef XP_WIN
+
+static WindowsDllInterceptor sKernel32Intercept;
+
+typedef DWORD(WINAPI* QueryDosDeviceWFnPtr)(_In_opt_ LPCWSTR lpDeviceName,
+                                            _Out_ LPWSTR lpTargetPath,
+                                            _In_ DWORD ucchMax);
+
+static QueryDosDeviceWFnPtr sOriginalQueryDosDeviceWFnPtr = nullptr;
+
+static std::unordered_map<std::wstring, std::wstring>* sDeviceNames = nullptr;
+
+DWORD WINAPI
+QueryDosDeviceWHook(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
+{
+  if (!sDeviceNames) {
+    return 0;
+  }
+  std::wstring name = std::wstring(lpDeviceName);
+  auto iter = sDeviceNames->find(name);
+  if (iter == sDeviceNames->end()) {
+    return 0;
+  }
+  const std::wstring& device = iter->second;
+  if (device.size() + 1 > ucchMax) {
+    return 0;
+  }
+  PodCopy(lpTargetPath, device.c_str(), device.size());
+  lpTargetPath[device.size()] = 0;
+  GMP_LOG("QueryDosDeviceWHook %S -> %S", lpDeviceName, lpTargetPath);
+  return name.size();
+}
+
+static std::vector<std::wstring>
+GetDosDeviceNames()
+{
+  std::vector<std::wstring> v;
+  std::vector<wchar_t> buf;
+  buf.resize(1024);
+  DWORD rv = GetLogicalDriveStringsW(buf.size(), buf.data());
+  if (rv == 0 || rv > buf.size()) {
+    return v;
+  }
+
+  // buf will be a list of null terminated strings, with the last string
+  // being 0 length.
+  const wchar_t* p = buf.data();
+  const wchar_t* end = &buf.back();
+  size_t l;
+  while (p < end && (l = wcsnlen_s(p, end - p)) > 0) {
+    // The string is of the form "C:\". We need to strip off the trailing
+    // backslash.
+    std::wstring drive = std::wstring(p, p + l);
+    if (drive.back() == '\\') {
+      drive.erase(drive.end() - 1);
+    }
+    v.push_back(move(drive));
+    p += l + 1;
+  }
+  return v;
+}
+
+static std::wstring
+GetDeviceMapping(const std::wstring& aDosDeviceName)
+{
+  wchar_t buf[MAX_PATH] = { 0 };
+  DWORD rv = QueryDosDeviceW(aDosDeviceName.c_str(), buf, MAX_PATH);
+  if (rv == 0) {
+    return std::wstring(L"");
+  }
+  return std::wstring(buf, buf + rv);
+}
+
+static void
+InitializeHooks()
+{
+  static bool initialized = false;
+  if (initialized) {
+    return;
+  }
+  initialized = true;
+  sDeviceNames = new std::unordered_map<std::wstring, std::wstring>();
+  for (const std::wstring& name : GetDosDeviceNames()) {
+    sDeviceNames->emplace(name, GetDeviceMapping(name));
+  }
+
+  sKernel32Intercept.Init("kernelbase.dll");
+  sKernel32Intercept.AddHook("QueryDosDeviceW",
+                             reinterpret_cast<intptr_t>(QueryDosDeviceWHook),
+                             (void**)(&sOriginalQueryDosDeviceWFnPtr));
+}
+#endif
+
 HostFile::HostFile(HostFile&& aOther)
   : mPath(aOther.mPath)
   , mFile(aOther.TakePlatformFile())
 {
 }
 
 HostFile::~HostFile()
 {
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -684,16 +684,28 @@ Layer::GetEffectiveMixBlendMode()
     c = c->GetParent()) {
     if(c->mSimpleAttrs.MixBlendMode() != CompositionOp::OP_OVER)
       return c->mSimpleAttrs.MixBlendMode();
   }
 
   return mSimpleAttrs.MixBlendMode();
 }
 
+Matrix4x4
+Layer::ComputeTransformToPreserve3DRoot()
+{
+  Matrix4x4 transform = GetLocalTransform();
+  for (Layer* layer = GetParent();
+       layer && layer->Extend3DContext();
+       layer = layer->GetParent()) {
+    transform = transform * layer->GetLocalTransform();
+  }
+  return transform;
+}
+
 void
 Layer::ComputeEffectiveTransformForMaskLayers(const gfx::Matrix4x4& aTransformToSurface)
 {
   if (GetMaskLayer()) {
     ComputeEffectiveTransformForMaskLayer(GetMaskLayer(), aTransformToSurface);
   }
   for (size_t i = 0; i < GetAncestorMaskLayerCount(); i++) {
     Layer* maskLayer = GetAncestorMaskLayerAt(i);
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -1678,16 +1678,25 @@ public:
    * it becomes different from GetEffectiveTransform().
    */
   virtual const gfx::Matrix4x4& GetEffectiveTransformForBuffer() const
   {
     return mEffectiveTransform;
   }
 
   /**
+   * If the current layers participates in a preserve-3d
+   * context (returns true for Combines3DTransformWithAncestors),
+   * returns the combined transform up to the preserve-3d (nearest
+   * ancestor that doesn't Extend3DContext()). Otherwise returns
+   * the local transform.
+   */
+  gfx::Matrix4x4 ComputeTransformToPreserve3DRoot();
+
+  /**
    * @param aTransformToSurface the composition of the transforms
    * from the parent layer (if any) to the destination pixel grid.
    *
    * Computes mEffectiveTransform for this layer and all its descendants.
    * mEffectiveTransform transforms this layer up to the destination
    * pixel grid (whatever aTransformToSurface is relative to).
    *
    * We promise that when this is called on a layer, all ancestor layers
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -718,16 +718,84 @@ ContainerLayerComposite::CleanupResource
   mLastIntermediateSurface = nullptr;
   mPrepared = nullptr;
 
   for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
     static_cast<LayerComposite*>(l->AsHostLayer())->CleanupResources();
   }
 }
 
+static LayerIntRect
+TransformRect(const LayerIntRect& aRect, const Matrix4x4& aTransform)
+{
+  if (aRect.IsEmpty()) {
+    return LayerIntRect();
+  }
+
+  Rect rect(aRect.x, aRect.y, aRect.width, aRect.height);
+  rect = aTransform.TransformAndClipBounds(rect, Rect::MaxIntRect());
+  rect.RoundOut();
+
+  IntRect intRect;
+  if (!gfxUtils::GfxRectToIntRect(ThebesRect(rect), &intRect)) {
+    return LayerIntRect();
+  }
+
+  return ViewAs<LayerPixel>(intRect);
+}
+
+static void
+AddTransformedRegion(LayerIntRegion& aDest, const LayerIntRegion& aSource, const Matrix4x4& aTransform)
+{
+  for (auto iter = aSource.RectIter(); !iter.Done(); iter.Next()) {
+    aDest.Or(aDest, TransformRect(iter.Get(), aTransform));
+  }
+  aDest.SimplifyOutward(20);
+}
+
+// Async animations can move child layers without updating our visible region.
+// PostProcessLayers will recompute visible regions for layers with an intermediate
+// surface, but otherwise we need to do it now.
+void
+ComputeVisibleRegionForChildren(ContainerLayer* aContainer, LayerIntRegion& aResult)
+{
+  for (Layer* l = aContainer->GetFirstChild(); l; l = l->GetNextSibling()) {
+    if (l->Extend3DContext()) {
+      MOZ_ASSERT(l->AsContainerLayer());
+      ComputeVisibleRegionForChildren(l->AsContainerLayer(), aResult);
+    } else {
+      AddTransformedRegion(aResult,
+                           l->GetLocalVisibleRegion(),
+                           l->ComputeTransformToPreserve3DRoot());
+    }
+  }
+}
+
+const LayerIntRegion&
+ContainerLayerComposite::GetShadowVisibleRegion()
+{
+  if (!UseIntermediateSurface()) {
+    mShadowVisibleRegion.SetEmpty();
+    ComputeVisibleRegionForChildren(this, mShadowVisibleRegion);
+  }
+
+  return mShadowVisibleRegion;
+}
+
+const LayerIntRegion&
+RefLayerComposite::GetShadowVisibleRegion()
+{
+  if (!UseIntermediateSurface()) {
+    mShadowVisibleRegion.SetEmpty();
+    ComputeVisibleRegionForChildren(this, mShadowVisibleRegion);
+  }
+
+  return mShadowVisibleRegion;
+}
+
 RefLayerComposite::RefLayerComposite(LayerManagerComposite* aManager)
   : RefLayer(aManager, nullptr)
   , LayerComposite(aManager)
 {
   mImplData = static_cast<LayerComposite*>(this);
 }
 
 RefLayerComposite::~RefLayerComposite()
--- a/gfx/layers/composite/ContainerLayerComposite.h
+++ b/gfx/layers/composite/ContainerLayerComposite.h
@@ -83,16 +83,18 @@ public:
 
   virtual void Prepare(const RenderTargetIntRect& aClipRect) override;
 
   virtual void ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSurface) override
   {
     DefaultComputeEffectiveTransforms(aTransformToSurface);
   }
 
+  virtual const LayerIntRegion& GetShadowVisibleRegion() override;
+
   virtual void CleanupResources() override;
 
   virtual HostLayer* AsHostLayer() override { return this; }
 
   // container layers don't use a compositable
   CompositableHost* GetCompositableHost() override { return nullptr; }
 
   // If the layer is marked as scale-to-resolution, add a post-scale
@@ -178,16 +180,18 @@ public:
 
   virtual void Prepare(const RenderTargetIntRect& aClipRect) override;
 
   virtual void ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSurface) override
   {
     DefaultComputeEffectiveTransforms(aTransformToSurface);
   }
 
+  virtual const LayerIntRegion& GetShadowVisibleRegion() override;
+
   virtual void Cleanup() override;
 
   virtual void CleanupResources() override;
 
   virtual HostLayer* AsHostLayer() override { return this; }
 
   // ref layers don't use a compositable
   CompositableHost* GetCompositableHost() override { return nullptr; }
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -257,31 +257,16 @@ bool ShouldProcessLayer(Layer* aLayer)
 {
   if (!aLayer->AsContainerLayer()) {
     return true;
   }
 
   return aLayer->AsContainerLayer()->UseIntermediateSurface();
 }
 
-/**
- * Get accumulated transform of from the context creating layer to the
- * given layer.
- */
-static Matrix4x4
-GetAccTransformIn3DContext(Layer* aLayer) {
-  Matrix4x4 transform = aLayer->GetLocalTransform();
-  for (Layer* layer = aLayer->GetParent();
-       layer && layer->Extend3DContext();
-       layer = layer->GetParent()) {
-    transform = transform * layer->GetLocalTransform();
-  }
-  return transform;
-}
-
 void
 LayerManagerComposite::PostProcessLayers(Layer* aLayer,
                                          nsIntRegion& aOpaqueRegion,
                                          LayerIntRegion& aVisibleRegion,
                                          const Maybe<RenderTargetIntRect>& aRenderTargetClip,
                                          const Maybe<ParentLayerIntRect>& aClipFromAncestors)
 {
 
@@ -302,17 +287,17 @@ LayerManagerComposite::PostProcessLayers
     if (outsideClip) {
       insideClip = Some(ViewAs<LayerPixel>(*outsideClip, PixelCastJustification::MovingDownToChildren));
     }
   } else if (outsideClip) {
     // Convert the combined clip into our pre-transform coordinate space, so
     // that it can later be intersected with our visible region.
     // If our transform is a perspective, there's no meaningful insideClip rect
     // we can compute (it would need to be a cone).
-    Matrix4x4 localTransform = GetAccTransformIn3DContext(aLayer);
+    Matrix4x4 localTransform = aLayer->ComputeTransformToPreserve3DRoot();
     if (!localTransform.HasPerspectiveComponent() && localTransform.Invert()) {
       LayerRect insideClipFloat =
         UntransformBy(ViewAs<ParentLayerToLayerMatrix4x4>(localTransform),
                       ParentLayerRect(*outsideClip),
                       LayerRect::MaxIntRect()).valueOr(LayerRect());
       insideClipFloat.RoundOut();
       LayerIntRect insideClipInt;
       if (insideClipFloat.ToIntRect(&insideClipInt)) {
@@ -322,16 +307,23 @@ LayerManagerComposite::PostProcessLayers
   }
 
   Maybe<ParentLayerIntRect> ancestorClipForChildren;
   if (insideClip) {
     ancestorClipForChildren =
       Some(ViewAs<ParentLayerPixel>(*insideClip, PixelCastJustification::MovingDownToChildren));
   }
 
+  nsIntRegion dummy;
+  nsIntRegion& opaqueRegion = aOpaqueRegion;
+  if (aLayer->Extend3DContext() ||
+      aLayer->Combines3DTransformWithAncestors()) {
+   opaqueRegion = dummy;
+  }
+
   if (!ShouldProcessLayer(aLayer)) {
     MOZ_ASSERT(aLayer->AsContainerLayer() && !aLayer->AsContainerLayer()->UseIntermediateSurface());
     // For layers participating 3D rendering context, their visible
     // region should be empty (invisible), so we pass through them
     // without doing anything.
     for (Layer* child = aLayer->GetLastChild();
          child;
          child = child->GetPrevSibling()) {
@@ -340,17 +332,17 @@ LayerManagerComposite::PostProcessLayers
       if (childComposite->GetShadowClipRect()) {
         RenderTargetIntRect clip = TransformBy(ViewAs<ParentLayerToRenderTargetMatrix4x4>(
           aLayer->GetEffectiveTransform(),
           PixelCastJustification::RenderTargetIsParentLayerForRoot),
                                                *childComposite->GetShadowClipRect());
         renderTargetClip = IntersectMaybeRects(renderTargetClip, Some(clip));
       }
 
-      PostProcessLayers(child, aOpaqueRegion, aVisibleRegion,
+      PostProcessLayers(child, opaqueRegion, aVisibleRegion,
                         renderTargetClip, ancestorClipForChildren);
     }
     return;
   }
 
   nsIntRegion localOpaque;
   // Treat layers on the path to the root of the 3D rendering context as
   // a giant layer if it is a leaf.
@@ -358,17 +350,17 @@ LayerManagerComposite::PostProcessLayers
   Matrix transform2d;
   Maybe<IntPoint> integerTranslation;
   // If aLayer has a simple transform (only an integer translation) then we
   // can easily convert aOpaqueRegion into pre-transform coordinates and include
   // that region.
   if (transform.Is2D(&transform2d)) {
     if (transform2d.IsIntegerTranslation()) {
       integerTranslation = Some(IntPoint::Truncate(transform2d.GetTranslation()));
-      localOpaque = aOpaqueRegion;
+      localOpaque = opaqueRegion;
       localOpaque.MoveBy(-*integerTranslation);
     }
   }
 
   // Save the value of localOpaque, which currently stores the region obscured
   // by siblings (and uncles and such), before our descendants contribute to it.
   nsIntRegion obscured = localOpaque;
 
@@ -426,17 +418,17 @@ LayerManagerComposite::PostProcessLayers
       aLayer->IsOpaqueForVisibility()) {
     if (aLayer->IsOpaque()) {
       localOpaque.OrWith(composite->GetFullyRenderedRegion());
     }
     localOpaque.MoveBy(*integerTranslation);
     if (aRenderTargetClip) {
       localOpaque.AndWith(aRenderTargetClip->ToUnknownRect());
     }
-    aOpaqueRegion.OrWith(localOpaque);
+    opaqueRegion.OrWith(localOpaque);
   }
 }
 
 void
 LayerManagerComposite::EndTransaction(const TimeStamp& aTimeStamp,
                                       EndTransactionFlags aFlags)
 {
   NS_ASSERTION(mInTransaction, "Didn't call BeginTransaction?");
--- a/gfx/layers/composite/LayerManagerComposite.h
+++ b/gfx/layers/composite/LayerManagerComposite.h
@@ -602,22 +602,21 @@ public:
   void SetShadowTransformSetByAnimation(bool aSetByAnimation)
   {
     mShadowTransformSetByAnimation = aSetByAnimation;
   }
 
   // These getters can be used anytime.
   float GetShadowOpacity() { return mShadowOpacity; }
   const Maybe<ParentLayerIntRect>& GetShadowClipRect() { return mShadowClipRect; }
-  const LayerIntRegion& GetShadowVisibleRegion() const { return mShadowVisibleRegion; }
+  virtual const LayerIntRegion& GetShadowVisibleRegion() { return mShadowVisibleRegion; }
   const gfx::Matrix4x4& GetShadowBaseTransform() { return mShadowTransform; }
   gfx::Matrix4x4 GetShadowTransform();
   bool GetShadowTransformSetByAnimation() { return mShadowTransformSetByAnimation; }
   bool GetShadowOpacitySetByAnimation() { return mShadowOpacitySetByAnimation; }
-  LayerIntRegion&& GetShadowVisibleRegion() { return Move(mShadowVisibleRegion); }
 
 protected:
   HostLayerManager* mCompositorManager;
 
   gfx::Matrix4x4 mShadowTransform;
   LayerIntRegion mShadowVisibleRegion;
   Maybe<ParentLayerIntRect> mShadowClipRect;
   float mShadowOpacity;
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -6299,17 +6299,20 @@ Parser<ParseHandler, CharT>::forStatemen
             return null();
 
         if (matched) {
             iflags |= JSITER_FORAWAITOF;
             iterKind = IteratorKind::Async;
         }
     }
 
-    MUST_MATCH_TOKEN(TOK_LP, JSMSG_PAREN_AFTER_FOR);
+    MUST_MATCH_TOKEN_MOD_WITH_REPORT(TOK_LP, TokenStream::None,
+                                     error((token == TOK_AWAIT && !pc->isAsync())
+                                           ? JSMSG_FOR_AWAIT_OUTSIDE_ASYNC
+                                           : JSMSG_PAREN_AFTER_FOR));
 
     // PNK_FORHEAD, PNK_FORIN, or PNK_FOROF depending on the loop type.
     ParseNodeKind headKind;
 
     // |x| in either |for (x; ...; ...)| or |for (x in/of ...)|.
     Node startNode;
 
     // The next two variables are used to implement `for (let/const ...)`.
--- a/js/src/js.msg
+++ b/js/src/js.msg
@@ -183,17 +183,17 @@ MSG_DEF(JSMSG_UNKNOWN_FORMAT,          1
 
 // Frontend
 MSG_DEF(JSMSG_ACCESSOR_WRONG_ARGS,     3, JSEXN_SYNTAXERR, "{0} functions must have {1} argument{2}")
 MSG_DEF(JSMSG_ARRAY_COMP_LEFTSIDE,     0, JSEXN_SYNTAXERR, "invalid array comprehension left-hand side")
 MSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG,      0, JSEXN_INTERNALERR, "array initializer too large")
 MSG_DEF(JSMSG_AS_AFTER_IMPORT_STAR,    0, JSEXN_SYNTAXERR, "missing keyword 'as' after import *")
 MSG_DEF(JSMSG_AS_AFTER_RESERVED_WORD,  1, JSEXN_SYNTAXERR, "missing keyword 'as' after reserved word '{0}'")
 MSG_DEF(JSMSG_AWAIT_IN_DEFAULT,        0, JSEXN_SYNTAXERR, "await can't be used in default expression")
-MSG_DEF(JSMSG_AWAIT_OUTSIDE_ASYNC,     0, JSEXN_SYNTAXERR, "await is only valid in async functions")
+MSG_DEF(JSMSG_AWAIT_OUTSIDE_ASYNC,     0, JSEXN_SYNTAXERR, "await is only valid in async functions and async generators")
 MSG_DEF(JSMSG_BAD_ARROW_ARGS,          0, JSEXN_SYNTAXERR, "invalid arrow-function arguments (parentheses around the arrow-function may help)")
 MSG_DEF(JSMSG_BAD_BINDING,             1, JSEXN_SYNTAXERR, "redefining {0} is deprecated")
 MSG_DEF(JSMSG_BAD_CONST_DECL,          0, JSEXN_SYNTAXERR, "missing = in const declaration")
 MSG_DEF(JSMSG_BAD_CONTINUE,            0, JSEXN_SYNTAXERR, "continue must be inside loop")
 MSG_DEF(JSMSG_BAD_DESTRUCT_ASS,        0, JSEXN_REFERENCEERR, "invalid destructuring assignment operator")
 MSG_DEF(JSMSG_BAD_DESTRUCT_TARGET,     0, JSEXN_SYNTAXERR, "invalid destructuring target")
 MSG_DEF(JSMSG_BAD_DESTRUCT_PARENS,     0, JSEXN_SYNTAXERR, "destructuring patterns in assignments can't be parenthesized")
 MSG_DEF(JSMSG_BAD_DESTRUCT_DECL,       0, JSEXN_SYNTAXERR, "missing = in destructuring declaration")
@@ -258,16 +258,17 @@ MSG_DEF(JSMSG_DUPLICATE_FORMAL,        1
 MSG_DEF(JSMSG_DUPLICATE_LABEL,         0, JSEXN_SYNTAXERR, "duplicate label")
 MSG_DEF(JSMSG_DUPLICATE_PROPERTY,      1, JSEXN_SYNTAXERR, "property name {0} appears more than once in object literal")
 MSG_DEF(JSMSG_DUPLICATE_PROTO_PROPERTY, 0, JSEXN_SYNTAXERR, "property name __proto__ appears more than once in object literal")
 MSG_DEF(JSMSG_EMPTY_CONSEQUENT,        0, JSEXN_SYNTAXERR, "mistyped ; after conditional?")
 MSG_DEF(JSMSG_EQUAL_AS_ASSIGN,         0, JSEXN_SYNTAXERR, "test for equality (==) mistyped as assignment (=)?")
 MSG_DEF(JSMSG_EXPORT_DECL_AT_TOP_LEVEL,0, JSEXN_SYNTAXERR, "export declarations may only appear at top level of a module")
 MSG_DEF(JSMSG_FINALLY_WITHOUT_TRY,     0, JSEXN_SYNTAXERR, "finally without try")
 MSG_DEF(JSMSG_FORBIDDEN_AS_STATEMENT,  1, JSEXN_SYNTAXERR, "{0} can't appear in single-statement context")
+MSG_DEF(JSMSG_FOR_AWAIT_OUTSIDE_ASYNC, 0, JSEXN_SYNTAXERR, "for await (... of ...) is only valid in async functions and async generators")
 MSG_DEF(JSMSG_FROM_AFTER_IMPORT_CLAUSE, 0, JSEXN_SYNTAXERR, "missing keyword 'from' after import clause")
 MSG_DEF(JSMSG_FROM_AFTER_EXPORT_STAR,  0, JSEXN_SYNTAXERR, "missing keyword 'from' after export *")
 MSG_DEF(JSMSG_GARBAGE_AFTER_INPUT,     2, JSEXN_SYNTAXERR, "unexpected garbage after {0}, starting with {1}")
 MSG_DEF(JSMSG_IDSTART_AFTER_NUMBER,    0, JSEXN_SYNTAXERR, "identifier starts immediately after numeric literal")
 MSG_DEF(JSMSG_ILLEGAL_CHARACTER,       0, JSEXN_SYNTAXERR, "illegal character")
 MSG_DEF(JSMSG_IMPORT_DECL_AT_TOP_LEVEL, 0, JSEXN_SYNTAXERR, "import declarations may only appear at top level of a module")
 MSG_DEF(JSMSG_OF_AFTER_FOR_LOOP_DECL,  0, JSEXN_SYNTAXERR, "a declaration in the head of a for-of loop can't have an initializer")
 MSG_DEF(JSMSG_IN_AFTER_LEXICAL_FOR_DECL,0,JSEXN_SYNTAXERR, "a lexical declaration in the head of a for-in loop can't have an initializer")
--- a/js/src/tests/ecma_2017/AsyncFunctions/await-error.js
+++ b/js/src/tests/ecma_2017/AsyncFunctions/await-error.js
@@ -2,15 +2,15 @@ var BUGNUMBER = 1317153;
 var summary = "await outside of async function should provide better error";
 
 print(BUGNUMBER + ": " + summary);
 
 let caught = false;
 try {
     eval("await 10");
 } catch(e) {
-    assertEq(e.message, "await is only valid in async functions");
+    assertEq(e.message.includes("await is only valid in"), true);
     caught = true;
 }
 assertEq(caught, true);
 
 if (typeof reportCompare === "function")
     reportCompare(true, true);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_2018/AsyncGenerators/for-await-of-error.js
@@ -0,0 +1,26 @@
+var BUGNUMBER = 1391519;
+var summary = "for-await-of outside of async function should provide better error";
+
+print(BUGNUMBER + ": " + summary);
+
+let caught = false;
+try {
+    eval("for await (let x of []) {}");
+} catch(e) {
+    assertEq(e.message.includes("for await (... of ...) is only valid in"), true);
+    caught = true;
+}
+assertEq(caught, true);
+
+// Extra `await` shouldn't throw that error.
+caught = false;
+try {
+    eval("async function f() { for await await (let x of []) {} }");
+} catch(e) {
+    assertEq(e.message, "missing ( after for");
+    caught = true;
+}
+assertEq(caught, true);
+
+if (typeof reportCompare === "function")
+    reportCompare(true, true);
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -476,18 +476,18 @@ def print_automation_format(ok, res):
     # INFO stdout          > foo
     # INFO stdout          > bar
     # INFO stdout          > baz
     # INFO stderr         2> TypeError: or something
     # TEST-UNEXPECTED-FAIL | jit_test.py: Test execution interrupted by user
     result = "TEST-PASS" if ok else "TEST-UNEXPECTED-FAIL"
     message = "Success" if ok else res.describe_failure()
     jitflags = " ".join(res.test.jitflags)
-    print("{} | {} | {} (code {}, args \"{}\")".format(
-        result, res.test.relpath_top, message, res.rc, jitflags))
+    print("{} | {} | {} (code {}, args \"{}\") [{:.1f} s]".format(
+        result, res.test.relpath_top, message, res.rc, jitflags, res.dt))
 
     # For failed tests, print as much information as we have, to aid debugging.
     if ok:
         return
     print("INFO exit-status     : {}".format(res.rc))
     print("INFO timed-out       : {}".format(res.timed_out))
     for line in res.out.splitlines():
         print("INFO stdout          > " + line.strip())
--- a/js/src/tests/lib/results.py
+++ b/js/src/tests/lib/results.py
@@ -295,9 +295,10 @@ class ResultsSink:
         args += test.jitflags
         result += ' | (args: "{}")'.format(' '.join(args))
         if message:
             result += " | " + message
         if skip:
             result += ' | (SKIP)'
         if time > self.options.timeout:
             result += ' | (TIMEOUT)'
+        result += ' [{:.1f} s]'.format(time)
         print(result)
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -956,16 +956,22 @@ IsHeapAccessAddress(const Instance &inst
 {
     size_t accessLimit = instance.memoryMappedSize();
 
     return instance.metadata().usesMemory() &&
            faultingAddress >= instance.memoryBase() &&
            faultingAddress < instance.memoryBase() + accessLimit;
 }
 
+MOZ_COLD static bool
+IsActiveContext(JSContext* cx)
+{
+    return cx == cx->runtime()->activeContext();
+}
+
 #if defined(XP_WIN)
 
 static bool
 HandleFault(PEXCEPTION_POINTERS exception)
 {
     EXCEPTION_RECORD* record = exception->ExceptionRecord;
     CONTEXT* context = exception->ContextRecord;
 
@@ -975,17 +981,17 @@ HandleFault(PEXCEPTION_POINTERS exceptio
     uint8_t** ppc = ContextToPC(context);
     uint8_t* pc = *ppc;
 
     if (record->NumberParameters < 2)
         return false;
 
     // Don't allow recursive handling of signals, see AutoSetHandlingSegFault.
     JSContext* cx = TlsContext.get();
-    if (!cx || cx->handlingSegFault)
+    if (!cx || cx->handlingSegFault || !IsActiveContext(cx))
         return false;
     AutoSetHandlingSegFault handling(cx);
 
     WasmActivation* activation = ActivationIfInnermost(cx);
     if (!activation)
         return false;
 
     const CodeSegment* codeSegment;
@@ -1078,17 +1084,17 @@ struct ExceptionRequest
     Request__mach_exception_raise_t body;
     mach_msg_trailer_t trailer;
 };
 
 static bool
 HandleMachException(JSContext* cx, const ExceptionRequest& request)
 {
     // Don't allow recursive handling of signals, see AutoSetHandlingSegFault.
-    if (cx->handlingSegFault)
+    if (cx->handlingSegFault || !IsActiveContext(cx))
         return false;
     AutoSetHandlingSegFault handling(cx);
 
     // Get the port of the JSContext's thread from the message.
     mach_port_t cxThread = request.body.thread.name;
 
     // Read out the JSRuntime thread's register state.
     EMULATOR_CONTEXT context;
@@ -1332,17 +1338,17 @@ HandleFault(int signum, siginfo_t* info,
         MOZ_RELEASE_ASSERT(signum == SIGBUS);
 
     CONTEXT* context = (CONTEXT*)ctx;
     uint8_t** ppc = ContextToPC(context);
     uint8_t* pc = *ppc;
 
     // Don't allow recursive handling of signals, see AutoSetHandlingSegFault.
     JSContext* cx = TlsContext.get();
-    if (!cx || cx->handlingSegFault)
+    if (!cx || cx->handlingSegFault || !IsActiveContext(cx))
         return false;
     AutoSetHandlingSegFault handling(cx);
 
     WasmActivation* activation = ActivationIfInnermost(cx);
     if (!activation)
         return false;
 
     const CodeSegment* segment;
deleted file mode 100644
--- a/testing/web-platform/meta/css/css-transforms-2/transform3d-sorting-001.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[transform3d-sorting-001.html]
-  type: reftest
-  expected: FAIL
--- a/toolkit/xre/test/win/TestDllInterceptor.cpp
+++ b/toolkit/xre/test/win/TestDllInterceptor.cpp
@@ -311,16 +311,23 @@ bool TestCreateFileA(void* aFunc)
   auto patchedCreateFileA =
     reinterpret_cast<decltype(&CreateFileA)>(aFunc);
 //  return patchedCreateFileA(0, 0, 0, 0, 0, 0, 0) == INVALID_HANDLE_VALUE;
   printf("TEST-SKIPPED | WindowsDllInterceptor | "
           "Will not attempt to execute patched CreateFileA -- patched method is known to fail.\n");
   return true;
 }
 
+bool TestQueryDosDeviceW(void* aFunc)
+{
+  auto patchedQueryDosDeviceW =
+    reinterpret_cast<decltype(&QueryDosDeviceW)>(aFunc);
+  return patchedQueryDosDeviceW(nullptr, nullptr, 0) == 0;
+}
+
 bool TestInSendMessageEx(void* aFunc)
 {
   auto patchedInSendMessageEx =
     reinterpret_cast<decltype(&InSendMessageEx)>(aFunc);
   patchedInSendMessageEx(0);
   return true;
 }
 
@@ -504,16 +511,17 @@ int main()
 #ifdef _M_IX86
       // Bug 670967: xpcom/base/AvailableMemoryTracker.cpp
       TestHook(TestVirtualAlloc, "kernel32.dll", "VirtualAlloc") &&
       TestHook(TestMapViewOfFile, "kernel32.dll", "MapViewOfFile") &&
       TestHook(TestCreateDIBSection, "gdi32.dll", "CreateDIBSection") &&
       TestHook(TestCreateFileW, "kernel32.dll", "CreateFileW") &&    // see Bug 1316415
 #endif
       TestHook(TestCreateFileA, "kernel32.dll", "CreateFileA") &&
+      TestHook(TestQueryDosDeviceW, "kernelbase.dll", "QueryDosDeviceW") &&
       TestDetour("user32.dll", "CreateWindowExW") &&
       TestHook(TestInSendMessageEx, "user32.dll", "InSendMessageEx") &&
       TestHook(TestImmGetContext, "imm32.dll", "ImmGetContext") &&
       // TestHook("imm32.dll", "ImmReleaseContext") &&    // see Bug 1316415
       TestHook(TestImmGetCompositionStringW, "imm32.dll", "ImmGetCompositionStringW") &&
       TestHook(TestImmSetCandidateWindow, "imm32.dll", "ImmSetCandidateWindow") &&
       TestHook(TestImmNotifyIME, "imm32.dll", "ImmNotifyIME") &&
       TestHook(TestGetSaveFileNameW, "comdlg32.dll", "GetSaveFileNameW") &&