Skip to content

Commit

Permalink
Merge pull request #8138 from Snuffleupagus/bug-1345253
Browse files Browse the repository at this point in the history
Get rid of `element.removeChild(element.firstChild)` usage (bug 1345253)
  • Loading branch information
timvandermeij authored Mar 8, 2017
2 parents 754c4bd + 468ed1b commit a544a3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions web/pdf_attachment_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions web/pdf_outline_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ 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 = '';
// Ensure that the left (right in RTL locales) margin is always reset,
// to prevent incorrect outline alignment if a new document is opened.
this.container.classList.remove('outlineWithDeepNesting');
},

/**
Expand Down

0 comments on commit a544a3b

Please sign in to comment.