Merge inbound to mozilla-central. a=merge
authorTiberius Oros <toros@mozilla.com>
Wed, 17 Jan 2018 23:48:10 +0200
changeset 453997 b7a651281314d6369658eeb58e3bb181cf95016f
parent 453996 3fb310e17608d482f88cc2d0084904c4bdee9079 (current diff)
parent 453988 6002f08576ab18bc099e7fcbdefbec04da23e3f7 (diff)
child 453998 0c5a115449a3e470307b83d92531c84c23382951
child 454039 b0af51b89b20b4db0fdb926e67c3817a01ad0843
child 454046 3dc3baec3fae36a0b2344436ebd5e147aba5dd6d
child 454074 f095d500e45453ae318c26097dc2258bdf48d084
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone59.0a1
first release with
nightly linux32
b7a651281314 / 59.0a1 / 20180117220327 / files
nightly linux64
b7a651281314 / 59.0a1 / 20180117220327 / files
nightly mac
b7a651281314 / 59.0a1 / 20180117220327 / files
nightly win32
b7a651281314 / 59.0a1 / 20180117220327 / files
nightly win64
b7a651281314 / 59.0a1 / 20180117220327 / 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
toolkit/components/telemetry/Histograms.json
--- 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.258
+Current extension version is: 2.0.274
 
-Taken from upstream commit: 5a52ee0a
+Taken from upstream commit: f774abc8
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -100,17 +100,17 @@ return /******/ (function(modules) { // 
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
-exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
+exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
 
 __w_pdfjs_require__(9);
 
 var _streams_polyfill = __w_pdfjs_require__(10);
 
 var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
 const NativeImageDecoding = {
   NONE: 'none',
@@ -892,19 +892,16 @@ function isString(v) {
   return typeof v === 'string';
 }
 function isArrayBuffer(v) {
   return typeof v === 'object' && v !== null && v.byteLength !== undefined;
 }
 function isSpace(ch) {
   return ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A;
 }
-function isNodeJS() {
-  return typeof process === 'object' && process + '' === '[object process]';
-}
 function createPromiseCapability() {
   var capability = {};
   capability.promise = new Promise(function (resolve, reject) {
     capability.resolve = resolve;
     capability.reject = reject;
   });
   return capability;
 }
@@ -1365,17 +1362,16 @@ exports.getLookupTableFactory = getLooku
 exports.getVerbosityLevel = getVerbosityLevel;
 exports.info = info;
 exports.isArrayBuffer = isArrayBuffer;
 exports.isBool = isBool;
 exports.isEmptyObj = isEmptyObj;
 exports.isNum = isNum;
 exports.isString = isString;
 exports.isSpace = isSpace;
-exports.isNodeJS = isNodeJS;
 exports.isSameOrigin = isSameOrigin;
 exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
 exports.isLittleEndian = isLittleEndian;
 exports.isEvalSupported = isEvalSupported;
 exports.loadJpegStream = loadJpegStream;
 exports.log2 = log2;
 exports.readInt8 = readInt8;
 exports.readUint16 = readUint16;
@@ -1931,17 +1927,17 @@ function getDocument(src) {
     });
   }).catch(task._capability.reject);
   return task;
 }
 function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
   if (worker.destroyed) {
     return Promise.reject(new Error('Worker was destroyed'));
   }
-  let apiVersion = '2.0.258';
+  let apiVersion = '2.0.274';
   source.disableRange = (0, _dom_utils.getDefaultSetting)('disableRange');
   source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
   source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
   if (pdfDataRangeTransport) {
     source.length = pdfDataRangeTransport.length;
     source.initialData = pdfDataRangeTransport.initialData;
   }
   return worker.messageHandler.sendWithPromise('GetDocRequest', {
@@ -3225,18 +3221,18 @@ var InternalRenderTask = function Intern
         }
       }
     }
   };
   return InternalRenderTask;
 }();
 var version, build;
 {
-  exports.version = version = '2.0.258';
-  exports.build = build = '5a52ee0a';
+  exports.version = version = '2.0.274';
+  exports.build = build = 'f774abc8';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
 exports.PDFDataRangeTransport = PDFDataRangeTransport;
 exports.PDFWorker = PDFWorker;
 exports.PDFDocumentProxy = PDFDocumentProxy;
 exports.PDFPageProxy = PDFPageProxy;
 exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass;
@@ -4600,31 +4596,37 @@ Object.defineProperty(exports, "__esModu
   value: true
 });
 exports.SVGGraphics = undefined;
 
 var _util = __w_pdfjs_require__(0);
 
 var _dom_utils = __w_pdfjs_require__(1);
 
+var _is_node = __w_pdfjs_require__(18);
+
+var _is_node2 = _interopRequireDefault(_is_node);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
 var SVGGraphics = function () {
   throw new Error('Not implemented: SVGGraphics');
 };
 ;
 exports.SVGGraphics = SVGGraphics;
 
 /***/ }),
 /* 8 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.0.258';
-var pdfjsBuild = '5a52ee0a';
+var pdfjsVersion = '2.0.274';
+var pdfjsBuild = 'f774abc8';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(12);
 var pdfjsDisplayAPI = __w_pdfjs_require__(3);
 var pdfjsDisplayTextLayer = __w_pdfjs_require__(6);
 var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(5);
 var pdfjsDisplayDOMUtils = __w_pdfjs_require__(1);
 var pdfjsDisplaySVG = __w_pdfjs_require__(7);
 ;
@@ -7736,18 +7738,18 @@ var _svg = __w_pdfjs_require__(7);
 
 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 if (!_global_scope2.default.PDFJS) {
   _global_scope2.default.PDFJS = {};
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '2.0.258';
-  PDFJS.build = '5a52ee0a';
+  PDFJS.version = '2.0.274';
+  PDFJS.build = 'f774abc8';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {
   (0, _util.setVerbosityLevel)(PDFJS.verbosity);
 }
 delete PDFJS.verbosity;
 Object.defineProperty(PDFJS, 'verbosity', {
   get() {
@@ -10679,11 +10681,22 @@ var WebGLUtils = function WebGLUtilsClos
       }
       smaskCache = null;
       figuresCache = null;
     }
   };
 }();
 exports.WebGLContext = WebGLContext;
 
+/***/ }),
+/* 18 */
+/***/ (function(module, exports, __w_pdfjs_require__) {
+
+"use strict";
+
+
+module.exports = function isNodeJS() {
+  return typeof process === 'object' && process + '' === '[object process]';
+};
+
 /***/ })
 /******/ ]);
 });
\ No newline at end of file
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -100,17 +100,17 @@ return /******/ (function(modules) { // 
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
-exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isNodeJS = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
+exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
 
 __w_pdfjs_require__(20);
 
 var _streams_polyfill = __w_pdfjs_require__(21);
 
 var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
 const NativeImageDecoding = {
   NONE: 'none',
@@ -892,19 +892,16 @@ function isString(v) {
   return typeof v === 'string';
 }
 function isArrayBuffer(v) {
   return typeof v === 'object' && v !== null && v.byteLength !== undefined;
 }
 function isSpace(ch) {
   return ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A;
 }
-function isNodeJS() {
-  return typeof process === 'object' && process + '' === '[object process]';
-}
 function createPromiseCapability() {
   var capability = {};
   capability.promise = new Promise(function (resolve, reject) {
     capability.resolve = resolve;
     capability.reject = reject;
   });
   return capability;
 }
@@ -1365,17 +1362,16 @@ exports.getLookupTableFactory = getLooku
 exports.getVerbosityLevel = getVerbosityLevel;
 exports.info = info;
 exports.isArrayBuffer = isArrayBuffer;
 exports.isBool = isBool;
 exports.isEmptyObj = isEmptyObj;
 exports.isNum = isNum;
 exports.isString = isString;
 exports.isSpace = isSpace;
-exports.isNodeJS = isNodeJS;
 exports.isSameOrigin = isSameOrigin;
 exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
 exports.isLittleEndian = isLittleEndian;
 exports.isEvalSupported = isEvalSupported;
 exports.loadJpegStream = loadJpegStream;
 exports.log2 = log2;
 exports.readInt8 = readInt8;
 exports.readUint16 = readUint16;
@@ -2800,41 +2796,45 @@ var ColorSpace = function ColorSpaceClos
         whitePoint = IR[1];
         blackPoint = IR[2];
         var range = IR[3];
         return new LabCS(whitePoint, blackPoint, range);
       default:
         throw new _util.FormatError(`Unknown colorspace name: ${name}`);
     }
   };
-  ColorSpace.parseToIR = function (cs, xref, res, pdfFunctionFactory) {
-    if ((0, _primitives.isName)(cs)) {
-      var colorSpaces = res.get('ColorSpace');
-      if ((0, _primitives.isDict)(colorSpaces)) {
-        var refcs = colorSpaces.get(cs.name);
-        if (refcs) {
-          cs = refcs;
-        }
-      }
-    }
+  ColorSpace.parseToIR = function (cs, xref, res = null, pdfFunctionFactory) {
     cs = xref.fetchIfRef(cs);
     if ((0, _primitives.isName)(cs)) {
       switch (cs.name) {
         case 'DeviceGray':
         case 'G':
           return 'DeviceGrayCS';
         case 'DeviceRGB':
         case 'RGB':
           return 'DeviceRgbCS';
         case 'DeviceCMYK':
         case 'CMYK':
           return 'DeviceCmykCS';
         case 'Pattern':
           return ['PatternCS', null];
         default:
+          if ((0, _primitives.isDict)(res)) {
+            let colorSpaces = res.get('ColorSpace');
+            if ((0, _primitives.isDict)(colorSpaces)) {
+              let resCS = colorSpaces.get(cs.name);
+              if (resCS) {
+                if ((0, _primitives.isName)(resCS)) {
+                  return ColorSpace.parseToIR(resCS, xref, res, pdfFunctionFactory);
+                }
+                cs = resCS;
+                break;
+              }
+            }
+          }
           throw new _util.FormatError(`unrecognized colorspace ${cs.name}`);
       }
     }
     if (Array.isArray(cs)) {
       var mode = xref.fetchIfRef(cs[0]).name;
       var numComps, params, alt, whitePoint, blackPoint, gamma;
       switch (mode) {
         case 'DeviceGray':
@@ -20779,18 +20779,18 @@ exports.PostScriptCompiler = PostScriptC
 
 /***/ }),
 /* 18 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.0.258';
-var pdfjsBuild = '5a52ee0a';
+var pdfjsVersion = '2.0.274';
+var pdfjsBuild = 'f774abc8';
 var pdfjsCoreWorker = __w_pdfjs_require__(19);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
 /***/ }),
 /* 19 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
@@ -20800,18 +20800,24 @@ Object.defineProperty(exports, "__esModu
   value: true
 });
 exports.WorkerMessageHandler = exports.WorkerTask = undefined;
 
 var _util = __w_pdfjs_require__(0);
 
 var _pdf_manager = __w_pdfjs_require__(23);
 
+var _is_node = __w_pdfjs_require__(44);
+
+var _is_node2 = _interopRequireDefault(_is_node);
+
 var _primitives = __w_pdfjs_require__(1);
 
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
 var WorkerTask = function WorkerTaskClosure() {
   function WorkerTask(name) {
     this.name = name;
     this.terminated = false;
     this._capability = (0, _util.createPromiseCapability)();
   }
   WorkerTask.prototype = {
     get finished() {
@@ -20975,17 +20981,17 @@ var WorkerMessageHandler = {
     });
   },
   createDocumentHandler(docParams, port) {
     var pdfManager;
     var terminated = false;
     var cancelXHRs = null;
     var WorkerTasks = [];
     let apiVersion = docParams.apiVersion;
-    let workerVersion = '2.0.258';
+    let workerVersion = '2.0.274';
     if (apiVersion !== null && 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 _util.MessageHandler(workerHandlerName, docId, port);
     handler.postMessageTransfers = docParams.postMessageTransfers;
@@ -21352,17 +21358,17 @@ var WorkerMessageHandler = {
     var handler = new _util.MessageHandler('worker', 'main', port);
     WorkerMessageHandler.setup(handler, port);
     handler.send('ready', null);
   }
 };
 function isMessagePort(maybePort) {
   return typeof maybePort.postMessage === 'function' && 'onmessage' in maybePort;
 }
-if (typeof window === 'undefined' && !(0, _util.isNodeJS)() && typeof self !== 'undefined' && isMessagePort(self)) {
+if (typeof window === 'undefined' && !(0, _is_node2.default)() && typeof self !== 'undefined' && isMessagePort(self)) {
   WorkerMessageHandler.initializeFromPort(self);
 }
 exports.WorkerTask = WorkerTask;
 exports.WorkerMessageHandler = WorkerMessageHandler;
 
 /***/ }),
 /* 20 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
@@ -29018,16 +29024,17 @@ var PartialEvaluator = function PartialE
       var softMask = dict.get('SMask', 'SM') || false;
       var mask = dict.get('Mask') || false;
       var SMALL_IMAGE_DIMENSIONS = 200;
       if (inline && !softMask && !mask && !(image instanceof _jpeg_stream.JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS) {
         let imageObj = new _image.PDFImage({
           xref: this.xref,
           res: resources,
           image,
+          isInline: inline,
           pdfFunctionFactory: this.pdfFunctionFactory
         });
         imgData = imageObj.createImageData(true);
         operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]);
         return;
       }
       var nativeImageDecoderSupport = this.options.nativeImageDecoderSupport;
       var objId = 'img_' + this.idFactory.createObjId();
@@ -29054,16 +29061,17 @@ var PartialEvaluator = function PartialE
           pdfFunctionFactory: this.pdfFunctionFactory
         });
       }
       _image.PDFImage.buildImage({
         handler: this.handler,
         xref: this.xref,
         res: resources,
         image,
+        isInline: inline,
         nativeDecoder: nativeImageDecoder,
         pdfFunctionFactory: this.pdfFunctionFactory
       }).then(imageObj => {
         var imgData = imageObj.createImageData(false);
         this.handler.send('obj', [objId, this.pageIndex, 'Image', imgData], [imgData.data.buffer]);
       }).catch(reason => {
         (0, _util.warn)('Unable to decode image: ' + reason);
         this.handler.send('obj', [objId, this.pageIndex, 'Image', null]);
@@ -40300,17 +40308,17 @@ var PDFImage = function PDFImageClosure(
       py = Math.floor(i * yRatio) * w1Scanline;
       for (j = 0; j < w2; j++) {
         oldIndex = py + xScaled[j];
         dest[newIndex++] = src[oldIndex];
       }
     }
     return dest;
   }
-  function PDFImage({ xref, res, image, smask = null, mask = null, isMask = false, pdfFunctionFactory }) {
+  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();
@@ -40354,17 +40362,18 @@ var PDFImage = function PDFImageClosure(
             break;
           case 4:
             colorSpace = _primitives.Name.get('DeviceCMYK');
             break;
           default:
             throw new Error(`JPX images with ${this.numComps} ` + 'color components not supported.');
         }
       }
-      this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, res, pdfFunctionFactory);
+      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;
     if (this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode) || isMask && !_colorspace.ColorSpace.isDefaultDecode(this.decode, 1))) {
       this.needsDecode = true;
       var max = (1 << bitsPerComponent) - 1;
       this.decodeCoefficients = [];
@@ -40376,39 +40385,41 @@ var PDFImage = function PDFImageClosure(
         this.decodeAddends[j] = max * dmin;
       }
     }
     if (smask) {
       this.smask = new PDFImage({
         xref,
         res,
         image: smask,
+        isInline,
         pdfFunctionFactory
       });
     } else if (mask) {
       if ((0, _primitives.isStream)(mask)) {
         var maskDict = mask.dict,
             imageMask = maskDict.get('ImageMask', 'IM');
         if (!imageMask) {
           (0, _util.warn)('Ignoring /Mask in image without /ImageMask.');
         } else {
           this.mask = new PDFImage({
             xref,
             res,
             image: mask,
+            isInline,
             isMask: true,
             pdfFunctionFactory
           });
         }
       } else {
         this.mask = mask;
       }
     }
   }
-  PDFImage.buildImage = function ({ handler, xref, res, image, nativeDecoder = null, pdfFunctionFactory }) {
+  PDFImage.buildImage = function ({ handler, xref, res, image, isInline = false, nativeDecoder = null, pdfFunctionFactory }) {
     var imagePromise = handleImageData(image, nativeDecoder);
     var smaskPromise;
     var maskPromise;
     var smask = image.dict.get('SMask');
     var mask = image.dict.get('Mask');
     if (smask) {
       smaskPromise = handleImageData(smask, nativeDecoder);
       maskPromise = Promise.resolve(null);
@@ -40427,16 +40438,17 @@ var PDFImage = function PDFImageClosure(
         maskPromise = Promise.resolve(null);
       }
     }
     return Promise.all([imagePromise, smaskPromise, maskPromise]).then(function ([imageData, smaskData, maskData]) {
       return new PDFImage({
         xref,
         res,
         image: imageData,
+        isInline,
         smask: smaskData,
         mask: maskData,
         pdfFunctionFactory
       });
     });
   };
   PDFImage.createMask = function ({ imgArray, width, height, imageIsFromDecodeStream, inverseDecode }) {
     var computedLength = (width + 7 >> 3) * height;
@@ -40758,11 +40770,22 @@ var PDFImage = function PDFImageClosure(
       this.image.forceRGB = !!forceRGB;
       return this.image.getBytes(length);
     }
   };
   return PDFImage;
 }();
 exports.PDFImage = PDFImage;
 
+/***/ }),
+/* 44 */
+/***/ (function(module, exports, __w_pdfjs_require__) {
+
+"use strict";
+
+
+module.exports = function isNodeJS() {
+  return typeof process === 'object' && process + '' === '[object process]';
+};
+
 /***/ })
 /******/ ]);
 });
