Merge inbound to mozilla-central. a=merge FIREFOX_NIGHTLY_59_END
authorshindli <shindli@mozilla.com>
Sun, 21 Jan 2018 23:57:26 +0200
changeset 400156 5faab9e61990
parent 400141 d112b730d461 (current diff)
parent 400155 cbea2cff1cc2 (diff)
child 400157 978f9f3cb0f6
child 400161 2c17ccaca1a2
child 400228 a4ac245899c5
push id33295
push usershindli@mozilla.com
push dateSun, 21 Jan 2018 21:57:41 +0000
treeherdermozilla-central@5faab9e61990 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone59.0a1
first release with
nightly linux32
5faab9e61990 / 59.0a1 / 20180121220252 / files
nightly linux64
5faab9e61990 / 59.0a1 / 20180121220252 / files
nightly mac
5faab9e61990 / 59.0a1 / 20180121220252 / files
nightly win32
5faab9e61990 / 59.0a1 / 20180121220252 / files
nightly win64
5faab9e61990 / 59.0a1 / 20180121220252 / 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
dom/interfaces/core/nsIDOMAttr.idl
dom/interfaces/core/nsIDOMMozNamedAttrMap.idl
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -18,17 +18,16 @@
 #include "RootAccessible.h"
 #include "TreeWalker.h"
 #include "xpcAccessibleDocument.h"
 
 #include "nsIMutableArray.h"
 #include "nsICommandManager.h"
 #include "nsIDocShell.h"
 #include "nsIDocument.h"
-#include "nsIDOMAttr.h"
 #include "nsIDOMCharacterData.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMXULDocument.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsPIDOMWindow.h"
 #include "nsIEditingSession.h"
 #include "nsIFrame.h"
 #include "nsIInterfaceRequestorUtils.h"
--- 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.274
+Current extension version is: 2.0.288
 
-Taken from upstream commit: f774abc8
+Taken from upstream commit: f0216484
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -1804,17 +1804,17 @@ module.exports = typeof window !== 'unde
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
-exports.build = exports.version = exports.setPDFNetworkStreamClass = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFWorker = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.getDocument = undefined;
+exports.build = exports.version = exports.setPDFNetworkStreamFactory = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFWorker = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.getDocument = undefined;
 
 var _util = __w_pdfjs_require__(0);
 
 var _dom_utils = __w_pdfjs_require__(1);
 
 var _font_loader = __w_pdfjs_require__(13);
 
 var _canvas = __w_pdfjs_require__(14);
