Get rid of element.removeChild(element.firstChild) usage (bug 1345253)

Instead of just upstreaming the changes from [bug 1345253](https://bugzilla.mozilla.org/show_bug.cgi?id=1345253) as-is, it seemed better to simply get rid of the loops altogether and use the same approach as in `PDFViewer`/`PDFThumbnailViewer`.
This commit is contained in:
Jonas Jenwald 2017-03-08 17:29:50 +01:00
parent 754c4bd0ab
commit e07cb8638e
2 changed files with 4 additions and 8 deletions

View File

@ -61,10 +61,8 @@ var PDFAttachmentViewer = (function PDFAttachmentViewerClosure() {
reset: function PDFAttachmentViewer_reset(keepRenderedCapability) {
this.attachments = null;
var container = this.container;
while (container.firstChild) {
container.removeChild(container.firstChild);
}
// Remove the attachments from the DOM.
this.container.textContent = '';
if (!keepRenderedCapability) {
// NOTE: The *only* situation in which the `_renderedCapability` should

View File

@ -63,10 +63,8 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
this.outline = null;
this.lastToggleIsShow = true;
var container = this.container;
while (container.firstChild) {
container.removeChild(container.firstChild);
}
// Remove the outline from the DOM.
this.container.textContent = '';
},
/**