\ No newline at end of file
--- a/browser/extensions/pdfjs/content/web/viewer.js
+++ b/browser/extensions/pdfjs/content/web/viewer.js
@@ -4476,16 +4476,19 @@ class PDFHistory {
         hash,
         page,
         rotation
       }, true);
       return;
     }
     let destination = state.destination;
     this._updateInternalState(destination, state.uid, true);
+    if (this._uid > this._maxUid) {
+      this._maxUid = this._uid;
+    }
     if (destination.rotation !== undefined) {
       this.initialRotation = destination.rotation;
     }
     if (destination.dest) {
       this.initialBookmark = JSON.stringify(destination.dest);
       this._destination.page = null;
     } else if (destination.hash) {
       this.initialBookmark = destination.hash;
@@ -4680,16 +4683,19 @@ class PDFHistory {
         name: 'hashchange',
         delay: HASH_CHANGE_TIMEOUT
       }).then(() => {
         this._blockHashChange--;
       });
     }
     let destination = state.destination;
     this._updateInternalState(destination, state.uid, true);
+    if (this._uid > this._maxUid) {
+      this._maxUid = this._uid;
+    }
     if ((0, _ui_utils.isValidRotation)(destination.rotation)) {
       this.linkService.rotation = destination.rotation;
     }
     if (destination.dest) {
       this.linkService.navigateTo(destination.dest);
     } else if (destination.hash) {
       this.linkService.setHash(destination.hash);
     } else if (destination.page) {
@@ -4699,17 +4705,17 @@ class PDFHistory {
       this._popStateInProgress = false;
     });
   }
   _bindEvents() {
     let { _boundEvents, eventBus } = this;
     _boundEvents.updateViewarea = this._updateViewarea.bind(this);
     _boundEvents.popState = this._popState.bind(this);
     _boundEvents.pageHide = evt => {
-      if (!this._destination) {
+      if (!this._destination || this._destination.temporary) {
         this._tryPushCurrentPosition();
       }
     };
     eventBus.on('updateviewarea', _boundEvents.updateViewarea);
     window.addEventListener('popstate', _boundEvents.popState);
     window.addEventListener('pagehide', _boundEvents.pageHide);
   }
 }
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_cspro.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_cspro.js
@@ -16,21 +16,21 @@ See Bug 1010953.
 
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf8,Web Console CSP report only test";
 const TEST_VIOLATION = "http://example.com/browser/devtools/client/webconsole/" +
                        "new-console-output/test/mochitest/test-cspro.html";
 const CSP_VIOLATION_MSG =
   "Content Security Policy: The page\u2019s settings blocked the loading of a resource " +
-  "at http://some.example.com/cspro.png (\u201cimg-src http://example.com\u201d).";
+  "at http://some.example.com/cspro.png (\u201cimg-src\u201d).";
 const CSP_REPORT_MSG =
   "Content Security Policy: The page\u2019s settings observed the loading of a " +
   "resource at http://some.example.com/cspro.js " +
