Merge inbound to mozilla-central. a=merge
authorCiure Andrei <aciure@mozilla.com>
Tue, 07 Aug 2018 00:58:13 +0300
changeset 430262 588a314db0d5d2f7d1b758d09f170e3afb1283a3
parent 430261 770a323b3609d3a76dfb05e7570d98bdea94dac9 (current diff)
parent 430250 96a7f93d60a9fe1b3a929810d3d8d7a8f8bde00e (diff)
child 430263 a3b77a006a201a4ee0fed2ca28556179d33ab5f0
child 430289 4466a4393d5f7fcf989155668906611df8775b5d
push id106108
push useraciure@mozilla.com
push dateMon, 06 Aug 2018 22:04:25 +0000
treeherdermozilla-inbound@a3b77a006a20 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone63.0a1
first release with
nightly linux32
588a314db0d5 / 63.0a1 / 20180806220216 / files
nightly linux64
588a314db0d5 / 63.0a1 / 20180806220216 / files
nightly mac
588a314db0d5 / 63.0a1 / 20180806220216 / files
nightly win32
588a314db0d5 / 63.0a1 / 20180806220216 / files
nightly win64
588a314db0d5 / 63.0a1 / 20180806220216 / 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 inbound to mozilla-central. a=merge
browser/base/content/browser.js
browser/components/nsBrowserGlue.js
browser/components/sessionstore/SessionStore.jsm
testing/web-platform/meta/navigation-timing/nav2_test_attributes_values.html.ini
testing/web-platform/meta/navigation-timing/test_navigation_type_reload.html.ini
testing/web-platform/meta/navigation-timing/test_performance_attributes.sub.html.ini
testing/web-platform/meta/navigation-timing/test_timing_reload.html.ini
testing/web-platform/meta/navigation-timing/test_timing_xserver_redirect.html.ini
testing/web-platform/meta/server-timing/test_server_timing.https.html.ini
--- a/accessible/aom/AccessibleNode.cpp
+++ b/accessible/aom/AccessibleNode.cpp
@@ -27,17 +27,18 @@ AccessibleNode::IsAOMEnabled(JSContext* 
   if (!sPrefCached) {
     sPrefCached = true;
     Preferences::AddBoolVarCache(&sPrefCacheValue, "accessibility.AOM.enabled");
   }
 
   return nsContentUtils::IsSystemCaller(aCx) || sPrefCacheValue;
 }
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AccessibleNode, mIntl, mDOMNode, mStates)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AccessibleNode, mRelationProperties,
+                                      mIntl, mDOMNode, mStates)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AccessibleNode)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(AccessibleNode)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(AccessibleNode)
--- a/accessible/aom/AccessibleNode.h
+++ b/accessible/aom/AccessibleNode.h
@@ -3,16 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef A11Y_AOM_ACCESSIBLENODE_H
 #define A11Y_AOM_ACCESSIBLENODE_H
 
 #include "nsDataHashtable.h"
+#include "nsRefPtrHashtable.h"
 #include "nsWrapperCache.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/Nullable.h"
 
 class nsINode;
 
 namespace mozilla {
@@ -233,37 +234,33 @@ protected:
   }
 
   ANODE_ACCESSOR_MUTATOR(Double, double, 0.0)
   ANODE_ACCESSOR_MUTATOR(Int, int32_t, 0)
   ANODE_ACCESSOR_MUTATOR(UInt, uint32_t, 0)
 
   already_AddRefed<AccessibleNode> GetProperty(AOMRelationProperty aProperty)
   {
-    RefPtr<AccessibleNode> data;
-    if (mRelationProperties.Get(static_cast<int>(aProperty), &data)) {
-      return data.forget();
-    }
-    return nullptr;
+    return mRelationProperties.Get(static_cast<int>(aProperty));
   }
 
   void SetProperty(AOMRelationProperty aProperty,
                    AccessibleNode* aValue)
   {
     if (!aValue) {
       mRelationProperties.Remove(static_cast<int>(aProperty));
     } else {
       mRelationProperties.Put(static_cast<int>(aProperty), aValue);
     }
   }
 
   // The 2k'th bit indicates whether the k'th boolean property is used(1) or not(0)
   // and 2k+1'th bit contains the property's value(1:true, 0:false)
   uint32_t mBooleanProperties;
-  nsDataHashtable<nsUint32HashKey, RefPtr<AccessibleNode> > mRelationProperties;
+  nsRefPtrHashtable<nsUint32HashKey, AccessibleNode> mRelationProperties;
   nsDataHashtable<nsUint32HashKey, nsString> mStringProperties;
 
   RefPtr<a11y::Accessible> mIntl;
   RefPtr<nsINode> mDOMNode;
   RefPtr<dom::DOMStringList> mStates;
 };
 
 } // dom
--- a/accessible/base/moz.build
+++ b/accessible/base/moz.build
@@ -109,8 +109,11 @@ else:
     ]
 
 FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/accessible/generic/moz.build
+++ b/accessible/generic/moz.build
@@ -65,8 +65,11 @@ else:
     ]
 
 FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/accessible/interfaces/ia2/moz.build
+++ b/accessible/interfaces/ia2/moz.build
@@ -93,8 +93,11 @@ RCINCLUDE = 'IA2Marshal.rc'
 # Suppress warnings from the MIDL generated code.
 if CONFIG['CC_TYPE'] == 'clang-cl':
     CFLAGS += [
         '-Wno-extern-initializer',
         '-Wno-incompatible-pointer-types',
         '-Wno-missing-braces',
         '-Wno-unused-const-variable',
     ]