@@ -1834,19 +1834,19 @@ function _interopRequireDefault(obj) { r
 var DEFAULT_RANGE_CHUNK_SIZE = 65536;
 var isWorkerDisabled = false;
 var workerSrc;
 var isPostMessageTransfersDisabled = false;
 var pdfjsFilePath = null;
 var fakeWorkerFilesLoader = null;
 var useRequireEnsure = false;
 ;
-var PDFNetworkStream;
-function setPDFNetworkStreamClass(cls) {
-  PDFNetworkStream = cls;
+var createPDFNetworkStream;
+function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {
+  createPDFNetworkStream = pdfNetworkStreamFactory;
 }
 function getDocument(src) {
   var task = new PDFDocumentLoadingTask();
   var source;
   if (typeof src === 'string') {
     source = { url: src };
   } else if ((0, _util.isArrayBuffer)(src)) {
     source = { data: src };
@@ -1912,32 +1912,32 @@ function getDocument(src) {
     return _fetchDocument(worker, params, rangeTransport, docId).then(function (workerId) {
       if (task.destroyed) {
         throw new Error('Loading aborted');
       }
       let networkStream;
       if (rangeTransport) {
         networkStream = new _transport_stream.PDFDataTransportStream(params, rangeTransport);
       } else if (!params.data) {
-        networkStream = new PDFNetworkStream(params);
+        networkStream = createPDFNetworkStream(params);
       }
       var messageHandler = new _util.MessageHandler(docId, workerId, worker.port);
       messageHandler.postMessageTransfers = worker.postMessageTransfers;
       var transport = new WorkerTransport(messageHandler, task, networkStream, CMapReaderFactory);
       task._transport = transport;
       messageHandler.send('Ready', null);
     });
   }).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.274';
+  let apiVersion = '2.0.288';
   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', {
@@ -3005,20 +3005,21 @@ var WorkerTransport = function WorkerTra
     },
     getJavaScript: function WorkerTransport_getJavaScript() {
       return this.messageHandler.sendWithPromise('GetJavaScript', null);
     },
     getOutline: function WorkerTransport_getOutline() {
       return this.messageHandler.sendWithPromise('GetOutline', null);
     },
     getMetadata: function WorkerTransport_getMetadata() {
-      return this.messageHandler.sendWithPromise('GetMetadata', null).then(function transportMetadata(results) {
+      return this.messageHandler.sendWithPromise('GetMetadata', null).then(results => {
         return {
           info: results[0],
-          metadata: results[1] ? new _metadata.Metadata(results[1]) : null
+          metadata: results[1] ? new _metadata.Metadata(results[1]) : null,
+          contentDispositionFilename: this._fullReader ? this._fullReader.filename : null
         };
       });
     },
     getStats: function WorkerTransport_getStats() {
       return this.messageHandler.sendWithPromise('GetStats', null);
     },
     startCleanup: function WorkerTransport_startCleanup() {
       this.messageHandler.sendWithPromise('Cleanup', null).then(() => {
@@ -3221,26 +3222,26 @@ var InternalRenderTask = function Intern
         }
       }
     }
   };
   return InternalRenderTask;
 }();
 var version, build;
 {
-  exports.version = version = '2.0.274';
-  exports.build = build = 'f774abc8';
+  exports.version = version = '2.0.288';
+  exports.build = build = 'f0216484';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
 exports.PDFDataRangeTransport = PDFDataRangeTransport;
 exports.PDFWorker = PDFWorker;
 exports.PDFDocumentProxy = PDFDocumentProxy;
 exports.PDFPageProxy = PDFPageProxy;
-exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass;
+exports.setPDFNetworkStreamFactory = setPDFNetworkStreamFactory;
 exports.version = version;
 exports.build = build;
 
 /***/ }),
 /* 4 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
@@ -4615,18 +4616,18 @@ exports.SVGGraphics = SVGGraphics;
 
 /***/ }),
 /* 8 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.0.274';
-var pdfjsBuild = 'f774abc8';
+var pdfjsVersion = '2.0.288';
+var pdfjsBuild = 'f0216484';
 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);
 ;
@@ -7738,18 +7739,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.274';
-  PDFJS.build = 'f774abc8';
+  PDFJS.version = '2.0.288';
+  PDFJS.build = 'f0216484';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {
   (0, _util.setVerbosityLevel)(PDFJS.verbosity);
 }
 delete PDFJS.verbosity;
 Object.defineProperty(PDFJS, 'verbosity', {
   get() {
@@ -10165,16 +10166,17 @@ var PDFDataTransportStream = function PD
         rangeReader.cancel(reason);
       });
       this._pdfDataRangeTransport.abort();
     }
   };
   function PDFDataTransportStreamReader(stream, queuedChunks) {
     this._stream = stream;
     this._done = false;
+    this._filename = null;
     this._queuedChunks = queuedChunks || [];
     this._requests = [];
     this._headersReady = Promise.resolve();
     stream._fullRequestReader = this;
     this.onProgress = null;
   }
   PDFDataTransportStreamReader.prototype = {
     _enqueue: function PDFDataTransportStreamReader_enqueue(chunk) {
@@ -10189,16 +10191,19 @@ var PDFDataTransportStream = function PD
         });
         return;
       }
       this._queuedChunks.push(chunk);
     },
     get headersReady() {
       return this._headersReady;
     },
+    get filename() {
+      return this._filename;
+    },
     get isRangeSupported() {
       return this._stream._isRangeSupported;
     },
     get isStreamingSupported() {
       return this._stream._isStreamingSupported;
     },
     get contentLength() {
       return this._stream._contentLength;
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -20779,18 +20779,18 @@ exports.PostScriptCompiler = PostScriptC
 
 /***/ }),
 /* 18 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.0.274';
-var pdfjsBuild = 'f774abc8';
+var pdfjsVersion = '2.0.288';
+var pdfjsBuild = 'f0216484';
 var pdfjsCoreWorker = __w_pdfjs_require__(19);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
 /***/ }),
 /* 19 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
@@ -20981,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.274';
+    let workerVersion = '2.0.288';
     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;
@@ -26867,32 +26867,16 @@ var Jbig2Image = function Jbig2ImageClos
       visitor[callbackName].apply(visitor, args);
     }
   }
   function processSegments(segments, visitor) {
     for (var i = 0, ii = segments.length; i < ii; i++) {
       processSegment(segments[i], visitor);
     }
   }
-  function parseJbig2(data, start, end) {
-    var position = start;
-    if (data[position] !== 0x97 || data[position + 1] !== 0x4A || data[position + 2] !== 0x42 || data[position + 3] !== 0x32 || data[position + 4] !== 0x0D || data[position + 5] !== 0x0A || data[position + 6] !== 0x1A || data[position + 7] !== 0x0A) {
-      throw new Jbig2Error('invalid header');
-    }
-    var header = {};
-    position += 8;
-    var flags = data[position++];
-    header.randomAccess = !(flags & 1);
-    if (!(flags & 2)) {
-      header.numberOfPages = (0, _util.readUint32)(data, position);
-      position += 4;
-    }
-    readSegments(header, data, position, end);
-    throw new Error('Not implemented');
-  }
   function parseJbig2Chunks(chunks) {
     var visitor = new SimpleSegmentVisitor();
     for (var i = 0, ii = chunks.length; i < ii; i++) {
       var chunk = chunks[i];
       var segments = readSegments({}, chunk.data, chunk.start, chunk.end);
       processSegments(segments, visitor);
     }
     return visitor.buffer;
--- a/browser/extensions/pdfjs/content/web/viewer.html
+++ b/browser/extensions/pdfjs/content/web/viewer.html
@@ -15,17 +15,17 @@ See the License for the specific languag
 limitations under the License.
 
 Adobe CMap resources are covered by their own copyright but the same license:
 
     Copyright 1990-2015 Adobe Systems Incorporated.
 
 See https://github.com/adobe-type-tools/cmap-resources
 -->
-<html dir="ltr" mozdisallowselectionprint moznomarginboxes>
+<html dir="ltr" mozdisallowselectionprint>
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
     <title>PDF.js viewer</title>
 
 <!-- This snippet is used in the Firefox extension (included from viewer.html) -->
 <base href="resource://pdf.js/web/">
 <script src="../build/pdf.js"></script>
--- a/browser/extensions/pdfjs/content/web/viewer.js
+++ b/browser/extensions/pdfjs/content/web/viewer.js
@@ -90,17 +90,17 @@
 /***/ (function(module, exports, __webpack_require__) {
 
 "use strict";
 
 
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
-exports.waitOnEventOrTimeout = exports.WaitOnType = exports.localized = exports.animationStarted = exports.normalizeWheelEventDelta = exports.binarySearchFirstItem = exports.watchScroll = exports.scrollIntoView = exports.getOutputScale = exports.approximateFraction = exports.roundToDivide = exports.getVisibleElements = exports.parseQueryString = exports.noContextMenuHandler = exports.getPDFFileNameFromURL = exports.ProgressBar = exports.EventBus = exports.NullL10n = exports.mozL10n = exports.RendererType = exports.PresentationModeState = exports.cloneObj = exports.isValidRotation = exports.VERTICAL_PADDING = exports.SCROLLBAR_PADDING = exports.MAX_AUTO_SCALE = exports.UNKNOWN_SCALE = exports.MAX_SCALE = exports.MIN_SCALE = exports.DEFAULT_SCALE = exports.DEFAULT_SCALE_VALUE = exports.CSS_UNITS = undefined;
+exports.waitOnEventOrTimeout = exports.WaitOnType = exports.localized = exports.animationStarted = exports.normalizeWheelEventDelta = exports.binarySearchFirstItem = exports.watchScroll = exports.scrollIntoView = exports.getOutputScale = exports.approximateFraction = exports.roundToDivide = exports.getVisibleElements = exports.parseQueryString = exports.noContextMenuHandler = exports.getPDFFileNameFromURL = exports.ProgressBar = exports.EventBus = exports.NullL10n = exports.mozL10n = exports.RendererType = exports.PresentationModeState = exports.cloneObj = exports.isFileSchema = exports.isValidRotation = exports.VERTICAL_PADDING = exports.SCROLLBAR_PADDING = exports.MAX_AUTO_SCALE = exports.UNKNOWN_SCALE = exports.MAX_SCALE = exports.MIN_SCALE = exports.DEFAULT_SCALE = exports.DEFAULT_SCALE_VALUE = exports.CSS_UNITS = undefined;
 
 var _pdfjsLib = __webpack_require__(1);
 
 const CSS_UNITS = 96.0 / 72.0;
 const DEFAULT_SCALE_VALUE = 'auto';
 const DEFAULT_SCALE = 1.0;
 const MIN_SCALE = 0.10;
 const MAX_SCALE = 10.0;
@@ -336,16 +336,24 @@ function getVisibleElements(scrollEl, vi
     first,
     last,
     views: visible
   };
 }
 function noContextMenuHandler(evt) {
   evt.preventDefault();
 }
+function isFileSchema(url) {
+  let i = 0,
+      ii = url.length;
+  while (i < ii && url[i].trim() === '') {
+    i++;
+  }
+  return url.substr(i, 7).toLowerCase() === 'file://';
+}
 function isDataSchema(url) {
   let i = 0,
       ii = url.length;
   while (i < ii && url[i].trim() === '') {
     i++;
   }
   return url.substr(i, 5).toLowerCase() === 'data:';
 }
@@ -527,16 +535,17 @@ exports.DEFAULT_SCALE_VALUE = DEFAULT_SC
 exports.DEFAULT_SCALE = DEFAULT_SCALE;
 exports.MIN_SCALE = MIN_SCALE;
 exports.MAX_SCALE = MAX_SCALE;
 exports.UNKNOWN_SCALE = UNKNOWN_SCALE;
 exports.MAX_AUTO_SCALE = MAX_AUTO_SCALE;
 exports.SCROLLBAR_PADDING = SCROLLBAR_PADDING;
 exports.VERTICAL_PADDING = VERTICAL_PADDING;
 exports.isValidRotation = isValidRotation;
+exports.isFileSchema = isFileSchema;
 exports.cloneObj = cloneObj;
 exports.PresentationModeState = PresentationModeState;
 exports.RendererType = RendererType;
 exports.mozL10n = mozL10n;
 exports.NullL10n = NullL10n;
 exports.EventBus = EventBus;
 exports.ProgressBar = ProgressBar;
 exports.getPDFFileNameFromURL = getPDFFileNameFromURL;
@@ -929,16 +938,17 @@ let PDFViewerApplication = {
     renderInteractiveForms: false,
     enablePrintAutoRotate: false
   },
   isViewerEmbedded: window.parent !== window,
   url: '',
   baseUrl: '',
   externalServices: DefaultExternalServices,
   _boundEvents: {},
+  contentDispositionFilename: null,
   initialize(appConfig) {
     this.preferences = this.externalServices.createPreferences();
     configure(_pdfjsLib.PDFJS);
     this.appConfig = appConfig;
     return this._readPreferences().then(() => {
       return this._parseHashParameters();
     }).then(() => {
       return this._initializeL10n();
@@ -1304,16 +1314,19 @@ let PDFViewerApplication = {
       this.pdfThumbnailViewer.setDocument(null);
       this.pdfViewer.setDocument(null);
       this.pdfLinkService.setDocument(null, null);
       this.pdfDocumentProperties.setDocument(null, null);
     }
     this.store = null;
     this.isInitialViewSet = false;
     this.downloadComplete = false;
+    this.url = '';
+    this.baseUrl = '';
+    this.contentDispositionFilename = null;
     this.pdfSidebar.reset();
     this.pdfOutlineViewer.reset();
     this.pdfAttachmentViewer.reset();
     this.findController.reset();
     this.findBar.reset();
     this.toolbar.reset();
     this.secondaryToolbar.reset();
     if (typeof PDFBug !== 'undefined') {
@@ -1342,16 +1355,21 @@ let PDFViewerApplication = {
     if (args) {
       for (let prop in args) {
         if (prop === 'length') {
           this.pdfDocumentProperties.setFileSize(args[prop]);
         }
         parameters[prop] = args[prop];
       }
     }
+    if (this.url && (0, _ui_utils.isFileSchema)(this.url)) {
+      let appConfig = this.appConfig;
+      appConfig.toolbar.download.setAttribute('hidden', 'true');
+      appConfig.secondaryToolbar.downloadButton.setAttribute('hidden', 'true');
+    }
     let loadingTask = (0, _pdfjsLib.getDocument)(parameters);
     this.pdfLoadingTask = loadingTask;
     loadingTask.onPassword = (updateCallback, reason) => {
       this.passwordPrompt.setUpdateCallback(updateCallback, reason);
       this.passwordPrompt.open();
     };
     loadingTask.onProgress = ({ loaded, total }) => {
       this.progress(loaded / total);
@@ -1380,17 +1398,17 @@ let PDFViewerApplication = {
       });
     });
   },
   download() {
     function downloadByUrl() {
       downloadManager.downloadUrl(url, filename);
     }
     let url = this.baseUrl;
-    let filename = (0, _ui_utils.getPDFFileNameFromURL)(this.url);
+    let filename = this.contentDispositionFilename || (0, _ui_utils.getPDFFileNameFromURL)(this.url);
     let downloadManager = this.downloadManager;
     downloadManager.onerror = err => {
       this.error(`PDF failed to download: ${err}`);
     };
     if (!this.pdfDocument || !this.downloadComplete) {
       downloadByUrl();
       return;
     }
@@ -1599,32 +1617,35 @@ let PDFViewerApplication = {
     Promise.all([onePageRendered, _ui_utils.animationStarted]).then(() => {
       pdfDocument.getOutline().then(outline => {
         this.pdfOutlineViewer.render({ outline });
       });
       pdfDocument.getAttachments().then(attachments => {
         this.pdfAttachmentViewer.render({ attachments });
       });
     });
-    pdfDocument.getMetadata().then(({ info, metadata }) => {
+    pdfDocument.getMetadata().then(({ info, metadata, contentDispositionFilename }) => {
       this.documentInfo = info;
       this.metadata = metadata;
+      this.contentDispositionFilename = contentDispositionFilename;
       console.log('PDF ' + pdfDocument.fingerprint + ' [' + info.PDFFormatVersion + ' ' + (info.Producer || '-').trim() + ' / ' + (info.Creator || '-').trim() + ']' + ' (PDF.js: ' + (_pdfjsLib.version || '-') + (!_pdfjsLib.PDFJS.disableWebGL ? ' [WebGL]' : '') + ')');
       let pdfTitle;
       if (metadata && metadata.has('dc:title')) {
         let title = metadata.get('dc:title');
         if (title !== 'Untitled') {
           pdfTitle = title;
         }
       }
       if (!pdfTitle && info && info['Title']) {
         pdfTitle = info['Title'];
       }
       if (pdfTitle) {
-        this.setTitle(pdfTitle + ' - ' + document.title);
+        this.setTitle(`${pdfTitle} - ${contentDispositionFilename || document.title}`);
+      } else if (contentDispositionFilename) {
+        this.setTitle(contentDispositionFilename);
       }
       if (info.IsAcroFormPresent) {
         console.warn('Warning: AcroForm/XFA is not supported');
         this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms);
       }
       let versionId = String(info.PDFFormatVersion).slice(-1) | 0;
       let generatorId = 0;
       const KNOWN_GENERATORS = ['acrobat distiller', 'acrobat pdfwriter', 'adobe livecycle', 'adobe pdf library', 'adobe photoshop', 'ghostscript', 'tcpdf', 'cairo', 'dvipdfm', 'dvips', 'pdftex', 'pdfkit', 'itext', 'prince', 'quarkxpress', 'mac os x', 'microsoft', 'openoffice', 'oracle', 'luradocument', 'pdf-xchange', 'antenna house', 'aspose.cells', 'fpdf'];
@@ -4099,28 +4120,28 @@ class PDFDocumentProperties {
         configurable: true
       });
     };
     Promise.all([this.overlayManager.open(this.overlayName), this._dataAvailableCapability.promise]).then(() => {
       if (this.fieldData) {
         this._updateUI();
         return;
       }
-      this.pdfDocument.getMetadata().then(({ info, metadata }) => {
-        return Promise.all([info, metadata, this._parseFileSize(this.maybeFileSize), this._parseDate(info.CreationDate), this._parseDate(info.ModDate)]);
-      }).then(([info, metadata, fileSize, creationDate, modificationDate]) => {
+      this.pdfDocument.getMetadata().then(({ info, metadata, contentDispositionFilename }) => {
+        return Promise.all([info, metadata, contentDispositionFilename || (0, _ui_utils.getPDFFileNameFromURL)(this.url), this._parseFileSize(this.maybeFileSize), this._parseDate(info.CreationDate), this._parseDate(info.ModDate)]);
+      }).then(([info, metadata, fileName, fileSize, creationDate, modDate]) => {
         freezeFieldData({
-          'fileName': (0, _ui_utils.getPDFFileNameFromURL)(this.url),
+          'fileName': fileName,
           'fileSize': fileSize,
           'title': info.Title,
           'author': info.Author,
           'subject': info.Subject,
           'keywords': info.Keywords,
           'creationDate': creationDate,
-          'modificationDate': modificationDate,
+          'modificationDate': modDate,
           'creator': info.Creator,
           'producer': info.Producer,
           'version': info.PDFFormatVersion,
           'pageCount': this.pdfDocument.numPages
         });
         this._updateUI();
         return this.pdfDocument.getDownloadInfo();
       }).then(({ length }) => {
--- a/devtools/server/actors/object.js
+++ b/devtools/server/actors/object.js
@@ -1765,18 +1765,18 @@ DebuggerServer.ObjectActorPreviewers.Obj
   function ArrayLike({obj, hooks}, grip, rawObj) {
     if (isWorker || !rawObj ||
         obj.class != "DOMStringList" &&
         obj.class != "DOMTokenList" &&
         obj.class != "CSSRuleList" &&
         obj.class != "MediaList" &&
         obj.class != "StyleSheetList" &&
         obj.class != "CSSValueList" &&
-        !(rawObj instanceof Ci.nsIDOMMozNamedAttrMap ||
-          rawObj instanceof Ci.nsIDOMFileList ||
+        obj.class != "NamedNodeMap" &&
+        !(rawObj instanceof Ci.nsIDOMFileList ||
           rawObj instanceof Ci.nsIDOMNodeList)) {
       return false;
     }
 
     if (typeof rawObj.length != "number") {
       return false;
     }
 
@@ -1858,17 +1858,17 @@ DebuggerServer.ObjectActorPreviewers.Obj
         preview.nodeName = preview.nodeName.toLowerCase();
       }
 
       preview.attributes = {};
       preview.attributesLength = rawObj.attributes.length;
       for (let attr of rawObj.attributes) {
         preview.attributes[attr.nodeName] = hooks.createValueGrip(attr.value);
       }
-    } else if (rawObj instanceof Ci.nsIDOMAttr) {
+    } else if (obj.class == "Attr") {
       preview.value = hooks.createValueGrip(rawObj.value);
     } else if (rawObj instanceof Ci.nsIDOMText ||
                rawObj instanceof Ci.nsIDOMComment) {
       preview.textContent = hooks.createValueGrip(rawObj.textContent);
     }
 
     return true;
   },
--- a/dom/base/Attr.cpp
+++ b/dom/base/Attr.cpp
@@ -1,16 +1,16 @@
 /* -*- 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/. */
 
 /*
- * Implementation of DOM Core's nsIDOMAttr node.
+ * Implementation of DOM Core's Attr node.
  */
 
 #include "mozilla/dom/Attr.h"
 #include "mozilla/dom/AttrBinding.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/InternalMutationEvent.h"
 #include "nsContentCreatorFunctions.h"
@@ -94,17 +94,17 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(Attr)
   return tmp->HasKnownLiveWrapper();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 // QueryInterface implementation for Attr
 NS_INTERFACE_TABLE_HEAD(Attr)
   NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY
-  NS_INTERFACE_TABLE(Attr, nsINode, nsIDOMAttr, nsIAttribute, nsIDOMNode,
+  NS_INTERFACE_TABLE(Attr, nsINode, nsIAttribute, nsIDOMNode,
                      nsIDOMEventTarget, EventTarget)
   NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(Attr)
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
                                  new nsNodeSupportsWeakRefTearoff(this))
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Attr)
 NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(Attr,
@@ -147,36 +147,33 @@ Attr::SetOwnerDocument(nsIDocument* aDoc
                 mNodeInfo->NamespaceID(),
                 nsIDOMNode::ATTRIBUTE_NODE);
   NS_ASSERTION(newNodeInfo, "GetNodeInfo lies");
   mNodeInfo.swap(newNodeInfo);
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 Attr::GetName(nsAString& aName)
 {
   aName = NodeName();
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 Attr::GetValue(nsAString& aValue)
 {
   Element* element = GetElement();
   if (element) {
     RefPtr<nsAtom> nameAtom = mNodeInfo->NameAtom();
     element->GetAttr(mNodeInfo->NamespaceID(), nameAtom, aValue);
   }
   else {
     aValue = mValue;
   }
-
-  return NS_OK;
 }
 
 void
 Attr::SetValue(const nsAString& aValue, nsIPrincipal* aTriggeringPrincipal, ErrorResult& aRv)
 {
   Element* element = GetElement();
   if (!element) {
     mValue = aValue;
@@ -187,69 +184,44 @@ Attr::SetValue(const nsAString& aValue, 
   aRv = element->SetAttr(mNodeInfo->NamespaceID(),
                          nameAtom,
                          mNodeInfo->GetPrefixAtom(),
                          aValue,
                          aTriggeringPrincipal,
                          true);
 }
 
-NS_IMETHODIMP
-Attr::SetValue(const nsAString& aValue)
+void
+Attr::SetValue(const nsAString& aValue, ErrorResult& aRv)
 {
-  ErrorResult rv;
-  SetValue(aValue, nullptr, rv);
-  return rv.StealNSResult();
+  SetValue(aValue, nullptr, aRv);
 }
 
 bool
 Attr::Specified() const
 {
   return true;
 }
 
-NS_IMETHODIMP
-Attr::GetSpecified(bool* aSpecified)
-{
-  NS_ENSURE_ARG_POINTER(aSpecified);
-  *aSpecified = Specified();
-  return NS_OK;
-}
-
 Element*
 Attr::GetOwnerElement(ErrorResult& aRv)
 {
   return GetElement();
 }
 
-NS_IMETHODIMP
-Attr::GetOwnerElement(nsIDOMElement** aOwnerElement)
-{
-  NS_ENSURE_ARG_POINTER(aOwnerElement);
-
-  Element* element = GetElement();
-  if (element) {
-    return CallQueryInterface(element, aOwnerElement);
-  }
-
-  *aOwnerElement = nullptr;
-
-  return NS_OK;
-}
-
 void
 Attr::GetNodeValueInternal(nsAString& aNodeValue)
 {
   GetValue(aNodeValue);
 }
 
 void
 Attr::SetNodeValueInternal(const nsAString& aNodeValue, ErrorResult& aError)
 {
-  aError = SetValue(aNodeValue);
+  SetValue(aNodeValue, nullptr, aError);
 }
 
 nsresult
 Attr::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
             bool aPreallocateChildren) const
 {
   nsAutoString value;
   const_cast<Attr*>(this)->GetValue(value);
@@ -283,23 +255,16 @@ Attr::GetTextContentInternal(nsAString& 
 void
 Attr::SetTextContentInternal(const nsAString& aTextContent,
                              nsIPrincipal* aSubjectPrincipal,
                              ErrorResult& aError)
 {
   SetNodeValueInternal(aTextContent, aError);
 }
 
-NS_IMETHODIMP
-Attr::GetIsId(bool* aReturn)
-{
-  *aReturn = mNodeInfo->Equals(nsGkAtoms::id, kNameSpaceID_None);
-  return NS_OK;
-}
-
 bool
 Attr::IsNodeOfType(uint32_t aFlags) const
 {
     return !(aFlags & ~eATTRIBUTE);
 }
 
 uint32_t
 Attr::GetChildCount() const
--- a/dom/base/Attr.h
+++ b/dom/base/Attr.h
@@ -1,41 +1,41 @@
 /* -*- 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/. */
 
 /*
- * Implementation of DOM Core's nsIDOMAttr node.
+ * Implementation of DOM Core's Attr node.
  */
 
 #ifndef mozilla_dom_Attr_h
 #define mozilla_dom_Attr_h
 
 #include "mozilla/Attributes.h"
 #include "nsIAttribute.h"
-#include "nsIDOMAttr.h"
+#include "nsIDOMNode.h"
 #include "nsIDOMText.h"
 #include "nsIDOMNodeList.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsStubMutationObserver.h"
 
 class nsIDocument;
 
 namespace mozilla {
 class EventChainPreVisitor;
 namespace dom {
 
 // Attribute helper class used to wrap up an attribute with a dom
-// object that implements nsIDOMAttr and nsIDOMNode
+// object that implements the DOM Attr interface.
 class Attr final : public nsIAttribute,
-                   public nsIDOMAttr
+                   public nsIDOMNode
 {
   virtual ~Attr() {}
 
 public:
   Attr(nsDOMAttributeMap* aAttrMap,
        already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
        const nsAString& aValue);
 
@@ -47,19 +47,16 @@ public:
                                       OOMReporter& aError) override;
   virtual void SetTextContentInternal(const nsAString& aTextContent,
                                       nsIPrincipal* aSubjectPrincipal,
                                       ErrorResult& aError) override;
   virtual void GetNodeValueInternal(nsAString& aNodeValue) override;
   virtual void SetNodeValueInternal(const nsAString& aNodeValue,
                                     ErrorResult& aError) override;
 
-  // nsIDOMAttr interface
-  NS_DECL_NSIDOMATTR
-
   virtual nsresult GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
 
   // nsIAttribute interface
   void SetMap(nsDOMAttributeMap *aMap) override;
   Element* GetElement() const;
   nsresult SetOwnerDocument(nsIDocument* aDocument) override;
 
   // nsINode interface
@@ -81,21 +78,21 @@ public:
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Attr,
                                                                    nsIAttribute)
 
   virtual nsIDOMNode* AsDOMNode() override { return this; }
 
   // WebIDL
   virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
-  // XPCOM GetName() is OK
-
-  // XPCOM GetValue() is OK
+  void GetName(nsAString& aName);
+  void GetValue(nsAString& aValue);
 
   void SetValue(const nsAString& aValue, nsIPrincipal* aTriggeringPrincipal, ErrorResult& aRv);
+  void SetValue(const nsAString& aValue, ErrorResult& aRv);
 
   bool Specified() const;
 
   // XPCOM GetNamespaceURI() is OK
   // XPCOM GetPrefix() is OK
   // XPCOM GetLocalName() is OK
 
   Element* GetOwnerElement(ErrorResult& aRv);
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -3010,17 +3010,17 @@ Element::UnsetAttr(int32_t aNameSpaceID,
   // Grab the attr node if needed before we remove it from the attr map
   RefPtr<Attr> attrNode;
   if (hasMutationListeners) {
     nsAutoString ns;
     nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, ns);
     attrNode = GetAttributeNodeNSInternal(ns, nsDependentAtomString(aName));
   }
 
-  // Clear binding to nsIDOMMozNamedAttrMap
+  // Clear the attribute out from attribute map.
   nsDOMSlots *slots = GetExistingDOMSlots();
   if (slots && slots->mAttributeMap) {
     slots->mAttributeMap->DropAttribute(aNameSpaceID, aName);
   }
 
   // The id-handling code, and in the future possibly other code, need to
   // react to unexpected attribute changes.
   nsMutationGuard::DidMutate();
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -42,17 +42,16 @@
 #include "mozilla/dom/Nullable.h"
 #include "mozilla/dom/PointerEventHandler.h"
 #include "mozilla/UniquePtr.h"
 #include "Units.h"
 #include "DOMIntersectionObserver.h"
 
 class mozAutoDocUpdate;
 class nsIFrame;
-class nsIDOMMozNamedAttrMap;
 class nsIMozBrowserFrame;
 class nsIURI;
 class nsIScrollableFrame;
 class nsAttrValueOrString;
 class nsContentList;
 class nsDOMTokenList;
 struct nsRect;
 class nsFocusManager;
@@ -2196,21 +2195,16 @@ nsresult                                
 
 #define NS_FORWARD_NSIDOMELEMENT_TO_GENERIC                                   \
 typedef mozilla::dom::Element Element;                                        \
 NS_IMETHOD GetTagName(nsAString& aTagName) final override                     \
 {                                                                             \
   Element::GetTagName(aTagName);                                              \
   return NS_OK;                                                               \
 }                                                                             \
-NS_IMETHOD GetAttributes(nsIDOMMozNamedAttrMap** aAttributes) final override  \
-{                                                                             \
-  NS_ADDREF(*aAttributes = Attributes());                                     \
-  return NS_OK;                                                               \
-}                                                                             \
 using Element::GetAttribute;                                                  \
 NS_IMETHOD GetAttribute(const nsAString& name, nsAString& _retval) final      \
   override                                                                    \
 {                                                                             \
   nsString attr;                                                              \
   GetAttribute(name, attr);                                                   \
   _retval = attr;                                                             \
   return NS_OK;                                                               \
@@ -2223,24 +2217,10 @@ NS_IMETHOD SetAttribute(const nsAString&
   return rv.StealNSResult();                                                  \
 }                                                                             \
 using Element::HasAttribute;                                                  \
 NS_IMETHOD HasAttribute(const nsAString& name,                                \
                            bool* _retval) final override                      \
 {                                                                             \
   *_retval = HasAttribute(name);                                              \
   return NS_OK;                                                               \
-}                                                                             \
-NS_IMETHOD GetAttributeNode(const nsAString& name,                            \
-                            nsIDOMAttr** _retval) final override              \
-{                                                                             \
-  NS_IF_ADDREF(*_retval = Element::GetAttributeNode(name));                   \
-  return NS_OK;                                                               \
-}                                                                             \
-NS_IMETHOD GetAttributeNodeNS(const nsAString& namespaceURI,                  \
-                              const nsAString& localName,                     \
-                              nsIDOMAttr** _retval) final override            \
-{                                                                             \
-  NS_IF_ADDREF(*_retval = Element::GetAttributeNodeNS(namespaceURI,           \
-                                                      localName));            \
-  return NS_OK;                                                               \
 }
 #endif // mozilla_dom_Element_h__
--- a/dom/base/FragmentOrElement.h
+++ b/dom/base/FragmentOrElement.h
@@ -310,18 +310,17 @@ public:
 
     /**
      * The .dataset attribute.
      * @see nsGenericHTMLElement::GetDataset
      */
     nsDOMStringMap* mDataset; // [Weak]
 
     /**
-     * An object implementing nsIDOMMozNamedAttrMap for this content (attributes)
-     * @see FragmentOrElement::GetAttributes
+     * @see Element::Attributes
      */
     RefPtr<nsDOMAttributeMap> mAttributeMap;
 
     /**
      * An object implementing the .children property for this element.
      */
     RefPtr<nsContentList> mChildrenList;
 
--- a/dom/base/nsDOMAttributeMap.cpp
+++ b/dom/base/nsDOMAttributeMap.cpp
@@ -89,21 +89,21 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_
   return tmp->HasKnownLiveWrapperAndDoesNotNeedTracing(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsDOMAttributeMap)
   return tmp->HasKnownLiveWrapper();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 // QueryInterface implementation for nsDOMAttributeMap
-NS_INTERFACE_TABLE_HEAD(nsDOMAttributeMap)
-  NS_INTERFACE_TABLE(nsDOMAttributeMap, nsIDOMMozNamedAttrMap)
-  NS_INTERFACE_TABLE_TO_MAP_SEGUE
-  NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY
+
+NS_INTERFACE_MAP_BEGIN(nsDOMAttributeMap)
+  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsDOMAttributeMap)
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMAttributeMap)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMAttributeMap)
 
 nsresult
 nsDOMAttributeMap::SetOwnerDocument(nsIDocument* aDocument)
 {
@@ -193,49 +193,16 @@ nsDOMAttributeMap::GetSupportedNames(nsT
 
 Attr*
 nsDOMAttributeMap::GetNamedItem(const nsAString& aAttrName)
 {
   bool dummy;
   return NamedGetter(aAttrName, dummy);
 }
 
-NS_IMETHODIMP
-nsDOMAttributeMap::GetNamedItem(const nsAString& aAttrName,
-                                nsIDOMAttr** aAttribute)
-{
-  NS_ENSURE_ARG_POINTER(aAttribute);
-
-  NS_IF_ADDREF(*aAttribute = GetNamedItem(aAttrName));
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsDOMAttributeMap::SetNamedItem(nsIDOMAttr* aAttr, nsIDOMAttr** aReturn)
-{
-  Attr* attribute = static_cast<Attr*>(aAttr);
-  NS_ENSURE_ARG(attribute);
-
-  ErrorResult rv;
-  *aReturn = SetNamedItemNS(*attribute, rv).take();
-  return rv.StealNSResult();
-}
-
-NS_IMETHODIMP
-nsDOMAttributeMap::SetNamedItemNS(nsIDOMAttr* aAttr, nsIDOMAttr** aReturn)
-{
-  Attr* attribute = static_cast<Attr*>(aAttr);
-  NS_ENSURE_ARG(attribute);
-
-  ErrorResult rv;
-  *aReturn = SetNamedItemNS(*attribute, rv).take();
-  return rv.StealNSResult();
-}
-
 already_AddRefed<Attr>
 nsDOMAttributeMap::SetNamedItemNS(Attr& aAttr, ErrorResult& aError)
 {
   NS_ENSURE_TRUE(mContent, nullptr);
 
   // XXX should check same-origin between mContent and aAttr however
   // nsContentUtils::CheckSameOrigin can't deal with attributenodes yet
 
@@ -327,27 +294,16 @@ already_AddRefed<Attr>
 nsDOMAttributeMap::RemoveNamedItem(NodeInfo* aNodeInfo, ErrorResult& aError)
 {
   RefPtr<Attr> attribute = GetAttribute(aNodeInfo);
   // This removes the attribute node from the attribute map.
   aError = mContent->UnsetAttr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom(), true);
   return attribute.forget();
 }
 
-NS_IMETHODIMP
-nsDOMAttributeMap::RemoveNamedItem(const nsAString& aName,
-                                   nsIDOMAttr** aReturn)
-{
-  NS_ENSURE_ARG_POINTER(aReturn);
-
-  ErrorResult rv;
-  *aReturn = RemoveNamedItem(aName, rv).take();
-  return rv.StealNSResult();
-}
-
 already_AddRefed<Attr>
 nsDOMAttributeMap::RemoveNamedItem(const nsAString& aName, ErrorResult& aError)
 {
   if (!mContent) {
     aError.Throw(NS_ERROR_DOM_NOT_FOUND_ERR);
     return nullptr;
   }
 
@@ -381,48 +337,24 @@ nsDOMAttributeMap::IndexedGetter(uint32_
 
 Attr*
 nsDOMAttributeMap::Item(uint32_t aIndex)
 {
   bool dummy;
   return IndexedGetter(aIndex, dummy);
 }
 
-NS_IMETHODIMP
-nsDOMAttributeMap::Item(uint32_t aIndex, nsIDOMAttr** aReturn)
-{
-  NS_IF_ADDREF(*aReturn = Item(aIndex));
-  return NS_OK;
-}
-
 uint32_t
 nsDOMAttributeMap::Length() const
 {
   NS_ENSURE_TRUE(mContent, 0);
 
   return mContent->GetAttrCount();
 }
 
-nsresult
-nsDOMAttributeMap::GetLength(uint32_t *aLength)
-{
-  NS_ENSURE_ARG_POINTER(aLength);
-  *aLength = Length();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsDOMAttributeMap::GetNamedItemNS(const nsAString& aNamespaceURI,
-                                  const nsAString& aLocalName,
-                                  nsIDOMAttr** aReturn)
-{
-  NS_IF_ADDREF(*aReturn = GetNamedItemNS(aNamespaceURI, aLocalName));
-  return NS_OK;
-}
-
 Attr*
 nsDOMAttributeMap::GetNamedItemNS(const nsAString& aNamespaceURI,
                                   const nsAString& aLocalName)
 {
   RefPtr<mozilla::dom::NodeInfo> ni = GetAttrNodeInfo(aNamespaceURI, aLocalName);
   if (!ni) {
     return nullptr;
   }
@@ -466,27 +398,16 @@ nsDOMAttributeMap::GetAttrNodeInfo(const
 
       return ni.forget();
     }
   }
 
   return nullptr;
 }
 
-NS_IMETHODIMP
-nsDOMAttributeMap::RemoveNamedItemNS(const nsAString& aNamespaceURI,
-                                     const nsAString& aLocalName,
-                                     nsIDOMAttr** aReturn)
-{
-  NS_ENSURE_ARG_POINTER(aReturn);
-  ErrorResult rv;
-  *aReturn = RemoveNamedItemNS(aNamespaceURI, aLocalName, rv).take();
-  return rv.StealNSResult();
-}
-
 already_AddRefed<Attr>
 nsDOMAttributeMap::RemoveNamedItemNS(const nsAString& aNamespaceURI,
                                      const nsAString& aLocalName,
                                      ErrorResult& aError)
 {
   RefPtr<mozilla::dom::NodeInfo> ni = GetAttrNodeInfo(aNamespaceURI, aLocalName);
   if (!ni) {
     aError.Throw(NS_ERROR_DOM_NOT_FOUND_ERR);
--- a/dom/base/nsDOMAttributeMap.h
+++ b/dom/base/nsDOMAttributeMap.h
@@ -10,17 +10,16 @@
 
 #ifndef nsDOMAttributeMap_h
 #define nsDOMAttributeMap_h
 
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/dom/Attr.h"
 #include "mozilla/ErrorResult.h"
 #include "nsCycleCollectionParticipant.h"
-#include "nsIDOMMozNamedAttrMap.h"
 #include "nsRefPtrHashtable.h"
 #include "nsString.h"
 #include "nsWrapperCache.h"
 
 class nsAtom;
 class nsIDocument;
 namespace mozilla {
 namespace dom {
@@ -81,34 +80,30 @@ public:
       return mozilla::HashGeneric(aKey->mNamespaceID, aKey->mLocalName);
     }
   enum { ALLOW_MEMMOVE = true };
 
 private:
   nsAttrKey mKey;
 };
 
-// Helper class that implements the nsIDOMMozNamedAttrMap interface.
-class nsDOMAttributeMap final : public nsIDOMMozNamedAttrMap
+class nsDOMAttributeMap final : public nsISupports
                               , public nsWrapperCache
 {
 public:
   typedef mozilla::dom::Attr Attr;
   typedef mozilla::dom::DocGroup DocGroup;
   typedef mozilla::dom::Element Element;
   typedef mozilla::ErrorResult ErrorResult;
 
   explicit nsDOMAttributeMap(Element *aContent);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsDOMAttributeMap)
 
-  // nsIDOMMozNamedAttrMap interface
-  NS_DECL_NSIDOMMOZNAMEDATTRMAP
-
   void DropReference();
 
   Element* GetContent()
   {
     return mContent;
   }
 
   /**
--- a/dom/base/nsDOMDataChannel.cpp
+++ b/dom/base/nsDOMDataChannel.cpp
@@ -108,161 +108,80 @@ nsDOMDataChannel::Init(nsPIDOMWindowInne
 
   rv = nsContentUtils::GetUTFOrigin(principal,mOrigin);
   LOG(("%s: origin = %s\n",__FUNCTION__,NS_LossyConvertUTF16toASCII(mOrigin).get()));
   return rv;
 }
 
 // Most of the GetFoo()/SetFoo()s don't need to touch shared resources and
 // are safe after Close()
-NS_IMETHODIMP
+void
 nsDOMDataChannel::GetLabel(nsAString& aLabel)
 {
   mDataChannel->GetLabel(aLabel);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 nsDOMDataChannel::GetProtocol(nsAString& aProtocol)
 {
   mDataChannel->GetProtocol(aProtocol);
-  return NS_OK;
 }
 
 uint16_t
 nsDOMDataChannel::Id() const
 {
   return mDataChannel->GetStream();
 }
 
-NS_IMETHODIMP
-nsDOMDataChannel::GetId(uint16_t *aId)
-{
-  *aId = Id();
-  return NS_OK;
-}
-
 // XXX should be GetType()?  Open question for the spec
 bool
 nsDOMDataChannel::Reliable() const
 {
   return mDataChannel->GetType() == mozilla::DataChannelConnection::RELIABLE;
 }
 
-NS_IMETHODIMP
-nsDOMDataChannel::GetReliable(bool* aReliable)
-{
-  *aReliable = Reliable();
-  return NS_OK;
-}
-
 bool
 nsDOMDataChannel::Ordered() const
 {
   return mDataChannel->GetOrdered();
 }
 
-NS_IMETHODIMP
-nsDOMDataChannel::GetOrdered(bool* aOrdered)
-{
-  *aOrdered = Ordered();
-  return NS_OK;
-}
-
 RTCDataChannelState
 nsDOMDataChannel::ReadyState() const
 {
   return static_cast<RTCDataChannelState>(mDataChannel->GetReadyState());
 }
 
 
-NS_IMETHODIMP
-nsDOMDataChannel::GetReadyState(nsAString& aReadyState)
-{
-  // mState is handled on multiple threads and needs locking
-  uint16_t readyState = mozilla::DataChannel::CLOSED;
-  if (!mSentClose) {
-    readyState = mDataChannel->GetReadyState();
-  }
-  // From the WebRTC spec
-  const char * stateName[] = {
-    "connecting",
-    "open",
-    "closing",
-    "closed"
-  };
-  MOZ_ASSERT(/*readyState >= mozilla::DataChannel::CONNECTING && */ // Always true due to datatypes
-             readyState <= mozilla::DataChannel::CLOSED);
-  aReadyState.AssignASCII(stateName[readyState]);
-
-  return NS_OK;
-}
-
 uint32_t
 nsDOMDataChannel::BufferedAmount() const
 {
   if (!mSentClose) {
     return mDataChannel->GetBufferedAmount();
   }
   return 0;
 }
 
 uint32_t
 nsDOMDataChannel::BufferedAmountLowThreshold() const
 {
   return mDataChannel->GetBufferedAmountLowThreshold();
 }
 
-NS_IMETHODIMP
-nsDOMDataChannel::GetBufferedAmount(uint32_t* aBufferedAmount)
-{
-  *aBufferedAmount = BufferedAmount();
-  return NS_OK;
-}
-
 void
 nsDOMDataChannel::SetBufferedAmountLowThreshold(uint32_t aThreshold)
 {
   mDataChannel->SetBufferedAmountLowThreshold(aThreshold);
 }
 
-NS_IMETHODIMP nsDOMDataChannel::GetBinaryType(nsAString & aBinaryType)
-{
-  switch (mBinaryType) {
-  case DC_BINARY_TYPE_ARRAYBUFFER:
-    aBinaryType.AssignLiteral("arraybuffer");
-    break;
-  case DC_BINARY_TYPE_BLOB:
-    aBinaryType.AssignLiteral("blob");
-    break;
-  default:
-    NS_ERROR("Should not happen");
-  }
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsDOMDataChannel::SetBinaryType(const nsAString& aBinaryType)
-{
-  if (aBinaryType.EqualsLiteral("arraybuffer")) {
-    mBinaryType = DC_BINARY_TYPE_ARRAYBUFFER;
-  } else if (aBinaryType.EqualsLiteral("blob")) {
-    mBinaryType = DC_BINARY_TYPE_BLOB;
-  } else  {
-    return NS_ERROR_INVALID_ARG;
-  }
-  return NS_OK;
-}
-
-NS_IMETHODIMP
+void
 nsDOMDataChannel::Close()
 {
   mDataChannel->Close();
   UpdateMustKeepAlive();
-  return NS_OK;
 }
 
 // All of the following is copy/pasted from WebSocket.cpp.
 void
 nsDOMDataChannel::Send(const nsAString& aData, ErrorResult& aRv)
 {
   NS_ConvertUTF16toUTF8 msgString(aData);
   Send(nullptr, msgString, false, aRv);
--- a/dom/base/nsDOMDataChannel.h
+++ b/dom/base/nsDOMDataChannel.h
@@ -52,26 +52,27 @@ public:
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
     override;
   nsPIDOMWindowInner* GetParentObject() const
   {
     return GetOwner();
   }
 
   // WebIDL
-  // Uses XPIDL GetLabel.
+  void GetLabel(nsAString& aLabel);
+  void GetProtocol(nsAString& aProtocol);
   bool Reliable() const;
   mozilla::dom::RTCDataChannelState ReadyState() const;
   uint32_t BufferedAmount() const;
   uint32_t BufferedAmountLowThreshold() const;
   void SetBufferedAmountLowThreshold(uint32_t aThreshold);
   IMPL_EVENT_HANDLER(open)
   IMPL_EVENT_HANDLER(error)
   IMPL_EVENT_HANDLER(close)
-  // Uses XPIDL Close.
+  void Close();
   IMPL_EVENT_HANDLER(message)
   IMPL_EVENT_HANDLER(bufferedamountlow)
   mozilla::dom::RTCDataChannelType BinaryType() const
   {
     return static_cast<mozilla::dom::RTCDataChannelType>(
       static_cast<int>(mBinaryType));
   }
   void SetBinaryType(mozilla::dom::RTCDataChannelType aType)
@@ -80,17 +81,16 @@ public:
       static_cast<int>(aType));
   }
   void Send(const nsAString& aData, mozilla::ErrorResult& aRv);
   void Send(mozilla::dom::Blob& aData, mozilla::ErrorResult& aRv);
   void Send(const mozilla::dom::ArrayBuffer& aData, mozilla::ErrorResult& aRv);
   void Send(const mozilla::dom::ArrayBufferView& aData,
             mozilla::ErrorResult& aRv);
 
-  // Uses XPIDL GetProtocol.
   bool Ordered() const;
   uint16_t Id() const;
 
   nsresult
   DoOnMessageAvailable(const nsACString& aMessage, bool aBinary);
 
   virtual nsresult
   OnMessageAvailable(nsISupports* aContext, const nsACString& aMessage) override;
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -6127,25 +6127,16 @@ nsIDocument::CreateProcessingInstruction
   }
 
   RefPtr<ProcessingInstruction> pi =
     NS_NewXMLProcessingInstruction(mNodeInfoManager, aTarget, aData);
 
   return pi.forget();
 }
 
-NS_IMETHODIMP
-nsDocument::CreateAttribute(const nsAString& aName,
-                            nsIDOMAttr** aReturn)
-{
-  ErrorResult rv;
-  *aReturn = nsIDocument::CreateAttribute(aName, rv).take();
-  return rv.StealNSResult();
-}
-
 already_AddRefed<Attr>
 nsIDocument::CreateAttribute(const nsAString& aName, ErrorResult& rv)
 {
   if (!mNodeInfoManager) {
     rv.Throw(NS_ERROR_NOT_INITIALIZED);
     return nullptr;
   }
 
@@ -6171,27 +6162,16 @@ nsIDocument::CreateAttribute(const nsASt
     return nullptr;
   }
 
   RefPtr<Attr> attribute = new Attr(nullptr, nodeInfo.forget(),
                                     EmptyString());
   return attribute.forget();
 }
 
-NS_IMETHODIMP
-nsDocument::CreateAttributeNS(const nsAString & aNamespaceURI,
-                              const nsAString & aQualifiedName,
-                              nsIDOMAttr **aResult)
-{
-  ErrorResult rv;
-  *aResult =
-    nsIDocument::CreateAttributeNS(aNamespaceURI, aQualifiedName, rv).take();
-  return rv.StealNSResult();
-}
-
 already_AddRefed<Attr>
 nsIDocument::CreateAttributeNS(const nsAString& aNamespaceURI,
                                const nsAString& aQualifiedName,
                                ErrorResult& rv)
 {
   RefPtr<mozilla::dom::NodeInfo> nodeInfo;
   rv = nsContentUtils::GetNodeInfoFromQName(aNamespaceURI,
                                             aQualifiedName,
--- a/dom/base/nsIDOMDataChannel.idl
+++ b/dom/base/nsIDOMDataChannel.idl
@@ -1,32 +1,10 @@
 /* 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 "nsIDOMEventTarget.idl"
 
-%{C++
-#ifdef GetBinaryType
-// Windows apparently has a #define for GetBinaryType...
-#undef GetBinaryType
-#endif
-%}
-
-interface nsIVariant;
-
 [builtinclass, uuid(b00a4ca7-312e-4926-84f6-8ebb43e53d83)]
 interface nsIDOMDataChannel : nsIDOMEventTarget
 {
-  readonly attribute DOMString label;
-  readonly attribute DOMString protocol;
-  readonly attribute boolean reliable;
-  readonly attribute boolean ordered;
-
-  readonly attribute DOMString readyState;
-  readonly attribute unsigned long bufferedAmount;
-
-  readonly attribute unsigned short id;
-
-  attribute DOMString binaryType;
-
-  void close();
 };
--- a/dom/base/nsNodeUtils.cpp
+++ b/dom/base/nsNodeUtils.cpp
@@ -11,17 +11,16 @@
 #include "nsIContent.h"
 #include "nsIContentInlines.h"
 #include "mozilla/dom/Element.h"
 #include "nsIMutationObserver.h"
 #include "nsIDocument.h"
 #include "mozilla/EventListenerManager.h"
 #include "nsIXPConnect.h"
 #include "PLDHashTable.h"
-#include "nsIDOMAttr.h"
 #include "nsCOMArray.h"
 #include "nsPIDOMWindow.h"
 #include "nsDocument.h"
 #ifdef MOZ_XUL
 #include "nsXULElement.h"
 #endif
 #include "nsBindingManager.h"
 #include "nsGenericHTMLElement.h"
--- a/dom/base/test/chrome/cpows_parent.xul
+++ b/dom/base/test/chrome/cpows_parent.xul
@@ -219,17 +219,16 @@
         try {
           savedElement.QueryInterface(i);
           ok(false, "should have thrown an exception");
         } catch (e) {
           is(e.result, Components.results.NS_ERROR_NO_INTERFACE, "threw the right exception");
         }
       }
 
-      testNoInterface(savedElement, Components.interfaces.nsIDOMAttr);
       testNoInterface(savedElement, Components.interfaces.nsIClassInfo);
 
       // Test to ensure that we don't pass CPOWs to C++-implemented interfaces.
       // See bug 1072980.
       if (test_state == "remote") {
         // This doesn't work because we intercept toString and QueryInterface specially
         // and don't cache the function pointer.
         // See bug 1140636.
--- a/dom/base/test/unit/head_xml.js
+++ b/dom/base/test/unit/head_xml.js
@@ -13,17 +13,16 @@ const nsIFileInputStream   = I.nsIFileIn
 const nsIInputStream       = I.nsIInputStream;
 
 const nsIDOMParser         = I.nsIDOMParser;
 const nsIDOMSerializer     = I.nsIDOMSerializer;
 const nsIDOMDocument       = I.nsIDOMDocument;
 const nsIDOMElement        = I.nsIDOMElement;
 const nsIDOMNode           = I.nsIDOMNode;
 const nsIDOMCharacterData  = I.nsIDOMCharacterData;
-const nsIDOMAttr           = I.nsIDOMAttr;
 const nsIDOMNodeList       = I.nsIDOMNodeList;
 const nsIDOMXULElement     = I.nsIDOMXULElement;
 const nsIDOMProcessingInstruction = I.nsIDOMProcessingInstruction;
 
 function DOMParser() {
   var parser = C["@mozilla.org/xmlextras/domparser;1"].createInstance(nsIDOMParser);
   parser.init();
   return parser;
@@ -89,18 +88,17 @@ function do_compare_attrs(e1, e2) {
     // Don't test for namespace decls, since those can just sorta be
     // scattered about
     if (att.namespaceURI != xmlns) {
       var att2 = a2.getNamedItemNS(att.namespaceURI, att.localName);
       if (!att2) {
         do_throw("Missing attribute with namespaceURI '" + att.namespaceURI +
                  "' and localName '" + att.localName + "'");
       }
-      Assert.equal(att.QueryInterface(nsIDOMAttr).value, 
-                   att2.QueryInterface(nsIDOMAttr).value);
+      Assert.equal(att.value, att2.value);
     }
   }
 }
 
 function do_check_equiv(dom1, dom2) {
   Assert.equal(dom1.nodeType, dom2.nodeType);
   // There's no classinfo around, so we'll need to do some QIing to
   // make sure the right interfaces are flattened as needed.
--- a/dom/base/test/unit/test_isequalnode.js
+++ b/dom/base/test/unit/test_isequalnode.js
@@ -383,17 +383,16 @@ function test_isEqualNode_wholeDoc()
     tw1.nextNode();
   } while(tw2.nextNode());
 }
 
 // UTILITY FUNCTIONS
 
 function n(node)  { return node ? node.QueryInterface(nsIDOMNode) : null; }
 function el(node) { return node ? node.QueryInterface(nsIDOMElement) : null; }
-function at(node) { return node ? node.QueryInterface(nsIDOMAttr) : null; }
 
 
 // TESTING FUNCTIONS
 
 /**
  * Compares the first and third (zero-indexed) child nodes of the element
  * (typically to allow whitespace) referenced by parentId for isEqualNode
  * equality or inequality based on the value of areEqual.
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -22,17 +22,16 @@
 #include "nsAtom.h"
 #include "nsQueryObject.h"
 #include "nsIContentInlines.h"
 #include "nsIContentViewer.h"
 #include "mozilla/css/Declaration.h"
 #include "nsIDocument.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIDOMHTMLDocument.h"
-#include "nsIDOMAttr.h"
 #include "nsIDOMDocumentFragment.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMDocument.h"
 #include "nsMappedAttributes.h"
 #include "nsHTMLStyleSheet.h"
 #include "nsIHTMLDocument.h"
 #include "nsPIDOMWindow.h"
--- a/dom/interfaces/base/domstubs.idl
+++ b/dom/interfaces/base/domstubs.idl
@@ -10,17 +10,16 @@ class nsWrapperCache;
 %}
 
 [ptr] native nsWrapperCachePtr(nsWrapperCache);
 
 typedef unsigned long long DOMTimeStamp;
 typedef double DOMHighResTimeStamp;
 
 // Core
-interface nsIDOMAttr;
 interface nsIDOMCDATASection;
 interface nsIDOMCharacterData;
 interface nsIDOMComment;
 interface nsIDOMDOMImplementation;
 interface nsIDOMDocument;
 interface nsIDOMDocumentFragment;
 interface nsIDOMDocumentType;
 interface nsIDOMElement;
--- a/dom/interfaces/core/moz.build
+++ b/dom/interfaces/core/moz.build
@@ -3,27 +3,25 @@
 # 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/.
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "DOM")
 
 XPIDL_SOURCES += [
-    'nsIDOMAttr.idl',
     'nsIDOMCDATASection.idl',
     'nsIDOMCharacterData.idl',
     'nsIDOMComment.idl',
     'nsIDOMDocument.idl',
     'nsIDOMDocumentFragment.idl',
     'nsIDOMDocumentType.idl',
     'nsIDOMDOMException.idl',
     'nsIDOMDOMImplementation.idl',
     'nsIDOMElement.idl',
-    'nsIDOMMozNamedAttrMap.idl',
     'nsIDOMNode.idl',
     'nsIDOMNodeList.idl',
     'nsIDOMNSEditableElement.idl',
     'nsIDOMProcessingInstruction.idl',
     'nsIDOMText.idl',
     'nsIDOMXMLDocument.idl',
 ]
 
deleted file mode 100644
--- a/dom/interfaces/core/nsIDOMAttr.idl
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "nsIDOMNode.idl"
-
-/**
- * The nsIDOMAttr interface represents an attribute in an "Element" object. 
- * Typically the allowable values for the attribute are defined in a document 
- * type definition.
- * 
- * For more information on this interface please see 
- * http://www.w3.org/TR/DOM-Level-2-Core/
- */
-
-[builtinclass, uuid(7db491e8-a3a3-4432-ad67-e6c33e24ac6d)]
-interface nsIDOMAttr : nsIDOMNode
-{
-  readonly attribute DOMString            name;
-  readonly attribute boolean              specified;
-           attribute DOMString            value;
-                                            // raises(DOMException) on setting
-
-  // Introduced in DOM Level 2:
-  readonly attribute  nsIDOMElement       ownerElement;
-
-  readonly attribute boolean              isId;
-};
--- a/dom/interfaces/core/nsIDOMDocument.idl
+++ b/dom/interfaces/core/nsIDOMDocument.idl
@@ -43,29 +43,23 @@ interface nsIDOMDocument : nsIDOMNode
   nsIDOMDocumentFragment        createDocumentFragment();
   nsIDOMText                    createTextNode(in DOMString data);
   nsIDOMComment                 createComment(in DOMString data);
   nsIDOMCDATASection            createCDATASection(in DOMString data)
                                   raises(DOMException);
   nsIDOMProcessingInstruction   createProcessingInstruction(in DOMString target, 
                                                             in DOMString data)
                                   raises(DOMException);
-  nsIDOMAttr                    createAttribute(in DOMString name)
-                                  raises(DOMException);
   nsIDOMNodeList                getElementsByTagName(in DOMString tagname);
 
   // Introduced in DOM Level 2:
   nsIDOMElement                 createElementNS(in DOMString namespaceURI,
                                                 [Null(Stringify)] in DOMString qualifiedName)
                                   raises(DOMException);
   // Introduced in DOM Level 2:
-  nsIDOMAttr                    createAttributeNS(in DOMString namespaceURI,
-                                                  in DOMString qualifiedName)
-                                  raises(DOMException);
-  // Introduced in DOM Level 2:
   nsIDOMNodeList                getElementsByTagNameNS(in DOMString namespaceURI,
                                                        in DOMString localName);
   // Introduced in DOM Level 2:
   nsIDOMElement                 getElementById(in DOMString elementId);
   // Introduced in DOM Level 3:
   readonly attribute DOMString       inputEncoding;
   // Introduced in DOM Level 3:
   readonly attribute DOMString       documentURI;
--- a/dom/interfaces/core/nsIDOMElement.idl
+++ b/dom/interfaces/core/nsIDOMElement.idl
@@ -24,19 +24,13 @@ interface nsIDOMMozNamedAttrMap;
  * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-element
  */
 
 [uuid(6289999b-1008-4269-b42a-413ec5a9d3f4)]
 interface nsIDOMElement : nsIDOMNode
 {
   readonly attribute DOMString        tagName;
 
-  readonly attribute nsIDOMMozNamedAttrMap attributes;
   DOMString          getAttribute(in DOMString name);
   void               setAttribute(in DOMString name, 
                                   in DOMString value);
   boolean            hasAttribute(in DOMString name);
-
-  // Obsolete methods.
-  nsIDOMAttr         getAttributeNode(in DOMString name);
-  nsIDOMAttr         getAttributeNodeNS(in DOMString namespaceURI, 
-                                        in DOMString localName);
 };
deleted file mode 100644
--- a/dom/interfaces/core/nsIDOMMozNamedAttrMap.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 "domstubs.idl"
-
-/**
- * This is a temporary, non-standard interface, to ease the transition to a
- * world where Attr no longer inherits from Node.
- */
-
-[uuid(cb5564cd-26ec-418f-a6d6-1d57cd2c971c)]
-interface nsIDOMMozNamedAttrMap : nsISupports
-{
-  nsIDOMAttr                getNamedItem(in DOMString name);
-  nsIDOMAttr                setNamedItem(in nsIDOMAttr arg)
-                                  raises(DOMException);
-  nsIDOMAttr                removeNamedItem(in DOMString name)
-                                  raises(DOMException);
-  nsIDOMAttr                item(in unsigned long index);
-  readonly attribute  unsigned long        length;
-  // Introduced in DOM Level 2:
-  nsIDOMAttr                getNamedItemNS(in DOMString namespaceURI, 
-                                           in DOMString localName);
-  // Introduced in DOM Level 2:
-  nsIDOMAttr                setNamedItemNS(in nsIDOMAttr arg)
-                                  raises(DOMException);
-  // Introduced in DOM Level 2:
-  nsIDOMAttr                removeNamedItemNS(in DOMString namespaceURI, 
-                                              in DOMString localName)
-                                  raises(DOMException);
-};
--- a/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
+++ b/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
@@ -1,39 +1,40 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * 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 "WebBrowserPersistLocalDocument.h"
 #include "WebBrowserPersistDocumentParent.h"
 
+#include "mozilla/dom/Attr.h"
+#include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLAnchorElement.h"
 #include "mozilla/dom/HTMLAreaElement.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/HTMLLinkElement.h"
 #include "mozilla/dom/HTMLObjectElement.h"
 #include "mozilla/dom/HTMLOptionElement.h"
 #include "mozilla/dom/HTMLSharedElement.h"
 #include "mozilla/dom/HTMLTextAreaElement.h"
 #include "mozilla/dom/TabParent.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsContentCID.h"
 #include "nsCycleCollectionParticipant.h"
+#include "nsDOMAttributeMap.h"
 #include "nsFrameLoader.h"
 #include "nsIComponentRegistrar.h"
 #include "nsIContent.h"
-#include "nsIDOMAttr.h"
 #include "nsIDOMComment.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLMediaElement.h"
-#include "nsIDOMMozNamedAttrMap.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeFilter.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsIDOMTreeWalker.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsIDocShell.h"
 #include "nsIDocument.h"
@@ -388,56 +389,49 @@ ResourceReader::OnWalkURI(const nsACStri
     rv = NS_NewURI(getter_AddRefs(uri),
                    aURISpec,
                    mParent->GetCharacterSet(),
                    mCurrentBaseURI);
     NS_ENSURE_SUCCESS(rv, rv);
     return OnWalkURI(uri);
 }
 
-static nsresult
+static void
 ExtractAttribute(nsIDOMNode* aNode,
                  const char* aAttribute,
                  const char* aNamespaceURI,
                  nsCString&  aValue)
 {
-    nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aNode);
+    nsCOMPtr<dom::Element> element = do_QueryInterface(aNode);
     MOZ_ASSERT(element);
 
     // Find the named URI attribute on the (element) node and store
     // a reference to the URI that maps onto a local file name
 
-    nsCOMPtr<nsIDOMMozNamedAttrMap> attrMap;
-    nsresult rv = element->GetAttributes(getter_AddRefs(attrMap));
-    NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
+    RefPtr<nsDOMAttributeMap> attrMap = element->Attributes();
 
     NS_ConvertASCIItoUTF16 namespaceURI(aNamespaceURI);
     NS_ConvertASCIItoUTF16 attribute(aAttribute);
-    nsCOMPtr<nsIDOMAttr> attr;
-    rv = attrMap->GetNamedItemNS(namespaceURI, attribute, getter_AddRefs(attr));
-    NS_ENSURE_SUCCESS(rv, rv);
+    RefPtr<dom::Attr> attr = attrMap->GetNamedItemNS(namespaceURI, attribute);
     if (attr) {
         nsAutoString value;
-        rv = attr->GetValue(value);
-        NS_ENSURE_SUCCESS(rv, rv);
-        aValue = NS_ConvertUTF16toUTF8(value);
+        attr->GetValue(value);
+        CopyUTF16toUTF8(value, aValue);
     } else {
         aValue.Truncate();
     }
-    return NS_OK;
 }
 
 nsresult
 ResourceReader::OnWalkAttribute(nsIDOMNode* aNode,
                                 const char* aAttribute,
                                 const char* aNamespaceURI)
 {
     nsAutoCString uriSpec;
-    nsresult rv = ExtractAttribute(aNode, aAttribute, aNamespaceURI, uriSpec);
-    NS_ENSURE_SUCCESS(rv, rv);
+    ExtractAttribute(aNode, aAttribute, aNamespaceURI, uriSpec);
     if (uriSpec.IsEmpty()) {
         return NS_OK;
     }
     return OnWalkURI(uriSpec);
 }
 
 static nsresult
 GetXMLStyleSheetLink(nsIDOMProcessingInstruction *aPI, nsAString &aHref)
@@ -682,57 +676,53 @@ PersistNodeFixup::FixupURI(nsAString &aU
     return NS_OK;
 }
 
 nsresult
 PersistNodeFixup::FixupAttribute(nsIDOMNode* aNode,
                                  const char* aAttribute,
                                  const char* aNamespaceURI)
 {
-    nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aNode);
+    nsCOMPtr<dom::Element> element = do_QueryInterface(aNode);
     MOZ_ASSERT(element);
 
-    nsCOMPtr<nsIDOMMozNamedAttrMap> attrMap;
-    nsresult rv = element->GetAttributes(getter_AddRefs(attrMap));
-    NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
+    RefPtr<nsDOMAttributeMap> attrMap = element->Attributes();
 
     NS_ConvertASCIItoUTF16 attribute(aAttribute);
     NS_ConvertASCIItoUTF16 namespaceURI(aNamespaceURI);
-    nsCOMPtr<nsIDOMAttr> attr;
-    rv = attrMap->GetNamedItemNS(namespaceURI, attribute, getter_AddRefs(attr));
+    RefPtr<dom::Attr> attr = attrMap->GetNamedItemNS(namespaceURI, attribute);
+    nsresult rv = NS_OK;
     if (attr) {
         nsString uri;
         attr->GetValue(uri);
         rv = FixupURI(uri);
         if (NS_SUCCEEDED(rv)) {
-            attr->SetValue(uri);
+            IgnoredErrorResult err;
+            attr->SetValue(uri, err);
         }
     }
 
     return rv;
 }
 
 nsresult
 PersistNodeFixup::FixupAnchor(nsIDOMNode *aNode)
 {
     if (IsFlagSet(IWBP::PERSIST_FLAGS_DONT_FIXUP_LINKS)) {
         return NS_OK;
     }
 
-    nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aNode);
+    nsCOMPtr<dom::Element> element = do_QueryInterface(aNode);
     MOZ_ASSERT(element);
 
-    nsCOMPtr<nsIDOMMozNamedAttrMap> attrMap;
-    nsresult rv = element->GetAttributes(getter_AddRefs(attrMap));
-    NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
+    RefPtr<nsDOMAttributeMap> attrMap = element->Attributes();
 
     // Make all anchor links absolute so they point off onto the Internet
     nsString attribute(NS_LITERAL_STRING("href"));
-    nsCOMPtr<nsIDOMAttr> attr;
-    rv = attrMap->GetNamedItem(attribute, getter_AddRefs(attr));
+    RefPtr<dom::Attr> attr = attrMap->GetNamedItem(attribute);
     if (attr) {
         nsString oldValue;
         attr->GetValue(oldValue);
         NS_ConvertUTF16toUTF8 oldCValue(oldValue);
 
         // Skip empty values and self-referencing bookmarks
         if (oldCValue.IsEmpty() || oldCValue.CharAt(0) == '#') {
             return NS_OK;
@@ -746,24 +736,25 @@ PersistNodeFixup::FixupAnchor(nsIDOMNode
             return NS_OK;
         }
 
         nsCOMPtr<nsIURI> relativeURI;
         relativeURI = IsFlagSet(IWBP::PERSIST_FLAGS_FIXUP_LINKS_TO_DESTINATION)
                       ? mTargetBaseURI : mCurrentBaseURI;
         // Make a new URI to replace the current one
         nsCOMPtr<nsIURI> newURI;
-        rv = NS_NewURI(getter_AddRefs(newURI), oldCValue,
-                       mParent->GetCharacterSet(), relativeURI);
+        nsresult rv = NS_NewURI(getter_AddRefs(newURI), oldCValue,
+                                mParent->GetCharacterSet(), relativeURI);
         if (NS_SUCCEEDED(rv) && newURI) {
             newURI->SetUserPass(EmptyCString());
             nsAutoCString uriSpec;
             rv = newURI->GetSpec(uriSpec);
             NS_ENSURE_SUCCESS(rv, rv);
-            attr->SetValue(NS_ConvertUTF8toUTF16(uriSpec));
+            IgnoredErrorResult err;
+            attr->SetValue(NS_ConvertUTF8toUTF16(uriSpec), err);
         }
     }
 
     return NS_OK;
 }
 
 static void
 AppendXMLAttr(const nsAString& key, const nsAString& aValue, nsAString& aBuffer)
--- a/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp
+++ b/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "txXPathTreeWalker.h"
 #include "nsAtom.h"
 #include "nsIAttribute.h"
-#include "nsIDOMAttr.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsPrintfCString.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
 #include "nsTextFragment.h"
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -5,17 +5,16 @@
 
 #include "nsCOMPtr.h"
 #include "nsDOMCID.h"
 #include "nsError.h"
 #include "nsDOMString.h"
 #include "nsIDOMEvent.h"
 #include "nsAtom.h"
 #include "nsIBaseWindow.h"
-#include "nsIDOMAttr.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMXULCommandDispatcher.h"
 #include "nsIDOMXULElement.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
 #include "nsIDocument.h"
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -56,25 +56,23 @@
 #include "nsDebug.h"                    // for NS_ENSURE_TRUE, etc.
 #include "nsError.h"                    // for NS_OK, etc.
 #include "nsFocusManager.h"             // for nsFocusManager
 #include "nsFrameSelection.h"           // for nsFrameSelection
 #include "nsGkAtoms.h"                  // for nsGkAtoms, nsGkAtoms::dir
 #include "nsIAbsorbingTransaction.h"    // for nsIAbsorbingTransaction
 #include "nsAtom.h"                    // for nsAtom
 #include "nsIContent.h"                 // for nsIContent
-#include "nsIDOMAttr.h"                 // for nsIDOMAttr
 #include "nsIDOMCharacterData.h"        // for nsIDOMCharacterData
 #include "nsIDOMDocument.h"             // for nsIDOMDocument
 #include "nsIDOMElement.h"              // for nsIDOMElement
 #include "nsIDOMEvent.h"                // for nsIDOMEvent
 #include "nsIDOMEventListener.h"        // for nsIDOMEventListener
 #include "nsIDOMEventTarget.h"          // for nsIDOMEventTarget
 #include "nsIDOMHTMLElement.h"          // for nsIDOMHTMLElement
-#include "nsIDOMMozNamedAttrMap.h"      // for nsIDOMMozNamedAttrMap
 #include "nsIDOMMouseEvent.h"           // for nsIDOMMouseEvent
 #include "nsIDOMNode.h"                 // for nsIDOMNode, etc.
 #include "nsIDOMNodeList.h"             // for nsIDOMNodeList
 #include "nsIDocumentStateListener.h"   // for nsIDocumentStateListener
 #include "nsIEditActionListener.h"      // for nsIEditActionListener
 #include "nsIEditorObserver.h"          // for nsIEditorObserver
 #include "nsIEditorSpellCheck.h"        // for nsIEditorSpellCheck
 #include "nsIFrame.h"                   // for nsIFrame
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -2621,18 +2621,17 @@ HTMLEditor::InsertLinkAroundSelection(ns
 
     if (attribute) {
       // We must clear the string buffers
       //   because GetValue appends to previous string!
       value.Truncate();
 
       nsAtom* name = attribute->NodeInfo()->NameAtom();
 
-      rv = attribute->GetValue(value);
-      NS_ENSURE_SUCCESS(rv, rv);
+      attribute->GetValue(value);
 
       rv = SetInlineProperty(nsGkAtoms::a, name, value);
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
   return NS_OK;
 }
 
--- a/editor/libeditor/HTMLURIRefObject.cpp
+++ b/editor/libeditor/HTMLURIRefObject.cpp
@@ -37,23 +37,24 @@
     del:    cite
     ins:    cite
     q:      cite
  */
 
 #include "HTMLURIRefObject.h"
 
 #include "mozilla/mozalloc.h"
+#include "mozilla/dom/Attr.h"
+#include "mozilla/dom/Element.h"
 #include "nsAString.h"
 #include "nsDebug.h"
+#include "nsDOMAttributeMap.h"
 #include "nsError.h"
 #include "nsID.h"
-#include "nsIDOMAttr.h"
 #include "nsIDOMElement.h"
-#include "nsIDOMMozNamedAttrMap.h"
 #include "nsIDOMNode.h"
 #include "nsISupportsUtils.h"
 #include "nsString.h"
 
 namespace mozilla {
 
 // String classes change too often and I can't keep up.
 // Set this macro to this week's approved case-insensitive compare routine.
@@ -86,62 +87,55 @@ HTMLURIRefObject::GetNextURI(nsAString& 
 
   // XXX Why don't you use nsAtom for comparing the tag name a lot?
   nsAutoString tagName;
   nsresult rv = mNode->GetNodeName(tagName);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Loop over attribute list:
   if (!mAttributes) {
-    nsCOMPtr<nsIDOMElement> element (do_QueryInterface(mNode));
+    nsCOMPtr<dom::Element> element(do_QueryInterface(mNode));
     NS_ENSURE_TRUE(element, NS_ERROR_INVALID_ARG);
 
-    mCurAttrIndex = 0;
-    element->GetAttributes(getter_AddRefs(mAttributes));
-    NS_ENSURE_TRUE(mAttributes, NS_ERROR_NOT_INITIALIZED);
-
-    rv = mAttributes->GetLength(&mAttributeCnt);
-    NS_ENSURE_SUCCESS(rv, rv);
+    mAttributes = element->Attributes();
+    mAttributeCnt = mAttributes->Length();
     NS_ENSURE_TRUE(mAttributeCnt, NS_ERROR_FAILURE);
     mCurAttrIndex = 0;
   }
 
   while (mCurAttrIndex < mAttributeCnt) {
-    nsCOMPtr<nsIDOMAttr> attrNode;
-    rv = mAttributes->Item(mCurAttrIndex++, getter_AddRefs(attrNode));
-    NS_ENSURE_SUCCESS(rv, rv);
+    RefPtr<dom::Attr> attrNode = mAttributes->Item(mCurAttrIndex++);
     NS_ENSURE_ARG_POINTER(attrNode);
     nsString curAttr;
-    rv = attrNode->GetName(curAttr);
-    NS_ENSURE_SUCCESS(rv, rv);
+    attrNode->GetName(curAttr);
 
     // href >> A, AREA, BASE, LINK
     if (MATCHES(curAttr, "href")) {
       if (!MATCHES(tagName, "a") && !MATCHES(tagName, "area") &&
           !MATCHES(tagName, "base") && !MATCHES(tagName, "link")) {
         continue;
       }
-      rv = attrNode->GetValue(aURI);
-      NS_ENSURE_SUCCESS(rv, rv);
+      attrNode->GetValue(aURI);
       nsString uri (aURI);
       // href pointing to a named anchor doesn't count
       if (aURI.First() != char16_t('#')) {
         return NS_OK;
       }
       aURI.Truncate();
       return NS_ERROR_INVALID_ARG;
     }
     // src >> FRAME, IFRAME, IMG, INPUT, SCRIPT
     else if (MATCHES(curAttr, "src")) {
       if (!MATCHES(tagName, "img") &&
           !MATCHES(tagName, "frame") && !MATCHES(tagName, "iframe") &&
           !MATCHES(tagName, "input") && !MATCHES(tagName, "script")) {
         continue;
       }
-      return attrNode->GetValue(aURI);
+      attrNode->GetValue(aURI);
+      return NS_OK;
     }
     //<META http-equiv="refresh" content="3,http://www.acme.com/intro.html">
     else if (MATCHES(curAttr, "content")) {
       if (!MATCHES(tagName, "meta")) {
         continue;
       }
     }
     // longdesc >> FRAME, IFRAME, IMG
--- a/editor/libeditor/HTMLURIRefObject.h
+++ b/editor/libeditor/HTMLURIRefObject.h
@@ -5,24 +5,25 @@
 
 #ifndef HTMLURIRefObject_h
 #define HTMLURIRefObject_h
 
 #include "nsCOMPtr.h"
 #include "nsISupportsImpl.h"
 #include "nsIURIRefObject.h"
 #include "nscore.h"
+#include "mozilla/RefPtr.h"
 
 #define NS_URI_REF_OBJECT_CID                          \
 { /* {bdd79df6-1dd1-11b2-b29c-c3d63a58f1d2} */         \
     0xbdd79df6, 0x1dd1, 0x11b2,                        \
     { 0xb2, 0x9c, 0xc3, 0xd6, 0x3a, 0x58, 0xf1, 0xd2 } \
 }
 
-class nsIDOMMozNamedAttrMap;
+class nsDOMAttributeMap;
 class nsIDOMNode;
 
 namespace mozilla {
 
 class HTMLURIRefObject final : public nsIURIRefObject
 {
 public:
   HTMLURIRefObject();
@@ -31,17 +32,17 @@ public:
   NS_DECL_ISUPPORTS
 
   NS_DECL_NSIURIREFOBJECT
 
 protected:
   virtual ~HTMLURIRefObject();
 
   nsCOMPtr<nsIDOMNode> mNode;
-  nsCOMPtr<nsIDOMMozNamedAttrMap> mAttributes;
+  RefPtr<nsDOMAttributeMap> mAttributes;
   uint32_t mCurAttrIndex;
   uint32_t mAttributeCnt;
 };
 
 } // namespace mozilla
 
 nsresult NS_NewHTMLURIRefObject(nsIURIRefObject** aResult, nsIDOMNode* aNode);
 
--- a/layout/inspector/inDOMView.cpp
+++ b/layout/inspector/inDOMView.cpp
@@ -5,29 +5,29 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "inDOMView.h"
 
 #include "inLayoutUtils.h"
 
 #include "nsString.h"
 #include "nsReadableUtils.h"
+#include "nsIAttribute.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeFilter.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMCharacterData.h"
-#include "nsIDOMAttr.h"
-#include "nsIDOMMozNamedAttrMap.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsBindingManager.h"
 #include "nsNameSpaceManager.h"
 #include "nsIDocument.h"
 #include "nsIServiceManager.h"
 #include "nsITreeColumns.h"
 #include "nsITreeBoxObject.h"
+#include "mozilla/dom/Attr.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/Services.h"
 #include "mozilla/dom/InspectorUtils.h"
 
 #ifdef ACCESSIBILITY
 #include "nsAccessibilityService.h"
 #endif
 
@@ -636,51 +636,48 @@ inDOMView::AttributeChanged(nsIDocument*
   if (!(mWhatToShow & nsIDOMNodeFilter::SHOW_ATTRIBUTE)) {
     return;
   }
 
   nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
 
   // get the dom attribute node, if there is any
   nsCOMPtr<nsIDOMElement> el(do_QueryInterface(aElement));
-  nsCOMPtr<nsIDOMAttr> domAttr;
+  RefPtr<dom::Attr> domAttr;
   nsDependentAtomString attrStr(aAttribute);
   if (aNameSpaceID) {
     nsNameSpaceManager* nsm = nsNameSpaceManager::GetInstance();
     if (!nsm) {
       // we can't find out which attribute we want :(
       return;
     }
     nsString attrNS;
     nsresult rv = nsm->GetNameSpaceURI(aNameSpaceID, attrNS);
     if (NS_FAILED(rv)) {
       return;
     }
-    (void)el->GetAttributeNodeNS(attrNS, attrStr, getter_AddRefs(domAttr));
+    domAttr = aElement->GetAttributeNodeNS(attrNS, attrStr);
   } else {
-    (void)el->GetAttributeNode(attrStr, getter_AddRefs(domAttr));
+    domAttr = aElement->GetAttributeNode(attrStr);
   }
 
   if (aModType == nsIDOMMutationEvent::MODIFICATION) {
     // No fancy stuff here, just invalidate the changed row
     if (!domAttr) {
       return;
     }
     int32_t row = 0;
     NodeToRow(domAttr, &row);
     mTree->InvalidateRange(row, row);
   } else if (aModType == nsIDOMMutationEvent::ADDITION) {
     if (!domAttr) {
       return;
     }
     // get the number of attributes on this content node
-    nsCOMPtr<nsIDOMMozNamedAttrMap> attrs;
-    el->GetAttributes(getter_AddRefs(attrs));
-    uint32_t attrCount;
-    attrs->GetLength(&attrCount);
+    uint32_t attrCount = aElement->GetAttrCount();
 
     inDOMViewNode* contentNode = nullptr;
     int32_t contentRow;
     int32_t attrRow;
     if (mRootNode == el &&
         !(mWhatToShow & nsIDOMNodeFilter::SHOW_ELEMENT)) {
       // if this view has a root node but is not displaying it,
       // it is ok to act as if the changed attribute is on the root.
@@ -730,17 +727,18 @@ inDOMView::AttributeChanged(nsIDocument*
     }
 
     // search for the attribute node that was removed
     inDOMViewNode* checkNode = nullptr;
     int32_t row = 0;
     for (row = contentRow+1; row < GetRowCount(); ++row) {
       checkNode = GetNodeAt(row);
       if (checkNode->level == baseLevel+1) {
-        domAttr = do_QueryInterface(checkNode->node);
+        nsCOMPtr<nsIAttribute> attr = do_QueryInterface(checkNode->node);
+        domAttr = static_cast<dom::Attr*>(attr.get());
         if (domAttr) {
           nsAutoString attrName;
           domAttr->GetNodeName(attrName);
           if (attrName.Equals(attrStr)) {
             // we have found the row for the attribute that was removed
             RemoveLink(checkNode);
             RemoveNode(row);
             mTree->RowCountChanged(row, -1);
@@ -1163,23 +1161,19 @@ inDOMView::GetLastDescendantOf(inDOMView
 //////// DOM UTILITIES
 
 nsresult
 inDOMView::GetChildNodesFor(nsIDOMNode* aNode, nsCOMArray<nsIDOMNode>& aResult)
 {
   NS_ENSURE_ARG(aNode);
   // attribute nodes
   if (mWhatToShow & nsIDOMNodeFilter::SHOW_ATTRIBUTE) {
-    nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aNode);
+    nsCOMPtr<dom::Element> element = do_QueryInterface(aNode);
     if (element) {
-      nsCOMPtr<nsIDOMMozNamedAttrMap> attrs;
-      element->GetAttributes(getter_AddRefs(attrs));
-      if (attrs) {
-        AppendAttrsToArray(attrs, aResult);
-      }
+      AppendAttrsToArray(element->Attributes(), aResult);
     }
   }
 
   if (mWhatToShow & nsIDOMNodeFilter::SHOW_ELEMENT) {
     nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
     MOZ_ASSERT(node);
 
     nsCOMPtr<nsINodeList> kids =
@@ -1204,17 +1198,17 @@ nsresult
 inDOMView::GetRealPreviousSibling(nsIDOMNode* aNode, nsIDOMNode* aRealParent, nsIDOMNode** aSibling)
 {
   // XXXjrh: This won't work for some cases during some situations where XBL insertion points
   // are involved.  Fix me!
   aNode->GetPreviousSibling(aSibling);
   return NS_OK;
 }
 
-nsresult
+void
 inDOMView::AppendKidsToArray(nsINodeList* aKids,
                              nsCOMArray<nsIDOMNode>& aArray)
 {
   for (uint32_t i = 0, len = aKids->Length(); i < len; ++i) {
     nsIContent* kid = aKids->Item(i);
     uint16_t nodeType = kid->NodeType();
 
     NS_ASSERTION(nodeType && nodeType <= nsIDOMNode::NOTATION_NODE,
@@ -1238,25 +1232,20 @@ inDOMView::AppendKidsToArray(nsINodeList
           continue;
         }
       }
 
       nsCOMPtr<nsIDOMNode> node = do_QueryInterface(kid);
       aArray.AppendElement(node.forget());
     }
   }
-
-  return NS_OK;
 }
 
 nsresult
-inDOMView::AppendAttrsToArray(nsIDOMMozNamedAttrMap* aAttributes,
+inDOMView::AppendAttrsToArray(nsDOMAttributeMap* aAttributes,
                               nsCOMArray<nsIDOMNode>& aArray)
 {
-  uint32_t l = 0;
-  aAttributes->GetLength(&l);
-  nsCOMPtr<nsIDOMAttr> attribute;
+  uint32_t l = aAttributes->Length();
   for (uint32_t i = 0; i < l; ++i) {
-    aAttributes->Item(i, getter_AddRefs(attribute));
-    aArray.AppendElement(attribute.forget());
+    aArray.AppendElement(aAttributes->Item(i));
   }
   return NS_OK;
 }
--- a/layout/inspector/inDOMView.h
+++ b/layout/inspector/inDOMView.h
@@ -14,17 +14,17 @@
 #include "nsStubMutationObserver.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMDocument.h"
 #include "nsTArray.h"
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"
 
 class inDOMViewNode;
-class nsIDOMMozNamedAttrMap;
+class nsDOMAttributeMap;
 
 class inDOMView : public inIDOMView,
                   public nsITreeView,
                   public nsStubMutationObserver
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_INIDOMVIEW
@@ -75,18 +75,18 @@ protected:
   nsresult NodeToRow(nsIDOMNode* aNode, int32_t* aRow);
 
   void InsertLinkAfter(inDOMViewNode* aNode, inDOMViewNode* aInsertAfter);
   void InsertLinkBefore(inDOMViewNode* aNode, inDOMViewNode* aInsertBefore);
   void RemoveLink(inDOMViewNode* aNode);
   void ReplaceLink(inDOMViewNode* aNewNode, inDOMViewNode* aOldNode);
 
   nsresult GetChildNodesFor(nsIDOMNode* aNode, nsCOMArray<nsIDOMNode>& aResult);
-  nsresult AppendKidsToArray(nsINodeList* aKids, nsCOMArray<nsIDOMNode>& aArray);
-  nsresult AppendAttrsToArray(nsIDOMMozNamedAttrMap* aKids, nsCOMArray<nsIDOMNode>& aArray);
+  void AppendKidsToArray(nsINodeList* aKids, nsCOMArray<nsIDOMNode>& aArray);
+  nsresult AppendAttrsToArray(nsDOMAttributeMap* aKids, nsCOMArray<nsIDOMNode>& aArray);
   nsresult GetFirstDescendantOf(inDOMViewNode* aNode, int32_t aRow, int32_t* aResult);
   nsresult GetLastDescendantOf(inDOMViewNode* aNode, int32_t aRow, int32_t* aResult);
   nsresult GetRealPreviousSibling(nsIDOMNode* aNode, nsIDOMNode* aRealParent, nsIDOMNode** aSibling);
 };
 
 // {FB5C1775-1BBD-4b9c-ABB0-AE7ACD29E87E}
 #define IN_DOMVIEW_CID \
 { 0xfb5c1775, 0x1bbd, 0x4b9c, { 0xab, 0xb0, 0xae, 0x7a, 0xcd, 0x29, 0xe8, 0x7e } }
--- a/layout/xul/nsBox.cpp
+++ b/layout/xul/nsBox.cpp
@@ -2,29 +2,30 @@
 /* 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 "nsBoxLayoutState.h"
 #include "nsBox.h"
 #include "nsBoxFrame.h"
+#include "nsDOMAttributeMap.h"
 #include "nsPresContext.h"
 #include "nsCOMPtr.h"
 #include "nsIContent.h"
 #include "nsContainerFrame.h"
 #include "nsNameSpaceManager.h"
 #include "nsGkAtoms.h"
 #include "nsIDOMNode.h"
-#include "nsIDOMMozNamedAttrMap.h"
-#include "nsIDOMAttr.h"
 #include "nsITheme.h"
 #include "nsIServiceManager.h"
 #include "nsBoxLayout.h"
 #include "FrameLayerBuilder.h"
+#include "mozilla/dom/Attr.h"
+#include "mozilla/dom/Element.h"
 #include <algorithm>
 
 using namespace mozilla;
 
 #ifdef DEBUG_LAYOUT
 int32_t gIndent = 0;
 #endif
 
@@ -60,28 +61,25 @@ nsBox::ListBox(nsAutoString& aResult)
 
     aResult.AppendASCII(addr);
     aResult.Append(name);
     aResult.Append(' ');
 
     nsIContent* content = GetContent();
 
     // add on all the set attributes
-    if (content) {
-      nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
-      nsCOMPtr<nsIDOMMozNamedAttrMap> namedMap;
+    if (content && content->IsElement()) {
+      RefPtr<nsDOMAttributeMap> namedMap = content->AsElement()->Attributes();
 
-      node->GetAttributes(getter_AddRefs(namedMap));
-      uint32_t length;
-      namedMap->GetLength(&length);
+      uint32_t length = namedMap->Length();
 
-      nsCOMPtr<nsIDOMAttr> attribute;
+      RefPtr<dom::Attr> attribute;
       for (uint32_t i = 0; i < length; ++i)
       {
-        namedMap->Item(i, getter_AddRefs(attribute));
+        attribute = namedMap->Item(i);
         attribute->GetName(name);
         nsAutoString value;
         attribute->GetValue(value);
         AppendAttribute(name, value, aResult);
       }
     }
 }
 
--- a/toolkit/content/widgets/notification.xml
+++ b/toolkit/content/widgets/notification.xml
@@ -509,19 +509,18 @@
                   class="popup-notification-body" xbl:inherits="popupid">
           <xul:hbox align="start">
             <xul:vbox flex="1">
               <xul:label class="popup-notification-origin header"
                          xbl:inherits="value=origin,tooltiptext=origin"
                          crop="center"/>
               <xul:description class="popup-notification-description"
                                xbl:inherits="popupid">
-                <html:span xbl:inherits="xbl:text=label,popupid"/>
-                <html:b    xbl:inherits="xbl:text=hostname,popupid"/>
-                <html:span xbl:inherits="xbl:text=endlabel,popupid"/>
+                <!-- These need to be on the same line to avoid creating whitespace between them (whitespace is added in the localization file, if necessary). -->
+                <html:span xbl:inherits="xbl:text=label,popupid"/><html:b xbl:inherits="xbl:text=hostname,popupid"/><html:span xbl:inherits="xbl:text=endlabel,popupid"/>
               </xul:description>
             </xul:vbox>
             <xul:toolbarbutton anonid="closebutton"
                                class="messageCloseButton close-icon popup-notification-closebutton tabbable"
                                xbl:inherits="oncommand=closebuttoncommand,hidden=closebuttonhidden"
                                tooltiptext="&closeNotification.tooltip;"/>
           </xul:hbox>
           <children includes="popupnotificationcontent"/>
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -1114,17 +1114,16 @@ function pingStateAndStatusCodes(aUpdate
  *          A <patch> element to initialize this object with
  * @throws if patch has a size of 0
  * @constructor
  */
 function UpdatePatch(patch) {
   this._properties = {};
   for (var i = 0; i < patch.attributes.length; ++i) {
     var attr = patch.attributes.item(i);
-    attr.QueryInterface(Ci.nsIDOMAttr);
     switch (attr.name) {
       case "selected":
         this.selected = attr.value == "true";
         break;
       case "entityID":
         this.setProperty("entityID", attr.value);
         break;
       case "size":
@@ -1287,17 +1286,16 @@ function Update(update) {
 
   // Set the installDate value with the current time. If the update has an
   // installDate attribute this will be replaced with that value if it doesn't
   // equal 0.
   this.installDate = (new Date()).getTime();
 
   for (let i = 0; i < update.attributes.length; ++i) {
     var attr = update.attributes.item(i);
-    attr.QueryInterface(Ci.nsIDOMAttr);
     if (attr.value == "undefined") {
       continue;
     } else if (attr.name == "detailsURL") {
       this._detailsURL = attr.value;
     } else if (attr.name == "installDate" && attr.value) {
       let val = parseInt(attr.value);
       if (val) {
         this.installDate = val;
--- a/xpcom/base/IntentionalCrash.h
+++ b/xpcom/base/IntentionalCrash.h
@@ -19,16 +19,20 @@
 #ifndef mozilla_IntentionalCrash_h
 #define mozilla_IntentionalCrash_h
 
 namespace mozilla {
 
 inline void
 NoteIntentionalCrash(const char* aProcessType)
 {
+// In opt builds we don't actually have the leak checking enabled, and the
+// sandbox doesn't allow writing to this path, so we just disable this
+// function's behaviour.
+#ifdef MOZ_DEBUG
   char* f = getenv("XPCOM_MEM_BLOAT_LOG");
   if (!f) {
     return;
   }
 
   fprintf(stderr, "XPCOM_MEM_BLOAT_LOG: %s\n", f);
 
   std::string bloatLog(f);
@@ -48,13 +52,14 @@ NoteIntentionalCrash(const char* aProces
 
   fprintf(stderr, "Writing to log: %s\n", bloatName.str().c_str());
 
   FILE* processfd = fopen(bloatName.str().c_str(), "a");
   if (processfd) {
     fprintf(processfd, "==> process %d will purposefully crash\n", getpid());
     fclose(processfd);
   }
+#endif
 }
 
 } // namespace mozilla
 
 #endif // mozilla_IntentionalCrash_h
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -4,17 +4,16 @@
  * 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 "ShimInterfaceInfo.h"
 
 #include "nsIContainerBoxObject.h"
 #include "nsIDOMAnimationEvent.h"
-#include "nsIDOMAttr.h"
 #include "nsIDOMBeforeUnloadEvent.h"
 #include "nsIDOMCanvasRenderingContext2D.h"
 #include "nsIDOMCDATASection.h"
 #include "nsIDOMCharacterData.h"
 #include "nsIDOMClientRect.h"
 #include "nsIDOMClientRectList.h"
 #include "nsIDOMClipboardEvent.h"
 #include "nsIDOMCommandEvent.h"
@@ -44,17 +43,16 @@
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLMediaElement.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMMouseScrollEvent.h"
 #include "nsIDOMMutationEvent.h"
-#include "nsIDOMMozNamedAttrMap.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeIterator.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMNotifyPaintEvent.h"
 #include "nsIDOMNSEvent.h"
 #include "nsIDOMOfflineResourceList.h"
 #include "nsIDOMPaintRequest.h"
 #include "nsIDOMParser.h"
@@ -85,17 +83,16 @@
 #include "nsIMenuBoxObject.h"
 #include "nsIScrollBoxObject.h"
 #include "nsISelection.h"
 #include "nsITreeBoxObject.h"
 #include "nsIWebBrowserPersistable.h"
 #include "nsIXMLHttpRequest.h"
 
 #include "mozilla/dom/AnimationEventBinding.h"
-#include "mozilla/dom/AttrBinding.h"
 #include "mozilla/dom/BeforeUnloadEventBinding.h"
 #include "mozilla/dom/CanvasRenderingContext2DBinding.h"
 #include "mozilla/dom/CDATASectionBinding.h"
 #include "mozilla/dom/CharacterDataBinding.h"
 #include "mozilla/dom/DOMRectBinding.h"
 #include "mozilla/dom/DOMRectListBinding.h"
 #include "mozilla/dom/ClipboardEventBinding.h"
 #include "mozilla/dom/CommandEventBinding.h"
@@ -141,17 +138,16 @@
 #include "mozilla/dom/KeyEventBinding.h"
 #include "mozilla/dom/ListBoxObjectBinding.h"
 #include "mozilla/dom/MediaListBinding.h"
 #include "mozilla/dom/MessageEventBinding.h"
 #include "mozilla/dom/MenuBoxObjectBinding.h"
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/dom/MouseScrollEventBinding.h"
 #include "mozilla/dom/MutationEventBinding.h"
-#include "mozilla/dom/NamedNodeMapBinding.h"
 #include "mozilla/dom/NodeIteratorBinding.h"
 #include "mozilla/dom/NodeListBinding.h"
 #include "mozilla/dom/NodeBinding.h"
 #include "mozilla/dom/NotifyPaintEventBinding.h"
 #include "mozilla/dom/EventBinding.h"
 #include "mozilla/dom/OfflineResourceListBinding.h"
 #include "mozilla/dom/PaintRequestBinding.h"
 #include "mozilla/dom/PositionErrorBinding.h"
@@ -238,17 +234,16 @@ struct ComponentsInterfaceShimEntry {
  *   interface only has an "nsIDOM" prefix prepended to the WebIDL name, you
  *   can use the DEFINE_SHIM macro and pass in the name of the WebIDL
  *   interface.  Otherwise, use DEFINE_SHIM_WITH_CUSTOM_INTERFACE.
  */
 
 const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] =
 {
   DEFINE_SHIM(AnimationEvent),
-  DEFINE_SHIM(Attr),
   DEFINE_SHIM(BeforeUnloadEvent),
   DEFINE_SHIM(CanvasRenderingContext2D),
   DEFINE_SHIM(CDATASection),
   DEFINE_SHIM(CharacterData),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRect, DOMRectReadOnly),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRectList, DOMRectList),
   DEFINE_SHIM(ClipboardEvent),
   DEFINE_SHIM(CommandEvent),
@@ -282,17 +277,16 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM(HTMLInputElement),
   DEFINE_SHIM(HTMLMediaElement),
   DEFINE_SHIM(KeyEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIListBoxObject, ListBoxObject),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIMenuBoxObject, MenuBoxObject),
   DEFINE_SHIM(MouseEvent),
   DEFINE_SHIM(MouseScrollEvent),
   DEFINE_SHIM(MutationEvent),
-  DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMMozNamedAttrMap, NamedNodeMap),
   DEFINE_SHIM(NodeIterator),
   DEFINE_SHIM(NodeList),
   DEFINE_SHIM(Node),
   DEFINE_SHIM(NotifyPaintEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMNSEvent, Event),
   DEFINE_SHIM(OfflineResourceList),
   DEFINE_SHIM(PaintRequest),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMParser, DOMParser),