-  "(\u201cscript-src http://example.com\u201d). A CSP report is being sent.";
+  "(\u201cscript-src\u201d). A CSP report is being sent.";
 
 add_task(async function () {
   let hud = await openNewTabAndConsole(TEST_URI);
 
   let onCspViolationMessage = waitForMessage(hud, CSP_VIOLATION_MSG, ".message.error");
   let onCspReportMessage = waitForMessage(hud, CSP_REPORT_MSG, ".message.error");
 
   info("Load a page with CSP warnings.");
--- a/devtools/client/webconsole/test/browser_webconsole_bug_1010953_cspro.js
+++ b/devtools/client/webconsole/test/browser_webconsole_bug_1010953_cspro.js
@@ -18,21 +18,21 @@ CSP_REPORT_MSG are confirmed to be found
 
 const TEST_URI = "data:text/html;charset=utf8,Web Console CSP report only " +
                  "test (bug 1010953)";
 const TEST_VIOLATION = "http://example.com/browser/devtools/client/" +
                        "webconsole/test/test_bug_1010953_cspro.html";
 const CSP_VIOLATION_MSG = "Content Security Policy: The page\u2019s settings " +
                           "blocked the loading of a resource at " +
                           "http://some.example.com/test.png " +
-                          "(\u201cimg-src http://example.com\u201d).";
+                          "(\u201cimg-src\u201d).";
 const CSP_REPORT_MSG = "Content Security Policy: The page\u2019s settings " +
                        "observed the loading of a resource at " +
                        "http://some.example.com/test_bug_1010953_cspro.js " +
-                       "(\u201cscript-src http://example.com\u201d). A CSP report is " +
+                       "(\u201cscript-src\u201d). A CSP report is " +
                        "being sent.";
 
 add_task(function* () {
   let { browser } = yield loadTab(TEST_URI);
 
   let hud = yield openConsole();
 
   hud.jsterm.clearOutput();
--- a/devtools/client/webconsole/test/browser_webconsole_bug_1247459_violation.js
+++ b/devtools/client/webconsole/test/browser_webconsole_bug_1247459_violation.js
@@ -8,18 +8,17 @@
 
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf8,Web Console CSP violation test";
 const TEST_VIOLATION = "https://example.com/browser/devtools/client/" +
                        "webconsole/test/test_bug_1247459_violation.html";
 const CSP_VIOLATION_MSG = "Content Security Policy: The page\u2019s settings " +
                           "blocked the loading of a resource at " +
-                          "http://some.example.com/test.png (\u201cimg-src " +
-                          "https://example.com\u201d).";
+                          "http://some.example.com/test.png (\u201cimg-src\u201d).";
 
 add_task(function* () {
   let { browser } = yield loadTab(TEST_URI);
 
   let hud = yield openConsole();
 
   hud.jsterm.clearOutput();
 
--- a/devtools/client/webconsole/test/browser_webconsole_bug_770099_violation.js
+++ b/devtools/client/webconsole/test/browser_webconsole_bug_770099_violation.js
@@ -7,18 +7,17 @@
 
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf8,Web Console CSP violation test";
 const TEST_VIOLATION = "https://example.com/browser/devtools/client/" +
                        "webconsole/test/test_bug_770099_violation.html";
 const CSP_VIOLATION_MSG = "Content Security Policy: The page\u2019s settings " +
                           "blocked the loading of a resource at " +
-                          "http://some.example.com/test.png (\u201cdefault-src " +
-                          "https://example.com\u201d).";
+                          "http://some.example.com/test.png (\u201cdefault-src\u201d).";
 
 add_task(function* () {
   let { browser } = yield loadTab(TEST_URI);
 
   let hud = yield openConsole();
 
   hud.jsterm.clearOutput();
 
--- a/dom/base/Selection.cpp
+++ b/dom/base/Selection.cpp
@@ -682,17 +682,17 @@ Selection::GetTableSelectionType(nsIDOMR
   if (!endNode) return NS_ERROR_FAILURE;
 
   // Not a single selected node
   if (startNode != endNode) return NS_OK;
 
   nsIContent* child = range->GetChildAtStartOffset();
 
   // Not a single selected node
-  if (!child || child != range->GetChildAtEndOffset()) {
+  if (!child || child->GetNextSibling() != range->GetChildAtEndOffset()) {
     return NS_OK;
   }
 
   nsIContent* startContent = static_cast<nsIContent*>(startNode);
   if (!(startNode->IsElement() && startContent->IsHTMLElement())) {
     // Implies a check for being an element; if we ever make this work
     // for non-HTML, need to keep checking for elements.
     return NS_OK;
--- a/dom/security/nsCSPContext.cpp
+++ b/dom/security/nsCSPContext.cpp
@@ -1,14 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include <string>
+#include <unordered_set>
+
 #include "nsCOMPtr.h"
 #include "nsContentPolicyUtils.h"
 #include "nsContentUtils.h"
 #include "nsCSPContext.h"
 #include "nsCSPParser.h"
 #include "nsCSPService.h"
 #include "nsError.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
@@ -59,16 +62,39 @@ GetCspContextLog()
   return gCspContextPRLog;
 }
 
 #define CSPCONTEXTLOG(args) MOZ_LOG(GetCspContextLog(), mozilla::LogLevel::Debug, args)
 #define CSPCONTEXTLOGENABLED() MOZ_LOG_TEST(GetCspContextLog(), mozilla::LogLevel::Debug)
 
 static const uint32_t CSP_CACHE_URI_CUTOFF_SIZE = 512;
 
+#ifdef DEBUG
+/**
+ * This function is only used for verification purposes within
+ * GatherSecurityPolicyViolationEventData.
+ */
+static bool
+ValidateDirectiveName(const nsAString& aDirective)
+{
+  static const auto directives = [] () {
+    std::unordered_set<std::string> directives;
+    constexpr size_t dirLen = sizeof(CSPStrDirectives) / sizeof(CSPStrDirectives[0]);
+    for (size_t i = 0; i < dirLen; ++i) {
+      directives.insert(CSPStrDirectives[i]);
+    }
+    return directives;
+  } ();
+
+  nsAutoString directive(aDirective);
+  auto itr = directives.find(NS_ConvertUTF16toUTF8(directive).get());
+  return itr != directives.end();
+}
+#endif // DEBUG
+
 /**
  * Creates a key for use in the ShouldLoad cache.
  * Looks like: <uri>!<nsIContentPolicy::LOAD_TYPE>
  */
 nsresult
 CreateCacheKey_Internal(nsIURI* aContentLocation,
                         nsContentPolicyType aContentType,
                         nsACString& outCacheKey)
@@ -864,16 +890,18 @@ nsCSPContext::GatherSecurityPolicyViolat
   uint32_t aViolatedPolicyIndex,
   nsAString& aSourceFile,
   nsAString& aScriptSample,
   uint32_t aLineNum,
   mozilla::dom::SecurityPolicyViolationEventInit& aViolationEventInit)
 {
   NS_ENSURE_ARG_MAX(aViolatedPolicyIndex, mPolicies.Length() - 1);
 
+  MOZ_ASSERT(ValidateDirectiveName(aViolatedDirective), "Invalid directive name");
+
   nsresult rv;
 
   // document-uri
   nsAutoCString reportDocumentURI;
   StripURIForReporting(mSelfURI, mSelfURI, reportDocumentURI);
   aViolationEventInit.mDocumentURI = NS_ConvertUTF8toUTF16(reportDocumentURI);
 
   // referrer
@@ -895,21 +923,24 @@ nsCSPContext::GatherSecurityPolicyViolat
     if (reportBlockedURI.IsEmpty()) {
       // this can happen for frame-ancestors violation where the violating
       // ancestor is cross-origin.
       NS_WARNING("No blocked URI (null aBlockedContentSource) for CSP violation report.");
     }
     aViolationEventInit.mBlockedURI = NS_ConvertUTF8toUTF16(reportBlockedURI);
   }
 
-  // violated-directive
-  aViolationEventInit.mViolatedDirective = aViolatedDirective;
+  // effective-directive
+  // The name of the policy directive that was violated.
+  aViolationEventInit.mEffectiveDirective = aViolatedDirective;
 
-  // effective-directive
-  aViolationEventInit.mEffectiveDirective = aViolatedDirective;
+  // violated-directive
+  // In CSP2, the policy directive that was violated, as it appears in the policy.
+  // In CSP3, the same as effective-directive.
+  aViolationEventInit.mViolatedDirective = aViolatedDirective;
 
   // original-policy
   nsAutoString originalPolicy;
   rv = this->GetPolicyString(aViolatedPolicyIndex, originalPolicy);
   NS_ENSURE_SUCCESS(rv, rv);
   aViolationEventInit.mOriginalPolicy = originalPolicy;
 
   // source-file
@@ -1211,28 +1242,31 @@ class CSPReportSenderRunnable final : pu
         mObserverSubject = do_QueryInterface(supportscstr);
       }
     }
 
     NS_IMETHOD Run() override
     {
       MOZ_ASSERT(NS_IsMainThread());
 
+      nsresult rv;
+
       // 0) prepare violation data
       mozilla::dom::SecurityPolicyViolationEventInit init;
-      mCSPContext->GatherSecurityPolicyViolationEventData(
+      rv = mCSPContext->GatherSecurityPolicyViolationEventData(
         mBlockedContentSource, mOriginalURI,
         mViolatedDirective, mViolatedPolicyIndex,
         mSourceFile, mScriptSample, mLineNum,
         init);
+      NS_ENSURE_SUCCESS(rv, rv);
 
       // 1) notify observers
       nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
       NS_ASSERTION(observerService, "needs observer service");
-      nsresult rv = observerService->NotifyObservers(mObserverSubject,
+      rv = observerService->NotifyObservers(mObserverSubject,
                                                      CSP_VIOLATION_TOPIC,
                                                      mViolatedDirective.get());
       NS_ENSURE_SUCCESS(rv, rv);
 
       // 2) send reports for the policy that was violated
       mCSPContext->SendReports(init, mViolatedPolicyIndex);
 
       // 3) log to console (one per policy violation)
--- a/dom/security/nsCSPUtils.cpp
+++ b/dom/security/nsCSPUtils.cpp
@@ -1241,16 +1241,22 @@ nsCSPDirective::visitSrcs(nsCSPSrcVisito
   return true;
 }
 
 bool nsCSPDirective::equals(CSPDirective aDirective) const
 {
   return (mDirective == aDirective);
 }
 
+void
+nsCSPDirective::getDirName(nsAString& outStr) const
+{
+  outStr.AppendASCII(CSP_CSPDirectiveToString(mDirective));
+}
+
 /* =============== nsCSPChildSrcDirective ============= */
 
 nsCSPChildSrcDirective::nsCSPChildSrcDirective(CSPDirective aDirective)
   : nsCSPDirective(aDirective)
   , mRestrictFrames(false)
   , mRestrictWorkers(false)
 {
 }
@@ -1326,16 +1332,23 @@ nsBlockAllMixedContentDirective::~nsBloc
 
 void
 nsBlockAllMixedContentDirective::toString(nsAString& outStr) const
 {
   outStr.AppendASCII(CSP_CSPDirectiveToString(
     nsIContentSecurityPolicy::BLOCK_ALL_MIXED_CONTENT));
 }
 
+void
+nsBlockAllMixedContentDirective::getDirName(nsAString& outStr) const
+{
+  outStr.AppendASCII(CSP_CSPDirectiveToString(
+    nsIContentSecurityPolicy::BLOCK_ALL_MIXED_CONTENT));
+}
+
 /* =============== nsUpgradeInsecureDirective ============= */
 
 nsUpgradeInsecureDirective::nsUpgradeInsecureDirective(CSPDirective aDirective)
 : nsCSPDirective(aDirective)
 {
 }
 
 nsUpgradeInsecureDirective::~nsUpgradeInsecureDirective()
@@ -1344,16 +1357,23 @@ nsUpgradeInsecureDirective::~nsUpgradeIn
 
 void
 nsUpgradeInsecureDirective::toString(nsAString& outStr) const
 {
   outStr.AppendASCII(CSP_CSPDirectiveToString(
     nsIContentSecurityPolicy::UPGRADE_IF_INSECURE_DIRECTIVE));
 }
 
+void
+nsUpgradeInsecureDirective::getDirName(nsAString& outStr) const
+{
+  outStr.AppendASCII(CSP_CSPDirectiveToString(
+    nsIContentSecurityPolicy::UPGRADE_IF_INSECURE_DIRECTIVE));
+}
+
 /* ===== nsRequireSRIForDirective ========================= */
 
 nsRequireSRIForDirective::nsRequireSRIForDirective(CSPDirective aDirective)
 : nsCSPDirective(aDirective)
 {
 }
 
 nsRequireSRIForDirective::~nsRequireSRIForDirective()
@@ -1395,16 +1415,23 @@ nsRequireSRIForDirective::restrictsConte
 bool
 nsRequireSRIForDirective::allows(enum CSPKeyword aKeyword, const nsAString& aHashOrNonce,
                                  bool aParserCreated) const
 {
   // can only disallow CSP_REQUIRE_SRI_FOR.
   return (aKeyword != CSP_REQUIRE_SRI_FOR);
 }
 
+void
+nsRequireSRIForDirective::getDirName(nsAString& outStr) const
+{
+  outStr.AppendASCII(CSP_CSPDirectiveToString(
+    nsIContentSecurityPolicy::REQUIRE_SRI_FOR));
+}
+
 /* ===== nsCSPPolicy ========================= */
 
 nsCSPPolicy::nsCSPPolicy()
   : mUpgradeInsecDir(nullptr)
   , mReportOnly(false)
 {
   CSPUTILSLOG(("nsCSPPolicy::nsCSPPolicy"));
 }
@@ -1448,32 +1475,32 @@ nsCSPPolicy::permits(CSPDirective aDir,
   nsCSPDirective* defaultDir = nullptr;
 
   // Try to find a relevant directive
   // These directive arrays are short (1-5 elements), not worth using a hashtable.
   for (uint32_t i = 0; i < mDirectives.Length(); i++) {
     if (mDirectives[i]->equals(aDir)) {
       if (!mDirectives[i]->permits(aUri, aNonce, aWasRedirected, mReportOnly,
                                    mUpgradeInsecDir, aParserCreated)) {
-        mDirectives[i]->toString(outViolatedDirective);
+        mDirectives[i]->getDirName(outViolatedDirective);
         return false;
       }
       return true;
     }
     if (mDirectives[i]->isDefaultDirective()) {
       defaultDir = mDirectives[i];
     }
   }
 
   // If the above loop runs through, we haven't found a matching directive.
   // Avoid relooping, just store the result of default-src while looping.
   if (!aSpecific && defaultDir) {
     if (!defaultDir->permits(aUri, aNonce, aWasRedirected, mReportOnly,
                              mUpgradeInsecDir, aParserCreated)) {
-      defaultDir->toString(outViolatedDirective);
+      defaultDir->getDirName(outViolatedDirective);
       return false;
     }
     return true;
   }
 
   // Nothing restricts this, so we're allowing the load
   // See bug 764937
   return true;
@@ -1590,27 +1617,27 @@ nsCSPPolicy::hasDirective(CSPDirective a
  */
 void
 nsCSPPolicy::getDirectiveStringForContentType(nsContentPolicyType aContentType,
                                               nsAString& outDirective) const
 {
   nsCSPDirective* defaultDir = nullptr;
   for (uint32_t i = 0; i < mDirectives.Length(); i++) {
     if (mDirectives[i]->restrictsContentType(aContentType)) {
-      mDirectives[i]->toString(outDirective);
+      mDirectives[i]->getDirName(outDirective);
       return;
     }
     if (mDirectives[i]->isDefaultDirective()) {
       defaultDir = mDirectives[i];
     }
   }
   // if we haven't found a matching directive yet,
   // the contentType must be restricted by the default directive
   if (defaultDir) {
-    defaultDir->toString(outDirective);
+    defaultDir->getDirName(outDirective);
     return;
   }
   NS_ASSERTION(false, "Can not query directive string for contentType!");
   outDirective.AppendASCII("couldNotQueryViolatedDirective");
 }
 
 void
 nsCSPPolicy::getDirectiveAsString(CSPDirective aDir, nsAString& outDirective) const
--- a/dom/security/nsCSPUtils.h
+++ b/dom/security/nsCSPUtils.h
@@ -466,16 +466,18 @@ class nsCSPDirective {
      { return mDirective == nsIContentSecurityPolicy::DEFAULT_SRC_DIRECTIVE; }
 
     virtual bool equals(CSPDirective aDirective) const;
 
     void getReportURIs(nsTArray<nsString> &outReportURIs) const;
 
     bool visitSrcs(nsCSPSrcVisitor* aVisitor) const;
 
+    virtual void getDirName(nsAString& outStr) const;
+
   protected:
     CSPDirective            mDirective;
     nsTArray<nsCSPBaseSrc*> mSrcs;
 };
 
 /* =============== nsCSPChildSrcDirective ============= */
 
 /*
@@ -544,16 +546,18 @@ class nsBlockAllMixedContentDirective : 
     bool allows(enum CSPKeyword aKeyword, const nsAString& aHashOrNonce,
                 bool aParserCreated) const override
       { return false; }
 
     void toString(nsAString& outStr) const override;
 
     void addSrcs(const nsTArray<nsCSPBaseSrc*>& aSrcs) override
       {  MOZ_ASSERT(false, "block-all-mixed-content does not hold any srcs"); }
+
+    void getDirName(nsAString& outStr) const override;
 };
 
 /* =============== nsUpgradeInsecureDirective === */
 
 /*
  * Upgrading insecure requests includes the following actors:
  * (1) CSP:
  *     The CSP implementation whitelists the http-request
@@ -597,16 +601,18 @@ class nsUpgradeInsecureDirective : publi
     bool allows(enum CSPKeyword aKeyword, const nsAString& aHashOrNonce,
                 bool aParserCreated) const override
       { return false; }
 
     void toString(nsAString& outStr) const override;
 
     void addSrcs(const nsTArray<nsCSPBaseSrc*>& aSrcs) override
       {  MOZ_ASSERT(false, "upgrade-insecure-requests does not hold any srcs"); }
+
+    void getDirName(nsAString& outStr) const override;
 };
 
 /* ===== nsRequireSRIForDirective ========================= */
 
 class nsRequireSRIForDirective : public nsCSPDirective {
   public:
     explicit nsRequireSRIForDirective(CSPDirective aDirective);
     ~nsRequireSRIForDirective();
@@ -614,16 +620,17 @@ class nsRequireSRIForDirective : public 
     void toString(nsAString& outStr) const override;
 
     void addType(nsContentPolicyType aType)
       { mTypes.AppendElement(aType); }
     bool hasType(nsContentPolicyType aType) const;
     bool restrictsContentType(nsContentPolicyType aType) const override;
     bool allows(enum CSPKeyword aKeyword, const nsAString& aHashOrNonce,
                 bool aParserCreated) const override;
+    void getDirName(nsAString& outStr) const override;
 
   private:
     nsTArray<nsContentPolicyType> mTypes;
 };
 
 /* =============== nsCSPPolicy ================== */
 
 class nsCSPPolicy {
--- a/dom/security/test/csp/test_frame_ancestors_ro.html
+++ b/dom/security/test/csp/test_frame_ancestors_ro.html
@@ -18,17 +18,17 @@ let testResults = {
 
 function checkResults(reportObj) {
   let cspReport = reportObj["csp-report"];
   is(cspReport["document-uri"], docUri, "Incorrect document-uri");
 
   // we can not test for the whole referrer since it includes platform specific information
   is(cspReport["referrer"], document.location.toString(), "Incorrect referrer");
   is(cspReport["blocked-uri"], document.location.toString(), "Incorrect blocked-uri");
-  is(cspReport["violated-directive"], "frame-ancestors 'none'", "Incorrect violated-directive");
+  is(cspReport["violated-directive"], "frame-ancestors", "Incorrect violated-directive");
   is(cspReport["original-policy"], "frame-ancestors 'none'; report-uri http://mochi.test:8888/foo.sjs", "Incorrect original-policy");
   testResults.reportFired = true;
 }
 
 let chromeScriptUrl = SimpleTest.getTestFileURL("file_report_chromescript.js");
 let script = SpecialPowers.loadChromeScript(chromeScriptUrl);
 
 script.addMessageListener('opening-request-completed', function ml(msg) {
--- a/dom/security/test/csp/test_report.html
+++ b/dom/security/test/csp/test_report.html
@@ -45,17 +45,17 @@ window.checkResults = function(reportObj
   is(cspReport["document-uri"], docUri, "Incorrect document-uri");
 
   // we can not test for the whole referrer since it includes platform specific information
   ok(cspReport["referrer"].startsWith("http://mochi.test:8888/tests/dom/security/test/csp/test_report.html"),
      "Incorrect referrer");
 
   is(cspReport["blocked-uri"], "self", "Incorrect blocked-uri");
 
-  is(cspReport["violated-directive"], "default-src 'none'", "Incorrect violated-directive");
+  is(cspReport["violated-directive"], "default-src", "Incorrect violated-directive");
 
   is(cspReport["original-policy"], "default-src 'none'; report-uri http://mochi.test:8888/foo.sjs",
      "Incorrect original-policy");
 
   is(cspReport["source-file"], docUri, "Incorrect source-file");
 
   is(cspReport["script-sample"], "\n    var foo = \"propEscFoo\";\n    var bar...",
      "Incorrect script-sample");
--- a/dom/security/test/csp/test_report_for_import.html
+++ b/dom/security/test/csp/test_report_for_import.html
@@ -45,17 +45,17 @@ function checkResults(reportStr) {
     var reportObj = JSON.parse(reportStr);
     var cspReport = reportObj["csp-report"];
 
     is(cspReport["document-uri"], DOC_URI, "Incorrect document-uri");
     is(cspReport["referrer"],
        "http://mochi.test:8888/tests/dom/security/test/csp/test_report_for_import.html",
        "Incorrect referrer");
     is(cspReport["violated-directive"],
-       "style-src http://mochi.test:8888",
+       "style-src",
        "Incorrect violated-directive");
     is(cspReport["original-policy"],
        "style-src http://mochi.test:8888; report-uri " +
        "http://mochi.test:8888/tests/dom/security/test/csp/file_report_for_import_server.sjs?report",
        "Incorrect original-policy");
     is(cspReport["blocked-uri"],
        "http://example.com",
        "Incorrect blocked-uri");
--- a/dom/security/test/csp/test_security_policy_violation_event.html
+++ b/dom/security/test/csp/test_security_policy_violation_event.html
@@ -6,14 +6,14 @@
 SimpleTest.waitForExplicitFinish();
 SpecialPowers.pushPrefEnv({
   set: [
     ["security.csp.enable_violation_events", true]
   ]
 });
 document.addEventListener("securitypolicyviolation", (e) => {
   SimpleTest.is(e.blockedURI, "http://mochi.test:8888/foo/bar.jpg", "blockedURI");
-  SimpleTest.todo_is(e.violatedDirective, "img-src", "violatedDirective")
+  SimpleTest.is(e.violatedDirective, "img-src", "violatedDirective")
   SimpleTest.is(e.originalPolicy, "img-src 'none'", "originalPolicy");
   SimpleTest.finish();
 });
 </script>
 <img src="http://mochi.test:8888/foo/bar.jpg">
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -1561,25 +1561,24 @@ public:
   static already_AddRefed<ScaledFont>
     CreateScaledFontForNativeFont(const NativeFont &aNativeFont,
                                   const RefPtr<UnscaledFont>& aUnscaledFont,
                                   Float aSize);
 
 #ifdef MOZ_WIDGET_GTK
   static already_AddRefed<ScaledFont>
     CreateScaledFontForFontconfigFont(cairo_scaled_font_t* aScaledFont, FcPattern* aPattern,
-                                      const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize,
-                                      bool aNeedsOblique = false);
+                                      const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize);
 #endif
 
 #ifdef XP_DARWIN
   static already_AddRefed<ScaledFont>
     CreateScaledFontForMacFont(CGFontRef aCGFont, const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize,
                                const Color& aFontSmoothingBackgroundColor, bool aUseFontSmoothing = true,
-                               bool aApplySyntheticBold = false, bool aNeedsOblique = false);
+                               bool aApplySyntheticBold = false);
 #endif
 
   /**
    * This creates a NativeFontResource from TrueType data.
    *
    * @param aData Pointer to the data
    * @param aSize Size of the TrueType data
    * @param aBackendType Type of the reference DrawTarget the font should be created for.
@@ -1735,17 +1734,16 @@ public:
 
   static already_AddRefed<ScaledFont>
     CreateScaledFontForDWriteFont(IDWriteFontFace* aFontFace,
                                   const gfxFontStyle* aStyle,
                                   const RefPtr<UnscaledFont>& aUnscaledFont,
                                   Float aSize,
                                   bool aUseEmbeddedBitmap,
                                   bool aForceGDIMode,
-                                  bool aNeedsOblique,
                                   IDWriteRenderingParams *aParams,
                                   Float aGamma,
                                   Float aContrast);
 
   static void UpdateSystemTextQuality();
 
 private:
   static StaticRefPtr<ID2D1Device> mD2D1Device;
--- a/gfx/2d/Factory.cpp
+++ b/gfx/2d/Factory.cpp
@@ -648,37 +648,35 @@ Factory::CreateScaledFontWithCairo(const
 #else
   return nullptr;
 #endif
 }
 
 #ifdef MOZ_WIDGET_GTK
 already_AddRefed<ScaledFont>
 Factory::CreateScaledFontForFontconfigFont(cairo_scaled_font_t* aScaledFont, FcPattern* aPattern,
-                                           const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize,
-                                           bool aNeedsOblique)
+                                           const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize)
 {
-  return MakeAndAddRef<ScaledFontFontconfig>(aScaledFont, aPattern, aUnscaledFont, aSize, aNeedsOblique);
+  return MakeAndAddRef<ScaledFontFontconfig>(aScaledFont, aPattern, aUnscaledFont, aSize);
 }
 #endif
 
 #ifdef XP_DARWIN
 already_AddRefed<ScaledFont>
 Factory::CreateScaledFontForMacFont(CGFontRef aCGFont,
                                     const RefPtr<UnscaledFont>& aUnscaledFont,
                                     Float aSize,
                                     const Color& aFontSmoothingBackgroundColor,
                                     bool aUseFontSmoothing,
-                                    bool aApplySyntheticBold,
-                                    bool aNeedsOblique)
+                                    bool aApplySyntheticBold)
 {
   return MakeAndAddRef<ScaledFontMac>(
     aCGFont, aUnscaledFont, aSize, false,
     aFontSmoothingBackgroundColor, aUseFontSmoothing,
-    aApplySyntheticBold, aNeedsOblique);
+    aApplySyntheticBold);
 }
 #endif
 
 already_AddRefed<DrawTarget>
 Factory::CreateDualDrawTarget(DrawTarget *targetA, DrawTarget *targetB)
 {
   MOZ_ASSERT(targetA && targetB);
 
@@ -947,23 +945,22 @@ Factory::D2DCleanup()
 
 already_AddRefed<ScaledFont>
 Factory::CreateScaledFontForDWriteFont(IDWriteFontFace* aFontFace,
                                        const gfxFontStyle* aStyle,
                                        const RefPtr<UnscaledFont>& aUnscaledFont,
                                        float aSize,
                                        bool aUseEmbeddedBitmap,
                                        bool aForceGDIMode,
-                                       bool aNeedsOblique,
                                        IDWriteRenderingParams* aParams,
                                        Float aGamma,
                                        Float aContrast)
 {
   return MakeAndAddRef<ScaledFontDWrite>(aFontFace, aUnscaledFont, aSize,
-                                         aUseEmbeddedBitmap, aForceGDIMode, aNeedsOblique,
+                                         aUseEmbeddedBitmap, aForceGDIMode,
                                          aParams, aGamma, aContrast,
                                          aStyle);
 }
 
 #endif // XP_WIN
 
 #ifdef USE_SKIA_GPU
 already_AddRefed<DrawTarget>
--- a/gfx/2d/ScaledFontDWrite.cpp
+++ b/gfx/2d/ScaledFontDWrite.cpp
@@ -105,26 +105,24 @@ DWriteFontStretchFromStretch(int16_t aSt
     }
 }
 
 ScaledFontDWrite::ScaledFontDWrite(IDWriteFontFace *aFontFace,
                                    const RefPtr<UnscaledFont>& aUnscaledFont,
                                    Float aSize,
                                    bool aUseEmbeddedBitmap,
                                    bool aForceGDIMode,
-                                   bool aNeedsOblique,
                                    IDWriteRenderingParams* aParams,
                                    Float aGamma,
                                    Float aContrast,
                                    const gfxFontStyle* aStyle)
     : ScaledFontBase(aUnscaledFont, aSize)
     , mFontFace(aFontFace)
     , mUseEmbeddedBitmap(aUseEmbeddedBitmap)
     , mForceGDIMode(aForceGDIMode)
-    , mNeedsOblique(aNeedsOblique)
     , mParams(aParams)
     , mGamma(aGamma)
     , mContrast(aContrast)
 {
   if (aStyle) {
     mStyle = SkFontStyle(aStyle->weight,
                          DWriteFontStretchFromStretch(aStyle->stretch),
                          aStyle->style == NS_FONT_STYLE_NORMAL ?
@@ -401,19 +399,16 @@ ScaledFontDWrite::GetWRFontInstanceOptio
     options.flags |= wr::FontInstanceFlags::SYNTHETIC_BOLD;
   }
   if (UseEmbeddedBitmaps()) {
     options.flags |= wr::FontInstanceFlags::EMBEDDED_BITMAPS;
   }
   if (ForceGDIMode()) {
     options.flags |= wr::FontInstanceFlags::FORCE_GDI;
   }
-  if (mNeedsOblique) {
-    options.flags |= wr::FontInstanceFlags::SYNTHETIC_ITALICS;
-  }
   options.bg_color = wr::ToColorU(Color());
   *aOutOptions = Some(options);
   return true;
 }
 
 already_AddRefed<ScaledFont>
 UnscaledFontDWrite::CreateScaledFont(Float aGlyphSize,
                                      const uint8_t* aInstanceData,
@@ -427,17 +422,16 @@ UnscaledFontDWrite::CreateScaledFont(Flo
   }
 
   const ScaledFontDWrite::InstanceData *instanceData =
     reinterpret_cast<const ScaledFontDWrite::InstanceData*>(aInstanceData);
   RefPtr<ScaledFontBase> scaledFont =
     new ScaledFontDWrite(mFontFace, this, aGlyphSize,
                          instanceData->mUseEmbeddedBitmap,
                          instanceData->mForceGDIMode,
-                         false,
                          nullptr,
                          instanceData->mGamma,
                          instanceData->mContrast);
 
   if (mNeedsCairo && !scaledFont->PopulateCairoScaledFont()) {
     gfxWarning() << "Unable to create cairo scaled font DWrite font.";
     return nullptr;
   }
--- a/gfx/2d/ScaledFontDWrite.h
+++ b/gfx/2d/ScaledFontDWrite.h
@@ -25,27 +25,25 @@ public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontDWrite, override)
   ScaledFontDWrite(IDWriteFontFace *aFont,
                    const RefPtr<UnscaledFont>& aUnscaledFont,
                    Float aSize)
     : ScaledFontBase(aUnscaledFont, aSize)
     , mFontFace(aFont)
     , mUseEmbeddedBitmap(false)
     , mForceGDIMode(false)
-    , mNeedsOblique(false)
     , mGamma(2.2f)
     , mContrast(1.0f)
   {}
 
   ScaledFontDWrite(IDWriteFontFace *aFontFace,
                    const RefPtr<UnscaledFont>& aUnscaledFont,
                    Float aSize,
                    bool aUseEmbeddedBitmap,
                    bool aForceGDIMode,
-                   bool aNeedsOblique,
                    IDWriteRenderingParams *aParams,
                    Float aGamma,
                    Float aContrast,
                    const gfxFontStyle* aStyle = nullptr);
 
   FontType GetType() const override { return FontType::DWRITE; }
 
   already_AddRefed<Path> GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget) override;
@@ -71,17 +69,16 @@ public:
 #ifdef USE_SKIA
   SkTypeface* GetSkTypeface() override;
   SkFontStyle mStyle;
 #endif
 
   RefPtr<IDWriteFontFace> mFontFace;
   bool mUseEmbeddedBitmap;
   bool mForceGDIMode;
-  bool mNeedsOblique;
   // DrawTargetD2D1 requires the IDWriteRenderingParams,
   // but we also separately need to store the gamma and contrast
   // since Skia needs to be able to access these without having
   // to use the full set of DWrite parameters (which would be
   // required to recreate an IDWriteRenderingParams) in a
   // DrawTargetRecording playback.
   RefPtr<IDWriteRenderingParams> mParams;
   Float mGamma;
--- a/gfx/2d/ScaledFontFontconfig.cpp
+++ b/gfx/2d/ScaledFontFontconfig.cpp
@@ -20,21 +20,19 @@ namespace gfx {
 
 // On Linux and Android our "platform" font is a cairo_scaled_font_t and we use
 // an SkFontHost implementation that allows Skia to render using this.
 // This is mainly because FT_Face is not good for sharing between libraries, which
 // is a requirement when we consider runtime switchable backends and so on
 ScaledFontFontconfig::ScaledFontFontconfig(cairo_scaled_font_t* aScaledFont,
                                            FcPattern* aPattern,
                                            const RefPtr<UnscaledFont>& aUnscaledFont,
-                                           Float aSize,
-                                           bool aNeedsOblique)
+                                           Float aSize)
   : ScaledFontBase(aUnscaledFont, aSize)
   , mPattern(aPattern)
-  , mNeedsOblique(aNeedsOblique)
 {
   SetCairoScaledFont(aScaledFont);
   FcPatternReference(aPattern);
 }
 
 ScaledFontFontconfig::~ScaledFontFontconfig()
 {
   FcPatternDestroy(mPattern);
@@ -245,20 +243,16 @@ ScaledFontFontconfig::GetWRFontInstanceO
   options.subpx_dir = wr::SubpixelDirection::Horizontal;
   options.flags = 0;
   options.bg_color = wr::ToColorU(Color());
 
   wr::FontInstancePlatformOptions platformOptions;
   platformOptions.lcd_filter = wr::FontLCDFilter::Legacy;
   platformOptions.hinting = wr::FontHinting::Normal;
 
-  if (mNeedsOblique) {
-    options.flags |= wr::FontInstanceFlags::SYNTHETIC_ITALICS;
-  }
-
   FcBool autohint;
   if (FcPatternGetBool(mPattern, FC_AUTOHINT, 0, &autohint) == FcResultMatch && autohint) {
     options.flags |= wr::FontInstanceFlags::FORCE_AUTOHINT;
   }
   FcBool embolden;
   if (FcPatternGetBool(mPattern, FC_EMBOLDEN, 0, &embolden) == FcResultMatch && embolden) {
     options.flags |= wr::FontInstanceFlags::SYNTHETIC_BOLD;
   }
--- a/gfx/2d/ScaledFontFontconfig.h
+++ b/gfx/2d/ScaledFontFontconfig.h
@@ -17,18 +17,17 @@ namespace gfx {
 class NativeFontResourceFontconfig;
 class UnscaledFontFontconfig;
 
 class ScaledFontFontconfig : public ScaledFontBase
 {
 public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontFontconfig, override)
   ScaledFontFontconfig(cairo_scaled_font_t* aScaledFont, FcPattern* aPattern,
-                       const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize,
-                       bool aNeedsOblique = false);
+                       const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize);
   ~ScaledFontFontconfig();
 
   FontType GetType() const override { return FontType::FONTCONFIG; }
 
 #ifdef USE_SKIA
   SkTypeface* GetSkTypeface() override;
 #endif
 
@@ -71,15 +70,14 @@ private:
 
   static already_AddRefed<ScaledFont>
     CreateFromInstanceData(const InstanceData& aInstanceData,
                            UnscaledFontFontconfig* aUnscaledFont,
                            Float aSize,
                            NativeFontResource* aNativeFontResource = nullptr);
 
   FcPattern* mPattern;
-  bool mNeedsOblique;
 };
 
 }
 }
 
 #endif /* MOZILLA_GFX_SCALEDFONTFONTCONFIG_H_ */
--- a/gfx/2d/ScaledFontMac.cpp
+++ b/gfx/2d/ScaledFontMac.cpp
@@ -106,24 +106,22 @@ CreateCTFontFromCGFontWithVariations(CGF
 }
 
 ScaledFontMac::ScaledFontMac(CGFontRef aFont,
                              const RefPtr<UnscaledFont>& aUnscaledFont,
                              Float aSize,
                              bool aOwnsFont,
                              const Color &aFontSmoothingBackgroundColor,
                              bool aUseFontSmoothing,
-                             bool aApplySyntheticBold,
-                             bool aNeedsOblique)
+                             bool aApplySyntheticBold)
   : ScaledFontBase(aUnscaledFont, aSize)
   , mFont(aFont)
   , mFontSmoothingBackgroundColor(aFontSmoothingBackgroundColor)
   , mUseFontSmoothing(aUseFontSmoothing)
   , mApplySyntheticBold(aApplySyntheticBold)
-  , mNeedsOblique(aNeedsOblique)
 {
   if (!sSymbolLookupDone) {
     CTFontDrawGlyphsPtr =
       (CTFontDrawGlyphsFuncT*)dlsym(RTLD_DEFAULT, "CTFontDrawGlyphs");
     sSymbolLookupDone = true;
   }
 
   if (!aOwnsFont) {
@@ -415,19 +413,16 @@ ScaledFontMac::GetWRFontInstanceOptions(
   options.subpx_dir = wr::SubpixelDirection::Horizontal;
   options.flags = 0;
   if (mUseFontSmoothing) {
     options.flags |= wr::FontInstanceFlags::FONT_SMOOTHING;
   }
   if (mApplySyntheticBold) {
     options.flags |= wr::FontInstanceFlags::SYNTHETIC_BOLD;
   }
-  if (mNeedsOblique) {
-    options.flags |= wr::FontInstanceFlags::SYNTHETIC_ITALICS;
-  }
   options.bg_color = wr::ToColorU(mFontSmoothingBackgroundColor);
   *aOutOptions = Some(options);
   return true;
 }
 
 static CFDictionaryRef
 CreateVariationDictionaryOrNull(CGFontRef aCGFont, uint32_t aVariationCount,
                                 const FontVariation* aVariations)
--- a/gfx/2d/ScaledFontMac.h
+++ b/gfx/2d/ScaledFontMac.h
@@ -24,18 +24,17 @@ namespace gfx {
 class ScaledFontMac : public ScaledFontBase
 {
 public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontMac, override)
   ScaledFontMac(CGFontRef aFont, const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize,
                 bool aOwnsFont = false,
                 const Color &aFontSmoothingBackgroundColor = Color(),
                 bool aUseFontSmoothing = true,
-                bool aApplySyntheticBold = false,
-                bool aNeedsOblique = false);
+                bool aApplySyntheticBold = false);
   ~ScaledFontMac();
 
   FontType GetType() const override { return FontType::MAC; }
 #ifdef USE_SKIA
   SkTypeface* GetSkTypeface() override;
 #endif
   already_AddRefed<Path> GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget) override;
 
@@ -55,17 +54,16 @@ public:
 
 private:
   friend class DrawTargetSkia;
   CGFontRef mFont;
   CTFontRef mCTFont; // only created if CTFontDrawGlyphs is available, otherwise null
   Color mFontSmoothingBackgroundColor;
   bool mUseFontSmoothing;
   bool mApplySyntheticBold;
-  bool mNeedsOblique;
 
   typedef void (CTFontDrawGlyphsFuncT)(CTFontRef,
                                        const CGGlyph[], const CGPoint[],
                                        size_t, CGContextRef);
 
   static bool sSymbolLookupDone;
 
 public:
--- a/gfx/tests/gtest/TestCompositor.cpp
+++ b/gfx/tests/gtest/TestCompositor.cpp
@@ -40,17 +40,17 @@ struct LayerManagerData {
     , mCompositor(compositor)
     , mCompositorWidget(aWidget)
     , mLayerManager(layerManager)
   {}
 };
 
 static already_AddRefed<Compositor> CreateTestCompositor(LayersBackend backend, widget::CompositorWidget* widget)
 {
-  gfxPrefs::GetSingleton();
+  gfxPlatform::GetPlatform();
 
   RefPtr<Compositor> compositor;
 
   if (backend == LayersBackend::LAYERS_OPENGL) {
     compositor = new CompositorOGL(nullptr,
                                    widget,
                                    gCompWidth,
                                    gCompHeight,
--- a/gfx/tests/gtest/TestTextureCompatibility.cpp
+++ b/gfx/tests/gtest/TestTextureCompatibility.cpp
@@ -49,17 +49,20 @@ CreateTextureWithBackend(LayersBackend& 
 
 /**
  * This will return the default list of backends that units test should run
  * against.
  */
 static void
 GetPlatformBackends(nsTArray<LayersBackend>& aBackends)
 {
-  gfxPlatform::GetPlatform()->GetCompositorBackends(
+  gfxPlatform* platform = gfxPlatform::GetPlatform();
+  MOZ_ASSERT(platform);
+
+  platform->GetCompositorBackends(
     gfxConfig::IsEnabled(Feature::HW_COMPOSITING), aBackends);
 
   if (aBackends.IsEmpty()) {
     aBackends.AppendElement(LayersBackend::LAYERS_BASIC);
   }
 }
 
 /**
--- a/gfx/thebes/gfxDWriteFonts.cpp
+++ b/gfx/thebes/gfxDWriteFonts.cpp
@@ -681,17 +681,16 @@ gfxDWriteFont::GetScaledFont(mozilla::gf
 
         const gfxFontStyle* fontStyle = GetStyle();
         mAzureScaledFont =
             Factory::CreateScaledFontForDWriteFont(mFontFace, fontStyle,
                                                    GetUnscaledFont(),
                                                    GetAdjustedSize(),
                                                    useEmbeddedBitmap,
                                                    forceGDI,
-                                                   IsSyntheticOblique(),
                                                    params,
                                                    params->GetGamma(),
                                                    params->GetEnhancedContrast());
         if (!mAzureScaledFont) {
             return nullptr;
         }
     }
 
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -1303,18 +1303,17 @@ gfxFontconfigFont::~gfxFontconfigFont()
 already_AddRefed<ScaledFont>
 gfxFontconfigFont::GetScaledFont(mozilla::gfx::DrawTarget *aTarget)
 {
     if (!mAzureScaledFont) {
         mAzureScaledFont =
             Factory::CreateScaledFontForFontconfigFont(GetCairoScaledFont(),
                                                        GetPattern(),
                                                        GetUnscaledFont(),
-                                                       GetAdjustedSize(),
-                                                       IsSyntheticOblique());
+                                                       GetAdjustedSize());
     }
 
     RefPtr<ScaledFont> scaledFont(mAzureScaledFont);
     return scaledFont.forget();
 }
 
 gfxFcPlatformFontList::gfxFcPlatformFontList()
     : mLocalNames(64)
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -1834,49 +1834,49 @@ gfxFont::DrawGlyphs(const gfxShapedText*
                     GlyphBufferAzure&        aBuffer)
 {
     float& inlineCoord = aBuffer.mFontParams.isVerticalFont ? aPt->y : aPt->x;
 
     const gfxShapedText::CompressedGlyph *glyphData =
         &aShapedText->GetCharacterGlyphs()[aOffset];
 
     if (S == SpacingT::HasSpacing) {
-        float space = aBuffer.mRunParams.spacing[0].mBefore;
-        inlineCoord += aBuffer.mRunParams.isRTL ? - space : space;
+        float space = aBuffer.mRunParams.spacing[0].mBefore * aBuffer.mFontParams.advanceDirection;
+        inlineCoord += space;
     }
 
     // Allocate buffer space for the run, assuming all simple glyphs.
     uint32_t capacityMult = 1 + aBuffer.mFontParams.extraStrikes;
     aBuffer.AddCapacity(capacityMult * aCount);
 
     bool emittedGlyphs = false;
 
     for (uint32_t i = 0; i < aCount; ++i, ++glyphData) {
         if (glyphData->IsSimpleGlyph()) {
-            float advance = glyphData->GetSimpleAdvance();
+            float advance = glyphData->GetSimpleAdvance() * aBuffer.mFontParams.advanceDirection;
             if (aBuffer.mRunParams.isRTL) {
-                inlineCoord -= advance;
+                inlineCoord += advance;
             }
             DrawOneGlyph<FC>(glyphData->GetSimpleGlyph(), *aPt, aBuffer,
                              &emittedGlyphs);
             if (!aBuffer.mRunParams.isRTL) {
                 inlineCoord += advance;
             }
         } else {
             uint32_t glyphCount = glyphData->GetGlyphCount();
             if (glyphCount > 0) {
                 // Add extra buffer capacity to allow for multiple-glyph entry.
                 aBuffer.AddCapacity(capacityMult * (glyphCount - 1));
                 const gfxShapedText::DetailedGlyph *details =
                     aShapedText->GetDetailedGlyphs(aOffset + i);
                 MOZ_ASSERT(details, "missing DetailedGlyph!");
                 for (uint32_t j = 0; j < glyphCount; ++j, ++details) {
-                    float advance = details->mAdvance;
+                    float advance = details->mAdvance * aBuffer.mFontParams.advanceDirection;
                     if (aBuffer.mRunParams.isRTL) {
-                        inlineCoord -= advance;
+                        inlineCoord += advance;
                     }
                     if (glyphData->IsMissing()) {
                         if (!DrawMissingGlyph(aBuffer.mRunParams,
                                               aBuffer.mFontParams,
                                               details, *aPt)) {
                             return false;
                         }
                     } else {
@@ -1891,17 +1891,18 @@ gfxFont::DrawGlyphs(const gfxShapedText*
             }
         }
 
         if (S == SpacingT::HasSpacing) {
             float space = aBuffer.mRunParams.spacing[i].mAfter;
             if (i + 1 < aCount) {
                 space += aBuffer.mRunParams.spacing[i + 1].mBefore;
             }
-            inlineCoord += aBuffer.mRunParams.isRTL ? -space : space;
+            space *= aBuffer.mFontParams.advanceDirection;
+            inlineCoord += space;
         }
     }
 
     return emittedGlyphs;
 }
 
 // Draw an individual glyph at a specific location.
 // *aPt is the glyph position in appUnits; it is converted to device
@@ -2009,17 +2010,17 @@ gfxFont::DrawMissingGlyph(const TextRunD
                  height, advanceDevUnits) :
             Rect(pt.x, pt.y - height,
                  advanceDevUnits, height);
 
         // If there's a fake-italic skew in effect as part
         // of the drawTarget's transform, we need to undo
         // this before drawing the hexbox. (Bug 983985)
         gfxContextMatrixAutoSaveRestore matrixRestore;
-        if (aFontParams.needsOblique && !aFontParams.isVerticalFont && !textDrawer) {
+        if (aFontParams.needsOblique && !textDrawer) {
             matrixRestore.SetContext(aRunParams.context);
             gfx::Matrix mat =
                 aRunParams.context->CurrentMatrix().
                 PreTranslate(pt).
                 PreMultiply(gfx::Matrix(1, 0, OBLIQUE_SKEW_FACTOR, 1, 0, 0)).
                 PreTranslate(-pt);
             aRunParams.context->SetMatrix(mat);
         }
@@ -2103,79 +2104,133 @@ gfxFont::Draw(const gfxTextRun *aTextRun
 
     if (fontParams.haveSVGGlyphs && textDrawer) {
         textDrawer->FoundUnsupportedFeature();
         return;
     }
 
     fontParams.haveColorGlyphs = GetFontEntry()->TryGetColorGlyphs();
     fontParams.contextPaint = aRunParams.runContextPaint;
-    fontParams.isVerticalFont =
-        aOrientation == gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_UPRIGHT;
-
-    bool sideways = false;
+
+    if (textDrawer) {
+        fontParams.isVerticalFont = aRunParams.isVerticalRun;
+    } else {
+        fontParams.isVerticalFont =
+            aOrientation == gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_UPRIGHT;
+    }
+
     gfxContextMatrixAutoSaveRestore matrixRestore;
-
+    layout::TextDrawTarget::AutoRestoreWRGlyphFlags glyphFlagsRestore;
+
+    // Save the current baseline offset for restoring later, in case it is modified.
+    float& baseline = fontParams.isVerticalFont ? aPt->x : aPt->y;
+    float origBaseline = baseline;
+
+    // The point may be advanced in local-space, while the resulting point on return
+    // must be advanced in transformed space. So save the original point so we can
+    // properly transform the advance later.
     gfx::Point origPt = *aPt;
-    if (aRunParams.isVerticalRun && !fontParams.isVerticalFont) {
-
+
+    // Default to advancing along the +X direction (-X if RTL).
+    fontParams.advanceDirection = aRunParams.isRTL ? -1.0f : 1.0f;
+    // Default to offsetting baseline downward along the +Y direction.
+    float baselineDir = 1.0f;
+    // The direction of sideways rotation, if applicable.
+    // -1 for rotating left/counter-clockwise
+    // 1 for rotating right/clockwise
+    // 0 for no rotation
+    float sidewaysDir =
+        (aOrientation == gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT ?
+            -1.0f :
+            (aOrientation == gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT ?
+                1.0f : 0.0f));
+    // If we're rendering a sideways run, we need to push a rotation transform to the context.
+    if (sidewaysDir != 0.0f) {
         if (textDrawer) {
-            textDrawer->FoundUnsupportedFeature();
-            return;
+            // For WebRender, we can't use a DrawTarget transform and must instead use flags
+            // that locally transform the glyph, without affecting the glyph origin. The glyph
+            // origins must thus be offset in the transformed directions (instead of local-space
+            // directions). Modify the advance and baseline directions to account for the
+            // indicated transform.
+
+            // The default text orientation is down being +Y and right being +X.
+            // Rotating 90 degrees left/CCW makes down be +X and right be -Y.
+            // Rotating 90 degrees right/CW makes down be -X and right be +Y.
+            // Thus the advance direction (moving right) is just sidewaysDir,
+            // i.e. negative along Y axis if rotated left and positive if
+            // rotated right.
+            fontParams.advanceDirection *= sidewaysDir;
+            // The baseline direction (moving down) is negated relative to the
+            // advance direction for sideways transforms.
+            baselineDir *= -sidewaysDir;
+
+            glyphFlagsRestore.Save(textDrawer);
+            // Set the transform flags accordingly. Both sideways rotations transpose X and Y,
+            // while left rotation flips the resulting Y axis, and right rotation flips the
+            // resulting X axis.
+            textDrawer->SetWRGlyphFlags(textDrawer->GetWRGlyphFlags() |
+                                        wr::FontInstanceFlags::TRANSPOSE |
+                                        (aOrientation ==
+                                         gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT ?
+                                            wr::FontInstanceFlags::FLIP_Y :
+                                            wr::FontInstanceFlags::FLIP_X));
+        } else {
+            // For non-WebRender targets, just push a rotation transform.
+            matrixRestore.SetContext(aRunParams.context);
+            gfxPoint p(aPt->x * aRunParams.devPerApp,
+                       aPt->y * aRunParams.devPerApp);
+            // Get a matrix we can use to draw the (horizontally-shaped) textrun
+            // with 90-degree CW rotation.
+            const gfxFloat rotation = sidewaysDir * M_PI / 2.0f;
+            gfxMatrix mat =
+                aRunParams.context->CurrentMatrixDouble().
+                PreTranslate(p).     // translate origin for rotation
+                PreRotate(rotation). // turn 90deg CCW (sideways-left) or CW (*-right)
+                PreTranslate(-p);    // undo the translation
+
+            aRunParams.context->SetMatrixDouble(mat);
         }
 
-        sideways = true;
-        matrixRestore.SetContext(aRunParams.context);
-        gfxPoint p(aPt->x * aRunParams.devPerApp,
-                   aPt->y * aRunParams.devPerApp);
-        const Metrics& metrics = GetMetrics(eHorizontal);
-        // Get a matrix we can use to draw the (horizontally-shaped) textrun
-        // with 90-degree CW rotation.
-        const gfxFloat
-            rotation = (aOrientation ==
-                        gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT)
-                       ? -M_PI / 2.0 : M_PI / 2.0;
-        gfxMatrix mat =
-            aRunParams.context->CurrentMatrixDouble().
-            PreTranslate(p).     // translate origin for rotation
-            PreRotate(rotation). // turn 90deg CCW (sideways-left) or CW (*-right)
-            PreTranslate(-p);    // undo the translation
-
         // If we're drawing rotated horizontal text for an element styled
         // text-orientation:mixed, the dominant baseline will be vertical-
         // centered. So in this case, we need to adjust the position so that
         // the rotated horizontal text (which uses an alphabetic baseline) will
         // look OK when juxtaposed with upright glyphs (rendered on a centered
         // vertical baseline). The adjustment here is somewhat ad hoc; we
         // should eventually look for baseline tables[1] in the fonts and use
         // those if available.
         // [1] See http://www.microsoft.com/typography/otspec/base.htm
         if (aTextRun->UseCenterBaseline()) {
-            gfxPoint baseAdj(0, (metrics.emAscent - metrics.emDescent) / 2);
-            mat.PreTranslate(baseAdj);
+            const Metrics& metrics = GetMetrics(eHorizontal);
+            float baseAdj = (metrics.emAscent - metrics.emDescent) / 2;
+            baseline += baseAdj * aTextRun->GetAppUnitsPerDevUnit() * baselineDir;
         }
-
-        aRunParams.context->SetMatrixDouble(mat);
     }
 
-    if (fontParams.needsOblique && !fontParams.isVerticalFont && !textDrawer) {
-        // Adjust matrix for synthetic-oblique, except if we're doing vertical-
-        // upright text, in which case this will be handled for each glyph
-        // individually in DrawOneGlyph.
-        if (!matrixRestore.HasMatrix()) {
-            matrixRestore.SetContext(aRunParams.context);
+    if (fontParams.needsOblique) {
+        if (textDrawer) {
+            glyphFlagsRestore.Save(textDrawer);
+            textDrawer->SetWRGlyphFlags(textDrawer->GetWRGlyphFlags() |
+                                        wr::FontInstanceFlags::SYNTHETIC_ITALICS);
+        } else if (!fontParams.isVerticalFont) {
+            // Adjust matrix for synthetic-oblique, except if we're doing vertical-
+            // upright text, in which case this will be handled for each glyph
+            // individually in DrawOneGlyph.
+            if (!matrixRestore.HasMatrix()) {
+                matrixRestore.SetContext(aRunParams.context);
+            }
+            gfx::Point p(aPt->x * aRunParams.devPerApp,
+                         aPt->y * aRunParams.devPerApp);
+            gfx::Matrix mat =
+                aRunParams.context->CurrentMatrix().
+                PreTranslate(p).
+                PreMultiply(gfx::Matrix(1, 0, -OBLIQUE_SKEW_FACTOR, 1, 0, 0)).
+                PreTranslate(-p);
+            aRunParams.context->SetMatrix(mat);
         }
-        gfx::Point p(aPt->x * aRunParams.devPerApp,
-                     aPt->y * aRunParams.devPerApp);
-        gfx::Matrix mat =
-            aRunParams.context->CurrentMatrix().
-            PreTranslate(p).
-            PreMultiply(gfx::Matrix(1, 0, -OBLIQUE_SKEW_FACTOR, 1, 0, 0)).
-            PreTranslate(-p);
-        aRunParams.context->SetMatrix(mat);
     }
 
     RefPtr<SVGContextPaint> contextPaint;
     if (fontParams.haveSVGGlyphs && !fontParams.contextPaint) {
         // If no pattern is specified for fill, use the current pattern
         NS_ASSERTION((int(aRunParams.drawMode) & int(DrawMode::GLYPH_STROKE)) == 0,
                      "no pattern supplied for stroking text");
         RefPtr<gfxPattern> fillPattern = aRunParams.context->GetPattern();
@@ -2207,33 +2262,31 @@ gfxFont::Draw(const gfxTextRun *aTextRun
         aRunParams.dt->SetPermitSubpixelAA(false);
     }
 
     Matrix mat;
     Matrix oldMat = aRunParams.dt->GetTransform();
 
     fontParams.drawOptions.mAntialiasMode = Get2DAAMode(mAntialiasOption);
 
-    float& baseline = fontParams.isVerticalFont ? aPt->x : aPt->y;
-    float origBaseline = baseline;
     if (mStyle.baselineOffset != 0.0) {
         baseline +=
-            mStyle.baselineOffset * aTextRun->GetAppUnitsPerDevUnit();
+            mStyle.baselineOffset * aTextRun->GetAppUnitsPerDevUnit() * baselineDir;
     }
 
     bool emittedGlyphs;
     {
         // Select appropriate version of the templated DrawGlyphs method
         // to output glyphs to the buffer, depending on complexity needed
         // for the type of font, and whether added inter-glyph spacing
         // is specified.
         GlyphBufferAzure buffer(aRunParams, fontParams);
         if (fontParams.haveSVGGlyphs || fontParams.haveColorGlyphs ||
             fontParams.extraStrikes ||
-            (fontParams.needsOblique && fontParams.isVerticalFont)) {
+            (fontParams.needsOblique && fontParams.isVerticalFont && !textDrawer)) {
             if (aRunParams.spacing) {
                 emittedGlyphs =
                     DrawGlyphs<FontComplexityT::ComplexFont,
                                SpacingT::HasSpacing>(aTextRun, aStart,
                                                      aEnd - aStart, aPt,
                                                      buffer);
             } else {
                 emittedGlyphs =
@@ -2263,25 +2316,23 @@ gfxFont::Draw(const gfxTextRun *aTextRun
 
     if (aRunParams.callbacks && emittedGlyphs) {
         aRunParams.callbacks->NotifyGlyphPathEmitted();
     }
 
     aRunParams.dt->SetTransform(oldMat);
     aRunParams.dt->SetPermitSubpixelAA(oldSubpixelAA);
 
-    if (sideways) {
-        // adjust updated aPt to account for the transform we were using
+    if (sidewaysDir != 0.0f && !textDrawer) {
+        // Adjust updated aPt to account for the transform we were using.
+        // The advance happened horizontally in local-space, but the transformed
+        // sideways advance is actually vertical, with sign depending on the
+        // direction of rotation.
         float advance = aPt->x - origPt.x;
-        if (aOrientation ==
-            gfx::ShapedTextFlags::TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT) {
-            *aPt = gfx::Point(origPt.x, origPt.y - advance);
-        } else {
-            *aPt = gfx::Point(origPt.x, origPt.y + advance);
-        }
+        *aPt = gfx::Point(origPt.x, origPt.y + advance * sidewaysDir);
     }
 }
 
 bool
 gfxFont::RenderSVGGlyph(gfxContext *aContext, gfx::Point aPoint,
                         uint32_t aGlyphId, SVGContextPaint* aContextPaint) const
 {
     if (!GetFontEntry()->HasSVGGlyph(aGlyphId)) {
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -2342,16 +2342,17 @@ struct MOZ_STACK_CLASS TextRunDrawParams
 };
 
 struct MOZ_STACK_CLASS FontDrawParams {
     RefPtr<mozilla::gfx::ScaledFont>            scaledFont;
     mozilla::SVGContextPaint *contextPaint;
     mozilla::gfx::Float       synBoldOnePixelOffset;
     int32_t                   extraStrikes;
     mozilla::gfx::DrawOptions drawOptions;
+    gfxFloat                  advanceDirection;
     bool                      isVerticalFont;
     bool                      haveSVGGlyphs;
     bool                      haveColorGlyphs;
     bool                      needsOblique;
 };
 
 struct MOZ_STACK_CLASS EmphasisMarkDrawParams {
     gfxContext* context;
--- a/gfx/thebes/gfxMacFont.cpp
+++ b/gfx/thebes/gfxMacFont.cpp
@@ -504,18 +504,17 @@ gfxMacFont::GetScaledFont(DrawTarget *aT
 {
     if (!mAzureScaledFont) {
         mAzureScaledFont =
             Factory::CreateScaledFontForMacFont(GetCGFontRef(),
                                                 GetUnscaledFont(),
                                                 GetAdjustedSize(),
                                                 Color::FromABGR(mFontSmoothingBackgroundColor),
                                                 !mStyle.useGrayscaleAntialiasing,
-                                                IsSyntheticBold(),
-                                                IsSyntheticOblique());
+                                                IsSyntheticBold());
         if (!mAzureScaledFont) {
             return nullptr;
         }
 
         mAzureScaledFont->SetCairoScaledFont(mScaledFont);
     }
 
     RefPtr<ScaledFont> scaledFont(mAzureScaledFont);
--- a/gfx/webrender_bindings/webrender_ffi.h
+++ b/gfx/webrender_bindings/webrender_ffi.h
@@ -46,21 +46,39 @@ struct FontInstanceFlags {
     return *this;
   }
 
   FontInstanceFlags& operator|=(uint32_t aBits) {
     bits |= aBits;
     return *this;
   }
 
+  FontInstanceFlags operator|(uint32_t aBits) {
+    FontInstanceFlags flags = { bits | aBits };
+    return flags;
+  }
+
+  FontInstanceFlags& operator&=(uint32_t aBits) {
+    bits &= aBits;
+    return *this;
+  }
+
+  FontInstanceFlags operator&(uint32_t aBits) {
+    FontInstanceFlags flags = { bits & aBits };
+    return flags;
+  }
+
   enum : uint32_t {
     SYNTHETIC_ITALICS = 1 << 0,
     SYNTHETIC_BOLD    = 1 << 1,
     EMBEDDED_BITMAPS  = 1 << 2,
     SUBPIXEL_BGR      = 1 << 3,
+    TRANSPOSE         = 1 << 4,
+    FLIP_X            = 1 << 5,
+    FLIP_Y            = 1 << 6,
 
     FORCE_GDI         = 1 << 16,
 
     FONT_SMOOTHING    = 1 << 16,
 
     FORCE_AUTOHINT    = 1 << 16,
     NO_AUTOHINT       = 1 << 17,
     VERTICAL_LAYOUT   = 1 << 18
--- a/ipc/chromium/src/base/dir_reader_linux.h
+++ b/ipc/chromium/src/base/dir_reader_linux.h
@@ -85,17 +85,20 @@ class DirReaderLinux {
   }
 
   static bool IsFallback() {
     return false;
   }
 
  private:
   const int fd_;
-  unsigned char buf_[512];
+  union {
+    linux_dirent dirent_;
+    unsigned char buf_[512];
+  };
   size_t offset_, size_;
 
   DISALLOW_COPY_AND_ASSIGN(DirReaderLinux);
 };
 
 }  // namespace base
 
 #endif // BASE_DIR_READER_LINUX_H_
--- a/js/public/TraceKind.h
+++ b/js/public/TraceKind.h
@@ -59,21 +59,26 @@ enum class TraceKind
     // The following kinds do not have an exposed C++ idiom.
     BaseShape = 0x0F,
     JitCode = 0x1F,
     LazyScript = 0x2F,
     Scope = 0x3F,
     RegExpShared = 0x4F
 };
 const static uintptr_t OutOfLineTraceKindMask = 0x07;
-static_assert(uintptr_t(JS::TraceKind::BaseShape) & OutOfLineTraceKindMask, "mask bits are set");
-static_assert(uintptr_t(JS::TraceKind::JitCode) & OutOfLineTraceKindMask, "mask bits are set");
-static_assert(uintptr_t(JS::TraceKind::LazyScript) & OutOfLineTraceKindMask, "mask bits are set");
-static_assert(uintptr_t(JS::TraceKind::Scope) & OutOfLineTraceKindMask, "mask bits are set");
-static_assert(uintptr_t(JS::TraceKind::RegExpShared) & OutOfLineTraceKindMask, "mask bits are set");
+
+#define ASSERT_TRACE_KIND(tk) \
+    static_assert((uintptr_t(tk) & OutOfLineTraceKindMask) == OutOfLineTraceKindMask, \
+        "mask bits are set")
+ASSERT_TRACE_KIND(JS::TraceKind::BaseShape);
+ASSERT_TRACE_KIND(JS::TraceKind::JitCode);
+ASSERT_TRACE_KIND(JS::TraceKind::LazyScript);
+ASSERT_TRACE_KIND(JS::TraceKind::Scope);
+ASSERT_TRACE_KIND(JS::TraceKind::RegExpShared);
+#undef ASSERT_TRACE_KIND
 
 // When this header is imported inside SpiderMonkey, the class definitions are
 // available and we can query those definitions to find the correct kind
 // directly from the class hierarchy.
 template <typename T>
 struct MapTypeToTraceKind {
     static const JS::TraceKind kind = T::TraceKind;
 };
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/gc/bug-1430752.js
@@ -0,0 +1,2 @@
+gczeal(18);
+gcslice(3);
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/super-getelem-profiling.js
@@ -0,0 +1,12 @@
+enableGeckoProfiling();
+
+class base {}
+class derived extends base {
+    testElem() {
+        super[ruin()];
+    }
+}
+let instance = new derived();
+try {
+    instance.testElem();
+} catch { /* don't crash */ }
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -9815,16 +9815,21 @@ IonBuilder::jsop_getprop_super(PropertyN
 
 AbortReasonOr<Ok>
 IonBuilder::jsop_getelem_super()
 {
     MDefinition* obj = current->pop();
     MDefinition* receiver = current->pop();
     MDefinition* id = current->pop();
 
+#if defined(JS_CODEGEN_X86)
+    if (instrumentedProfiling())
+        return abort(AbortReason::Disable, "profiling functions with GETELEM_SUPER is disabled on x86");
+#endif
+
     auto* ins = MGetPropSuperCache::New(alloc(), obj, receiver, id);
     current->add(ins);
     current->push(ins);
 
     MOZ_TRY(resumeAfter(ins));
 
     TemporaryTypeSet* types = bytecodeTypes(pc);
     return pushTypeBarrier(ins, types, BarrierKind::TypeSet);
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -7491,17 +7491,17 @@ GCRuntime::collect(bool nonincrementalBy
     if (reason == JS::gcreason::COMPARTMENT_REVIVED)
         maybeDoCycleCollection();
 
 #ifdef JS_GC_ZEAL
     if (rt->hasZealMode(ZealMode::CheckHeapAfterGC)) {
         gcstats::AutoPhase ap(rt->gc.stats(), gcstats::PhaseKind::TRACE_HEAP);
         CheckHeapAfterGC(rt);
     }
-    if (rt->hasZealMode(ZealMode::CheckGrayMarking)) {
+    if (rt->hasZealMode(ZealMode::CheckGrayMarking) && !isIncrementalGCInProgress()) {
         MOZ_RELEASE_ASSERT(CheckGrayMarkingState(rt));
     }
 #endif
 }
 
 js::AutoEnqueuePendingParseTasksAfterGC::~AutoEnqueuePendingParseTasksAfterGC()
 {
     if (!OffThreadParsingMustWaitForGC(gc_.rt))
--- a/layout/generic/TextDrawTarget.h
+++ b/layout/generic/TextDrawTarget.h
@@ -86,16 +86,51 @@ public:
     } else {
       mBuilder.ClearSave();
     }
   }
 
   void FoundUnsupportedFeature() { mHasUnsupportedFeatures = true; }
   bool HasUnsupportedFeatures() { return mHasUnsupportedFeatures; }
 
+  wr::FontInstanceFlags GetWRGlyphFlags() const { return mWRGlyphFlags; }
+  void SetWRGlyphFlags(wr::FontInstanceFlags aFlags) { mWRGlyphFlags = aFlags; }
+
+  class AutoRestoreWRGlyphFlags
+  {
+  public:
+    ~AutoRestoreWRGlyphFlags()
+    {
+      if (mTarget) {
+        mTarget->SetWRGlyphFlags(mFlags);
+      }
+    }
+
+    void Save(TextDrawTarget* aTarget)
+    {
+      // This allows for recursive saves, in case the flags need to be modified
+      // under multiple conditions (i.e. transforms and synthetic italics),
+      // since the flags will be restored to the first saved value in the
+      // destructor on scope exit.
+      if (!mTarget) {
+        // Only record the first save with the original flags that will be restored.
+        mTarget = aTarget;
+        mFlags = aTarget->GetWRGlyphFlags();
+      } else {
+        // Ensure that this is actually a recursive save to the same target
+        MOZ_ASSERT(mTarget == aTarget,
+                   "Recursive save of WR glyph flags to different TextDrawTargets");
+      }
+    }
+
+  private:
+    TextDrawTarget* mTarget = nullptr;
+    wr::FontInstanceFlags mFlags = {0};
+  };
+
   // This overload just stores the glyphs/font/color.
   void
   FillGlyphs(ScaledFont* aFont,
              const GlyphBuffer& aBuffer,
              const Pattern& aPattern,
              const DrawOptions& aOptions) override
   {
     // Make sure we're only given boring color patterns
@@ -129,17 +164,17 @@ public:
                   && std::is_standard_layout<std::remove_reference<decltype(aBuffer.mGlyphs[0])>>::value
                   && std::is_standard_layout<std::remove_reference<decltype(glyphs[0])>>::value
                   && sizeof(aBuffer.mGlyphs[0]) == sizeof(glyphs[0])
                   && sizeof(aBuffer.mGlyphs[0].mPosition) == sizeof(glyphs[0].point)
                   , "glyph buf types don't match");
 
     wr::GlyphOptions glyphOptions;
     glyphOptions.render_mode = wr::ToFontRenderMode(aOptions.mAntialiasMode, GetPermitSubpixelAA());
-    glyphOptions.flags = 0;
+    glyphOptions.flags = mWRGlyphFlags;
 
     mManager->WrBridge()->PushGlyphs(mBuilder, glyphs, aFont,
                                      color, mSc, mBoundsRect, mClipRect,
                                      mBackfaceVisible, &glyphOptions);
   }
 
   void
   PushClipRect(const Rect &aRect) override {
@@ -282,16 +317,18 @@ private:
   const layers::StackingContextHelper& mSc;
   layers::WebRenderLayerManager* mManager;
 
   // Computed facts
   wr::LayerRect mBoundsRect;
   wr::LayerRect mClipRect;
   bool mBackfaceVisible;
 
+  wr::FontInstanceFlags mWRGlyphFlags = {0};
+
   // The rest of this is dummy implementations of DrawTarget's API
 public:
   DrawTargetType GetType() const override {
     return DrawTargetType::SOFTWARE_RASTER;
   }
 
   BackendType GetBackendType() const override {
     return BackendType::WEBRENDER_TEXT;
--- a/layout/reftests/w3c-css/failures.list
+++ b/layout/reftests/w3c-css/failures.list
@@ -106,17 +106,17 @@ fuzzy-if(OSX||winWidget,135,1080) css-wr
 fuzzy-if(OSX||winWidget,111,960)  css-writing-modes-3/inline-block-alignment-srl-008.xht
 fuzzy-if(OSX||winWidget,213,1540) css-writing-modes-3/line-box-direction-???-0??.xht
 fuzzy-if(OSX||winWidget,110,1200) css-writing-modes-3/row-progression-???-0??.xht
 fuzzy-if(OSX||winWidget,110,1200) css-writing-modes-3/table-column-order-00?.xht
 fuzzy-if(winWidget,110,1200) css-writing-modes-3/table-column-order-slr-007.xht
 fuzzy-if(OSX||winWidget,110,1200) css-writing-modes-3/table-column-order-srl-006.xht
 fuzzy-if(OSX||winWidget,75,404)   css-writing-modes-3/text-align-v??-0??.xht
 fuzzy-if(OSX||winWidget,215,780)  css-writing-modes-3/text-baseline-???-00?.xht
-fuzzy-if(OSX,15,16) fails-if(webrender) css-writing-modes-3/text-combine-upright-decorations-001.html
+fuzzy-if(OSX,15,16) css-writing-modes-3/text-combine-upright-decorations-001.html
 fuzzy-if(OSX||winWidget,255,480)  css-writing-modes-3/text-indent-v??-0??.xht
 fuzzy-if(OSX||winWidget,226,960)  css-writing-modes-3/text-orientation-016.xht
 fuzzy-if(OSX||winWidget,223,720)  css-writing-modes-3/vertical-alignment-*.xht
 fuzzy-if(OSX||winWidget,153,612)  css-writing-modes-3/writing-mode-vertical-??-00?.*
 fuzzy(255,960) random-if(webrender) css-writing-modes-3/text-combine-upright-value-all-00?.html
 
 # Bug 1167911
 skip css-writing-modes-3/abs-pos-non-replaced-icb-vlr-021.xht
--- a/layout/reftests/w3c-css/received/reftest.list
+++ b/layout/reftests/w3c-css/received/reftest.list
@@ -1068,17 +1068,17 @@ fuzzy-if(OSX||winWidget,75,404) == css-w
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes-3/text-baseline-slr-009.xht css-writing-modes-3/text-baseline-slr-009-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes-3/text-baseline-srl-008.xht css-writing-modes-3/text-baseline-vrl-006-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes-3/text-baseline-vlr-003.xht css-writing-modes-3/text-baseline-vrl-002-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes-3/text-baseline-vlr-005.xht css-writing-modes-3/text-baseline-vrl-002-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes-3/text-baseline-vlr-007.xht css-writing-modes-3/text-baseline-vrl-006-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes-3/text-baseline-vrl-002.xht css-writing-modes-3/text-baseline-vrl-002-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes-3/text-baseline-vrl-004.xht css-writing-modes-3/text-baseline-vrl-002-ref.xht
 fuzzy-if(OSX||winWidget,215,780) == css-writing-modes-3/text-baseline-vrl-006.xht css-writing-modes-3/text-baseline-vrl-006-ref.xht
-fuzzy-if(OSX,15,16) fails-if(webrender) == css-writing-modes-3/text-combine-upright-decorations-001.html css-writing-modes-3/reference/text-combine-upright-decorations-001.html
+fuzzy-if(OSX,15,16) == css-writing-modes-3/text-combine-upright-decorations-001.html css-writing-modes-3/reference/text-combine-upright-decorations-001.html
 == css-writing-modes-3/text-combine-upright-inherit-all-001.html css-writing-modes-3/reference/text-combine-upright-inherit-all-001.html
 == css-writing-modes-3/text-combine-upright-inherit-all-002.html css-writing-modes-3/reference/text-combine-upright-inherit-all-002.html
 == css-writing-modes-3/text-combine-upright-layout-rules-001.html css-writing-modes-3/reference/text-combine-upright-layout-rules-001-ref.html
 == css-writing-modes-3/text-combine-upright-line-breaking-rules-001.html css-writing-modes-3/text-combine-upright-line-breaking-rules-001-ref.html
 fuzzy(255,960) random-if(webrender) == css-writing-modes-3/text-combine-upright-value-all-001.html css-writing-modes-3/reference/text-combine-upright-value-single-character.html
 fuzzy(255,960) random-if(webrender) == css-writing-modes-3/text-combine-upright-value-all-002.html css-writing-modes-3/reference/vertical-ahem-1x1-ref.html
 fuzzy(255,960) random-if(webrender) != css-writing-modes-3/text-combine-upright-value-all-002.html css-writing-modes-3/reference/horizontal-ahem-1x1-notref.html
 fuzzy(255,960) random-if(webrender) == css-writing-modes-3/text-combine-upright-value-all-003.html css-writing-modes-3/reference/vertical-ahem-1x1-ref.html
--- a/netwerk/base/TCPFastOpenLayer.cpp
+++ b/netwerk/base/TCPFastOpenLayer.cpp
@@ -416,18 +416,17 @@ TCPFastOpenFinish(PRFileDesc *fd, PRErro
                 secret->mFirstPacketBuf + rv,
                 secret->mFirstPacketBufLen);
       }
       tfoStatus = TFO_DATA_SENT;
     } else {
       result = PR_GetError();
       SOCKET_LOG(("TCPFastOpenFinish - sendto error=%d.\n", result));
 
-      if (result == PR_NOT_IMPLEMENTED_ERROR || // When a windows version does not support Fast Open it will return this error.
-          result == PR_NOT_TCP_SOCKET_ERROR) { // SendTo will return PR_NOT_TCP_SOCKET_ERROR if TCP Fast Open is turned off on Linux.
+      if (result == PR_NOT_TCP_SOCKET_ERROR) { // SendTo will return PR_NOT_TCP_SOCKET_ERROR if TCP Fast Open is turned off on Linux.
         // We can call connect again.
         fastOpenNotSupported = true;
         rv = (tfoFd->lower->methods->connect)(tfoFd->lower, &secret->mAddr,
                                               PR_INTERVAL_NO_WAIT);
 
         if (rv == PR_SUCCESS) {
           result = PR_IS_CONNECTED_ERROR;
         } else {
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -179,20 +179,16 @@ public:
     {
         return mUseFastOpen && mFastOpenSupported &&
                (mFastOpenStallsCounter < mFastOpenStallsLimit) &&
                (mFastOpenConsecutiveFailureCounter < mFastOpenConsecutiveFailureLimit);
     }
     // If one of tcp connections return PR_NOT_TCP_SOCKET_ERROR while trying
     // fast open, it means that Fast Open is turned off so we will not try again
     // until a restart. This is only on Linux.
-    // For windows 10 we can only check whether a version of windows support
-    // Fast Open at run time, so if we get error PR_NOT_IMPLEMENTED_ERROR it
-    // means that Fast Open is not supported and we will set mFastOpenSupported
-    // to false.
     void SetFastOpenNotSupported() { mFastOpenSupported = false; }
 
     void IncrementFastOpenConsecutiveFailureCounter();
 
     void ResetFastOpenConsecutiveFailureCounter()
     {
         mFastOpenConsecutiveFailureCounter = 0;
     }
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -1660,16 +1660,19 @@ nsHttpTransaction::HandleContentStart()
                 return NS_ERROR_NET_RESET;
             }
             break;
         case 425:
             LOG(("Too Early."));
             if ((mEarlyDataDisposition == EARLY_425) && !mDoNotTryEarlyData) {
                 mDoNotTryEarlyData = true;
                 mForceRestart = true; // force restart has built in loop protection
+                if (mConnection->Version() == HTTP_VERSION_2) {
+                    mReuseOnRestart = true;
+                }
                 return NS_ERROR_NET_RESET;
             }
             break;
         }
 
         if (mResponseHead->Status() == 200 &&
             mConnection->IsProxyConnectInProgress()) {
             // successful CONNECTs do not have response bodies
--- a/python/mozboot/mozboot/bootstrap.py
+++ b/python/mozboot/mozboot/bootstrap.py
@@ -316,16 +316,17 @@ class Bootstrapper(object):
 
                 if choice == 1:
                     print('Creating global state directory: %s' % state_dir)
                     os.makedirs(state_dir, mode=0o770)
 
         state_dir_available = os.path.exists(state_dir)
 
         r = current_firefox_checkout(check_output=self.instance.check_output,
+                                     env=self.instance._hgplain_env(),
                                      hg=self.instance.which('hg'))
         (checkout_type, checkout_root) = r
 
         # Possibly configure Mercurial, but not if the current checkout is Git.
         # TODO offer to configure Git.
         if hg_installed and state_dir_available and checkout_type != 'git':
             configure_hg = False
             if not self.instance.no_interactive:
@@ -499,34 +500,36 @@ def clone_firefox(hg, dest):
     res = subprocess.call([hg, 'update', '-r', 'central'], cwd=dest)
     if res:
         print('error updating; you will need to `hg update` manually')
 
     print('Firefox source code available at %s' % dest)
     return True
 
 
-def current_firefox_checkout(check_output, hg=None):
+def current_firefox_checkout(check_output, env, hg=None):
     """Determine whether we're in a Firefox checkout.
 
     Returns one of None, ``git``, or ``hg``.
     """
     HG_ROOT_REVISIONS = set([
         # From mozilla-central.
         '8ba995b74e18334ab3707f27e9eb8f4e37ba3d29',
     ])
 
     path = os.getcwd()
     while path:
         hg_dir = os.path.join(path, '.hg')
         git_dir = os.path.join(path, '.git')
         if hg and os.path.exists(hg_dir):
             # Verify the hg repo is a Firefox repo by looking at rev 0.
             try:
-                node = check_output([hg, 'log', '-r', '0', '--template', '{node}'], cwd=path)
+                node = check_output([hg, 'log', '-r', '0', '--template', '{node}'],
+                                    cwd=path,
+                                    env=env)
                 if node in HG_ROOT_REVISIONS:
                     return ('hg', path)
                 # Else the root revision is different. There could be nested
                 # repos. So keep traversing the parents.
             except subprocess.CalledProcessError:
                 pass
 
         # Just check for known-good files in the checkout, to prevent attempted
--- a/security/manager/ssl/nsNSSCertHelper.cpp
+++ b/security/manager/ssl/nsNSSCertHelper.cpp
@@ -1670,17 +1670,23 @@ ProcessTime(PRTime dispTime,
 
   PRExplodedTime explodedTimeGMT;
   PR_ExplodeTime(dispTime, PR_GMTParameters, &explodedTimeGMT);
 
   DateTimeFormat::FormatPRExplodedTime(
     kDateFormatLong, kTimeFormatSeconds, &explodedTimeGMT, tempString);
 
   text.Append(tempString);
-  text.AppendLiteral(" GMT)");
+  // Append "GMT" if it's not already added by the formatter
+  // since the OS pattern contained a timezone (Mac and Linux).
+  if (tempString.Find(" GMT") == kNotFound) {
+    text.AppendLiteral(" GMT)");
+  } else {
+    text.Append(')');
+  }
 
   nsCOMPtr<nsIASN1PrintableItem> printableItem = new nsNSSASN1PrintableItem();
 
   printableItem->SetDisplayValue(text);
   printableItem->SetDisplayName(nsDependentString(displayName));
   nsCOMPtr<nsIMutableArray> asn1Objects;
   parentSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
   asn1Objects->AppendElement(printableItem);
--- a/testing/web-platform/meta/content-security-policy/base-uri/report-uri-does-not-respect-base-uri.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/base-uri/report-uri-does-not-respect-base-uri.sub.html.ini
@@ -1,5 +1,3 @@
 [report-uri-does-not-respect-base-uri.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Event is fired]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/blob/blob-urls-do-not-match-self.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/blob/blob-urls-do-not-match-self.sub.html.ini
@@ -1,4 +1,3 @@
 [blob-urls-do-not-match-self.sub.html]
-  [Expecting logs: ["violated-directive=script-src"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/connect-src/connect-src-beacon-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/connect-src/connect-src-beacon-blocked.sub.html.ini
@@ -1,10 +1,9 @@
 [connect-src-beacon-blocked.sub.html]
+  type: testharness
+  prefs: [security.csp.enable_violation_events:true]
   [sendBeacon should not throw.]
     expected: FAIL
 
   [redirect case]
     expected: TIMEOUT
 
-  [Expecting logs: ["Pass", "violated-directive=connect-src"\]]
-    expected: FAIL
-
--- a/testing/web-platform/meta/content-security-policy/connect-src/connect-src-beacon-redirect-to-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/connect-src/connect-src-beacon-redirect-to-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [connect-src-beacon-redirect-to-blocked.sub.html]
-  [Expecting logs: ["violated-directive=connect-src"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/connect-src/connect-src-eventsource-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/connect-src/connect-src-eventsource-blocked.sub.html.ini
@@ -1,4 +1,4 @@
 [connect-src-eventsource-blocked.sub.html]
-  [Expecting logs: ["Pass","violated-directive=connect-src"\]]
-    expected: FAIL
+  type: testharness
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/connect-src/connect-src-eventsource-redirect-to-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/connect-src/connect-src-eventsource-redirect-to-blocked.sub.html.ini
@@ -1,7 +1,6 @@
 [connect-src-eventsource-redirect-to-blocked.sub.html]
+  type: testharness
+  prefs: [security.csp.enable_violation_events:true]
   [Expecting logs: ["PASS EventSource() did not follow the disallowed redirect.","PASS successfullyParsed is true","TEST COMPLETE"\]]
     expected: FAIL
 
-  [Expecting logs: ["PASS EventSource() did not follow the disallowed redirect.","TEST COMPLETE", "violated-directive=connect-src"\]]
-    expected: FAIL
-
--- a/testing/web-platform/meta/content-security-policy/connect-src/connect-src-websocket-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/connect-src/connect-src-websocket-blocked.sub.html.ini
@@ -1,7 +1,6 @@
 [connect-src-websocket-blocked.sub.html]
+  type: testharness
+  prefs: [security.csp.enable_violation_events:true]
   [WebSocket should fire error event.]
     expected: FAIL
 
-  [Expecting logs: ["Pass","violated-directive=connect-src"\]]
-    expected: FAIL
-
--- a/testing/web-platform/meta/content-security-policy/connect-src/connect-src-xmlhttprequest-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/connect-src/connect-src-xmlhttprequest-blocked.sub.html.ini
@@ -1,11 +1,8 @@
 [connect-src-xmlhttprequest-blocked.sub.html]
   prefs: [security.csp.enable_violation_events:true]
   [XHR should fire onerror.]
     expected: TIMEOUT
 
   [XHR should fire onerror after a redirect.]
     expected: FAIL
 
-  [Expecting logs: ["Pass","violated-directive=connect-src"\]]
-    expected: FAIL
-
--- a/testing/web-platform/meta/content-security-policy/connect-src/connect-src-xmlhttprequest-redirect-to-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/connect-src/connect-src-xmlhttprequest-redirect-to-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [connect-src-xmlhttprequest-redirect-to-blocked.sub.html]
-  [Expecting logs: ["PASS XMLHttpRequest.send() did not follow the disallowed redirect.","TEST COMPLETE","violated-directive=connect-src"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/connect-src/worker-from-guid.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/connect-src/worker-from-guid.sub.html.ini
@@ -1,4 +1,3 @@
 [worker-from-guid.sub.html]
-  [Expecting logs: ["violated-directive=connect-src","xhr blocked","TEST COMPLETE"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/font-src/font-stylesheet-font-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/font-src/font-stylesheet-font-blocked.sub.html.ini
@@ -1,5 +1,3 @@
 [font-stylesheet-font-blocked.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Test font does not load if it does not match font-src.]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/form-action/form-action-src-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/form-action/form-action-src-blocked.sub.html.ini
@@ -1,7 +1,6 @@
 [form-action-src-blocked.sub.html]
+  type: testharness
+  prefs: [security.csp.enable_violation_events:true]
   [form-action-src-blocked]
     expected: FAIL
 
-  [Expecting logs: ["violated-directive=form-action","TEST COMPLETE"\]]
-    expected: FAIL
-
--- a/testing/web-platform/meta/content-security-policy/form-action/form-action-src-get-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/form-action/form-action-src-get-blocked.sub.html.ini
@@ -1,7 +1,6 @@
 [form-action-src-get-blocked.sub.html]
+  type: testharness
+  prefs: [security.csp.enable_violation_events:true]
   [form-action-src-allowed]
     expected: FAIL
 
-  [Expecting logs: ["violated-directive=form-action","TEST COMPLETE"\]]
-    expected: FAIL
-
--- a/testing/web-platform/meta/content-security-policy/form-action/form-action-src-javascript-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/form-action/form-action-src-javascript-blocked.sub.html.ini
@@ -1,7 +1,6 @@
 [form-action-src-javascript-blocked.sub.html]
+  type: testharness
+  prefs: [security.csp.enable_violation_events:true]
   [form-action-src-javascript-blocked]
     expected: FAIL
 
-  [Expecting logs: ["violated-directive=form-action","TEST COMPLETE"\]]
-    expected: FAIL
-
--- a/testing/web-platform/meta/content-security-policy/generic/generic-0_10_1.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/generic/generic-0_10_1.sub.html.ini
@@ -1,5 +1,3 @@
 [generic-0_10_1.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire violation events for every failed violation]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/generic/generic-0_2_2.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/generic/generic-0_2_2.sub.html.ini
@@ -1,5 +1,3 @@
 [generic-0_2_2.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire violation events for every failed violation]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/generic/generic-0_2_3.html.ini
+++ b/testing/web-platform/meta/content-security-policy/generic/generic-0_2_3.html.ini
@@ -1,5 +1,3 @@
 [generic-0_2_3.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire violation events for every failed violation]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/generic/generic-0_8_1.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/generic/generic-0_8_1.sub.html.ini
@@ -1,5 +1,3 @@
 [generic-0_8_1.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire violation events for every failed violation]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/img-src/report-blocked-data-uri.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/img-src/report-blocked-data-uri.sub.html.ini
@@ -1,4 +1,3 @@
 [report-blocked-data-uri.sub.html]
-  [Expecting logs: ["violated-directive=img-src"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/object-src/object-src-url-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/object-src/object-src-url-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [object-src-url-blocked.sub.html]
-  [Expecting logs: ["violated-directive=object-src"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/reporting/reporting-api-report-only-sends-reports-on-violation.https.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/reporting/reporting-api-report-only-sends-reports-on-violation.https.sub.html.ini
@@ -1,8 +1,5 @@
 [reporting-api-report-only-sends-reports-on-violation.https.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Event is fired]
-    expected: FAIL
-
   [Violation report status OK.]
     expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/reporting/reporting-api-report-to-overrides-report-uri-1.https.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/reporting/reporting-api-report-to-overrides-report-uri-1.https.sub.html.ini
@@ -1,5 +1,3 @@
 [reporting-api-report-to-overrides-report-uri-1.https.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Event is fired]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/reporting/reporting-api-report-to-overrides-report-uri-2.https.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/reporting/reporting-api-report-to-overrides-report-uri-2.https.sub.html.ini
@@ -1,5 +1,3 @@
 [reporting-api-report-to-overrides-report-uri-2.https.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Event is fired]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/reporting/reporting-api-sends-reports-on-violation.https.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/reporting/reporting-api-sends-reports-on-violation.https.sub.html.ini
@@ -1,8 +1,5 @@
 [reporting-api-sends-reports-on-violation.https.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Event is fired]
-    expected: FAIL
-
   [Violation report status OK.]
     expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/injected-inline-script-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/injected-inline-script-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [injected-inline-script-blocked.sub.html]
-  [Expecting logs: ["violated-directive=script-src",\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-1_1.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-1_1.html.ini
@@ -1,5 +1,3 @@
 [script-src-1_1.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should not fire policy violation events]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-1_2.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-1_2.html.ini
@@ -1,7 +1,5 @@
 [script-src-1_2.html]
   disabled:
     if os == "win": bug 1172411
   prefs: [security.csp.enable_violation_events:true]
-  [Should not fire policy violation events]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-1_2_1.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-1_2_1.html.ini
@@ -1,7 +1,5 @@
 [script-src-1_2_1.html]
   disabled:
     if os == "win": bug 1094323
   prefs: [security.csp.enable_violation_events:true]
-  [Test that securitypolicyviolation event is fired]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-1_4.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-1_4.html.ini
@@ -1,8 +1,5 @@
 [script-src-1_4.html]
   prefs: [security.csp.enable_violation_events:true]
   [eval() should throw without 'unsafe-eval' keyword source in script-src directive.]
     expected: FAIL
 
-  [Test that securitypolicyviolation event is fired]
-    expected: FAIL
-
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-1_4_1.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-1_4_1.html.ini
@@ -1,7 +1,5 @@
 [script-src-1_4_1.html]
   disabled:
     if os == "win": bug 1094323
   prefs: [security.csp.enable_violation_events:true]
-  [Test that securitypolicyviolation event is fired]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-1_4_2.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-1_4_2.html.ini
@@ -1,8 +1,5 @@
 [script-src-1_4_2.html]
   prefs: [security.csp.enable_violation_events:true]
   [Unsafe eval ran in Function() constructor.]
     expected: FAIL
 
-  [Test that securitypolicyviolation event is fired]
-    expected: FAIL
-
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_discard_whitelist.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_discard_whitelist.html.ini
@@ -1,5 +1,3 @@
 [script-src-strict_dynamic_discard_whitelist.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Whitelisted script without a correct nonce is not allowed with `strict-dynamic`.]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_double_policy_different_nonce.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_double_policy_different_nonce.html.ini
@@ -1,5 +1,3 @@
 [script-src-strict_dynamic_double_policy_different_nonce.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Unnonced script injected via `appendChild` is not allowed with `strict-dynamic` + a nonce-only double policy.]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_double_policy_report_only.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_double_policy_report_only.html.ini
@@ -1,5 +1,4 @@
 [script-src-strict_dynamic_double_policy_report_only.html]
+  type: testharness
   prefs: [security.csp.enable_violation_events:true]
-  [Script injected via `appendChild` is allowed with `strict-dynamic` + Report-Only `script-src 'none'` policy.]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_javascript_uri.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_javascript_uri.html.ini
@@ -1,5 +1,3 @@
 [script-src-strict_dynamic_javascript_uri.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Script injected via `javascript:` URIs are not allowed with `strict-dynamic`.]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_non_parser_inserted_incorrect_nonce.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_non_parser_inserted_incorrect_nonce.html.ini
@@ -1,5 +1,3 @@
 [script-src-strict_dynamic_non_parser_inserted_incorrect_nonce.html]
   prefs: [security.csp.enable_violation_events:true]
-  [All the expected CSP violation reports have been fired.]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_parser_inserted.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/script-src-strict_dynamic_parser_inserted.html.ini
@@ -1,33 +1,9 @@
 [script-src-strict_dynamic_parser_inserted.html]
   expected: TIMEOUT
   prefs: [security.csp.enable_violation_events:true]
-  [Parser-inserted script via `document.write` without a correct nonce is not allowed with `strict-dynamic`.]
-    expected: FAIL
-
-  [Parser-inserted script via `document.writeln` without a correct nonce is not allowed with `strict-dynamic`.]
-    expected: FAIL
-
-  [Parser-inserted deferred script via `document.write` without a correct nonce is not allowed with `strict-dynamic`.]
-    expected: FAIL
-
-  [Parser-inserted deferred script via `document.writeln` without a correct nonce is not allowed with `strict-dynamic`.]
-    expected: FAIL
-
-  [Parser-inserted async script via `document.write` without a correct nonce is not allowed with `strict-dynamic`.]
-    expected: FAIL
-
-  [Parser-inserted async script via `document.writeln` without a correct nonce is not allowed with `strict-dynamic`.]
-    expected: FAIL
-
-  [Parser-inserted deferred async script via `document.write` without a correct nonce is not allowed with `strict-dynamic`.]
-    expected: FAIL
-
-  [Parser-inserted deferred async script via `document.writeln` without a correct nonce is not allowed with `strict-dynamic`.]
-    expected: FAIL
-
   [Script injected via `innerHTML` is not allowed with `strict-dynamic`.]
     expected: TIMEOUT
 
   [Script injected via `insertAdjacentHTML` is not allowed with `strict-dynamic`.]
     expected: TIMEOUT
 
--- a/testing/web-platform/meta/content-security-policy/script-src/scripthash-unicode-normalization.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/scripthash-unicode-normalization.sub.html.ini
@@ -1,5 +1,3 @@
 [scripthash-unicode-normalization.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire securitypolicyviolation]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/scriptnonce-and-scripthash.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/scriptnonce-and-scripthash.sub.html.ini
@@ -1,5 +1,3 @@
 [scriptnonce-and-scripthash.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Expecting alerts: ["PASS (1/3)","PASS (2/3)","PASS (3/3)"\]]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/script-src/scriptnonce-ignore-unsafeinline.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/script-src/scriptnonce-ignore-unsafeinline.sub.html.ini
@@ -1,5 +1,3 @@
 [scriptnonce-ignore-unsafeinline.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Expecting alerts: ["PASS (1/2)","PASS (2/2)", "violated-directive=script-src"\]]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/securitypolicyviolation/securitypolicyviolation-block-image.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/securitypolicyviolation/securitypolicyviolation-block-image.sub.html.ini
@@ -1,5 +1,3 @@
 [securitypolicyviolation-block-image.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Non-redirected same-origin URLs are not stripped.]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/securitypolicyviolation/upgrade-insecure-requests-reporting.https.html.ini
+++ b/testing/web-platform/meta/content-security-policy/securitypolicyviolation/upgrade-insecure-requests-reporting.https.html.ini
@@ -1,11 +1,4 @@
 [upgrade-insecure-requests-reporting.https.html]
-  expected: TIMEOUT
-  [Upgraded image is reported]
-    expected: TIMEOUT
+  type: testharness
+  prefs: [security.csp.enable_violation_events:true]
 
-  [Upgraded iframe is reported]
-    expected: TIMEOUT
-
-  [Navigated iframe is upgraded and reported]
-    expected: TIMEOUT
-
--- a/testing/web-platform/meta/content-security-policy/style-src/injected-inline-style-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/injected-inline-style-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [injected-inline-style-blocked.sub.html]
-  [Expecting logs: ["violated-directive=style-src","PASS"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html.ini
@@ -1,5 +1,3 @@
 [inline-style-allowed-while-cloning-objects.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Test that violation report event was fired]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/inline-style-attribute-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/inline-style-attribute-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [inline-style-attribute-blocked.sub.html]
-  [Expecting logs: ["violated-directive=style-src","PASS"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [style-blocked.sub.html]
-  [Expecting logs: ["violated-directive=style-src","PASS"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-src-hash-blocked.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-src-hash-blocked.html.ini
@@ -1,5 +1,3 @@
 [style-src-hash-blocked.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire a securitypolicyviolation event]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-src-imported-style-blocked.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-src-imported-style-blocked.html.ini
@@ -1,5 +1,4 @@
 [style-src-imported-style-blocked.html]
+  type: testharness
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire a securitypolicyviolation event]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-src-injected-inline-style-blocked.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-src-injected-inline-style-blocked.html.ini
@@ -1,5 +1,3 @@
 [style-src-injected-inline-style-blocked.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire a securitypolicyviolation event]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-src-injected-stylesheet-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-src-injected-stylesheet-blocked.sub.html.ini
@@ -1,5 +1,3 @@
 [style-src-injected-stylesheet-blocked.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire a securitypolicyviolation event]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-src-inline-style-attribute-blocked.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-src-inline-style-attribute-blocked.html.ini
@@ -1,5 +1,3 @@
 [style-src-inline-style-attribute-blocked.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire a securitypolicyviolation event]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-src-inline-style-blocked.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-src-inline-style-blocked.html.ini
@@ -1,5 +1,3 @@
 [style-src-inline-style-blocked.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire a securitypolicyviolation event]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event.html.ini
@@ -1,9 +1,6 @@
 [style-src-inline-style-nonce-blocked-error-event.html]
   expected: TIMEOUT
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire a securitypolicyviolation event]
-    expected: FAIL
-
   [Test that paragraph remains unmodified and error events received.]
     expected: NOTRUN
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-src-inline-style-nonce-blocked.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-src-inline-style-nonce-blocked.html.ini
@@ -1,5 +1,3 @@
 [style-src-inline-style-nonce-blocked.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire a securitypolicyviolation event]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-src-none-blocked.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-src-none-blocked.html.ini
@@ -1,5 +1,3 @@
 [style-src-none-blocked.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire a securitypolicyviolation event]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/style-src-stylesheet-nonce-blocked.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/style-src-stylesheet-nonce-blocked.html.ini
@@ -1,5 +1,3 @@
 [style-src-stylesheet-nonce-blocked.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire a securitypolicyviolation event]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/stylehash-basic-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/stylehash-basic-blocked.sub.html.ini
@@ -1,5 +1,3 @@
 [stylehash-basic-blocked.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Expecting alerts: ["PASS: The 'p' element's text is green, which means the style was correctly applied.", "violated-directive=style-src"\]]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/stylenonce-allowed.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/stylenonce-allowed.sub.html.ini
@@ -1,5 +1,4 @@
 [stylenonce-allowed.sub.html]
+  type: testharness
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire securitypolicyviolation]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/style-src/stylenonce-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/style-src/stylenonce-blocked.sub.html.ini
@@ -1,5 +1,4 @@
 [stylenonce-blocked.sub.html]
+  type: testharness
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire securitypolicyviolation]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/svg/object-in-svg-foreignobject.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/svg/object-in-svg-foreignobject.sub.html.ini
@@ -1,5 +1,3 @@
 [object-in-svg-foreignobject.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should throw a securitypolicyviolation]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/svg/svg-inline.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/svg/svg-inline.sub.html.ini
@@ -1,5 +1,3 @@
 [svg-inline.sub.html]
   prefs: [security.csp.enable_violation_events:true]
-  [Should fire violation event]
-    expected: FAIL
 
--- a/testing/web-platform/meta/content-security-policy/unsafe-eval/eval-blocked-and-sends-report.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/unsafe-eval/eval-blocked-and-sends-report.sub.html.ini
@@ -1,4 +1,3 @@
 [eval-blocked-and-sends-report.sub.html]
-  [Expecting logs: ["PASS: eval() blocked.","violated-directive=script-src"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/unsafe-eval/eval-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/unsafe-eval/eval-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [eval-blocked.sub.html]
-  [Expecting logs: ["PASS EvalError","PASS EvalError", "violated-directive=script-src"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/unsafe-eval/eval-scripts-setInterval-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/unsafe-eval/eval-scripts-setInterval-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [eval-scripts-setInterval-blocked.sub.html]
-  [Expecting logs: ["PASS","violated-directive=script-src"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/unsafe-eval/eval-scripts-setTimeout-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/unsafe-eval/eval-scripts-setTimeout-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [eval-scripts-setTimeout-blocked.sub.html]
-  [Expecting logs: ["PASS","violated-directive=script-src"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/testing/web-platform/meta/content-security-policy/unsafe-eval/function-constructor-blocked.sub.html.ini
+++ b/testing/web-platform/meta/content-security-policy/unsafe-eval/function-constructor-blocked.sub.html.ini
@@ -1,4 +1,3 @@
 [function-constructor-blocked.sub.html]
-  [Expecting logs: ["PASS EvalError","violated-directive=script-src"\]]
-    expected: FAIL
+  prefs: [security.csp.enable_violation_events:true]
 
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -10266,62 +10266,62 @@
   "VIEW_SOURCE_EXTERNAL_RESULT_BOOLEAN": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["mozilla-dev-developer-tools@lists.mozilla.org", "jryans@mozilla.com"],
     "expires_in_version": "53",
     "kind": "boolean",
     "description": "How many times has view source in an external editor been opened, and did it succeed?"
   },
   "BROWSER_IS_USER_DEFAULT": {
-    "record_in_processes": ["main", "content"],
+    "record_in_processes": ["main"],
     "expires_in_version": "never",
     "kind": "boolean",
     "releaseChannelCollection": "opt-out",
     "description": "The result of the startup default desktop browser check."
   },
   "BROWSER_IS_USER_DEFAULT_ERROR": {
-    "record_in_processes": ["main", "content"],
+    "record_in_processes": ["main"],
     "expires_in_version": "never",
     "kind": "boolean",
     "releaseChannelCollection": "opt-out",
     "description": "True if the browser was unable to determine if the browser was set as default."
   },
   "BROWSER_SET_DEFAULT_DIALOG_PROMPT_RAWCOUNT": {
-    "record_in_processes": ["main", "content"],
+    "record_in_processes": ["main"],
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 250,
     "n_buckets": 15,
     "releaseChannelCollection": "opt-out",
     "description": "The number of times that a profile has seen the 'Set Default Browser' dialog."
   },
   "BROWSER_SET_DEFAULT_ALWAYS_CHECK": {
-    "record_in_processes": ["main", "content"],
+    "record_in_processes": ["main"],
     "expires_in_version": "never",
     "kind": "boolean",
     "releaseChannelCollection": "opt-out",
     "description": "True if the profile has `browser.shell.checkDefaultBrowser` set to true."
   },
   "BROWSER_SET_DEFAULT_RESULT": {
-    "record_in_processes": ["main", "content"],
+    "record_in_processes": ["main"],
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values": 4,
     "releaseChannelCollection": "opt-out",
     "description": "Result of the Set Default Browser dialog (0=Use Firefox + 'Always perform check' unchecked, 1=Use Firefox + 'Always perform check' checked, 2=Not Now + 'Always perform check' unchecked, 3=Not Now + 'Always perform check' checked)"
   },
   "BROWSER_SET_DEFAULT_ERROR": {
-    "record_in_processes": ["main", "content"],
+    "record_in_processes": ["main"],
     "expires_in_version": "never",
     "kind": "boolean",
     "releaseChannelCollection": "opt-out",
     "description": "True if the browser was unable to set Firefox as the default browser"
   },
   "BROWSER_IS_ASSIST_DEFAULT": {
-    "record_in_processes": ["main", "content"],
+    "record_in_processes": ["main"],
     "expires_in_version": "never",
     "kind": "boolean",
     "description": "The result of the default browser check for assist intent."
   },
   "MIXED_CONTENT_PAGE_LOAD": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "never",
     "kind": "enumerated",
@@ -12143,25 +12143,25 @@
   "SHOULD_AUTO_DETECT_LANGUAGE": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "default",
     "kind": "flag",
     "description": "Tracks situations when the user opts for auto-detecting the language of a page"
   },
   "PERMISSIONS_REMIGRATION_COMPARISON": {
     "record_in_processes": ["main", "content"],
-    "alert_emails": ["michael@thelayzells.com"],
+    "alert_emails": ["nika@thelayzells.com"],
     "expires_in_version": "44",
     "kind": "enumerated",
     "n_values": 10,
     "description": "Reports a comparison between row count of original and re-migration of the v7 permissions DB. 0=New == 0, 1=New < Old, 2=New == Old, 3=New > Old"
   },
   "PERMISSIONS_MIGRATION_7_ERROR": {
     "record_in_processes": ["main", "content"],
-    "alert_emails": ["michael@thelayzells.com"],
+    "alert_emails": ["nika@thelayzells.com"],
     "expires_in_version": "44",
     "kind": "boolean",
     "description": "Was there an error while performing the v7 permissions DB migration?"
   },
   "PERF_MONITORING_TEST_CPU_RESCHEDULING_PROPORTION_MOVED": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["dteller@mozilla.com"],
     "expires_in_version": "48",
@@ -13222,19 +13222,19 @@
     "kind": "exponential",
     "high": 5000,
     "n_buckets": 100,
     "bug_numbers": [1341531],
     "description": "Time (ms) for the APZ handled wheel event to dispatch, but before handlers executing."
   },
   "IPC_SYNC_MESSAGE_MANAGER_LATENCY_MS": {
     "record_in_processes": ["main", "content"],
-    "alert_emails": ["michael@thelayzells.com"],
+    "alert_emails": ["nika@thelayzells.com"],
     "bug_numbers": [1348113],
-    "expires_in_version": "60",
+    "expires_in_version": "70",
     "kind": "exponential",
     "low": 32,
     "high": 750,
     "n_buckets": 40,
     "keyed": true,
     "description": "Measures the number of milliseconds we spend waiting for sync message manager IPC messages to finish sending, keyed by message name. Note: only messages that wait for more than 500 microseconds are included in this probe."
   },
   "TIMEOUT_EXECUTION_FG_MS":
@@ -13546,19 +13546,19 @@
     "low": 1000,
     "high": 100000,
     "n_buckets": 100,
     "bug_numbers": [1366640],
     "description": "Time (ms) VideoFrameContainer::ClearFutureFrames spent holding a lock."
   },
   "IPC_SYNC_RECEIVE_MS": {
     "record_in_processes": ["main", "content", "gpu"],
-    "alert_emails": ["michael@thelayzells.com"],
+    "alert_emails": ["nika@thelayzells.com"],
     "bug_numbers": [1365719],
-    "expires_in_version": "60",
+    "expires_in_version": "70",
     "kind": "exponential",
     "low": 32,
     "high": 750,
     "n_buckets": 40,
     "keyed": true,
     "description": "Measures the number of milliseconds we spend processing sync IPC messages in the receiving process, keyed by message name. Note: only messages that take over 500 microseconds are included in this probe."
   },
   "IDLE_RUNNABLE_BUDGET_OVERUSE_MS": {
@@ -13656,19 +13656,19 @@
     "kind": "exponential",
     "releaseChannelCollection": "opt-out",
     "high": 50000,
     "n_buckets": 100,
     "description": "The amount of time it takes to perform a set via storage.local."
   },
   "NOTIFY_OBSERVERS_LATENCY_MS": {
     "record_in_processes": ["main", "content", "gpu"],
-    "alert_emails": ["michael@thelayzells.com"],
+    "alert_emails": ["nika@thelayzells.com"],
     "bug_numbers": [1368524],
-    "expires_in_version": "60",
+    "expires_in_version": "70",
     "kind": "exponential",
     "low": 3,
     "high": 512,
     "n_buckets": 20,
     "keyed": true,
     "description": "Measures the number of milliseconds we spend synchronously notifying observers, keyed by topic. Note: only NotifyObservers calls which take over 500 microseconds are included in this probe."
   },
   "HOVER_UNTIL_UNSELECTED_TAB_OPENED": {
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -906,16 +906,17 @@ nsBaseWidget::UseAPZ()
             gfxPrefs::APZPopupsEnabled())));
 }
 
 bool
 nsBaseWidget::AllowWebRenderForThisWindow()
 {
   return WindowType() == eWindowType_toplevel ||
          WindowType() == eWindowType_child ||
+         WindowType() == eWindowType_dialog ||
          (WindowType() == eWindowType_popup && HasRemoteContent());
 }
 
 void nsBaseWidget::CreateCompositor()
 {
   LayoutDeviceIntRect rect = GetBounds();
   CreateCompositor(rect.Width(), rect.Height());
 }
--- a/xpcom/base/NSPRLogModulesParser.cpp
+++ b/xpcom/base/NSPRLogModulesParser.cpp
@@ -25,27 +25,21 @@ NSPRLogModulesParser(const char* aLogMod
   nsAutoCString moduleName;
 
   // Format: LOG_MODULES="Foo:2,Bar, Baz:5"
   while (parser.ReadWord(moduleName)) {
     // Next should be :<level>, default to Error if not provided.
     LogLevel logLevel = LogLevel::Error;
     int32_t levelValue = 0;
     if (parser.CheckChar(':')) {
-      // Check if a negative value is provided.
-      int32_t multiplier = 1;
-      if (parser.CheckChar([](const char aChar) { return aChar == '-'; })) {
-        multiplier = -1;
-      }
-
       // NB: If a level isn't provided after the ':' we assume the default
       //     Error level is desired. This differs from NSPR which will stop
       //     processing the log module string in this case.
-      if (parser.ReadInteger(&levelValue)) {
-        logLevel = ToLogLevel(levelValue * multiplier);
+      if (parser.ReadSignedInteger(&levelValue)) {
+        logLevel = ToLogLevel(levelValue);
       }
     }
 
     aCallback(moduleName.get(), logLevel, levelValue);
 
     // Skip ahead to the next token.
     parser.SkipWhites();
   }
--- a/xpcom/base/nsConsoleService.cpp
+++ b/xpcom/base/nsConsoleService.cpp
@@ -49,16 +49,19 @@ NS_IMPL_RELEASE(nsConsoleService)
 NS_IMPL_CLASSINFO(nsConsoleService, nullptr,
                   nsIClassInfo::THREADSAFE | nsIClassInfo::SINGLETON,
                   NS_CONSOLESERVICE_CID)
 NS_IMPL_QUERY_INTERFACE_CI(nsConsoleService, nsIConsoleService, nsIObserver)
 NS_IMPL_CI_INTERFACE_GETTER(nsConsoleService, nsIConsoleService, nsIObserver)
 
 static const bool gLoggingEnabled = true;
 static const bool gLoggingBuffered = true;
+#ifdef XP_WIN
+static bool gLoggingToDebugger = true;
+#endif // XP_WIN
 #if defined(ANDROID)
 static bool gLoggingLogcat = false;
 #endif // defined(ANDROID)
 
 nsConsoleService::MessageElement::~MessageElement()
 {
 }
 
@@ -66,16 +69,28 @@ nsConsoleService::nsConsoleService()
   : mCurrentSize(0)
   , mDeliveringMessage(false)
   , mLock("nsConsoleService.mLock")
 {
   // XXX grab this from a pref!
   // hm, but worry about circularity, bc we want to be able to report
   // prefs errs...
   mMaximumSize = 250;
+
+#ifdef XP_WIN
+  // This environment variable controls whether the console service
+  // should be prevented from putting output to the attached debugger.
+  // It only affects the Windows platform.
+  //
+  // To disable OutputDebugString, set:
+  //   MOZ_CONSOLESERVICE_DISABLE_DEBUGGER_OUTPUT=1
+  //
+  const char* disableDebugLoggingVar = getenv("MOZ_CONSOLESERVICE_DISABLE_DEBUGGER_OUTPUT");
+  gLoggingToDebugger = !disableDebugLoggingVar || (disableDebugLoggingVar[0] == '0');
+#endif // XP_WIN
 }
 
 
 void
 nsConsoleService::ClearMessagesForWindowID(const uint64_t innerID)
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   MutexAutoLock lock(mLock);
@@ -281,17 +296,17 @@ nsConsoleService::LogMessageWithMode(nsI
           logPriority = ANDROID_LOG_ERROR;
           break;
       }
 
       __android_log_print(logPriority, appName.get(), "%s", msg.get());
     }
 #endif
 #ifdef XP_WIN
-    if (IsDebuggerPresent()) {
+    if (gLoggingToDebugger && IsDebuggerPresent()) {
       nsString msg;
       aMessage->GetMessageMoz(getter_Copies(msg));
       msg.Append('\n');
       OutputDebugStringW(msg.get());
     }
 #endif
 #ifdef MOZ_TASK_TRACER
     if (IsStartLogging()) {
--- a/xpcom/ds/Tokenizer.h
+++ b/xpcom/ds/Tokenizer.h
@@ -4,16 +4,18 @@
  * 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 Tokenizer_h__
 #define Tokenizer_h__
 
 #include "nsString.h"
 #include "mozilla/CheckedInt.h"
+#include "mozilla/ScopeExit.h"
+#include "mozilla/TypeTraits.h"
 #include "mozilla/UniquePtr.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 
 class TokenizerBase
 {
 public:
@@ -342,17 +344,17 @@ public:
    * This is an integer read helper.  It returns false and doesn't move the read
    * cursor when any of the following happens:
    *  - the token at the read cursor is not an integer
    *  - the final number doesn't fit the T type
    * Otherwise true is returned, aValue is filled with the integral number
    * and the cursor is moved forward.
    */
   template <typename T>
-  MOZ_MUST_USE bool ReadInteger(T* aValue)
+  MOZ_MUST_USE bool ReadInteger(T *aValue)
   {
     MOZ_RELEASE_ASSERT(aValue);
 
     nsACString::const_char_iterator rollback = mRollback;
     nsACString::const_char_iterator cursor = mCursor;
     Token t;
     if (!Check(TOKEN_INTEGER, t)) {
       return false;
@@ -367,16 +369,58 @@ public:
       return false;
     }
 
     *aValue = checked.value();
     return true;
   }
 
   /**
+   * Same as above, but accepts an integer with an optional minus sign.
+   */
+  template <typename T,
+            typename V = typename EnableIf<IsSigned<typename RemovePointer<T>::Type>::value,
+                                           typename RemovePointer<T>::Type>::Type>
+  MOZ_MUST_USE bool ReadSignedInteger(T *aValue)
+  {
+    MOZ_RELEASE_ASSERT(aValue);
+
+    nsACString::const_char_iterator rollback = mRollback;
+    nsACString::const_char_iterator cursor = mCursor;
+    auto revert = MakeScopeExit([&] {
+      // Move to a state as if Check() call has failed
+      mRollback = rollback;
+      mCursor = cursor;
+      mHasFailed = true;
+    });
+
+    // Using functional raw access because '-' could be part of the word set
+    // making CheckChar('-') not work.
+    bool minus = CheckChar([](const char aChar) { return aChar == '-'; });
+
+    Token t;
+    if (!Check(TOKEN_INTEGER, t)) {
+      return false;
+    }
+
+    mozilla::CheckedInt<T> checked(t.AsInteger());
+    if (minus) {
+      checked *= -1;
+    }
+
+    if (!checked.isValid()) {
+      return false;
+    }
+
+    *aValue = checked.value();
+    revert.release();
+    return true;
+  }
+
+  /**
    * Returns the read cursor position back as it was before the last call of any parsing
    * method of Tokenizer (Next, Check*, Skip*, Read*) so that the last operation
    * can be repeated.
    * Rollback cannot be used multiple times, it only reverts the last successfull parse
    * operation.  It also cannot be used before any parsing operation has been called
    * on the Tokenizer.
    */
   void Rollback();
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_mips64.cpp
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_mips64.cpp
@@ -85,16 +85,18 @@ invoke_copy_to_stack(uint64_t* d, uint32
             break;
         case nsXPTType::T_U64:
             if (i < N_ARG_REGS)
                 regs[i] = s->val.u64;
             else
                 *d++ = s->val.u64;
             break;
         case nsXPTType::T_FLOAT:
+            // the float data formate must not be converted!
+            // Just only copy without conversion.
             if (i < N_ARG_REGS)
                 *(float*)&regs[i] = s->val.f;
             else
                 *(float*)d++ = s->val.f;
             break;
         case nsXPTType::T_DOUBLE:
             if (i < N_ARG_REGS)
                 *(double*)&regs[i] = s->val.d;
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_mips64.cpp
+++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_mips64.cpp
@@ -120,20 +120,22 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         case nsXPTType::T_U64:
              if (iCount < PARAM_GPR_COUNT)
                  dp->val.u64  = (uint64_t)gprData[iCount++];
              else
                  dp->val.u64  = (uint64_t)*ap++;
              break;
 
         case nsXPTType::T_FLOAT:
+              // the float data formate must not be converted!
+              // Just only copy without conversion.
               if (iCount < PARAM_FPR_COUNT)
-                  dp->val.f  = (double)fprData[iCount++];
+                  dp->val.f  = *(float*)&fprData[iCount++];
               else
-                  dp->val.f  = *((double*)ap++);
+                  dp->val.f  = *((float*)ap++);
               break;
 
         case nsXPTType::T_DOUBLE:
                if (iCount < PARAM_FPR_COUNT)
                    dp->val.d  = (double)fprData[iCount++];
                else
                    dp->val.d  = *((double*)ap++);
                break;
--- a/xpcom/tests/gtest/TestTokenizer.cpp
+++ b/xpcom/tests/gtest/TestTokenizer.cpp
@@ -1148,8 +1148,69 @@ TEST(Tokenizer, RecordAndReadUntil)
   EXPECT_TRUE(subject.Length() == 4);
   EXPECT_TRUE(subject == "bbbb");
 
   EXPECT_FALSE(t.ReadUntil(mozilla::Tokenizer::Token::Char(','), subject));
   EXPECT_TRUE(subject.Length() == 0);
 
   EXPECT_TRUE(t.CheckEOF());
 }
+
+TEST(Tokenizer, ReadIntegers)
+{
+  // Make sure that adding dash (the 'minus' sign) as an additional char
+  // doesn't break reading negative numbers.
+  Tokenizer t("100,-100,200,-200,4294967295,-4294967295,-2147483647", nullptr, "-");
+
+  uint32_t unsigned_value32;
+  int32_t signed_value32;
+  int64_t signed_value64;
+
+  // "100,"
+  EXPECT_TRUE(t.ReadInteger(&unsigned_value32));
+  EXPECT_TRUE(unsigned_value32 == 100);
+  EXPECT_TRUE(t.CheckChar(','));
+
+  // "-100,"
+  EXPECT_FALSE(t.ReadInteger(&unsigned_value32));
+  EXPECT_FALSE(t.CheckChar(','));
+
+  EXPECT_TRUE(t.ReadSignedInteger(&signed_value32));
+  EXPECT_TRUE(signed_value32 == -100);
+  EXPECT_TRUE(t.CheckChar(','));
+
+  // "200,"
+  EXPECT_TRUE(t.ReadSignedInteger(&signed_value32));
+  EXPECT_TRUE(signed_value32 == 200);
+  EXPECT_TRUE(t.CheckChar(','));
+
+  // "-200,"
+  EXPECT_TRUE(t.ReadSignedInteger(&signed_value32));
+  EXPECT_TRUE(signed_value32 == -200);
+  EXPECT_TRUE(t.CheckChar(','));
+
+  // "4294967295,"
+  EXPECT_FALSE(t.ReadSignedInteger(&signed_value32));
+  EXPECT_FALSE(t.CheckChar(','));
+
+  EXPECT_TRUE(t.ReadInteger(&unsigned_value32));
+  EXPECT_TRUE(unsigned_value32 == 4294967295UL);
+  EXPECT_TRUE(t.CheckChar(','));
+
+  // "-4294967295,"
+  EXPECT_FALSE(t.ReadSignedInteger(&signed_value32));
+  EXPECT_FALSE(t.CheckChar(','));
+
+  EXPECT_FALSE(t.ReadInteger(&unsigned_value32));
+  EXPECT_FALSE(t.CheckChar(','));
+
+  EXPECT_TRUE(t.ReadSignedInteger(&signed_value64));
+  EXPECT_TRUE(signed_value64 == -4294967295LL);
+  EXPECT_TRUE(t.CheckChar(','));
+
+  // "-2147483647"
+  EXPECT_FALSE(t.ReadInteger(&unsigned_value32));
+  EXPECT_FALSE(t.CheckChar(','));
+
+  EXPECT_TRUE(t.ReadSignedInteger(&signed_value32));
+  EXPECT_TRUE(signed_value32 == -2147483647L);
+  EXPECT_TRUE(t.CheckEOF());
+}