+
+if CONFIG['MOZ_PGO'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/accessible/interfaces/msaa/moz.build
+++ b/accessible/interfaces/msaa/moz.build
@@ -39,8 +39,11 @@ RCINCLUDE = 'AccessibleMarshal.rc'
 # Suppress warnings from the MIDL generated code.
 if CONFIG['CC_TYPE'] == 'clang-cl':
     CFLAGS += [
         '-Wno-extern-initializer',
         '-Wno-incompatible-pointer-types',
         '-Wno-missing-braces',
         '-Wno-unused-const-variable',
     ]
+
+if CONFIG['MOZ_PGO'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/accessible/ipc/moz.build
+++ b/accessible/ipc/moz.build
@@ -57,8 +57,11 @@ if CONFIG['ACCESSIBILITY']:
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 # Add libFuzzer configuration directives
 include('/tools/fuzzing/libfuzzer-config.mozbuild')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/accessible/ipc/win/handler/moz.build
+++ b/accessible/ipc/win/handler/moz.build
@@ -78,8 +78,10 @@ elif CONFIG['MOZ_UPDATE_CHANNEL'] == 'be
 # Windows 7 and Windows 8.
 USE_STATIC_LIBS = True
 
 LIBRARY_DEFINES['UNICODE'] = True
 LIBRARY_DEFINES['_UNICODE'] = True
 LIBRARY_DEFINES['MOZ_NO_MOZALLOC'] = True
 DisableStlWrapping()
 
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/accessible/ipc/win/moz.build
+++ b/accessible/ipc/win/moz.build
@@ -50,8 +50,11 @@ if CONFIG['ACCESSIBILITY']:
         '/accessible/windows/ia2',
         '/accessible/windows/msaa',
         '/accessible/xpcom',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/accessible/windows/msaa/moz.build
+++ b/accessible/windows/msaa/moz.build
@@ -79,8 +79,11 @@ LOCAL_INCLUDES += [
 #
 # which clang-cl complains about.  MSVC doesn't, so turn this warning off.
 if CONFIG['CC_TYPE'] == 'clang-cl':
     CXXFLAGS += ['-Wno-extra-tokens']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/accessible/windows/sdn/moz.build
+++ b/accessible/windows/sdn/moz.build
@@ -17,8 +17,11 @@ LOCAL_INCLUDES += [
     '/accessible/windows/msaa',
     '/accessible/xpcom',
     '/accessible/xul',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/accessible/xpcom/moz.build
+++ b/accessible/xpcom/moz.build
@@ -59,8 +59,11 @@ xpc_acc.script = 'AccEventGen.py:gen_fil
 xpc_acc.inputs += ['AccEvents.conf', '!/xpcom/idl-parser/xpidl/xpidllex.py', '!/xpcom/idl-parser/xpidl/xpidlyacc.py']
 
 FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/browser/app/winlauncher/moz.build
+++ b/browser/app/winlauncher/moz.build
@@ -20,8 +20,11 @@ OS_LIBS += [
     'ole32',
 ]
 
 TEST_DIRS += [
     'test',
 ]
 
 DisableStlWrapping()
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/browser/app/winlauncher/test/moz.build
+++ b/browser/app/winlauncher/test/moz.build
@@ -10,8 +10,11 @@ CppUnitTests(['TestNativeNt'])
 
 LOCAL_INCLUDES += [
     '/browser/app/winlauncher',
 ]
 
 OS_LIBS += [
     'ntdll',
 ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- 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: 2.0.719
+Current extension version is: 2.0.750
 
-Taken from upstream commit: 35214245
+Taken from upstream commit: c8ee6331
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -118,18 +118,18 @@ return /******/ (function(modules) { // 
 /************************************************************************/
 /******/ ([
 /* 0 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.0.719';
-var pdfjsBuild = '35214245';
+var pdfjsVersion = '2.0.750';
+var pdfjsBuild = 'c8ee6331';
 var pdfjsSharedUtil = __w_pdfjs_require__(1);
 var pdfjsDisplayAPI = __w_pdfjs_require__(7);
 var pdfjsDisplayTextLayer = __w_pdfjs_require__(19);
 var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(20);
 var pdfjsDisplayDOMUtils = __w_pdfjs_require__(8);
 var pdfjsDisplaySVG = __w_pdfjs_require__(21);
 let pdfjsDisplayWorkerOptions = __w_pdfjs_require__(13);
 let pdfjsDisplayAPICompatibility = __w_pdfjs_require__(10);
@@ -4218,17 +4218,17 @@ function _fetchDocument(worker, source, 
     return Promise.reject(new Error('Worker was destroyed'));
   }
   if (pdfDataRangeTransport) {
     source.length = pdfDataRangeTransport.length;
     source.initialData = pdfDataRangeTransport.initialData;
   }
   return worker.messageHandler.sendWithPromise('GetDocRequest', {
     docId,
-    apiVersion: '2.0.719',
+    apiVersion: '2.0.750',
     source: {
       data: source.data,
       url: source.url,
       password: source.password,
       disableAutoFetch: source.disableAutoFetch,
       rangeChunkSize: source.rangeChunkSize,
       length: source.length
     },
@@ -5558,18 +5558,18 @@ var InternalRenderTask = function Intern
         }
       });
     }
   };
   return InternalRenderTask;
 }();
 var version, build;
 {
-  exports.version = version = '2.0.719';
-  exports.build = build = '35214245';
+  exports.version = version = '2.0.750';
+  exports.build = build = 'c8ee6331';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
 exports.PDFDataRangeTransport = PDFDataRangeTransport;
 exports.PDFWorker = PDFWorker;
 exports.PDFDocumentProxy = PDFDocumentProxy;
 exports.PDFPageProxy = PDFPageProxy;
 exports.setPDFNetworkStreamFactory = setPDFNetworkStreamFactory;
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -118,18 +118,18 @@ return /******/ (function(modules) { // 
 /************************************************************************/
 /******/ ([
 /* 0 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.0.719';
-var pdfjsBuild = '35214245';
+var pdfjsVersion = '2.0.750';
+var pdfjsBuild = 'c8ee6331';
 var pdfjsCoreWorker = __w_pdfjs_require__(1);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
 /***/ }),
 /* 1 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
@@ -322,17 +322,17 @@ var WorkerMessageHandler = {
     });
   },
   createDocumentHandler(docParams, port) {
     var pdfManager;
     var terminated = false;
     var cancelXHRs = null;
     var WorkerTasks = [];
     let apiVersion = docParams.apiVersion;
-    let workerVersion = '2.0.719';
+    let workerVersion = '2.0.750';
     if (apiVersion !== workerVersion) {
       throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
     }
     var docId = docParams.docId;
     var docBaseUrl = docParams.docBaseUrl;
     var workerHandlerName = docParams.docId + '_worker';
     var handler = new _message_handler.MessageHandler(workerHandlerName, docId, port);
     handler.postMessageTransfers = docParams.postMessageTransfers;
@@ -17442,21 +17442,16 @@ var CalRGBCS = function CalRGBCSClosure(
     if (XB < 0 || YB < 0 || ZB < 0) {
       (0, _util.info)('Invalid BlackPoint for ' + this.name + ' [' + XB + ', ' + YB + ', ' + ZB + '], falling back to default');
       this.blackPoint = new Float32Array(3);
     }
     if (this.GR < 0 || this.GG < 0 || this.GB < 0) {
       (0, _util.info)('Invalid Gamma [' + this.GR + ', ' + this.GG + ', ' + this.GB + '] for ' + this.name + ', falling back to default');
       this.GR = this.GG = this.GB = 1;
     }
-    if (this.MXA < 0 || this.MYA < 0 || this.MZA < 0 || this.MXB < 0 || this.MYB < 0 || this.MZB < 0 || this.MXC < 0 || this.MYC < 0 || this.MZC < 0) {
-      (0, _util.info)('Invalid Matrix for ' + this.name + ' [' + this.MXA + ', ' + this.MYA + ', ' + this.MZA + this.MXB + ', ' + this.MYB + ', ' + this.MZB + this.MXC + ', ' + this.MYC + ', ' + this.MZC + '], falling back to default');
-      this.MXA = this.MYB = this.MZC = 1;
-      this.MXB = this.MYA = this.MZA = this.MXC = this.MYC = this.MZB = 0;
-    }
   }
   function matrixProduct(a, b, result) {
     result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
     result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2];
     result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2];
   }
   function convertToFlat(sourceWhitePoint, LMS, result) {
     result[0] = LMS[0] * 1 / sourceWhitePoint[0];
@@ -18157,30 +18152,43 @@ class TextWidgetAnnotation extends Widge
 }
 class ButtonWidgetAnnotation extends WidgetAnnotation {
   constructor(params) {
     super(params);
     this.data.checkBox = !this.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
     this.data.radioButton = this.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
     this.data.pushButton = this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
     if (this.data.checkBox) {
-      this._processCheckBox();
+      this._processCheckBox(params);
     } else if (this.data.radioButton) {
       this._processRadioButton(params);
     } else if (this.data.pushButton) {
       this._processPushButton(params);
     } else {
       (0, _util.warn)('Invalid field flags for button widget annotation');
     }
   }
-  _processCheckBox() {
-    if (!(0, _primitives.isName)(this.data.fieldValue)) {
-      return;
-    }
-    this.data.fieldValue = this.data.fieldValue.name;
+  _processCheckBox(params) {
+    if ((0, _primitives.isName)(this.data.fieldValue)) {
+      this.data.fieldValue = this.data.fieldValue.name;
+    }
+    const customAppearance = params.dict.get('AP');
+    if (!(0, _primitives.isDict)(customAppearance)) {
+      return;
+    }
+    const exportValueOptionsDict = customAppearance.get('D');
+    if (!(0, _primitives.isDict)(exportValueOptionsDict)) {
+      return;
+    }
+    const exportValues = exportValueOptionsDict.getKeys();
+    const hasCorrectOptionCount = exportValues.length === 2;
+    if (!hasCorrectOptionCount) {
+      return;
+    }
+    this.data.exportValue = exportValues[0] === 'Off' ? exportValues[1] : exportValues[0];
   }
   _processRadioButton(params) {
     this.data.fieldValue = this.data.buttonValue = null;
     let fieldParent = params.dict.get('Parent');
     if ((0, _primitives.isDict)(fieldParent) && fieldParent.has('V')) {
       let fieldParentValue = fieldParent.get('V');
       if ((0, _primitives.isName)(fieldParentValue)) {
         this.data.fieldValue = fieldParentValue.name;
@@ -20386,18 +20394,18 @@ var PartialEvaluator = function PartialE
     extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, properties) {
       var xref = this.xref;
       var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode');
       var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined);
       if (properties.composite) {
         var cidSystemInfo = dict.get('CIDSystemInfo');
         if ((0, _primitives.isDict)(cidSystemInfo)) {
           properties.cidSystemInfo = {
-            registry: cidSystemInfo.get('Registry'),
-            ordering: cidSystemInfo.get('Ordering'),
+            registry: (0, _util.stringToPDFString)(cidSystemInfo.get('Registry')),
+            ordering: (0, _util.stringToPDFString)(cidSystemInfo.get('Ordering')),
             supplement: cidSystemInfo.get('Supplement')
           };
         }
         var cidToGidMap = dict.get('CIDToGIDMap');
         if ((0, _primitives.isStream)(cidToGidMap)) {
           properties.cidToGidMap = this.readCidToGidMap(cidToGidMap);
         }
       }
@@ -22341,16 +22349,18 @@ var _glyphlist = __w_pdfjs_require__(34)
 var _encodings = __w_pdfjs_require__(33);
 
 var _standard_fonts = __w_pdfjs_require__(35);
 
 var _unicode = __w_pdfjs_require__(36);
 
 var _font_renderer = __w_pdfjs_require__(37);
 
+var _cmap = __w_pdfjs_require__(29);
+
 var _stream = __w_pdfjs_require__(14);
 
 var _type1_parser = __w_pdfjs_require__(38);
 
 var PRIVATE_USE_OFFSET_START = 0xE000;
 var PRIVATE_USE_OFFSET_END = 0xF8FF;
 var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = false;
 var PDF_GLYPH_SPACE_UNITS = 1000;
@@ -22680,41 +22690,19 @@ var Font = function FontClosure() {
     }
     if (!file || file.isEmpty) {
       if (file) {
         (0, _util.warn)('Font file is empty in "' + name + '" (' + this.loadedName + ')');
       }
       this.fallbackToSystemFont();
       return;
     }
-    if (subtype === 'Type1C') {
-      if (type !== 'Type1' && type !== 'MMType1') {
-        if (isTrueTypeFile(file)) {
-          subtype = 'TrueType';
-        } else {
-          type = 'Type1';
-        }
-      } else if (isOpenTypeFile(file)) {
-        subtype = 'OpenType';
-      }
-    }
-    if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') {
-      type = 'CIDFontType0';
-    }
-    if (type === 'CIDFontType0') {
-      if (isType1File(file)) {
-        subtype = 'CIDFontType0';
-      } else if (isOpenTypeFile(file)) {
-        subtype = 'OpenType';
-      } else {
-        subtype = 'CIDFontType0C';
-      }
-    }
-    if (subtype === 'OpenType' && type !== 'OpenType') {
-      type = 'OpenType';
+    [type, subtype] = getFontFileType(file, properties);
+    if (type !== this.type || subtype !== this.subtype) {
+      (0, _util.info)('Inconsistent font file Type/SubType, expected: ' + `${this.type}/${this.subtype} but found: ${type}/${subtype}.`);
     }
     try {
       var data;
       switch (type) {
         case 'MMType1':
           (0, _util.info)('MMType1 font (' + name + '), falling back to Type1.');
         case 'Type1':
         case 'CIDFontType0':
@@ -22732,19 +22720,16 @@ var Font = function FontClosure() {
             adjustWidths(properties);
             type = 'OpenType';
           }
           break;
         default:
           throw new _util.FormatError(`Font ${type} is not supported`);
       }
     } catch (e) {
-      if (!(e instanceof _util.FormatError)) {
-        throw e;
-      }
       (0, _util.warn)(e);
       this.fallbackToSystemFont();
       return;
     }
     this.data = data;
     this.fontType = getFontType(type, subtype);
     this.fontMatrix = properties.fontMatrix;
     this.widths = properties.widths;
@@ -22778,17 +22763,17 @@ var Font = function FontClosure() {
     return String.fromCharCode(value >> 8 & 0xff, value & 0xff);
   }
   function safeString16(value) {
     value = value > 0x7FFF ? 0x7FFF : value < -0x8000 ? -0x8000 : value;
     return String.fromCharCode(value >> 8 & 0xff, value & 0xff);
   }
   function isTrueTypeFile(file) {
     var header = file.peekBytes(4);
-    return (0, _util.readUint32)(header, 0) === 0x00010000;
+    return (0, _util.readUint32)(header, 0) === 0x00010000 || (0, _util.bytesToString)(header) === 'true';
   }
   function isTrueTypeCollectionFile(file) {
     let header = file.peekBytes(4);
     return (0, _util.bytesToString)(header) === 'ttcf';
   }
   function isOpenTypeFile(file) {
     var header = file.peekBytes(4);
     return (0, _util.bytesToString)(header) === 'OTTO';
@@ -22798,16 +22783,60 @@ var Font = function FontClosure() {
     if (header[0] === 0x25 && header[1] === 0x21) {
       return true;
     }
     if (header[0] === 0x80 && header[1] === 0x01) {
       return true;
     }
     return false;
   }
+  function isCFFFile(file) {
+    const header = file.peekBytes(4);
+    if (header[0] >= 1 && header[3] >= 1 && header[3] <= 4) {
+      return true;
+    }
+    return false;
+  }
+  function getFontFileType(file, { type, subtype, composite }) {
+    let fileType, fileSubtype;
+    if (isTrueTypeFile(file) || isTrueTypeCollectionFile(file)) {
+      if (composite) {
+        fileType = 'CIDFontType2';
+      } else {
+        fileType = 'TrueType';
+      }
+    } else if (isOpenTypeFile(file)) {
+      if (composite) {
+        fileType = 'CIDFontType2';
+      } else {
+        fileType = 'OpenType';
+      }
+    } else if (isType1File(file)) {
+      if (composite) {
+        fileType = 'CIDFontType0';
+      } else if (type === 'MMType1') {
+        fileType = 'MMType1';
+      } else {
+        fileType = 'Type1';
+      }
+    } else if (isCFFFile(file)) {
+      if (composite) {
+        fileType = 'CIDFontType0';
+        fileSubtype = 'CIDFontType0C';
+      } else {
+        fileType = 'Type1';
+        fileSubtype = 'Type1C';
+      }
+    } else {
+      (0, _util.warn)('getFontFileType: Unable to detect correct font file Type/Subtype.');
+      fileType = type;
+      fileSubtype = subtype;
+    }
+    return [fileType, fileSubtype];
+  }
   function buildToFontChar(encoding, glyphsUnicodeMap, differences) {
     var toFontChar = [],
         unicode;
     for (var i = 0, ii = encoding.length; i < ii; i++) {
       unicode = (0, _unicode.getUnicodeForGlyph)(encoding[i], glyphsUnicodeMap);
       if (unicode !== -1) {
         toFontChar[i] = unicode;
       }
@@ -24035,17 +24064,18 @@ var Font = function FontClosure() {
         tables = ttcData.tables;
       } else {
         header = readOpenTypeHeader(font);
         tables = readTables(font, header.numTables);
       }
       let cff, cffFile;
       var isTrueType = !tables['CFF '];
       if (!isTrueType) {
-        if (header.version === 'OTTO' && !(properties.composite && properties.cidToGidMap) || !tables['head'] || !tables['hhea'] || !tables['maxp'] || !tables['post']) {
+        const isComposite = properties.composite && ((properties.cidToGidMap || []).length > 0 || !(properties.cMap instanceof _cmap.IdentityCMap));
+        if (header.version === 'OTTO' && !isComposite || !tables['head'] || !tables['hhea'] || !tables['maxp'] || !tables['post']) {
           cffFile = new _stream.Stream(tables['CFF '].data);
           cff = new CFFFont(cffFile, properties);
           adjustWidths(properties);
           return this.convert(name, cff, properties);
         }
         delete tables['glyf'];
         delete tables['loca'];
         delete tables['fpgm'];
@@ -40370,34 +40400,46 @@ var PDFImage = function PDFImageClosure(
         dest[newIndex++] = src[oldIndex];
       }
     }
     return dest;
   }
   function PDFImage({ xref, res, image, isInline = false, smask = null, mask = null, isMask = false, pdfFunctionFactory }) {
     this.image = image;
     var dict = image.dict;
-    if (dict.has('Filter')) {
-      var filter = dict.get('Filter').name;
-      if (filter === 'JPXDecode') {
-        var jpxImage = new _jpx.JpxImage();
-        jpxImage.parseImageProperties(image.stream);
-        image.stream.reset();
-        image.bitsPerComponent = jpxImage.bitsPerComponent;
-        image.numComps = jpxImage.componentsCount;
-      } else if (filter === 'JBIG2Decode') {
-        image.bitsPerComponent = 1;
-        image.numComps = 1;
-      }
-    }
-    this.width = dict.get('Width', 'W');
-    this.height = dict.get('Height', 'H');
-    if (this.width < 1 || this.height < 1) {
-      throw new _util.FormatError(`Invalid image width: ${this.width} or ` + `height: ${this.height}`);
-    }
+    const filter = dict.get('Filter');
+    if ((0, _primitives.isName)(filter)) {
+      switch (filter.name) {
+        case 'JPXDecode':
+          var jpxImage = new _jpx.JpxImage();
+          jpxImage.parseImageProperties(image.stream);
+          image.stream.reset();
+          image.width = jpxImage.width;
+          image.height = jpxImage.height;
+          image.bitsPerComponent = jpxImage.bitsPerComponent;
+          image.numComps = jpxImage.componentsCount;
+          break;
+        case 'JBIG2Decode':
+          image.bitsPerComponent = 1;
+          image.numComps = 1;
+          break;
+      }
+    }
+    let width = dict.get('Width', 'W');
+    let height = dict.get('Height', 'H');
+    if (Number.isInteger(image.width) && image.width > 0 && Number.isInteger(image.height) && image.height > 0 && (image.width !== width || image.height !== height)) {
+      (0, _util.warn)('PDFImage - using the Width/Height of the image data, ' + 'rather than the image dictionary.');
+      width = image.width;
+      height = image.height;
+    }
+    if (width < 1 || height < 1) {
+      throw new _util.FormatError(`Invalid image width: ${width} or ` + `height: ${height}`);
+    }
+    this.width = width;
+    this.height = height;
     this.interpolate = dict.get('Interpolate', 'I') || false;
     this.imageMask = dict.get('ImageMask', 'IM') || false;
     this.matte = dict.get('Matte') || false;
     var bitsPerComponent = image.bitsPerComponent;
     if (!bitsPerComponent) {
       bitsPerComponent = dict.get('BitsPerComponent', 'BPC');
       if (!bitsPerComponent) {
         if (this.imageMask) {
@@ -40418,17 +40460,17 @@ var PDFImage = function PDFImageClosure(
             break;
           case 3:
             colorSpace = _primitives.Name.get('DeviceRGB');
             break;
           case 4:
             colorSpace = _primitives.Name.get('DeviceCMYK');
             break;
           default:
-            throw new Error(`JPX images with ${this.numComps} ` + 'color components not supported.');
+            throw new Error(`JPX images with ${image.numComps} ` + 'color components not supported.');
         }
       }
       let resources = isInline ? res : null;
       this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, resources, pdfFunctionFactory);
       this.numComps = this.colorSpace.numComps;
     }
     this.decode = dict.getArray('Decode', 'D');
     this.needsDecode = false;
--- a/build/clang-plugin/tests/moz.build
+++ b/build/clang-plugin/tests/moz.build
@@ -61,8 +61,11 @@ COMPILE_FLAGS['OS_CXXFLAGS'] = (
     [f for f in COMPILE_FLAGS.get('OS_CXXFLAGS', []) if not f.startswith('-W')] +
     ['-fsyntax-only', '-Xclang', '-verify', '-ferror-limit=0', '-Wno-invalid-noreturn']
 )
 COMPILE_FLAGS['OS_CFLAGS'] = (
     [f for f in COMPILE_FLAGS.get('OS_CFLAGS', []) if not f.startswith('-W')] +
     ['-fsyntax-only', '-Xclang', '-verify', '-ferror-limit=0', '-std=c11',
      '-Wno-invalid-noreturn']
 )
+
+if CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/build/win32/moz.build
+++ b/build/win32/moz.build
@@ -27,8 +27,11 @@ if CONFIG['WIN_UCRT_REDIST_DIR'] and CON
             '%%%s/%s' % (CONFIG['WIN_UCRT_REDIST_DIR'], f)
         ]
 
 if CONFIG['LLVM_SYMBOLIZER'] and CONFIG['WIN_DIA_SDK_BIN_DIR']:
     # On Windows, llvm-symbolizer depends on the MS DIA library.
     FINAL_TARGET_FILES += [
         '%%%s/msdia140.dll' % CONFIG['WIN_DIA_SDK_BIN_DIR']
     ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -505,8 +505,11 @@ countermap.script = 'gen-usecounters.py:
 countermap.inputs = ['UseCounters.conf']
 
 counterlist = GENERATED_FILES['UseCounterList.h']
 counterlist.script = 'gen-usecounters.py:use_counter_list'
 counterlist.inputs = ['UseCounters.conf']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/encoding/moz.build
+++ b/dom/encoding/moz.build
@@ -46,8 +46,12 @@ props = GENERATED_FILES[header]
 props.script = '../../intl/locale/props2arrays.py'
 props.inputs = [input_file]
 
 MOCHITEST_MANIFESTS += [
     'test/mochitest.ini',
 ]
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
+
+if (not CONFIG['HAVE_64BIT_BUILD'] and
+    CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl'):
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/indexedDB/moz.build
+++ b/dom/indexedDB/moz.build
@@ -110,8 +110,12 @@ LOCAL_INCLUDES += [
     '/xpcom/threads',
 ]
 
 XPIDL_SOURCES += [
     'nsIIDBPermissionsRequest.idl',
 ]
 
 XPIDL_MODULE = 'dom_indexeddb'
+
+if (not CONFIG['HAVE_64BIT_BUILD'] and
+    CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl'):
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/media/fake-cdm/moz.build
+++ b/dom/media/fake-cdm/moz.build
@@ -25,8 +25,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
         'ole32',
     ]
 
 USE_STATIC_LIBS = True
 NoVisibilityFlags()
 # Don't use STL wrappers; this isn't Gecko code
 DisableStlWrapping()
 NO_PGO = True
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/media/gmp/moz.build
+++ b/dom/media/gmp/moz.build
@@ -143,8 +143,11 @@ LOCAL_INCLUDES += [
     '/media/mtransport',
     '/xpcom/base',
     '/xpcom/build',
     '/xpcom/threads',
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/media/gtest/moz.build
+++ b/dom/media/gtest/moz.build
@@ -83,8 +83,11 @@ LOCAL_INCLUDES += [
     '/security/certverifier',
     '/security/pkix/include',
 ]
 
 FINAL_LIBRARY = 'xul-gtest'
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow', '-Wno-unused-private-field']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/media/webrtc/moz.build
+++ b/dom/media/webrtc/moz.build
@@ -83,8 +83,11 @@ FINAL_LIBRARY = 'xul'
 
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += [
         '-wd4275', # non dll-interface class used as base for dll-interface class
         '-wd4312', # This is intended as a temporary hack to support building with VS2015
                    # 'reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
     ]
     DEFINES['__PRETTY_FUNCTION__'] = '__FUNCSIG__'
+
+if CONFIG['MOZ_ASAN'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1306642
--- a/dom/performance/PerformanceTiming.cpp
+++ b/dom/performance/PerformanceTiming.cpp
@@ -281,21 +281,19 @@ PerformanceTimingData::CheckAllowedOrigi
 
   // Check that the current document passes the ckeck.
   nsCOMPtr<nsILoadInfo> loadInfo;
   aResourceChannel->GetLoadInfo(getter_AddRefs(loadInfo));
   if (!loadInfo) {
     return false;
   }
 
-  // TYPE_DOCUMENT loads have no loadingPrincipal.  And that's OK, because we
-  // never actually need to have a performance timing entry for TYPE_DOCUMENT
-  // loads.
+  // TYPE_DOCUMENT loads have no loadingPrincipal.
   if (loadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_DOCUMENT) {
-    return false;
+    return true;
   }
 
   nsCOMPtr<nsIPrincipal> principal = loadInfo->LoadingPrincipal();
 
   // Check if the resource is either same origin as the page that started
   // the load, or if the response contains the proper Timing-Allow-Origin
   // header with the domain of the page that started the load.
   return aChannel->TimingAllowCheck(principal);
--- a/dom/plugins/base/moz.build
+++ b/dom/plugins/base/moz.build
@@ -87,8 +87,11 @@ include('/ipc/chromium/chromium-config.m
 
 FINAL_LIBRARY = 'xul'
 
 CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/plugins/ipc/hangui/moz.build
+++ b/dom/plugins/ipc/hangui/moz.build
@@ -20,8 +20,13 @@ DisableStlWrapping()
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     WIN32_EXE_LDFLAGS += ['-municode']
 
 RCINCLUDE = 'HangUIDlg.rc'
 
 OS_LIBS += [
     'comctl32',
 ]
+
+if ((CONFIG['MOZ_PGO'] or
+     (not CONFIG['HAVE_64BIT_BUILD'] and CONFIG['ENABLE_CLANG_PLUGIN']))
+    and CONFIG['CC_TYPE'] == 'clang-cl'):
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/plugins/ipc/moz.build
+++ b/dom/plugins/ipc/moz.build
@@ -150,8 +150,11 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
 
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary hack to support building with VS2015.
     # conversion from 'X' to 'Y' requires a narrowing conversion
     CXXFLAGS += ['-wd4838']
 
     # 'type cast': conversion from 'unsigned int' to 'HIMC' of greater size
     CXXFLAGS += ['-wd4312']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/plugins/test/testplugin/testplugin.mozbuild
+++ b/dom/plugins/test/testplugin/testplugin.mozbuild
@@ -63,8 +63,11 @@ if CONFIG['CC_TYPE'] in ('msvc', 'clang-
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     FINAL_TARGET = 'dist/plugins/%s.plugin/Contents/MacOS' % cocoa_name
     OBJDIR_FILES.dist.plugins['%s.plugin' % cocoa_name].Contents += ['%s/Info.plist' % relative_path]
 else:
     FINAL_TARGET = 'dist/plugins'
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/storage/moz.build
+++ b/dom/storage/moz.build
@@ -44,8 +44,11 @@ include('/ipc/chromium/chromium-config.m
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 if CONFIG['ENABLE_TESTS']:
     DEFINES['DOM_STORAGE_TESTS'] = True
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/url/moz.build
+++ b/dom/url/moz.build
@@ -25,8 +25,11 @@ LOCAL_INCLUDES += [
 
 MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
 MOCHITEST_CHROME_MANIFESTS += [ 'tests/chrome.ini' ]
 BROWSER_CHROME_MANIFESTS += [ 'tests/browser.ini' ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['MOZ_PGO'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/dom/webauthn/WebAuthnManager.cpp
+++ b/dom/webauthn/WebAuthnManager.cpp
@@ -397,17 +397,17 @@ WebAuthnManager::MakeCredential(const Pu
 
   AbortSignal* signal = nullptr;
   if (aSignal.WasPassed()) {
     signal = &aSignal.Value();
     Follow(signal);
   }
 
   MOZ_ASSERT(mTransaction.isNothing());
-  mTransaction = Some(WebAuthnTransaction(promise, signal));
+  mTransaction = Some(WebAuthnTransaction(promise));
   mChild->SendRequestRegister(mTransaction.ref().mId, info);
 
   return promise.forget();
 }
 
 already_AddRefed<Promise>
 WebAuthnManager::GetAssertion(const PublicKeyCredentialRequestOptions& aOptions,
                               const Optional<OwningNonNull<AbortSignal>>& aSignal)
@@ -577,17 +577,17 @@ WebAuthnManager::GetAssertion(const Publ
 
   AbortSignal* signal = nullptr;
   if (aSignal.WasPassed()) {
     signal = &aSignal.Value();
     Follow(signal);
   }
 
   MOZ_ASSERT(mTransaction.isNothing());
-  mTransaction = Some(WebAuthnTransaction(promise, signal));
+  mTransaction = Some(WebAuthnTransaction(promise));
   mChild->SendRequestSign(mTransaction.ref().mId, info);
 
   return promise.forget();
 }
 
 already_AddRefed<Promise>
 WebAuthnManager::Store(const Credential& aCredential)
 {
--- a/dom/webauthn/WebAuthnManager.h
+++ b/dom/webauthn/WebAuthnManager.h
@@ -42,31 +42,26 @@
  */
 
 namespace mozilla {
 namespace dom {
 
 class WebAuthnTransaction
 {
 public:
-  WebAuthnTransaction(const RefPtr<Promise>& aPromise,
-                      AbortSignal* aSignal)
+  explicit WebAuthnTransaction(const RefPtr<Promise>& aPromise)
     : mPromise(aPromise)
-    , mSignal(aSignal)
     , mId(NextId())
   {
     MOZ_ASSERT(mId > 0);
   }
 
   // JS Promise representing the transaction status.
   RefPtr<Promise> mPromise;
 
-  // An optional AbortSignal instance.
-  RefPtr<AbortSignal> mSignal;
-
   // Unique transaction id.
   uint64_t mId;
 
 private:
   // Generates a unique id for new transactions. This doesn't have to be unique
   // forever, it's sufficient to differentiate between temporally close
   // transactions, where messages can intersect. Can overflow.
   static uint64_t NextId() {
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -946,17 +946,21 @@ class DrawTargetCapture;
  * factory and accepts drawing commands. The results of drawing to a target
  * may be used either through a Snapshot or by flushing the target and directly
  * accessing the backing store a DrawTarget was created with.
  */
 class DrawTarget : public external::AtomicRefCounted<DrawTarget>
 {
 public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTarget)
-  DrawTarget() : mTransformDirty(false), mPermitSubpixelAA(false) {}
+  DrawTarget()
+    : mTransformDirty(false)
+    , mPermitSubpixelAA(false)
+    , mFormat(SurfaceFormat::UNKNOWN)
+  {}
   virtual ~DrawTarget() {}
 
   virtual bool IsValid() const { return true; };
   virtual DrawTargetType GetType() const = 0;
 
   virtual BackendType GetBackendType() const = 0;
 
   virtual bool IsRecording() const { return false; }
--- a/gfx/2d/Blur.cpp
+++ b/gfx/2d/Blur.cpp
@@ -434,23 +434,26 @@ AlphaBoxBlur::RoundUpToMultipleOf4(int32
   return val;
 }
 
 AlphaBoxBlur::AlphaBoxBlur(const Rect& aRect,
                            const IntSize& aSpreadRadius,
                            const IntSize& aBlurRadius,
                            const Rect* aDirtyRect,
                            const Rect* aSkipRect)
-  : mSurfaceAllocationSize(0)
+  : mStride(0),
+    mSurfaceAllocationSize(0)
 {
   Init(aRect, aSpreadRadius, aBlurRadius, aDirtyRect, aSkipRect);
 }
 
 AlphaBoxBlur::AlphaBoxBlur()
-  : mSurfaceAllocationSize(0)
+  : mStride(0),
+    mSurfaceAllocationSize(0),
+    mHasDirtyRect(false)
 {
 }
 
 void
 AlphaBoxBlur::Init(const Rect& aRect,
                    const IntSize& aSpreadRadius,
                    const IntSize& aBlurRadius,
                    const Rect* aDirtyRect,
@@ -512,17 +515,18 @@ AlphaBoxBlur::Init(const Rect& aRect,
 AlphaBoxBlur::AlphaBoxBlur(const Rect& aRect,
                            int32_t aStride,
                            float aSigmaX,
                            float aSigmaY)
   : mRect(TruncatedToInt(aRect)),
     mSpreadRadius(),
     mBlurRadius(CalculateBlurRadius(Point(aSigmaX, aSigmaY))),
     mStride(aStride),
-    mSurfaceAllocationSize(0)
+    mSurfaceAllocationSize(0),
+    mHasDirtyRect(false)
 {
   IntRect intRect;
   if (aRect.ToIntRect(&intRect)) {
     size_t minDataSize = BufferSizeFromStrideAndHeight(intRect.Width(), intRect.Height());
     if (minDataSize != 0) {
       mSurfaceAllocationSize = minDataSize;
     }
   }
--- a/gfx/2d/DrawTargetCairo.cpp
+++ b/gfx/2d/DrawTargetCairo.cpp
@@ -432,16 +432,18 @@ public:
     , mX(0)
     , mY(0)
   {
     Init(aSurface);
   }
 
   explicit AutoClearDeviceOffset(const Pattern& aPattern)
     : mSurface(nullptr)
+    , mX(0.0)
+    , mY(0.0)
   {
     if (aPattern.GetType() == PatternType::SURFACE) {
       const SurfacePattern& pattern = static_cast<const SurfacePattern&>(aPattern);
       Init(pattern.mSurface);
     }
   }
 
   ~AutoClearDeviceOffset()
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -270,17 +270,18 @@ GetSkImageForSurface(SourceSurface* aSur
   // Skia doesn't support RGBX surfaces so ensure that the alpha value is opaque white.
   MOZ_ASSERT(VerifyRGBXCorners(surf->GetData(), surf->GetSize(),
                                surf->Stride(), surf->GetFormat(),
                                aBounds, aMatrix));
   return image;
 }
 
 DrawTargetSkia::DrawTargetSkia()
-  : mSnapshot(nullptr)
+  : mCanvas(nullptr)
+  , mSnapshot(nullptr)
   , mSnapshotLock{"DrawTargetSkia::mSnapshotLock"}
 #ifdef MOZ_WIDGET_COCOA
   , mCG(nullptr)
   , mColorSpace(nullptr)
   , mCanvasData(nullptr)
   , mCGSize(0, 0)
   , mNeedLayer(false)
 #endif
--- a/gfx/2d/FilterNodeSoftware.cpp
+++ b/gfx/2d/FilterNodeSoftware.cpp
@@ -2124,16 +2124,20 @@ FilterNodeGammaTransferSoftware::FilterN
  : mAmplitudeR(0)
  , mAmplitudeG(0)
  , mAmplitudeB(0)
  , mAmplitudeA(0)
  , mExponentR(0)
  , mExponentG(0)
  , mExponentB(0)
  , mExponentA(0)
+ , mOffsetR(0.0)
+ , mOffsetG(0.0)
+ , mOffsetB(0.0)
+ , mOffsetA(0.0)
 {}
 
 void
 FilterNodeGammaTransferSoftware::SetAttribute(uint32_t aIndex,
                                               Float aValue)
 {
   switch (aIndex) {
     case ATT_GAMMA_TRANSFER_AMPLITUDE_R:
@@ -3111,17 +3115,18 @@ FilterNodeGaussianBlurSoftware::SetAttri
 
 Size
 FilterNodeGaussianBlurSoftware::StdDeviationXY()
 {
   return Size(mStdDeviation, mStdDeviation);
 }
 
 FilterNodeDirectionalBlurSoftware::FilterNodeDirectionalBlurSoftware()
- : mBlurDirection(BLUR_DIRECTION_X)
+  : mStdDeviation(0.0)
+  , mBlurDirection(BLUR_DIRECTION_X)
 {}
 
 void
 FilterNodeDirectionalBlurSoftware::SetAttribute(uint32_t aIndex,
                                                 Float aStdDeviation)
 {
   switch (aIndex) {
     case ATT_DIRECTIONAL_BLUR_STD_DEVIATION:
--- a/gfx/2d/ImageScaling.h
+++ b/gfx/2d/ImageScaling.h
@@ -16,16 +16,18 @@ namespace mozilla {
 namespace gfx {
 
 class ImageHalfScaler
 {
 public:
   ImageHalfScaler(uint8_t *aData, int32_t aStride, const IntSize &aSize)
     : mOrigData(aData), mOrigStride(aStride), mOrigSize(aSize)
     , mDataStorage(nullptr)
+    , mData(nullptr)
+    , mStride(0)
   {
   }
 
   ~ImageHalfScaler()
   {
     delete [] mDataStorage;
   }
 
--- a/gfx/2d/RecordedEventImpl.h
+++ b/gfx/2d/RecordedEventImpl.h
@@ -90,17 +90,18 @@ private:
 
   template<class S>
   MOZ_IMPLICIT RecordedDrawTargetCreation(S &aStream);
 };
 
 class RecordedDrawTargetDestruction : public RecordedEventDerived<RecordedDrawTargetDestruction> {
 public:
   MOZ_IMPLICIT RecordedDrawTargetDestruction(ReferencePtr aRefPtr)
-    : RecordedEventDerived(DRAWTARGETDESTRUCTION), mRefPtr(aRefPtr)
+    : RecordedEventDerived(DRAWTARGETDESTRUCTION), mRefPtr(aRefPtr),
+      mBackendType(BackendType::NONE)
   {}
 
   virtual bool PlayEvent(Translator *aTranslator) const override;
 
   template<class S>
   void Record(S &aStream) const;
   virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
 
@@ -176,17 +177,18 @@ private:
 
   template<class S>
   MOZ_IMPLICIT RecordedCreateClippedDrawTarget(S &aStream);
 };
 
 class RecordedFillRect : public RecordedDrawingEvent<RecordedFillRect> {
 public:
   RecordedFillRect(DrawTarget *aDT, const Rect &aRect, const Pattern &aPattern, const DrawOptions &aOptions)
-    : RecordedDrawingEvent(FILLRECT, aDT), mRect(aRect), mOptions(aOptions)
+    : RecordedDrawingEvent(FILLRECT, aDT), mRect(aRect),
+      mPattern(), mOptions(aOptions)
   {
     StorePattern(mPattern, aPattern);
   }
 
   virtual bool PlayEvent(Translator *aTranslator) const override;
 
   template<class S>
   void Record(S &aStream) const;
@@ -205,17 +207,18 @@ private:
   DrawOptions mOptions;
 };
 
 class RecordedStrokeRect : public RecordedDrawingEvent<RecordedStrokeRect> {
 public:
   RecordedStrokeRect(DrawTarget *aDT, const Rect &aRect, const Pattern &aPattern,
                      const StrokeOptions &aStrokeOptions, const DrawOptions &aOptions)
     : RecordedDrawingEvent(STROKERECT, aDT), mRect(aRect),
-      mStrokeOptions(aStrokeOptions), mOptions(aOptions)
+      mPattern(), mStrokeOptions(aStrokeOptions),
+      mOptions(aOptions)
   {
     StorePattern(mPattern, aPattern);
   }
 
   virtual bool PlayEvent(Translator *aTranslator) const override;
 
   template<class S>
   void Record(S &aStream) const;
@@ -236,17 +239,17 @@ private:
 };
 
 class RecordedStrokeLine : public RecordedDrawingEvent<RecordedStrokeLine> {
 public:
   RecordedStrokeLine(DrawTarget *aDT, const Point &aBegin, const Point &aEnd,
                      const Pattern &aPattern, const StrokeOptions &aStrokeOptions,
                      const DrawOptions &aOptions)
     : RecordedDrawingEvent(STROKELINE, aDT), mBegin(aBegin), mEnd(aEnd),
-      mStrokeOptions(aStrokeOptions), mOptions(aOptions)
+      mPattern(), mStrokeOptions(aStrokeOptions), mOptions(aOptions)
   {
     StorePattern(mPattern, aPattern);
   }
 
   virtual bool PlayEvent(Translator *aTranslator) const override;
 
   template<class S>
   void Record(S &aStream) const;
@@ -265,17 +268,18 @@ private:
   PatternStorage mPattern;
   StrokeOptions mStrokeOptions;
   DrawOptions mOptions;
 };
 
 class RecordedFill : public RecordedDrawingEvent<RecordedFill> {
 public:
   RecordedFill(DrawTarget *aDT, ReferencePtr aPath, const Pattern &aPattern, const DrawOptions &aOptions)
-    : RecordedDrawingEvent(FILL, aDT), mPath(aPath), mOptions(aOptions)
+    : RecordedDrawingEvent(FILL, aDT), mPath(aPath),
+      mPattern(), mOptions(aOptions)
   {
     StorePattern(mPattern, aPattern);
   }
 
   virtual bool PlayEvent(Translator *aTranslator) const override;
 
   template<class S> void Record(S &aStream) const;
   virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
@@ -292,17 +296,18 @@ private:
   PatternStorage mPattern;
   DrawOptions mOptions;
 };
 
 class RecordedFillGlyphs : public RecordedDrawingEvent<RecordedFillGlyphs> {
 public:
   RecordedFillGlyphs(DrawTarget *aDT, ReferencePtr aScaledFont, const Pattern &aPattern, const DrawOptions &aOptions,
                      const Glyph *aGlyphs, uint32_t aNumGlyphs)
-    : RecordedDrawingEvent(FILLGLYPHS, aDT), mScaledFont(aScaledFont), mOptions(aOptions)
+    : RecordedDrawingEvent(FILLGLYPHS, aDT), mScaledFont(aScaledFont),
+      mPattern(), mOptions(aOptions)
   {
     StorePattern(mPattern, aPattern);
     mNumGlyphs = aNumGlyphs;
     mGlyphs = new Glyph[aNumGlyphs];
     memcpy(mGlyphs, aGlyphs, sizeof(Glyph) * aNumGlyphs);
   }
   virtual ~RecordedFillGlyphs();
 
@@ -324,17 +329,17 @@ private:
   DrawOptions mOptions;
   Glyph *mGlyphs;
   uint32_t mNumGlyphs;
 };
 
 class RecordedMask : public RecordedDrawingEvent<RecordedMask> {
 public:
   RecordedMask(DrawTarget *aDT, const Pattern &aSource, const Pattern &aMask, const DrawOptions &aOptions)
-    : RecordedDrawingEvent(MASK, aDT), mOptions(aOptions)
+    : RecordedDrawingEvent(MASK, aDT), mSource(), mMask(), mOptions(aOptions)
   {
     StorePattern(mSource, aSource);
     StorePattern(mMask, aMask);
   }
 
   virtual bool PlayEvent(Translator *aTranslator) const override;
 
   template<class S> void Record(S &aStream) const;
@@ -352,17 +357,17 @@ private:
   PatternStorage mMask;
   DrawOptions mOptions;
 };
 
 class RecordedStroke : public RecordedDrawingEvent<RecordedStroke> {
 public:
   RecordedStroke(DrawTarget *aDT, ReferencePtr aPath, const Pattern &aPattern,
                      const StrokeOptions &aStrokeOptions, const DrawOptions &aOptions)
-    : RecordedDrawingEvent(STROKE, aDT), mPath(aPath),
+    : RecordedDrawingEvent(STROKE, aDT), mPath(aPath), mPattern(),
       mStrokeOptions(aStrokeOptions), mOptions(aOptions)
   {
     StorePattern(mPattern, aPattern);
   }
 
   virtual bool PlayEvent(Translator *aTranslator) const override;
 
   template<class S> void Record(S &aStream) const;
@@ -1003,16 +1008,17 @@ public:
     auto recordedFontData = static_cast<RecordedFontData*>(aBaton);
     recordedFontData->SetFontData(aData, aSize, aIndex);
   }
 
   explicit RecordedFontData(UnscaledFont *aUnscaledFont)
     : RecordedEventDerived(FONTDATA)
     , mType(aUnscaledFont->GetType())
     , mData(nullptr)
+    , mFontDetails()
   {
     mGetFontFileDataSucceeded = aUnscaledFont->GetFontFileData(&FontDataProc, this) && mData;
   }
 
   ~RecordedFontData();
 
   bool IsValid() const { return mGetFontFileDataSucceeded; }
 
@@ -1264,18 +1270,18 @@ private:
   template<class S>
   MOZ_IMPLICIT RecordedScaledFontDestruction(S &aStream);
 };
 
 class RecordedMaskSurface : public RecordedDrawingEvent<RecordedMaskSurface> {
 public:
   RecordedMaskSurface(DrawTarget *aDT, const Pattern &aPattern, ReferencePtr aRefMask,
                       const Point &aOffset, const DrawOptions &aOptions)
-    : RecordedDrawingEvent(MASKSURFACE, aDT), mRefMask(aRefMask), mOffset(aOffset)
-    , mOptions(aOptions)
+    : RecordedDrawingEvent(MASKSURFACE, aDT), mPattern(), mRefMask(aRefMask),
+      mOffset(aOffset), mOptions(aOptions)
   {
     StorePattern(mPattern, aPattern);
   }
 
   virtual bool PlayEvent(Translator *aTranslator) const override;
 
   template<class S> void Record(S &aStream) const;
   virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
--- a/gfx/2d/SVGTurbulenceRenderer-inl.h
+++ b/gfx/2d/SVGTurbulenceRenderer-inl.h
@@ -96,16 +96,19 @@ private:
 
 } // unnamed namespace
 
 template<TurbulenceType Type, bool Stitch, typename f32x4_t, typename i32x4_t, typename u8x16_t>
 SVGTurbulenceRenderer<Type,Stitch,f32x4_t,i32x4_t,u8x16_t>::SVGTurbulenceRenderer(const Size &aBaseFrequency, int32_t aSeed,
                                                             int aNumOctaves, const Rect &aTileRect)
  : mBaseFrequency(aBaseFrequency)
  , mNumOctaves(aNumOctaves)
+ , mStitchInfo()
+ , mStitchable(false)
+ , mType(TURBULENCE_TYPE_TURBULENCE)
 {
   InitFromSeed(aSeed);
   if (Stitch) {
     AdjustBaseFrequencyForStitch(aTileRect);
     mStitchInfo = CreateStitchInfo(aTileRect);
   }
 }
 
--- a/gfx/2d/SourceSurfaceSkia.cpp
+++ b/gfx/2d/SourceSurfaceSkia.cpp
@@ -14,17 +14,19 @@
 #include "mozilla/CheckedInt.h"
 
 using namespace std;
 
 namespace mozilla {
 namespace gfx {
 
 SourceSurfaceSkia::SourceSurfaceSkia()
-  : mDrawTarget(nullptr)
+  : mFormat(SurfaceFormat::UNKNOWN)
+  , mStride(0)
+  , mDrawTarget(nullptr)
   , mChangeMutex("SourceSurfaceSkia::mChangeMutex")
 {
 }
 
 SourceSurfaceSkia::~SourceSurfaceSkia()
 {
 }
 
--- a/gfx/2d/Tools.h
+++ b/gfx/2d/Tools.h
@@ -141,21 +141,23 @@ IsOpaqueFormat(SurfaceFormat aFormat) {
 template<typename T, int alignment = 16>
 struct AlignedArray
 {
   typedef T value_type;
 
   AlignedArray()
     : mPtr(nullptr)
     , mStorage(nullptr)
+    , mCount(0)
   {
   }
 
   explicit MOZ_ALWAYS_INLINE AlignedArray(size_t aCount, bool aZero = false)
-    : mStorage(nullptr)
+    : mPtr(nullptr)
+    , mStorage(nullptr)
     , mCount(0)
   {
     Realloc(aCount, aZero);
   }
 
   MOZ_ALWAYS_INLINE ~AlignedArray()
   {
     Dealloc();
--- a/gfx/2d/moz.build
+++ b/gfx/2d/moz.build
@@ -250,8 +250,10 @@ if CONFIG['MOZ_ENABLE_SKIA']:
         '/gfx/skia/skia/src/core',
         '/gfx/skia/skia/src/image',
     ]
 if CONFIG['MOZ_ENABLE_SKIA_GPU']:
     LOCAL_INCLUDES += [
         '/gfx/skia/skia/src/gpu',
     ]
 
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/gfx/gl/moz.build
+++ b/gfx/gl/moz.build
@@ -161,8 +161,11 @@ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 CFLAGS += CONFIG['TK_CFLAGS']
 
 LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/gfx/layers/AnimationHelper.h
+++ b/gfx/layers/AnimationHelper.h
@@ -62,16 +62,17 @@ struct AnimatedValue {
     AnimationTransform mTransform;
     float mOpacity;
   };
 
   AnimatedValue(gfx::Matrix4x4&& aTransformInDevSpace,
                 gfx::Matrix4x4&& aFrameTransform,
                 const TransformData& aData)
     : mType(AnimatedValue::TRANSFORM)
+    , mOpacity(0.0)
   {
     mTransform.mTransformInDevSpace = std::move(aTransformInDevSpace);
     mTransform.mFrameTransform = std::move(aFrameTransform);
     mTransform.mData = aData;
   }
 
   explicit AnimatedValue(const float& aValue)
     : mType(AnimatedValue::OPACITY)
--- a/gfx/layers/AtomicRefCountedWithFinalize.h
+++ b/gfx/layers/AtomicRefCountedWithFinalize.h
@@ -31,16 +31,17 @@ class RefQueue;
 } // namespace gl
 
 template<typename T>
 class AtomicRefCountedWithFinalize
 {
 protected:
     explicit AtomicRefCountedWithFinalize(const char* aName)
       : mRecycleCallback(nullptr)
+      , mClosure(nullptr)
       , mRefCount(0)
 #ifdef DEBUG
       , mSpew(false)
       , mManualAddRefs(0)
       , mManualReleases(0)
 #endif
 #ifdef NS_BUILD_REFCNT_LOGGING
       , mName(aName)
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -166,16 +166,20 @@ struct LayerPropertiesBase : public Laye
     if (mUseClipRect) {
       mClipRect = *aLayer->GetLocalClipRect();
     }
     mTransform = GetTransformForInvalidation(aLayer);
   }
   LayerPropertiesBase()
     : mLayer(nullptr)
     , mMaskLayer(nullptr)
+    , mPostXScale(0.0)
+    , mPostYScale(0.0)
+    , mOpacity(0.0)
+    , mUseClipRect(false)
   {
     MOZ_COUNT_CTOR(LayerPropertiesBase);
   }
   ~LayerPropertiesBase() override
   {
     MOZ_COUNT_DTOR(LayerPropertiesBase);
   }
 
--- a/gfx/layers/SourceSurfaceSharedData.h
+++ b/gfx/layers/SourceSurfaceSharedData.h
@@ -37,16 +37,17 @@ class SourceSurfaceSharedDataWrapper fin
 
 public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceSharedDataWrapper, override)
 
   SourceSurfaceSharedDataWrapper()
     : mStride(0)
     , mConsumers(0)
     , mFormat(SurfaceFormat::UNKNOWN)
+    , mCreatorPid(0)
   { }
 
   bool Init(const IntSize& aSize,
             int32_t aStride,
             SurfaceFormat aFormat,
             const SharedMemoryBasic::Handle& aHandle,
             base::ProcessId aCreatorPid);
 
--- a/gfx/layers/apz/src/KeyboardMap.cpp
+++ b/gfx/layers/apz/src/KeyboardMap.cpp
@@ -6,17 +6,25 @@
 
 #include "mozilla/layers/KeyboardMap.h"
 
 #include "mozilla/TextEvents.h" // for IgnoreModifierState, ShortcutKeyCandidate
 
 namespace mozilla {
 namespace layers {
 
-KeyboardShortcut::KeyboardShortcut() = default;
+KeyboardShortcut::KeyboardShortcut()
+  : mKeyCode(0)
+  , mCharCode(0)
+  , mModifiers(0)
+  , mModifiersMask(0)
+  , mEventType(KeyboardInput::KeyboardEventType::KEY_OTHER)
+  , mDispatchToContent(false)
+{
+}
 
 KeyboardShortcut::KeyboardShortcut(KeyboardInput::KeyboardEventType aEventType,
                                    uint32_t aKeyCode,
                                    uint32_t aCharCode,
                                    Modifiers aModifiers,
                                    Modifiers aModifiersMask,
                                    const KeyboardScrollAction& aAction)
   : mAction(aAction)
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -309,16 +309,17 @@ BasicLayerManager::BasicLayerManager(nsI
 
 BasicLayerManager::BasicLayerManager(BasicLayerManagerType aType)
   : mPhase(PHASE_NONE)
   , mWidget(nullptr)
   , mDoubleBuffering(BufferMode::BUFFER_NONE)
   , mType(aType)
   , mUsingDefaultTarget(false)
   , mTransactionIncomplete(false)
+  , mCompositorMightResample(false)
 {
   MOZ_COUNT_CTOR(BasicLayerManager);
   MOZ_ASSERT(mType != BLM_WIDGET);
 }
 
 BasicLayerManager::~BasicLayerManager()
 {
   NS_ASSERTION(!InTransaction(), "Died during transaction?");
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -89,16 +89,18 @@ ClientLayerManager::MemoryPressureObserv
   }
 }
 
 NS_IMPL_ISUPPORTS(ClientLayerManager::MemoryPressureObserver, nsIObserver)
 
 ClientLayerManager::ClientLayerManager(nsIWidget* aWidget)
   : mPhase(PHASE_NONE)
   , mWidget(aWidget)
+  , mPaintedLayerCallback(nullptr)
+  , mPaintedLayerCallbackData(nullptr)
   , mLatestTransactionId{0}
   , mLastPaintTime(TimeDuration::Forever())
   , mTargetRotation(ROTATION_0)
   , mRepeatTransaction(false)
   , mIsRepeatTransaction(false)
   , mTransactionIncomplete(false)
   , mCompositorMightResample(false)
   , mNeedsComposite(false)
--- a/gfx/layers/composite/TextureHost.h
+++ b/gfx/layers/composite/TextureHost.h
@@ -930,17 +930,20 @@ private:
  */
 class CompositingRenderTarget: public TextureSource
 {
 public:
 
   explicit CompositingRenderTarget(const gfx::IntPoint& aOrigin)
     : mClearOnBind(false)
     , mOrigin(aOrigin)
+    , mZNear(0)
+    , mZFar(0)
     , mHasComplexProjection(false)
+    , mEnableDepthBuffer(false)
   {}
   virtual ~CompositingRenderTarget() {}
 
   virtual const char* Name() const override { return "CompositingRenderTarget"; }
 
 #ifdef MOZ_DUMP_PAINTING
   virtual already_AddRefed<gfx::DataSourceSurface> Dump(Compositor* aCompositor) { return nullptr; }
 #endif
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -353,16 +353,17 @@ CompositorBridgeParent::CompositorBridge
   , mVsyncRate(aVsyncRate)
   , mPendingTransaction{0}
   , mPaused(false)
   , mUseExternalSurfaceSize(aUseExternalSurfaceSize)
   , mEGLSurfaceSize(aSurfaceSize)
   , mOptions(aOptions)
   , mPauseCompositionMonitor("PauseCompositionMonitor")
   , mResumeCompositionMonitor("ResumeCompositionMonitor")
+  , mCompositorBridgeID(0)
   , mRootLayerTreeID{0}
   , mOverrideComposeReadiness(false)
   , mForceCompositionTask(nullptr)
   , mCompositorScheduler(nullptr)
   , mAnimationStorage(nullptr)
   , mPaintTime(TimeDuration::Forever())
 #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
   , mLastPluginUpdateLayerTreeId{0}
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -56,16 +56,17 @@ LayerTransactionParent::LayerTransaction
   , mAnimStorage(aAnimStorage)
   , mId(aId)
   , mChildEpoch{0}
   , mParentEpoch{0}
   , mVsyncRate(aVsyncRate)
   , mPendingTransaction{0}
   , mDestroyed(false)
   , mIPCOpen(false)
+  , mUpdateHitTestingTree(false)
 {
   MOZ_ASSERT(mId.IsValid());
 }
 
 LayerTransactionParent::~LayerTransactionParent()
 {
 }
 
--- a/gfx/layers/ipc/ShadowLayers.cpp
+++ b/gfx/layers/ipc/ShadowLayers.cpp
@@ -60,16 +60,17 @@ typedef nsTArray<Edit> EditVector;
 typedef nsTHashtable<nsPtrHashKey<ShadowableLayer>> ShadowableLayerSet;
 typedef nsTArray<OpDestroy> OpDestroyVector;
 
 class Transaction
 {
 public:
   Transaction()
     : mTargetRotation(ROTATION_0)
+    , mTargetOrientation(dom::eScreenOrientation_None)
     , mOpen(false)
     , mRotationChanged(false)
   {}
 
   void Begin(const gfx::IntRect& aTargetBounds, ScreenRotation aRotation,
              dom::ScreenOrientationInternal aOrientation)
   {
     mOpen = true;
--- a/gfx/layers/mlgpu/ContainerLayerMLGPU.cpp
+++ b/gfx/layers/mlgpu/ContainerLayerMLGPU.cpp
@@ -18,17 +18,18 @@ namespace mozilla {
 namespace layers {
 
 using namespace gfx;
 
 ContainerLayerMLGPU::ContainerLayerMLGPU(LayerManagerMLGPU* aManager)
  : ContainerLayer(aManager, nullptr),
    LayerMLGPU(aManager),
    mInvalidateEntireSurface(false),
-   mSurfaceCopyNeeded(false)
+   mSurfaceCopyNeeded(false),
+   mView(nullptr)
 {
 }
 
 ContainerLayerMLGPU::~ContainerLayerMLGPU()
 {
   while (mFirstChild) {
     RemoveChild(mFirstChild);
   }
--- a/gfx/layers/mlgpu/LayerMLGPU.cpp
+++ b/gfx/layers/mlgpu/LayerMLGPU.cpp
@@ -15,16 +15,17 @@ namespace layers {
 
 using namespace gfx;
 
 uint64_t LayerMLGPU::sFrameKey = 0;
 
 LayerMLGPU::LayerMLGPU(LayerManagerMLGPU* aManager)
  : HostLayer(aManager),
    mFrameKey(0),
+   mComputedOpacity(0.0),
    mPrepared(false)
 {
 }
 
 /* static */ void
 LayerMLGPU::BeginFrame()
 {
   sFrameKey++;
--- a/gfx/layers/mlgpu/MLGDevice.cpp
+++ b/gfx/layers/mlgpu/MLGDevice.cpp
@@ -63,16 +63,17 @@ MLGSwapChain::ApplyNewInvalidRegion(nsIn
     mFrontBufferInvalid.OrWith(invalid);
     AL_LOG("Frontbuffer invalid region: %s\n", Stringify(mFrontBufferInvalid).c_str());
   }
   return true;
 }
 
 MLGDevice::MLGDevice()
  : mTopology(MLGPrimitiveTopology::Unknown),
+   mInitialized(false),
    mIsValid(false),
    mCanUseClearView(false),
    mCanUseConstantBufferOffsetBinding(false),
    mMaxConstantBufferBindSize(0)
 {
 }
 
 MLGDevice::~MLGDevice()
--- a/gfx/layers/mlgpu/RenderPassMLGPU.cpp
+++ b/gfx/layers/mlgpu/RenderPassMLGPU.cpp
@@ -564,16 +564,17 @@ TexturedRenderPass::AddClippedItem(Txn& 
       }
     }
   }
   return true;
 }
 
 SingleTexturePass::SingleTexturePass(FrameBuilder* aBuilder, const ItemInfo& aItem)
  : TexturedRenderPass(aBuilder, aItem),
+   mSamplerMode(SamplerMode::LinearClamp),
    mOpacity(1.0f)
 {
   SetDefaultGeometry(aItem);
 }
 
 bool
 SingleTexturePass::AddToPass(LayerMLGPU* aLayer, ItemInfo& aItem)
 {
@@ -672,17 +673,18 @@ SingleTexturePass::SetupPipeline()
       else
         mDevice->SetPixelShader(PixelShaderID::TexturedVertexRGB);
       break;
   }
 }
 
 ComponentAlphaPass::ComponentAlphaPass(FrameBuilder* aBuilder, const ItemInfo& aItem)
  : TexturedRenderPass(aBuilder, aItem),
-   mOpacity(1.0f)
+   mOpacity(1.0f),
+   mSamplerMode(SamplerMode::LinearClamp)
 {
   SetDefaultGeometry(aItem);
 }
 
 bool
 ComponentAlphaPass::AddToPass(LayerMLGPU* aLayer, ItemInfo& aItem)
 {
   PaintedLayerMLGPU* layer = aLayer->AsPaintedLayerMLGPU();
@@ -696,17 +698,17 @@ ComponentAlphaPass::AddToPass(LayerMLGPU
     {
       return false;
     }
   } else {
     mOpacity = layer->GetComputedOpacity();
     mSamplerMode = layer->GetSamplerMode();
     mTextureOnBlack = layer->GetTexture();
     mTextureOnWhite = layer->GetTextureOnWhite();
-  } 
+  }
 
   Txn txn(this);
 
   Info info(aItem, layer);
   if (!AddItems(txn, info, layer->GetDrawRects())) {
     return false;
   }
   return txn.Commit();
@@ -737,16 +739,17 @@ ComponentAlphaPass::SetupPipeline()
   }
 
   mDevice->SetSamplerMode(kDefaultSamplerSlot, mSamplerMode);
   mDevice->SetPSTextures(0, 2, textures);
 }
 
 VideoRenderPass::VideoRenderPass(FrameBuilder* aBuilder, const ItemInfo& aItem)
  : TexturedRenderPass(aBuilder, aItem),
+   mSamplerMode(SamplerMode::LinearClamp),
    mOpacity(1.0f)
 {
   SetDefaultGeometry(aItem);
 }
 
 bool
 VideoRenderPass::AddToPass(LayerMLGPU* aLayer, ItemInfo& aItem)
 {
--- a/gfx/layers/mlgpu/SharedBufferMLGPU.cpp
+++ b/gfx/layers/mlgpu/SharedBufferMLGPU.cpp
@@ -15,16 +15,17 @@ namespace layers {
 
 SharedBufferMLGPU::SharedBufferMLGPU(MLGDevice* aDevice, MLGBufferType aType, size_t aDefaultSize)
  : mDevice(aDevice),
    mType(aType),
    mDefaultSize(aDefaultSize),
    mCanUseOffsetAllocation(true),
    mCurrentPosition(0),
    mMaxSize(0),
+   mMap(),
    mMapped(false),
    mBytesUsedThisFrame(0),
    mNumSmallFrames(0)
 {
   MOZ_COUNT_CTOR(SharedBufferMLGPU);
 }
 
 SharedBufferMLGPU::~SharedBufferMLGPU()
@@ -188,17 +189,19 @@ VertexBufferSection::Init(MLGBuffer* aBu
 {
   mBuffer = aBuffer;
   mOffset = aOffset;
   mNumVertices = aNumVertices;
   mStride = aStride;
 }
 
 ConstantBufferSection::ConstantBufferSection()
- : mOffset(-1)
+ : mOffset(-1),
+   mNumBytes(0),
+   mNumItems(0)
 {}
 
 void
 ConstantBufferSection::Init(MLGBuffer* aBuffer, ptrdiff_t aOffset, size_t aBytes, size_t aNumItems)
 {
   mBuffer = aBuffer;
   mOffset = aOffset;
   mNumBytes = aBytes;
--- a/gfx/layers/mlgpu/TexturedLayerMLGPU.cpp
+++ b/gfx/layers/mlgpu/TexturedLayerMLGPU.cpp
@@ -166,17 +166,19 @@ TexturedLayerMLGPU::AssignBigImage(Frame
     // Since the layer tree is not holding this alive, we have to ask the
     // FrameBuilder to do it for us.
     aBuilder->RetainTemporaryLayer(item);
   } while (aIter->NextTile());
 }
 
 TempImageLayerMLGPU::TempImageLayerMLGPU(LayerManagerMLGPU* aManager)
  : ImageLayer(aManager, static_cast<HostLayer*>(this)),
-   TexturedLayerMLGPU(aManager)
+   TexturedLayerMLGPU(aManager),
+   mFilter(gfx::SamplingFilter::GOOD),
+   mIsOpaque(false)
 {
 }
 
 TempImageLayerMLGPU::~TempImageLayerMLGPU()
 {
 }
 
 void
--- a/gfx/layers/moz.build
+++ b/gfx/layers/moz.build
@@ -578,8 +578,11 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
     CXXFLAGS += [
         '-Wno-maybe-uninitialized'
     ]
 
 if CONFIG['MOZ_ENABLE_SKIA']:
   UNIFIED_SOURCES += [
     'composite/PaintCounter.cpp',
   ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/gfx/layers/opengl/CompositingRenderTargetOGL.h
+++ b/gfx/layers/opengl/CompositingRenderTargetOGL.h
@@ -40,17 +40,21 @@ class CompositingRenderTargetOGL : publi
 {
   typedef mozilla::gl::GLContext GLContext;
 
   friend class CompositorOGL;
 
   // For lazy initialisation of the GL stuff
   struct InitParams
   {
-    InitParams() : mStatus(NO_PARAMS) {}
+    InitParams()
+      : mStatus(NO_PARAMS)
+      , mFBOTextureTarget(0)
+      , mInit(INIT_MODE_NONE)
+    {}
     InitParams(const gfx::IntSize& aSize,
                const gfx::IntSize& aPhySize,
                GLenum aFBOTextureTarget,
                SurfaceInitMode aInit)
       : mStatus(READY)
       , mSize(aSize)
       , mPhySize(aPhySize)
       , mFBOTextureTarget(aFBOTextureTarget)
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -91,16 +91,17 @@ private:
   GLContext* mGL;
   GLuint mBufferHandle;
 };
 
 AsyncReadbackBufferOGL::AsyncReadbackBufferOGL(GLContext* aGL,
                                                const IntSize& aSize)
   : AsyncReadbackBuffer(aSize)
   , mGL(aGL)
+  , mBufferHandle(0)
 {
   size_t bufferByteCount = mSize.width * mSize.height * 4;
   mGL->fGenBuffers(1, &mBufferHandle);
 
   ScopedPackState scopedPackState(mGL);
   Bind();
   mGL->fBufferData(LOCAL_GL_PIXEL_PACK_BUFFER, bufferByteCount, nullptr,
                    LOCAL_GL_STREAM_READ);
@@ -175,16 +176,20 @@ CompositorOGL::BindBackdrop(ShaderProgra
 
 CompositorOGL::CompositorOGL(CompositorBridgeParent* aParent,
                              widget::CompositorWidget* aWidget,
                              int aSurfaceWidth, int aSurfaceHeight,
                              bool aUseExternalSurfaceSize)
   : Compositor(aWidget, aParent)
   , mWidgetSize(-1, -1)
   , mSurfaceSize(aSurfaceWidth, aSurfaceHeight)
+  , mFBOTextureTarget(0)
+  , mWindowRenderTarget(nullptr)
+  , mQuadVBO(0)
+  , mTriangleVBO(0)
   , mHasBGRA(0)
   , mUseExternalSurfaceSize(aUseExternalSurfaceSize)
   , mFrameInProgress(false)
   , mDestroyed(false)
   , mViewportSize(0, 0)
   , mCurrentProgram(nullptr)
 {
 #ifdef XP_DARWIN
--- a/gfx/layers/opengl/TextureHostOGL.h
+++ b/gfx/layers/opengl/TextureHostOGL.h
@@ -78,17 +78,18 @@ inline void ApplySamplingFilterToBoundTe
 /**
  * TextureSourceOGL provides the necessary API for CompositorOGL to composite
  * a TextureSource.
  */
 class TextureSourceOGL
 {
 public:
   TextureSourceOGL()
-    : mHasCachedSamplingFilter(false)
+    : mCachedSamplingFilter(gfx::SamplingFilter::GOOD)
+    , mHasCachedSamplingFilter(false)
   {}
 
   virtual bool IsValid() const = 0;
 
   virtual void BindTexture(GLenum aTextureUnit,
                            gfx::SamplingFilter aSamplingFilter) = 0;
 
   virtual gfx::IntSize GetSize() const = 0;
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -112,17 +112,19 @@ struct BlobItemData
   Matrix mMatrix; // updated to track the current transform to device space
   Matrix4x4Flagged mTransform; // only used with nsDisplayTransform items to detect transform changes
   float mOpacity; // only used with nsDisplayOpacity items to detect change to opacity
 
   IntRect mImageRect;
   LayerIntPoint mGroupOffset;
 
   BlobItemData(DIGroup* aGroup, nsDisplayItem *aItem)
-    : mGroup(aGroup)
+    : mUsed(false)
+    , mGroup(aGroup)
+    , mOpacity(0.0)
   {
     mInvalid = false;
     mEmpty = false;
     mDisplayItemKey = aItem->GetPerFrameKey();
     AddFrame(aItem->Frame());
   }
 
 private:
@@ -216,17 +218,19 @@ TakeExternalSurfaces(WebRenderDrawEventR
     SharedSurfacesChild::Share(sharedSurface, aManager, aResources, key);
   }
 }
 
 struct DIGroup;
 struct Grouper
 {
   explicit Grouper(ClipManager& aClipManager)
-   : mClipManager(aClipManager)
+   : mAppUnitsPerDevPixel(0)
+   , mDisplayListBuilder(nullptr)
+   , mClipManager(aClipManager)
   {}
 
   int32_t mAppUnitsPerDevPixel;
   std::vector<nsDisplayItem*> mItemStack;
   nsDisplayListBuilder* mDisplayListBuilder;
   ClipManager& mClipManager;
   Matrix mTransform;
 
--- a/gfx/src/nsDeviceContext.cpp
+++ b/gfx/src/nsDeviceContext.cpp
@@ -42,17 +42,17 @@
 using namespace mozilla;
 using namespace mozilla::gfx;
 using mozilla::services::GetObserverService;
 using mozilla::widget::ScreenManager;
 
 class nsFontCache final : public nsIObserver
 {
 public:
-    nsFontCache() {}
+    nsFontCache(): mContext(nullptr) {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIOBSERVER
 
     void Init(nsDeviceContext* aContext);
     void Destroy();
 
     already_AddRefed<nsFontMetrics> GetMetricsFor(
--- a/gfx/src/nsRegion.h
+++ b/gfx/src/nsRegion.h
@@ -2176,16 +2176,19 @@ public:
     const nsRegion& mRegion;
     typename BandArray::const_iterator mCurrentBand;
     typename StripArray::const_iterator mCurrentStrip;
 
   public:
     explicit RectIterator(const nsRegion& aRegion)
       : mRegion(aRegion)
       , mCurrentBand(aRegion.mBands.begin())
+#ifndef DEBUG
+      , mCurrentStrip(nullptr)
+#endif
     {
       mIsDone = mRegion.mBounds.IsEmpty();
       if (mCurrentBand != aRegion.mBands.end()) {
         mCurrentStrip = mCurrentBand->mStrips.begin();
       }
     }
 
     bool Done() const { return mIsDone; }
--- a/gfx/thebes/PrintTargetSkPDF.cpp
+++ b/gfx/thebes/PrintTargetSkPDF.cpp
@@ -12,16 +12,17 @@
 namespace mozilla {
 namespace gfx {
 
 PrintTargetSkPDF::PrintTargetSkPDF(const IntSize& aSize,
                                    UniquePtr<SkWStream> aStream)
   : PrintTarget(/* not using cairo_surface_t */ nullptr, aSize)
   , mOStream(std::move(aStream))
   , mPageCanvas(nullptr)
+  , mRefCanvas(nullptr)
 {
 }
 
 PrintTargetSkPDF::~PrintTargetSkPDF()
 {
   Finish(); // ensure stream is flushed
 
   // Make sure mPDFDoc and mRefPDFDoc are destroyed before our member streams
--- a/gfx/thebes/gfxContext.h
+++ b/gfx/thebes/gfxContext.h
@@ -627,17 +627,18 @@ private:
     mozilla::gfx::Matrix mMatrix;
 };
 
 
 class DrawTargetAutoDisableSubpixelAntialiasing {
 public:
     typedef mozilla::gfx::DrawTarget DrawTarget;
 
-    DrawTargetAutoDisableSubpixelAntialiasing(DrawTarget *aDT, bool aDisable)
+    DrawTargetAutoDisableSubpixelAntialiasing(DrawTarget* aDT, bool aDisable) :
+      mSubpixelAntialiasingEnabled(false)
     {
         if (aDisable) {
             mDT = aDT;
             mSubpixelAntialiasingEnabled = mDT->GetPermitSubpixelAA();
             mDT->SetPermitSubpixelAA(false);
         }
     }
     ~DrawTargetAutoDisableSubpixelAntialiasing()
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -816,16 +816,17 @@ gfxFont::gfxFont(const RefPtr<UnscaledFo
     mFontEntry(aFontEntry),
     mUnscaledFont(aUnscaledFont),
     mStyle(*aFontStyle),
     mAdjustedSize(0.0),
     mFUnitsConvFactor(-1.0f), // negative to indicate "not yet initialized"
     mAntialiasOption(anAAOption),
     mIsValid(true),
     mApplySyntheticBold(false),
+    mKerningEnabled(false),
     mMathInitialized(false)
 {
 #ifdef DEBUG_TEXT_RUN_STORAGE_METRICS
     ++gFontCount;
 #endif
     mKerningSet = HasFeatureSet(HB_TAG('k','e','r','n'), mKerningEnabled);
 }
 
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -72,16 +72,17 @@ gfxFontEntry::gfxFontEntry() :
     mHasSpaceFeatures(false),
     mHasSpaceFeaturesKerning(false),
     mHasSpaceFeaturesNonKerning(false),
     mSkipDefaultFeatureSpaceCheck(false),
     mGraphiteSpaceContextualsInitialized(false),
     mHasGraphiteSpaceContextuals(false),
     mSpaceGlyphIsInvisible(false),
     mSpaceGlyphIsInvisibleInitialized(false),
+    mHasGraphiteTables(false),
     mCheckedForGraphiteTables(false),
     mHasCmapTable(false),
     mGrFaceInitialized(false),
     mCheckedForColorGlyph(false),
     mCheckedForVariationAxes(false)
 {
     memset(&mDefaultSubSpaceFeatures, 0, sizeof(mDefaultSubSpaceFeatures));
     memset(&mNonDefaultSubSpaceFeatures, 0, sizeof(mNonDefaultSubSpaceFeatures));
@@ -102,16 +103,17 @@ gfxFontEntry::gfxFontEntry(const nsAStri
     mHasSpaceFeatures(false),
     mHasSpaceFeaturesKerning(false),
     mHasSpaceFeaturesNonKerning(false),
     mSkipDefaultFeatureSpaceCheck(false),
     mGraphiteSpaceContextualsInitialized(false),
     mHasGraphiteSpaceContextuals(false),
     mSpaceGlyphIsInvisible(false),
     mSpaceGlyphIsInvisibleInitialized(false),
+    mHasGraphiteTables(false),
     mCheckedForGraphiteTables(false),
     mHasCmapTable(false),
     mGrFaceInitialized(false),
     mCheckedForColorGlyph(false),
     mCheckedForVariationAxes(false)
 {
     memset(&mDefaultSubSpaceFeatures, 0, sizeof(mDefaultSubSpaceFeatures));
     memset(&mNonDefaultSubSpaceFeatures, 0, sizeof(mNonDefaultSubSpaceFeatures));
--- a/gfx/thebes/gfxFontFamilyList.h
+++ b/gfx/thebes/gfxFontFamilyList.h
@@ -277,16 +277,17 @@ public:
     explicit FontFamilyList(const FontFamilyName& aName)
         : mFontlist(MakeNotNull<SharedFontList*>(aName))
         , mDefaultFontType(eFamily_none)
     {
     }
 
     explicit FontFamilyList(nsTArray<FontFamilyName>&& aNames)
         : mFontlist(MakeNotNull<SharedFontList*>(std::move(aNames)))
+        , mDefaultFontType(eFamily_none)
     {
     }
 
     FontFamilyList(const FontFamilyList& aOther)
         : mFontlist(aOther.mFontlist)
         , mDefaultFontType(aOther.mDefaultFontType)
     {
     }
--- a/gfx/thebes/gfxFontInfoLoader.h
+++ b/gfx/thebes/gfxFontInfoLoader.h
@@ -46,16 +46,17 @@ struct FontFaceData {
 class FontInfoData {
 public:
     NS_INLINE_DECL_THREADSAFE_REFCOUNTING(FontInfoData)
 
     FontInfoData(bool aLoadOtherNames,
                  bool aLoadFaceNames,
                  bool aLoadCmaps) :
         mCanceled(false),
+        mLoadStats(),
         mLoadOtherNames(aLoadOtherNames),
         mLoadFaceNames(aLoadFaceNames),
         mLoadCmaps(aLoadCmaps)
     {
         MOZ_COUNT_CTOR(FontInfoData);
     }
 
 protected:
--- a/gfx/thebes/gfxGlyphExtents.h
+++ b/gfx/thebes/gfxGlyphExtents.h
@@ -83,19 +83,28 @@ public:
     size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
 private:
     class HashEntry : public nsUint32HashKey {
     public:
         // When constructing a new entry in the hashtable, we'll leave this
         // blank. The caller of Put() will fill this in.
-        explicit HashEntry(KeyTypePointer aPtr) : nsUint32HashKey(aPtr) {}
-        HashEntry(const HashEntry& toCopy) : nsUint32HashKey(toCopy) {
-          x = toCopy.x; y = toCopy.y; width = toCopy.width; height = toCopy.height;
+        explicit HashEntry(KeyTypePointer aPtr)
+          : nsUint32HashKey(aPtr)
+          , x(0.0)
+          , y(0.0)
+          , width(0.0)
+          , height(0.0) {}
+        HashEntry(const HashEntry& toCopy)
+          : nsUint32HashKey(toCopy) {
+            x = toCopy.x;
+            y = toCopy.y;
+            width = toCopy.width;
+            height = toCopy.height;
         }
 
         float x, y, width, height;
     };
 
     enum { BLOCK_SIZE_BITS = 7, BLOCK_SIZE = 1 << BLOCK_SIZE_BITS }; // 128-glyph blocks
 
     class GlyphWidths {
--- a/gfx/thebes/gfxGraphiteShaper.cpp
+++ b/gfx/thebes/gfxGraphiteShaper.cpp
@@ -28,16 +28,17 @@ using namespace mozilla; // for AutoSwap
  * Creation and destruction; on deletion, release any font tables we're holding
  */
 
 gfxGraphiteShaper::gfxGraphiteShaper(gfxFont *aFont)
     : gfxFontShaper(aFont),
       mGrFace(mFont->GetFontEntry()->GetGrFace()),
       mGrFont(nullptr), mFallbackToSmallCaps(false)
 {
+    mCallbackData.mDrawTarget = nullptr;
     mCallbackData.mFont = aFont;
 }
 
 gfxGraphiteShaper::~gfxGraphiteShaper()
 {
     if (mGrFont) {
         gr_font_destroy(mGrFont);
     }
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -38,16 +38,17 @@ using namespace mozilla::unicode; // for
  * Creation and destruction; on deletion, release any font tables we're holding
  */
 
 gfxHarfBuzzShaper::gfxHarfBuzzShaper(gfxFont *aFont)
     : gfxFontShaper(aFont),
       mHBFace(aFont->GetFontEntry()->GetHBFace()),
       mHBFont(nullptr),
       mBuffer(nullptr),
+      mCallbackData(),
       mKernTable(nullptr),
       mHmtxTable(nullptr),
       mVmtxTable(nullptr),
       mVORGTable(nullptr),
       mLocaTable(nullptr),
       mGlyfTable(nullptr),
       mCmapTable(nullptr),
       mCmapFormat(-1),
@@ -55,16 +56,17 @@ gfxHarfBuzzShaper::gfxHarfBuzzShaper(gfx
       mUVSTableOffset(0),
       mNumLongHMetrics(0),
       mNumLongVMetrics(0),
       mDefaultVOrg(-1.0),
       mUseFontGetGlyph(aFont->ProvidesGetGlyph()),
       mUseFontGlyphWidths(aFont->ProvidesGlyphWidths()),
       mInitialized(false),
       mVerticalInitialized(false),
+      mUseVerticalPresentationForms(false),
       mLoadedLocaGlyf(false),
       mLocaLongOffsets(false)
 {
 }
 
 gfxHarfBuzzShaper::~gfxHarfBuzzShaper()
 {
     if (mCmapTable) {
--- a/gfx/thebes/gfxImageSurface.cpp
+++ b/gfx/thebes/gfxImageSurface.cpp
@@ -17,16 +17,17 @@
 #include <algorithm>
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
 gfxImageSurface::gfxImageSurface()
   : mSize(0, 0),
     mOwnsData(false),
+    mData(nullptr),
     mFormat(SurfaceFormat::UNKNOWN),
     mStride(0)
 {
 }
 
 void
 gfxImageSurface::InitFromSurface(cairo_surface_t *csurf)
 {
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -379,17 +379,18 @@ MacOSFontEntry::MacOSFontEntry(const nsA
       mHasVariations(false),
       mHasVariationsInitialized(false),
       mHasAATSmallCaps(false),
       mHasAATSmallCapsInitialized(false),
       mCheckedForTracking(false),
       mCheckedForOpszAxis(false),
       mTrakTable(nullptr),
       mTrakValues(nullptr),
-      mTrakSizeTable(nullptr)
+      mTrakSizeTable(nullptr),
+      mNumTrakSizes(0)
 {
     mWeightRange = aWeight;
 }
 
 MacOSFontEntry::MacOSFontEntry(const nsAString& aPostscriptName,
                                CGFontRef aFontRef,
                                WeightRange aWeight,
                                StretchRange aStretch,
@@ -406,17 +407,18 @@ MacOSFontEntry::MacOSFontEntry(const nsA
       mHasVariations(false),
       mHasVariationsInitialized(false),
       mHasAATSmallCaps(false),
       mHasAATSmallCapsInitialized(false),
       mCheckedForTracking(false),
       mCheckedForOpszAxis(false),
       mTrakTable(nullptr),
       mTrakValues(nullptr),
-      mTrakSizeTable(nullptr)
+      mTrakSizeTable(nullptr),
+      mNumTrakSizes(0)
 {
     mFontRef = aFontRef;
     mFontRefInitialized = true;
     ::CFRetain(mFontRef);
 
     mWeightRange = aWeight;
     mStretchRange = aStretch;
     mFixedPitch = false; // xxx - do we need this for downloaded fonts?
--- a/gfx/thebes/gfxMathTable.cpp
+++ b/gfx/thebes/gfxMathTable.cpp
@@ -9,16 +9,17 @@
 
 #define FloatToFixed(f) (65536 * (f))
 #define FixedToFloat(f) ((f) * (1.0 / 65536.0))
 
 using namespace mozilla;
 
 gfxMathTable::gfxMathTable(hb_face_t *aFace, gfxFloat aSize)
 {
+  mMathVariantCache.vertical = false;
   mHBFont = hb_font_create(aFace);
   if (mHBFont) {
     hb_font_set_ppem(mHBFont, aSize, aSize);
     uint32_t scale = FloatToFixed(aSize);
     hb_font_set_scale(mHBFont, scale, scale);
   }
 
   mMathVariantCache.glyphID = 0;
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -482,17 +482,18 @@ MemoryPressureObserver::Observe(nsISuppo
     gfxGradientCache::PurgeAllCaches();
 
     gfxPlatform::PurgeSkiaFontCache();
     gfxPlatform::GetPlatform()->PurgeSkiaGPUCache();
     return NS_OK;
 }
 
 gfxPlatform::gfxPlatform()
-  : mAzureCanvasBackendCollector(this, &gfxPlatform::GetAzureBackendInfo)
+  : mHasVariationFontSupport(false)
+  , mAzureCanvasBackendCollector(this, &gfxPlatform::GetAzureBackendInfo)
   , mApzSupportCollector(this, &gfxPlatform::GetApzSupportInfo)
   , mTilesInfoCollector(this, &gfxPlatform::GetTilesSupportInfo)
   , mCompositorBackend(layers::LayersBackend::LAYERS_NONE)
   , mScreenDepth(0)
 {
     mAllowDownloadableFonts = UNINITIALIZED_VALUE;
     mFallbackUsesCmaps = UNINITIALIZED_VALUE;
 
--- a/gfx/thebes/gfxSkipChars.h
+++ b/gfx/thebes/gfxSkipChars.h
@@ -199,17 +199,21 @@ public:
           mCurrentRangeIndex(aIterator.mCurrentRangeIndex),
           mOriginalStringToSkipCharsOffset(aIterator.mOriginalStringToSkipCharsOffset)
     { }
 
     /**
      * The empty constructor creates an object that is useless until it is assigned.
      */
     gfxSkipCharsIterator()
-        : mSkipChars(nullptr)
+        : mSkipChars(nullptr),
+          mOriginalStringOffset(0),
+          mSkippedStringOffset(0),
+          mCurrentRangeIndex(0),
+          mOriginalStringToSkipCharsOffset(0)
     { }
 
     /**
      * Return true if this iterator is properly initialized and usable.
      */
     bool IsInitialized()
     {
         return mSkipChars != nullptr;
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -915,16 +915,17 @@ void
 gfxUserFontEntry::GetUserFontSets(nsTArray<gfxUserFontSet*>& aResult)
 {
     aResult.Clear();
     aResult.AppendElement(mFontSet);
 }
 
 gfxUserFontSet::gfxUserFontSet()
     : mFontFamilies(4),
+      mRebuildGeneration(0),
       mLocalRulesUsed(false),
       mRebuildLocalRules(false),
       mDownloadCount(0),
       mDownloadSize(0)
 {
     IncrementGeneration(true);
     gfxPlatformFontList* fp = gfxPlatformFontList::PlatformFontList();
     if (fp) {
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -288,8 +288,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3
 
 LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
 
 DEFINES['GRAPHITE2_STATIC'] = True
 
 if CONFIG['CC_TYPE'] == 'clang':
     # Suppress warnings from Skia header files.
     SOURCES['gfxPlatform.cpp'].flags += ['-Wno-implicit-fallthrough']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/gfx/vr/moz.build
+++ b/gfx/vr/moz.build
@@ -92,8 +92,11 @@ include('/ipc/chromium/chromium-config.m
 
 FINAL_LIBRARY = 'xul'
 
 # This is intended as a temporary hack to enable VS2015 builds.
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # ovr_capi_dynamic.h '<unnamed-tag>': Alignment specifier is less than
     # actual alignment (8), and will be ignored
     CXXFLAGS += ['-wd4359']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/gfx/webrender_bindings/RenderBufferTextureHost.cpp
+++ b/gfx/webrender_bindings/RenderBufferTextureHost.cpp
@@ -11,16 +11,20 @@
 
 namespace mozilla {
 namespace wr {
 
 RenderBufferTextureHost::RenderBufferTextureHost(uint8_t* aBuffer,
                                                  const layers::BufferDescriptor& aDescriptor)
   : mBuffer(aBuffer)
   , mDescriptor(aDescriptor)
+  , mMap()
+  , mYMap()
+  , mCbMap()
+  , mCrMap()
   , mLocked(false)
 {
   MOZ_COUNT_CTOR_INHERITED(RenderBufferTextureHost, RenderTextureHost);
 
   switch (mDescriptor.type()) {
     case layers::BufferDescriptor::TYCbCrDescriptor: {
       const layers::YCbCrDescriptor& ycbcr = mDescriptor.get_YCbCrDescriptor();
       mSize = ycbcr.ySize();
--- a/gfx/webrender_bindings/RenderSharedSurfaceTextureHost.cpp
+++ b/gfx/webrender_bindings/RenderSharedSurfaceTextureHost.cpp
@@ -10,16 +10,17 @@
 #include "mozilla/layers/ImageDataSerializer.h"
 #include "mozilla/layers/SourceSurfaceSharedData.h"
 
 namespace mozilla {
 namespace wr {
 
 RenderSharedSurfaceTextureHost::RenderSharedSurfaceTextureHost(gfx::SourceSurfaceSharedDataWrapper* aSurface)
   : mSurface(aSurface)
+  , mMap()
   , mLocked(false)
 {
   MOZ_COUNT_CTOR_INHERITED(RenderSharedSurfaceTextureHost, RenderTextureHost);
   MOZ_ASSERT(aSurface);
 }
 
 RenderSharedSurfaceTextureHost::~RenderSharedSurfaceTextureHost()
 {
--- a/gfx/webrender_bindings/moz.build
+++ b/gfx/webrender_bindings/moz.build
@@ -61,8 +61,11 @@ if CONFIG['MOZ_ENABLE_D3D10_LAYER']:
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk3'):
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/ipc/chromium/moz.build
+++ b/ipc/chromium/moz.build
@@ -147,8 +147,11 @@ DIRS += [
     'atomics',
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
 
 # Add libFuzzer configuration directives
 include('/tools/fuzzing/libfuzzer-config.mozbuild')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/ipc/contentproc/moz.build
+++ b/ipc/contentproc/moz.build
@@ -18,8 +18,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
         '/xpcom/base',
     ]
 
 if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT':
     LOCAL_INCLUDES += [
         '/security/sandbox/chromium',
         '/security/sandbox/chromium-shim',
     ]
+
+if CONFIG['MOZ_PGO'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/ipc/mscom/moz.build
+++ b/ipc/mscom/moz.build
@@ -81,8 +81,11 @@ LOCAL_INCLUDES += [
 DEFINES['MOZ_MSCOM_REMARSHAL_NO_HANDLER'] = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "IPC: MSCOM")
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/ipc/mscom/oop/moz.build
+++ b/ipc/mscom/oop/moz.build
@@ -32,8 +32,11 @@ LIBRARY_DEFINES['MOZ_MSCOM_REMARSHAL_NO_
 
 DisableStlWrapping()
 NO_EXPAND_LIBS = True
 FORCE_STATIC_LIB = True
 
 # This DLL may be loaded into other processes, so we need static libs for
 # Windows 7 and Windows 8.
 USE_STATIC_LIBS = True
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/js/xpconnect/shell/moz.build
+++ b/js/xpconnect/shell/moz.build
@@ -48,8 +48,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
 
     DELAYLOAD_DLLS += [
         'xul.dll',
     ]
 
 CFLAGS += CONFIG['TK_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
 OS_LIBS += CONFIG['TK_LIBS']
+
+if CONFIG['MOZ_PGO'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/js/xpconnect/src/moz.build
+++ b/js/xpconnect/src/moz.build
@@ -59,8 +59,11 @@ LOCAL_INCLUDES += [
     '/layout/style',
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-shadow', '-Werror=format']
 
 if CONFIG['NIGHTLY_BUILD']:
     DEFINES['ENABLE_WASM_GC'] = True
+
+if CONFIG['MOZ_ASAN'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/layout/painting/moz.build
+++ b/layout/painting/moz.build
@@ -70,8 +70,11 @@ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary hack to support building with VS2015.
     # 'type cast': conversion from 'unsigned int' to 'void *' of greater size
     CXXFLAGS += ['-wd4312']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/layout/reftests/bidi/reftest.list
+++ b/layout/reftests/bidi/reftest.list
@@ -138,17 +138,17 @@ random-if(/^Windows\x20NT\x206\.1/.test(
 == 746987-4.html 746987-4-ref.html
 == 779003-1.html 779003-1-ref.html
 == 779003-1-dynamic.html 779003-1-ref.html
 == 817406-1.html 817406-1-ref.html
 == 817406-2.html 817406-2-ref.html
 == 817406-3.html 817406-1-ref.html
 == 817406-4.html 817406-4-ref.html
 == 847242-1.html 847242-1-ref.html
-fuzzy-if(xulRuntime.widgetToolkit=="gtk3",1,11) == 869833-1.xul 869833-1-ref.xul
+pref(layout.css.xul-tree-pseudos.content.enabled,true) fuzzy-if(xulRuntime.widgetToolkit=="gtk3",1,11) == 869833-1.xul 869833-1-ref.xul
 == 922530-1.html 922530-1-ref.html
 == 922550-1.html 922550-1-ref.html
 == 989994-1.html 989994-1-ref.html
 == 1067268-1.html 1067268-1-ref.html
 == 1069941-inline-bidi-border-1.html 1069941-inline-bidi-border-1-ref.html
 == 1069941-inline-bidi-margin-1.html 1069941-inline-bidi-margin-1-ref.html
 != 1155359-1.xul 1155359-1-ref.xul
 == 1157726-1.html 1157726-1-ref.html
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1284,17 +1284,17 @@ fuzzy-if(skiaContent,1,5) == 474472-1.ht
 == 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
+pref(layout.css.xul-tree-pseudos.content.enabled,true) random-if(d2d) == 478377-1.xul 478377-1-ref.xul
 == 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
 == 478811-1.html 478811-1-ref.html
@@ -1680,21 +1680,21 @@ HTTP == 652991-4.html 652991-4-ref.html
 fuzzy-if(skiaContent,1,5) == 653930-1.html 653930-1-ref.html
 == 654057-1.html 654057-1-ref.html
 fuzzy-if(skiaContent,1,65536) == 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
 fuzzy-if(skiaContent,10,919) fuzzy-if(webrender&&cocoaWidget,54-54,831-831) == 660682-1.html 660682-1-ref.html
-fuzzy-if(d2d,1,256) skip-if(Android) fuzzy-if(skiaContent,1,68000) fuzzy-if(webrender&&cocoaWidget,2-2,256-256) == 664127-1.xul 664127-1-ref.xul # Android: Intermittent failures - bug 1019131
+pref(layout.css.xul-tree-pseudos.content.enabled,true) fuzzy-if(d2d,1,256) skip-if(Android) fuzzy-if(skiaContent,1,68000) fuzzy-if(webrender&&cocoaWidget,2-2,256-256) == 664127-1.xul 664127-1-ref.xul # Android: Intermittent failures - bug 1019131
 == 665597-1.html 665597-1-ref.html
 == 665597-2.html 665597-2-ref.html
 == 667079-1.html 667079-1-ref.html
-== 668319-1.xul about:blank
+pref(layout.css.xul-tree-pseudos.content.enabled,true) == 668319-1.xul about:blank
 != 669015-1.xul 669015-1-notref.xul
 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
--- a/layout/reftests/xul/reftest.list
+++ b/layout/reftests/xul/reftest.list
@@ -2,19 +2,19 @@
 
 == menuitem-key.xul menuitem-key-ref.xul
 # these random-if(Android) are due to differences between Android Native & Xul, see bug 732569
 random-if(Android) == menulist-shrinkwrap-1.xul menulist-shrinkwrap-1-ref.xul
 random-if(Android) == menulist-shrinkwrap-2.xul menulist-shrinkwrap-2-ref.xul
 == textbox-overflow-1.xul textbox-overflow-1-ref.xul # for bug 749658
 # accesskeys are not normally displayed on Mac, so skip this test
 skip-if(cocoaWidget) == accesskey.xul accesskey-ref.xul
-fails-if(cocoaWidget) fuzzy-if(xulRuntime.widgetToolkit=="gtk3",1,11) == tree-row-outline-1.xul tree-row-outline-1-ref.xul # win8: bug 1254832
+pref(layout.css.xul-tree-pseudos.content.enabled,true) fails-if(cocoaWidget) fuzzy-if(xulRuntime.widgetToolkit=="gtk3",1,11) == tree-row-outline-1.xul tree-row-outline-1-ref.xul # win8: bug 1254832
 skip-if(!cocoaWidget) fails-if(webrender&&cocoaWidget) == mac-tab-toolbar.xul mac-tab-toolbar-ref.xul
-!= tree-row-outline-1.xul tree-row-outline-1-notref.xul
+pref(layout.css.xul-tree-pseudos.content.enabled,true) != tree-row-outline-1.xul tree-row-outline-1-notref.xul
 == text-crop.xul text-crop-ref.xul
 random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == text-small-caps-1.xul text-small-caps-1-ref.xul
 fuzzy-if(skiaContent,1,60) fuzzy-if(cocoaWidget&&browserIsRemote&&!skiaContent,1,31) fuzzy-if(winWidget&&browserIsRemote&&layersGPUAccelerated,1,50) == inactive-fixed-bg-bug1205630.xul inactive-fixed-bg-bug1205630-ref.html
 fuzzy-if(skiaContent,1,60) fuzzy-if(cocoaWidget&&browserIsRemote&&!skiaContent,1,31) fuzzy-if(winWidget&&browserIsRemote&&layersGPUAccelerated,1,50) == inactive-fixed-bg-bug1272525.xul inactive-fixed-bg-bug1272525-ref.html
 
 # Tests for XUL <image> with 'object-fit' & 'object-position':
 # These tests should be very similar to tests in our w3c-css/submitted/images3
 # reftest directory. They live here because they use XUL, and it
@@ -71,18 +71,18 @@ fails == object-fit-fill-svg-006.xul obj
 # XXXdholbert: These are marked as "random" right now, since they might not
 # render the images they trying to test in time for the reftest snapshot, per
 # bug 1218954.
 skip == treecell-image-svg-1a.xul treecell-image-svg-1-ref.xul # bug 1218954
 skip == treecell-image-svg-1b.xul treecell-image-svg-1-ref.xul # bug 1218954
 
 == treechildren-padding-percent-1.xul treechildren-padding-percent-1-ref.xul
 
-!= treetwisty-svg-context-paint-1-not-ref.xul treetwisty-svg-context-paint-1-ref.xul
-test-pref(svg.context-properties.content.enabled,true) == treetwisty-svg-context-paint-1.xul treetwisty-svg-context-paint-1-ref.xul
+pref(layout.css.xul-tree-pseudos.content.enabled,true) != treetwisty-svg-context-paint-1-not-ref.xul treetwisty-svg-context-paint-1-ref.xul
+pref(layout.css.xul-tree-pseudos.content.enabled,true) test-pref(svg.context-properties.content.enabled,true) == treetwisty-svg-context-paint-1.xul treetwisty-svg-context-paint-1-ref.xul
 
 # resizer (non-native-themed)
 
 != resizer-bottomend.xul blank-window.xul
 == resizer-bottomend.xul resizer-bottomright.xul
 != resizer-bottomend.xul resizer-bottomend-rtl.xul
 != resizer-bottomend-rtl.xul blank-window.xul
 == resizer-bottomend-rtl.xul resizer-bottomend-flipped.xul
--- a/layout/style/test/test_non_content_accessible_pseudos.html
+++ b/layout/style/test/test_non_content_accessible_pseudos.html
@@ -27,16 +27,20 @@ const NON_CONTENT_ACCESIBLE_PSEUDOS = [
   ":-moz-has-dir-attr",
   ":-moz-dir-attr-ltr",
   ":-moz-dir-attr-rtl",
   ":-moz-dir-attr-like-auto",
   ":-moz-autofill",
   ":-moz-autofill-preview",
 ];
 
+if (!SpecialPowers.getBoolPref("layout.css.xul-tree-pseudos.content.enabled")) {
+  NON_CONTENT_ACCESIBLE_PSEUDOS.push("::-moz-tree-row", "::-moz-tree-row(foo)");
+}
+
 test(function() {
   sheet.textContent = `div { color: initial }`;
   assert_equals(sheet.sheet.cssRules.length, 1);
 }, "sanity");
 
 for (const pseudo of NON_CONTENT_ACCESIBLE_PSEUDOS) {
   test(function() {
     sheet.textContent = `${pseudo} { color: blue; }`;
--- a/layout/style/test/test_selectors.html
+++ b/layout/style/test/test_selectors.html
@@ -11,17 +11,19 @@
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestLongerTimeout(2);
 
 var cloneiframe;
 
 function run() {
-
+  SpecialPowers.pushPrefEnv({ set: [["layout.css.xul-tree-pseudos.content.enabled", true]] }, runTests);
+}
+function runTests() {
     var iframe = document.getElementById("iframe");
     var ifwin = iframe.contentWindow;
     var ifdoc = iframe.contentDocument;
 
     cloneiframe = document.getElementById("cloneiframe");
 
     var style_elem = ifdoc.createElement("style");
     style_elem.setAttribute("type", "text/css");
--- a/media/gmp-clearkey/0.1/moz.build
+++ b/media/gmp-clearkey/0.1/moz.build
@@ -73,8 +73,11 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
     CFLAGS += [
         '-include', 'stdio.h',      # for sprintf() prototype
         '-include', 'unistd.h',     # for getpid() prototype
     ]
 elif CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CFLAGS += [
         '-FI', 'stdio.h',           # for sprintf() prototype
     ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/media/mtransport/common.build
+++ b/media/mtransport/common.build
@@ -88,8 +88,11 @@ DEFINES['R_DEFINED_INT2'] = 'int16_t'
 DEFINES['R_DEFINED_UINT2'] = 'uint16_t'
 DEFINES['R_DEFINED_INT4'] = 'int32_t'
 DEFINES['R_DEFINED_UINT4'] = 'uint32_t'
 DEFINES['R_DEFINED_INT8'] = 'int64_t'
 DEFINES['R_DEFINED_UINT8'] = 'uint64_t'
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/media/mtransport/third_party/nICEr/nicer.gyp
+++ b/media/mtransport/third_party/nICEr/nicer.gyp
@@ -202,16 +202,17 @@
                  'include_dirs': [
                      '../nrappkit/src/port/win32/include'
                  ],
               }],
 
               # Windows, clang-cl build
               [ 'clang_cl == 1', {
                 'cflags_mozilla': [
+                    '-Wno-error', # workaround for bug 1090497
                     '-Xclang',
                     '-Wall',
                     '-Wno-parentheses',
                     '-Wno-strict-prototypes',
                     '-Wmissing-prototypes',
                     '-Wno-format',
                     '-Wno-format-security',
                  ],
--- a/media/mtransport/third_party/nrappkit/nrappkit.gyp
+++ b/media/mtransport/third_party/nrappkit/nrappkit.gyp
@@ -199,16 +199,17 @@
                  'sources': [
                       './src/port/win32/include/csi_platform.h',
                  ],
               }],
 
               # Windows, clang-cl build
               [ 'clang_cl == 1', {
                 'cflags_mozilla': [
+                    '-Wno-error', # workaround for bug 1090497
                     '-Xclang',
                     '-Wall',
                     '-Wno-parentheses',
                     '-Wno-strict-prototypes',
                     '-Wmissing-prototypes',
                     '-Wno-format',
                     '-Wno-format-security',
                  ],
--- a/media/webrtc/signaling/gtest/moz.build
+++ b/media/webrtc/signaling/gtest/moz.build
@@ -43,8 +43,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'uiki
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary workaround to enable warning free building
     # with VS2015.
     # reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
     CXXFLAGS += ['-wd4312']
 
     # Disable warning for decorated name length exceeded, name was truncated
     CXXFLAGS += ['-wd4503']
+
+if CONFIG['MOZ_ASAN'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1306642
--- a/media/webrtc/signaling/src/media-conduit/moz.build
+++ b/media/webrtc/signaling/src/media-conduit/moz.build
@@ -30,8 +30,11 @@ UNIFIED_SOURCES += [
 
 if CONFIG['OS_TARGET'] == 'Android':
     UNIFIED_SOURCES += [
         'MediaCodecVideoCodec.cpp',
         'WebrtcMediaCodecVP8VideoCodec.cpp',
     ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['MOZ_ASAN'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1306642
--- a/media/webrtc/signaling/src/mediapipeline/moz.build
+++ b/media/webrtc/signaling/src/mediapipeline/moz.build
@@ -24,8 +24,11 @@ UNIFIED_SOURCES += [
     'MediaPipelineFilter.cpp',
     'RtpLogger.cpp',
     'TransportLayerPacketDumper.cpp',
 ]
 
 DEFINES['TRACING'] = True
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['MOZ_ASAN'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1306642
--- a/media/webrtc/signaling/src/sdp/moz.build
+++ b/media/webrtc/signaling/src/sdp/moz.build
@@ -56,8 +56,11 @@ SOURCES += [
     'sipcc/sdp_base64.c',
     'sipcc/sdp_config.c',
     'sipcc/sdp_main.c',
     'sipcc/sdp_token.c',
     'sipcc/sdp_utils.c',
 ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/memory/build/moz.build
+++ b/memory/build/moz.build
@@ -48,8 +48,11 @@ if CONFIG['MOZ_BUILD_APP'] != 'memory':
 
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd4273'] # inconsistent dll linkage (bug 558163)
 
 if CONFIG['MOZ_REPLACE_MALLOC_STATIC']:
     DEFINES['MOZ_REPLACE_MALLOC_STATIC'] = True
 
 DisableStlWrapping()
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/memory/replace/dmd/moz.build
+++ b/memory/replace/dmd/moz.build
@@ -31,8 +31,11 @@ if CONFIG['MOZ_OPTIMIZE']:
 DisableStlWrapping()
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'dbghelp',
     ]
 
 TEST_DIRS += ['test']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/memory/replace/logalloc/moz.build
+++ b/memory/replace/logalloc/moz.build
@@ -23,8 +23,11 @@ LOCAL_INCLUDES += [
 if CONFIG['OS_TARGET'] == 'Android' and FORCE_SHARED_LIB:
     USE_LIBS += [
         'mozglue',
     ]
 
 DIRS += [
     'replay',
 ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/memory/replace/moz.build
+++ b/memory/replace/moz.build
@@ -13,8 +13,11 @@ def ReplaceMalloc(name):
         SharedLibrary(name)
 
 DIRS += [
     'logalloc',
 ]
 
 if CONFIG['MOZ_DMD']:
     DIRS += ['dmd']
+
+if CONFIG['MOZ_DEBUG'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/mfbt/JSONWriter.h
+++ b/mfbt/JSONWriter.h
@@ -88,16 +88,17 @@
 //
 // The nesting in the example code is obviously optional, but can aid
 // readability.
 
 #ifndef mozilla_JSONWriter_h
 #define mozilla_JSONWriter_h
 
 #include "double-conversion/double-conversion.h"
+#include "mozilla/Assertions.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/Vector.h"
 
 #include <stdio.h>
 
@@ -321,16 +322,17 @@ protected:
     NewVectorEntries();
     mNeedNewlines[mDepth] =
       mNeedNewlines[mDepth - 1] && aStyle == MultiLineStyle;
   }
 
   // Adds the whitespace and closing char necessary to end a collection.
   void EndCollection(const char* aEndChar)
   {
+    MOZ_ASSERT(mDepth > 0);
     if (mNeedNewlines[mDepth]) {
       mWriter->Write("\n");
       mDepth--;
       Indent();
     } else {
       mDepth--;
     }
     mWriter->Write(aEndChar);
--- a/mfbt/MemoryChecking.h
+++ b/mfbt/MemoryChecking.h
@@ -41,16 +41,22 @@
 // In clang-cl based ASAN, we link against the memory poisoning functions
 // statically.
 #define MOZ_ASAN_VISIBILITY
 #else
 #define MOZ_ASAN_VISIBILITY MOZ_EXPORT
 #endif
 
 extern "C" {
+/* workaround for bug 1306642 */
+#if defined(_MSC_VER) && defined(__clang__)
+#pragma clang diagnostic warning "-Wdll-attribute-on-redeclaration"
+#pragma clang diagnostic warning "-Winconsistent-dllimport"
+#endif
+
 /* These definitions are usually provided through the
  * sanitizer/asan_interface.h header installed by ASan.
  */
 void MOZ_ASAN_VISIBILITY
 __asan_poison_memory_region(void const volatile *addr, size_t size);
 void MOZ_ASAN_VISIBILITY
 __asan_unpoison_memory_region(void const volatile *addr, size_t size);
 
--- a/modules/libpref/init/StaticPrefList.h
+++ b/modules/libpref/init/StaticPrefList.h
@@ -381,16 +381,30 @@ VARCACHE_PREF(
 #endif
 VARCACHE_PREF(
   "layout.css.xul-box-display-values.content.enabled",
    layout_css_xul_box_display_values_content_enabled,
   bool, PREF_VALUE
 )
 #undef PREF_VALUE
 
+// Pref to control whether ::xul-tree-* pseudo-elements are parsed in content
+// pages.
+#ifdef EARLY_BETA_OR_EARLIER
+#define PREF_VALUE false
+#else
+#define PREF_VALUE true
+#endif
+VARCACHE_PREF(
+  "layout.css.xul-tree-pseudos.content.enabled",
+   layout_css_xul_tree_pseudos_content_enabled,
+  bool, PREF_VALUE
+)
+#undef PREF_VALUE
+
 // Is support for CSS "grid-template-{columns,rows}: subgrid X" enabled?
 VARCACHE_PREF(
   "layout.css.grid-template-subgrid-value.enabled",
    layout_css_grid_template_subgrid_value_enabled,
   bool, false
 )
 
 // Is support for variation fonts enabled?
--- a/mozglue/build/moz.build
+++ b/mozglue/build/moz.build
@@ -129,8 +129,11 @@ if CONFIG['OS_TARGET'] == 'Darwin':
     # because somehow clang doesn't want to accept the __thread keyword
     # for TLS.
     LDFLAGS += ['-Wl,-bind_at_load']
 
 if CONFIG['MOZ_LINKER'] and CONFIG['CPU_ARCH'] == 'arm':
     LDFLAGS += ['-Wl,-version-script,%s/arm-eabi-filter' % SRCDIR]
 
 DIST_INSTALL = True
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/mozglue/tests/gtest/InjectorDLL/moz.build
+++ b/mozglue/tests/gtest/InjectorDLL/moz.build
@@ -8,8 +8,11 @@ DIST_INSTALL = False
 SharedLibrary('InjectorDLL')
 
 UNIFIED_SOURCES = [
     'InjectorDLL.cpp',
 ]
 
 if CONFIG['COMPILE_ENVIRONMENT']:
     TEST_HARNESS_FILES.gtest += ['!InjectorDLL.dll']
+
+if CONFIG['MOZ_PGO'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/mozglue/tests/interceptor/moz.build
+++ b/mozglue/tests/interceptor/moz.build
@@ -16,8 +16,11 @@ OS_LIBS += [
     'ole32',
 ]
 
 if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CC_TYPE'] == 'gcc':
     # This allows us to use wmain as the entry point on mingw
     LDFLAGS += [
         '-municode',
     ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/netwerk/base/moz.build
+++ b/netwerk/base/moz.build
@@ -301,8 +301,11 @@ LOCAL_INCLUDES += [
     '/dom/base',
     '/netwerk/protocol/http',
     '/netwerk/socket',
     '/security/pkix/include'
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/netwerk/base/nsChannelClassifier.cpp
+++ b/netwerk/base/nsChannelClassifier.cpp
@@ -37,16 +37,17 @@
 #include "nsIUrlClassifierDBService.h"
 #include "nsIURLFormatter.h"
 
 #include "mozilla/ErrorNames.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/net/HttpBaseChannel.h"
 #include "mozilla/ClearOnShutdown.h"
+#include "mozilla/Services.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/Unused.h"
 
 namespace mozilla {
 namespace net {
 
 //
 // MOZ_LOG=nsChannelClassifier:5
@@ -359,21 +360,23 @@ nsChannelClassifier::ShouldEnableTrackin
                                                          bool *result)
 {
     // Should only be called in the parent process.
     MOZ_ASSERT(XRE_IsParentProcess());
 
     NS_ENSURE_ARG(result);
     *result = false;
 
+    nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
+      services::GetThirdPartyUtil();
+    if (NS_WARN_IF(!thirdPartyUtil)) {
+      return NS_ERROR_FAILURE;
+    }
+
     nsresult rv;
-    nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
-        do_GetService(THIRDPARTYUTIL_CONTRACTID, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
     nsCOMPtr<nsIHttpChannelInternal> chan = do_QueryInterface(aChannel, &rv);
     if (NS_FAILED(rv) || !chan) {
       LOG(("nsChannelClassifier[%p]: Not an HTTP channel", this));
       return NS_OK;
     }
 
     nsCOMPtr<nsIURI> topWinURI;
     rv = chan->GetTopWindowURI(getter_AddRefs(topWinURI));
@@ -538,21 +541,23 @@ nsChannelClassifier::NotifyTrackingProte
     NS_QueryNotificationCallbacks(aChannel, parentChannel);
     if (parentChannel) {
       // This channel is a parent-process proxy for a child process request.
       // Tell the child process channel to do this instead.
       parentChannel->NotifyTrackingProtectionDisabled();
       return NS_OK;
     }
 
+    nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
+      services::GetThirdPartyUtil();
+    if (NS_WARN_IF(!thirdPartyUtil)) {
+      return NS_ERROR_FAILURE;
+    }
+
     nsresult rv;
-    nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
-        do_GetService(THIRDPARTYUTIL_CONTRACTID, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
     nsCOMPtr<mozIDOMWindowProxy> win;
     rv = thirdPartyUtil->GetTopWindowForChannel(aChannel, getter_AddRefs(win));
     NS_ENSURE_SUCCESS(rv, rv);
 
     auto* pwin = nsPIDOMWindowOuter::From(win);
     nsCOMPtr<nsIDocShell> docShell = pwin->GetDocShell();
     if (!docShell) {
       return NS_OK;
@@ -842,20 +847,23 @@ nsChannelClassifier::SetBlockedContent(n
   nsresult rv;
   nsCOMPtr<nsIClassifiedChannel> classifiedChannel = do_QueryInterface(channel, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (classifiedChannel) {
     classifiedChannel->SetMatchedInfo(aList, aProvider, aFullHash);
   }
 
+  nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
+    services::GetThirdPartyUtil();
+  if (NS_WARN_IF(!thirdPartyUtil)) {
+    return NS_OK;
+  }
+
   nsCOMPtr<mozIDOMWindowProxy> win;
-  nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
-    do_GetService(THIRDPARTYUTIL_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, NS_OK);
   rv = thirdPartyUtil->GetTopWindowForChannel(channel, getter_AddRefs(win));
   NS_ENSURE_SUCCESS(rv, NS_OK);
   auto* pwin = nsPIDOMWindowOuter::From(win);
   nsCOMPtr<nsIDocShell> docShell = pwin->GetDocShell();
   if (!docShell) {
     return NS_OK;
   }
   nsCOMPtr<nsIDocument> doc = docShell->GetDocument();
@@ -1199,17 +1207,25 @@ TrackingURICallback::OnTrackerFound(nsre
     // Even with TP disabled, we still want to show the user that there
     // are unblocked trackers on the site, so notify the UI that we loaded
     // tracking content. UI code can treat this notification differently
     // depending on whether TP is enabled or disabled.
     mChannelClassifier->NotifyTrackingProtectionDisabled(channel);
 
     SetIsTrackingResourceHelper(channel);
     if (CachedPrefs::GetInstance()->IsLowerNetworkPriority()) {
-      LowerPriorityHelper(channel);
+      nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
+        services::GetThirdPartyUtil();
+      bool result = false;
+      if (thirdPartyUtil &&
+          NS_SUCCEEDED(thirdPartyUtil->IsThirdPartyChannel(channel, nullptr,
+                                                           &result)) &&
+          result) {
+        LowerPriorityHelper(channel);
+      }
     }
   }
 }
 
 } // end of unnamed namespace/
 
 nsresult
 nsChannelClassifier::CreateWhiteListURI(nsIURI** aURI) const
--- a/netwerk/cookie/moz.build
+++ b/netwerk/cookie/moz.build
@@ -50,8 +50,11 @@ IPDL_SOURCES = [
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/netwerk/protocol/http/moz.build
+++ b/netwerk/protocol/http/moz.build
@@ -138,8 +138,11 @@ if CONFIG['OS_TARGET'] == 'Darwin':
     if not CONFIG['HOST_MAJOR_VERSION']:
         DEFINES.update(
             HAS_CONNECTX=True,
         )
     elif CONFIG['HOST_MAJOR_VERSION'] >= '15':
         DEFINES.update(
             HAS_CONNECTX=True,
         )
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -565,23 +565,31 @@ nsHttpChannel::Connect()
         return RedirectToInterceptedChannel();
     }
 
     bool isTrackingResource = mIsTrackingResource; // is atomic
     LOG(("nsHttpChannel %p tracking resource=%d, cos=%u",
           this, isTrackingResource, mClassOfService));
 
     if (isTrackingResource) {
-        if (CheckFastBlocked()) {
-            Unused << AsyncAbort(NS_ERROR_ABORT);
-            CloseCacheEntry(false);
-            return NS_OK;
-        }
-
-        AddClassFlags(nsIClassOfService::Tail);
+        nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
+          services::GetThirdPartyUtil();
+        bool result = false;
+        if (thirdPartyUtil &&
+            NS_SUCCEEDED(thirdPartyUtil->IsThirdPartyChannel(this, nullptr,
+                                                             &result)) &&
+            result) {
+            if (CheckFastBlocked()) {
+                Unused << AsyncAbort(NS_ERROR_ABORT);
+                CloseCacheEntry(false);
+                return NS_OK;
+            }
+
+            AddClassFlags(nsIClassOfService::Tail);
+        }
     }
 
     if (WaitingForTailUnblock()) {
         MOZ_DIAGNOSTIC_ASSERT(!mOnTailUnblock);
         mOnTailUnblock = &nsHttpChannel::ConnectOnTailUnblock;
         return NS_OK;
     }
 
@@ -2208,21 +2216,35 @@ nsHttpChannel::ProcessResponse()
     // not be a full URI (HttpBaseChannel::SetReferrer has the gorey details).
     // If that's null, though, we'll fall back to mReferrer just in case (this
     // is especially useful in xpcshell tests, where we don't have an actual
     // pageload to get a referrer from).
     nsCOMPtr<nsIURI> referrer = GetReferringPage();
     if (!referrer) {
         referrer = mReferrer;
     }
+
+    // We consider top-level tracking resource as non-tracking if not in 3rd
+    // party context.
+    bool isThirdPartyAndTrackingResource = false;
+    if(mIsTrackingResource) {
+        nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
+          services::GetThirdPartyUtil();
+        if (thirdPartyUtil) {
+            thirdPartyUtil->IsThirdPartyChannel(this, nullptr,
+                                                &isThirdPartyAndTrackingResource);
+        }
+    }
+
     if (referrer) {
         nsCOMPtr<nsILoadContextInfo> lci = GetLoadContextInfo(this);
         mozilla::net::Predictor::UpdateCacheability(referrer, mURI, httpStatus,
                                                     mRequestHead, mResponseHead,
-                                                    lci, mIsTrackingResource);
+                                                    lci,
+                                                    isThirdPartyAndTrackingResource);
     }
 
     // Only allow 407 (authentication required) to continue
     if (mTransaction && mTransaction->ProxyConnectFailed() && httpStatus != 407) {
         return ProcessFailedProxyConnect(httpStatus);
     }
 
     MOZ_ASSERT(!mCachedContentIsValid || mRaceCacheWithNetwork,
--- a/netwerk/protocol/http/nsIHttpChannel.idl
+++ b/netwerk/protocol/http/nsIHttpChannel.idl
@@ -474,16 +474,18 @@ interface nsIHttpChannel : nsIChannel
      */
     [must_use] attribute uint64_t topLevelContentWindowId;
 
     /**
      * Returns true if the channel has loaded a resource that is on the tracking
      * protection list.  This is only available if the
      * privacy.trackingprotection.annotate_channels pref is set and its value
      * should only be relied on after the channel has established a connection.
+     * Note that, if privacy.restrict3rdpartystorage.enabled pref is set, also
+     * top-level channels could be marked as tracking resource.
      */
     [infallible] readonly attribute boolean isTrackingResource;
 
     /**
      * This method is used in order to override the tracking status of an HTTP
      * channel.  This should only be called by Gecko under certain circumstances
      * when Gecko can guarantee that the channel classifier service will not be
      * determining the tracking status of the channel.
--- a/netwerk/test/unit/test_trackingProtection_annotateChannels.js
+++ b/netwerk/test/unit/test_trackingProtection_annotateChannels.js
@@ -21,30 +21,32 @@ ChromeUtils.import("resource://testing-c
 
 const runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
 if (runtime.processType == runtime.PROCESS_TYPE_DEFAULT) {
   do_get_profile();
 }
 
 const topWindowURI = NetUtil.newURI("http://www.example.com/");
 
-function listener(tracking, priority, nextTest) {
+function listener(tracking, priority, throttleable, nextTest) {
   this._tracking = tracking;
   this._priority = priority;
+  this._throttleable = throttleable;
   this._nextTest = nextTest;
 }
 listener.prototype = {
   onStartRequest: function(request, context) {
     Assert.equal(request.QueryInterface(Ci.nsIHttpChannel).isTrackingResource,
                  this._tracking);
     Assert.equal(request.QueryInterface(Ci.nsISupportsPriority).priority,
                  this._priority);
     if (runtime.processType == runtime.PROCESS_TYPE_DEFAULT && this._tracking) {
-      Assert.ok(request.QueryInterface(Ci.nsIClassOfService).classFlags &
-                Ci.nsIClassOfService.Throttleable);
+      Assert.equal(!!(request.QueryInterface(Ci.nsIClassOfService).classFlags &
+                       Ci.nsIClassOfService.Throttleable),
+                   this._throttleable);
     }
     request.cancel(Cr.NS_ERROR_ABORT);
     this._nextTest();
   },
   onDataAvailable: function(request, context, stream, offset, count) {
   },
   onStopRequest: function(request, context, status) {
   }
@@ -85,27 +87,39 @@ function setup_test() {
 
 function doPriorityTest() {
   if (!testPriorityMap.length) {
     runTests();
     return;
   }
 
   currentTest = testPriorityMap.shift();
-  var channel = makeChannel(currentTest.path);
+  var channel = makeChannel(currentTest.path, currentTest.loadingPrincipal);
   channel.asyncOpen2(new listener(currentTest.expectedTracking,
                                   currentTest.expectedPriority,
+                                  currentTest.expectedThrottleable,
                                   doPriorityTest));
 }
 
-function makeChannel(path) {
-  var chan = NetUtil.newChannel({
-    uri: path,
-    loadUsingSystemPrincipal: true
-  });
+function makeChannel(path, loadingPrincipal) {
+  var chan;
+
+  if (loadingPrincipal) {
+    chan = NetUtil.newChannel({
+      uri: path,
+      loadingPrincipal: loadingPrincipal,
+      securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
+      contentPolicyType: Ci.nsIContentPolicy.TYPE_OTHER,
+    });
+  } else {
+    chan = NetUtil.newChannel({
+      uri: path,
+      loadUsingSystemPrincipal: true,
+    });
+  }
   chan.QueryInterface(Ci.nsIHttpChannel);
   chan.requestMethod = "GET";
   chan.loadFlags |= Ci.nsIChannel.LOAD_CLASSIFY_URI;
   chan.QueryInterface(Ci.nsIHttpChannelInternal).setTopWindowURIIfUnknown(topWindowURI);
   return chan;
 }
 
 var tests =[
@@ -132,32 +146,36 @@ var tests =[
     if (runtime.processType == runtime.PROCESS_TYPE_DEFAULT) {
       Services.prefs.setBoolPref("privacy.trackingprotection.annotate_channels", false);
       Services.prefs.setBoolPref("privacy.trackingprotection.lower_network_priority", false);
     }
     testPriorityMap = [
       {
         path: normalOrigin + "/innocent.css",
         expectedTracking: false,
-        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL,
+        expectedThrottleable: false,
       },
       {
         path: normalOrigin + "/innocent.js",
         expectedTracking: false,
-        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL,
+        expectedThrottleable: false,
       },
       {
         path: trackingOrigin + "/evil.css",
         expectedTracking: false,
-        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL,
+        expectedThrottleable: false,
       },
       {
         path: trackingOrigin + "/evil.js",
         expectedTracking: false,
-        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL,
+        expectedThrottleable: false,
       },
     ];
     // We add the doPriorityTest test here so that it only gets injected in the
     // test list if we're not skipping over this test.
     tests.unshift(doPriorityTest);
     runTests();
   },
 
@@ -166,36 +184,88 @@ var tests =[
     if (skipLowestPriority) {
       runTests();
       return;
     }
     if (runtime.processType == runtime.PROCESS_TYPE_DEFAULT) {
       Services.prefs.setBoolPref("privacy.trackingprotection.annotate_channels", true);
       Services.prefs.setBoolPref("privacy.trackingprotection.lower_network_priority", true);
     }
+    var principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(normalOrigin);
+    testPriorityMap = [
+      {
+        path: normalOrigin + "/innocent.css",
+        loadingPrincipal: principal,
+        expectedTracking: false,
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL,
+        expectedThrottleable: true,
+      },
+      {
+        path: normalOrigin + "/innocent.js",
+        loadingPrincipal: principal,
+        expectedTracking: false,
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL,
+        expectedThrottleable: true,
+      },
+      {
+        path: trackingOrigin + "/evil.css",
+        loadingPrincipal: principal,
+        expectedTracking: true,
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_LOWEST,
+        expectedThrottleable: true,
+      },
+      {
+        path: trackingOrigin + "/evil.js",
+        loadingPrincipal: principal,
+        expectedTracking: true,
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_LOWEST,
+        expectedThrottleable: true,
+      },
+    ];
+    // We add the doPriorityTest test here so that it only gets injected in the
+    // test list if we're not skipping over this test.
+    tests.unshift(doPriorityTest);
+    runTests();
+  },
+
+  // With the pref on, but not top-level requests, the priority of channel
+  // should be normal.
+  function setupTopLevelNormalPriority() {
+    if (skipLowestPriority) {
+      runTests();
+      return;
+    }
+    if (runtime.processType == runtime.PROCESS_TYPE_DEFAULT) {
+      Services.prefs.setBoolPref("privacy.trackingprotection.annotate_channels", true);
+      Services.prefs.setBoolPref("privacy.trackingprotection.lower_network_priority", true);
+    }
     testPriorityMap = [
       {
         path: normalOrigin + "/innocent.css",
         expectedTracking: false,
-        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL,
+        expectedThrottleable: false,
       },
       {
         path: normalOrigin + "/innocent.js",
         expectedTracking: false,
-        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL,
+        expectedThrottleable: false,
       },
       {
         path: trackingOrigin + "/evil.css",
         expectedTracking: true,
-        expectedPriority: Ci.nsISupportsPriority.PRIORITY_LOWEST
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL,
+        expectedThrottleable: false,
       },
       {
         path: trackingOrigin + "/evil.js",
         expectedTracking: true,
-        expectedPriority: Ci.nsISupportsPriority.PRIORITY_LOWEST
+        expectedPriority: Ci.nsISupportsPriority.PRIORITY_NORMAL,
+        expectedThrottleable: false,
       },
     ];
     // We add the doPriorityTest test here so that it only gets injected in the
     // test list if we're not skipping over this test.
     tests.unshift(doPriorityTest);
     runTests();
   },
 
--- a/netwerk/wifi/moz.build
+++ b/netwerk/wifi/moz.build
@@ -49,8 +49,11 @@ if CONFIG['NECKO_WIFI_DBUS']:
         'nsWifiScannerDBus.cpp',
     ]
     CXXFLAGS += ['-Wno-error=shadow']
 
 if CONFIG['NECKO_WIFI_DBUS']:
     CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/old-configure.in
+++ b/old-configure.in
@@ -1039,22 +1039,17 @@ case "$target" in
         fi
         # make 'foo == bar;' error out
         CFLAGS="$CFLAGS -we4553"
         CXXFLAGS="$CXXFLAGS -we4553"
         # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
         CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
         LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib"
         MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
-        # -Werror is disabled on clang-cl until bug 1090497 cleans up the noise.
-        if test -n "$CLANG_CL"; then
-            WARNINGS_AS_ERRORS=''
-        else
-            WARNINGS_AS_ERRORS='-WX'
-        fi
+        WARNINGS_AS_ERRORS='-WX'
         # Use a higher optimization level for clang-cl, so we can come closer
         # to MSVC's performance numbers (see bug 1443590).
         if test -n "$CLANG_CL"; then
             MOZ_OPTIMIZE_FLAGS='-O2'
         else
             MOZ_OPTIMIZE_FLAGS='-O1 -Oi'
         fi
         MOZ_FIX_LINK_PATHS=
--- a/security/certverifier/moz.build
+++ b/security/certverifier/moz.build
@@ -139,8 +139,11 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
     ]
 
     # Gecko headers aren't warning-free enough for us to enable these warnings.
     CXXFLAGS += [
         '-Wno-unused-parameter',
     ]
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/security/manager/ssl/moz.build
+++ b/security/manager/ssl/moz.build
@@ -214,8 +214,11 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
         # -Wextra enables this warning, but it's too noisy to be useful.
         '-Wno-missing-field-initializers',
     ]
 
     # Gecko headers aren't warning-free enough for us to enable these warnings.
     CXXFLAGS += [
         '-Wno-unused-parameter',
     ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/security/pkix/test/gtest/moz.build
+++ b/security/pkix/test/gtest/moz.build
@@ -65,8 +65,11 @@ elif CONFIG['CC_TYPE'] == 'msvc':
     '-wd4625', # copy constructor could not be generated.
     '-wd4626', # assugment operator could not be generated.
     '-wd4640', # construction of local static object is not thread safe.
 
     # This is intended as a temporary hack to support building with VS2015.
     # declaration of '*' hides class member
     '-wd4458',
   ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/security/pkix/warnings.mozbuild
+++ b/security/pkix/warnings.mozbuild
@@ -5,16 +5,18 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang
     '-Wno-c++98-compat',
     '-Wno-c++98-compat-pedantic',
     '-Wno-missing-prototypes',
     '-Wno-missing-variable-declarations',
     '-Wno-padded',
     '-Wno-reserved-id-macro', # NSPR and NSS use reserved IDs in their include guards.
     '-Wno-weak-vtables', # We rely on the linker to merge the duplicate vtables.
   ]
+  if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
 elif CONFIG['CC_TYPE'] == 'msvc':
   CXXFLAGS += [
     '-sdl', # Enable additional security checks based on Microsoft's SDL.
 
     '-Wall',
 
     '-wd4464', # relative include path contains '..'
     '-wd4514', # 'function': unreferenced inline function has been removed
--- a/security/sandbox/moz.build
+++ b/security/sandbox/moz.build
@@ -173,8 +173,11 @@ elif CONFIG['OS_ARCH'] == 'WINNT':
         CXXFLAGS += [
             '-wd4275', # non dll-interface class exception used as base for dll-interface class
             '-wd4717', # recursive on all control paths, function will cause runtime stack overflow
             '-wd4996', # 'GetVersionExW': was declared deprecated
             '-wd4302', # 'reinterpret_cast': truncation from 'LPCSTR' to 'WORD'
             '-wd4311', # 'reinterpret_cast': pointer truncation from 'LPOVERLAPPED' to 'DWORD'
             '-wd4312', # 'reinterpret_cast': conversion from 'DWORD' to 'LPOVERLAPPED' of greater size
         ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/security/sandbox/win/src/sandboxbroker/moz.build
+++ b/security/sandbox/win/src/sandboxbroker/moz.build
@@ -14,8 +14,11 @@ EXPORTS += [
 
 for var in ('UNICODE', '_UNICODE'):
     DEFINES[var] = True
 
 LOCAL_INCLUDES += ['/security/sandbox/chromium-shim']
 LOCAL_INCLUDES += ['/security/sandbox/chromium']
 
 FINAL_LIBRARY = 'xul'
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/servo/components/style/gecko/pseudo_element_definition.mako.rs
+++ b/servo/components/style/gecko/pseudo_element_definition.mako.rs
@@ -107,17 +107,21 @@ impl PseudoElement {
 
     /// Gets the flags associated to this pseudo-element, or 0 if it's an
     /// anonymous box.
     pub fn flags(&self) -> u32 {
         match *self {
             % for pseudo in PSEUDOS:
                 ${pseudo_element_variant(pseudo)} =>
                 % if pseudo.is_tree_pseudo_element():
-                    0,
+                    if unsafe { structs::StaticPrefs_sVarCache_layout_css_xul_tree_pseudos_content_enabled } {
+                        0
+                    } else {
+                        structs::CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS_AND_CHROME
+                    },
                 % elif pseudo.is_anon_box():
                     structs::CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS,
                 % else:
                     structs::SERVO_CSS_PSEUDO_ELEMENT_FLAGS_${pseudo.original_ident},
                 % endif
             % endfor
         }
     }
--- a/servo/components/style/gecko/selector_parser.rs
+++ b/servo/components/style/gecko/selector_parser.rs
@@ -483,17 +483,19 @@ impl<'a, 'i> ::selectors::Parser<'i> for
                         kind: BasicParseErrorKind::EndOfInput,
                         ..
                     }) => break,
                     _ => unreachable!("Parser::next() shouldn't return any other error"),
                 }
             }
             let args = args.into_boxed_slice();
             if let Some(pseudo) = PseudoElement::tree_pseudo_element(&name, args) {
-                return Ok(pseudo);
+                if self.is_pseudo_element_enabled(&pseudo) {
+                    return Ok(pseudo);
+                }
             }
         }
         Err(
             parser.new_custom_error(SelectorParseErrorKind::UnsupportedPseudoClassOrElement(
                 name,
             )),
         )
     }
--- a/testing/tools/fileid/moz.build
+++ b/testing/tools/fileid/moz.build
@@ -33,8 +33,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
 if CONFIG['OS_ARCH'] == 'Linux' or CONFIG['OS_ARCH'] == 'Darwin':
     USE_LIBS += [
         'breakpad_common_s',
     ]
     LOCAL_INCLUDES += [
         '/toolkit/crashreporter/google-breakpad/src',
     ]
 
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/testing/tools/minidumpwriter/moz.build
+++ b/testing/tools/minidumpwriter/moz.build
@@ -12,8 +12,11 @@ if CONFIG['ENABLE_TESTS'] and CONFIG['CP
     SOURCES += [
         'minidumpwriter.cpp',
     ]
     USE_STATIC_LIBS = True
     if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
         WIN32_EXE_LDFLAGS += ['-municode']
 
 NO_PGO = True
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
deleted file mode 100644
--- a/testing/web-platform/meta/navigation-timing/nav2_test_attributes_values.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[nav2_test_attributes_values.html]
-  [Performance navigation timing instance's value is reasonable.]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/navigation-timing/test_navigation_type_reload.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[test_navigation_type_reload.html]
-  disabled:
-    if os == "mac": bug 1155555
deleted file mode 100644
--- a/testing/web-platform/meta/navigation-timing/test_performance_attributes.sub.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[test_performance_attributes.sub.html]
-  disabled:
-    if verify and (os == "win"): fails in verify mode
deleted file mode 100644
--- a/testing/web-platform/meta/navigation-timing/test_timing_reload.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[test_timing_reload.html]
-  disabled:
-    if os == "mac": bug 1171916
deleted file mode 100644
--- a/testing/web-platform/meta/navigation-timing/test_timing_xserver_redirect.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[test_timing_xserver_redirect.html]
-  disabled:
-    if (os == "mac") and (version == "OS X 10.10"): https://bugzilla.mozilla.org/show_bug.cgi?id=1172135
deleted file mode 100644
--- a/testing/web-platform/meta/server-timing/test_server_timing.https.html.ini
+++ /dev/null
@@ -1,13 +0,0 @@
-[test_server_timing.https.html]
-  [Untitled]
-    expected: FAIL
-
-  [Entry {"duration":1.1,"name":"metric1","description":"document"} could not be found.]
-    expected: FAIL
-
-  [Entry {"duration":1.2,"name":"metric1","description":"document"} could not be found.]
-    expected: FAIL
-
-  [test_server_timing]
-    expected: FAIL
-
--- a/toolkit/components/build/moz.build
+++ b/toolkit/components/build/moz.build
@@ -32,8 +32,11 @@ LOCAL_INCLUDES += [
     '../typeaheadfind',
     '../url-classifier',
 ]
 
 if not CONFIG['MOZ_DISABLE_PARENTAL_CONTROLS']:
     LOCAL_INCLUDES += [
         '../parentalcontrols',
     ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/components/extensions/moz.build
+++ b/toolkit/components/extensions/moz.build
@@ -93,8 +93,11 @@ XPCSHELL_TESTS_MANIFESTS += [
 ]
 
 SPHINX_TREES['webextensions'] = 'docs'
 
 with Files('docs/**'):
     SCHEDULES.exclusive = ['docs']
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/components/jsoncpp/src/lib_json/moz.build
+++ b/toolkit/components/jsoncpp/src/lib_json/moz.build
@@ -46,8 +46,11 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang
     CXXFLAGS += [
         '-Wno-c++11-narrowing',
     ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl', 'gcc'):
     CXXFLAGS += [
         '-Wno-implicit-fallthrough',
     ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/components/maintenanceservice/moz.build
+++ b/toolkit/components/maintenanceservice/moz.build
@@ -42,8 +42,11 @@ DisableStlWrapping()
 OS_LIBS += [
     'comctl32',
     'ws2_32',
     'shell32',
 ]
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Application Update')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/components/osfile/moz.build
+++ b/toolkit/components/osfile/moz.build
@@ -28,8 +28,12 @@ EXPORTS.mozilla += [
 EXTRA_JS_MODULES += [
     'osfile.jsm',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'OS.File')
+
+if (not CONFIG['HAVE_64BIT_BUILD'] and
+    CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl'):
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/components/reputationservice/moz.build
+++ b/toolkit/components/reputationservice/moz.build
@@ -37,8 +37,11 @@ LOCAL_INCLUDES += [
 
 DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
 DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-shadow']
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/components/telemetry/pingsender/moz.build
+++ b/toolkit/components/telemetry/pingsender/moz.build
@@ -31,8 +31,11 @@ else:
     UNIFIED_SOURCES += [
         'pingsender_unix_common.cpp',
     ]
 
 
 # Don't use the STL wrappers; we don't link with -lmozalloc, and it really
 # doesn't matter here anyway.
 DisableStlWrapping()
+
+if CONFIG['MOZ_DEBUG'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/components/url-classifier/moz.build
+++ b/toolkit/components/url-classifier/moz.build
@@ -93,8 +93,11 @@ if CONFIG['NIGHTLY_BUILD'] or CONFIG['MO
     DEFINES['MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES'] = True
 
 SPHINX_TREES['url-classifier'] = 'docs'
 
 with Files('docs/**'):
     SCHEDULES.exclusive = ['docs']
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/components/url-classifier/tests/gtest/moz.build
+++ b/toolkit/components/url-classifier/tests/gtest/moz.build
@@ -31,8 +31,11 @@ UNIFIED_SOURCES += [
 ]
 
 # Required to have the same MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
 # as non-testing code.
 if CONFIG['NIGHTLY_BUILD'] or CONFIG['MOZ_DEBUG']:
     DEFINES['MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES'] = True
 
 FINAL_LIBRARY = 'xul-gtest'
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/crashreporter/client/moz.build
+++ b/toolkit/crashreporter/client/moz.build
@@ -93,8 +93,11 @@ DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG[
 
 RCINCLUDE = 'crashreporter.rc'
 
 # Don't use the STL wrappers in the crashreporter clients; they don't
 # link with -lmozalloc, and it really doesn't matter here anyway.
 DisableStlWrapping()
 
 include('/toolkit/crashreporter/crashreporter.mozbuild')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/crashreporter/google-breakpad/src/processor/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/processor/moz.build
@@ -56,8 +56,11 @@ UNIFIED_SOURCES += [
 DEFINES['BPLOG_MINIMUM_SEVERITY'] = 'SEVERITY_ERROR'
 
 Library('breakpad_processor')
 
 # Don't use the STL wrappers in the crashreporter clients
 DisableStlWrapping()
 
 include('/toolkit/crashreporter/crashreporter.mozbuild')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/crashreporter/minidump-analyzer/moz.build
+++ b/toolkit/crashreporter/minidump-analyzer/moz.build
@@ -54,8 +54,11 @@ USE_LIBS += [
 LOCAL_INCLUDES += [
     '/toolkit/components/jsoncpp/include',
 ]
 
 if CONFIG['OS_TARGET'] != 'WINNT':
     DisableStlWrapping()
 
 include('/toolkit/crashreporter/crashreporter.mozbuild')
+
+if CONFIG['MOZ_PGO'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/crashreporter/moz.build
+++ b/toolkit/crashreporter/moz.build
@@ -123,8 +123,11 @@ if CONFIG['MOZ_CRASHREPORTER']:
 else:
     UNIFIED_SOURCES += [
         'nsDummyExceptionHandler.cpp',
     ]
 
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'Crash Reporting')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/crashreporter/test/moz.build
+++ b/toolkit/crashreporter/test/moz.build
@@ -53,8 +53,11 @@ TEST_HARNESS_FILES.xpcshell.toolkit.cras
 
 include('/toolkit/crashreporter/crashreporter.mozbuild')
 
 NO_PGO = True
 
 # Temporary workaround for an issue in upstream breakpad
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd4334']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
\ No newline at end of file
--- a/toolkit/mozapps/update/common/moz.build
+++ b/toolkit/mozapps/update/common/moz.build
@@ -45,8 +45,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
             'crypt32',
             'wintrust',
         ]
 
 SOURCES += [
     'readstrings.cpp',
     'updatecommon.cpp',
 ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/mozapps/update/updater/updater-common.build
+++ b/toolkit/mozapps/update/updater/updater-common.build
@@ -109,8 +109,10 @@ elif CONFIG['OS_ARCH'] == 'WINNT':
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     CXXFLAGS += CONFIG['TK_CFLAGS']
     OS_LIBS += CONFIG['TK_LIBS']
 
 if CONFIG['CC_TYPE'] == 'gcc':
     CXXFLAGS += ['-Wno-format-truncation']
 
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/system/windowsDHCPClient/moz.build
+++ b/toolkit/system/windowsDHCPClient/moz.build
@@ -10,9 +10,12 @@ with Files('**'):
 TEST_DIRS += ['tests/gtest']
 
 SOURCES += [
     'DHCPUtils.cpp',
     'nsWindowsDHCPClient.cpp',
     'WindowsNetworkFunctionsWrapper.cpp'
 ]
 
-FINAL_LIBRARY = 'xul'
\ No newline at end of file
+FINAL_LIBRARY = 'xul'
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/system/windowsDHCPClient/tests/gtest/moz.build
+++ b/toolkit/system/windowsDHCPClient/tests/gtest/moz.build
@@ -13,9 +13,12 @@ UNIFIED_SOURCES += [
 
 LOCAL_INCLUDES += [
     '/toolkit/system/windowsDHCPClient',
 ]
 
 FINAL_LIBRARY = 'xul-gtest'
 
 if CONFIG['GNU_CXX']:
-    CXXFLAGS += ['-Wshadow']
\ No newline at end of file
+    CXXFLAGS += ['-Wshadow']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -229,8 +229,11 @@ FINAL_TARGET_PP_FILES += [
     'platform.ini'
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
 
 if CONFIG['MOZ_IPDL_TESTS']:
     DEFINES['MOZ_IPDL_TESTS'] = True
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/toolkit/xre/test/win/moz.build
+++ b/toolkit/xre/test/win/moz.build
@@ -18,8 +18,11 @@ LOCAL_INCLUDES += [
 DisableStlWrapping()
 USE_STATIC_LIBS = True
 
 OS_LIBS += [
     'comctl32',
     'shell32',
     'ws2_32',
 ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -1774,18 +1774,18 @@ StreamMetaJSCustomObject(PSLockRef aLock
             aWriter.StringElement(NS_ConvertUTF16toUTF8(url.unwrap()).get());
           }
 
           aWriter.EndArray();
         }
       }
       aWriter.EndArray();
     }
+    aWriter.EndObject();
   }
-  aWriter.EndObject();
 }
 
 #if defined(GP_OS_android)
 static UniquePtr<ProfileBuffer>
 CollectJavaThreadProfileData()
 {
   // locked_profiler_start uses sample count is 1000 for Java thread.
   // This entry size is enough now, but we might have to estimate it
--- a/tools/profiler/moz.build
+++ b/tools/profiler/moz.build
@@ -148,8 +148,11 @@ MOCHITEST_CHROME_MANIFESTS += ['tests/ch
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += [
         '-Wno-error=shadow',
         '-Wno-ignored-qualifiers', # due to use of breakpad headers
     ]
 
 with Files('**'):
     BUG_COMPONENT = ('Core', 'Gecko Profiler')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/widget/windows/moz.build
+++ b/widget/windows/moz.build
@@ -161,8 +161,11 @@ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
 
 OS_LIBS += [
     'rpcrt4',
 ]
 
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # C5038: Suppress initializer list order warnings from wrl.h
     SOURCES['WindowsUIUtils.cpp'].flags += ['-wd5038']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/xpcom/base/moz.build
+++ b/xpcom/base/moz.build
@@ -212,8 +212,11 @@ FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '../build',
     '/dom/base',
     '/xpcom/ds',
 ]
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     CXXFLAGS += CONFIG['TK_CFLAGS']
+
+if CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/xpcom/glue/objs.mozbuild
+++ b/xpcom/glue/objs.mozbuild
@@ -14,8 +14,11 @@ xpcom_glue_src_cppsrcs = [
 ]
 
 xpcom_gluens_src_lcppsrcs = [
 ]
 
 xpcom_gluens_src_cppsrcs = [
     '/xpcom/glue/%s' % s for s in xpcom_gluens_src_lcppsrcs
 ]
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/xpcom/io/moz.build
+++ b/xpcom/io/moz.build
@@ -152,8 +152,11 @@ LOCAL_INCLUDES += [
     '../build',
 ]
 
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     # This is intended as a temporary hack to support building with VS2015.
     # '_snwprintf' : format string '%s' requires an argument of type 'wchar_t *',
     # but variadic argument 3 has type 'char16ptr_t'
     CXXFLAGS += ['-wd4477']
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/xpcom/threads/moz.build
+++ b/xpcom/threads/moz.build
@@ -114,8 +114,11 @@ LOCAL_INCLUDES += [
     '../build',
     '/caps',
     '/tools/profiler',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497
--- a/xpcom/windbgdlg/moz.build
+++ b/xpcom/windbgdlg/moz.build
@@ -2,8 +2,11 @@
 # 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/.
 
 SimplePrograms([
     'windbgdlg'
 ])
+
+if CONFIG['MOZ_DEBUG'] and CONFIG['CC_TYPE'] == 'clang-cl':
+    AllowCompilerWarnings()  # workaround for bug 1090497