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:
		
							parent
							
								
									754c4bd0ab
								
							
						
					
					
						commit
						e07cb8638e
					
				@ -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
 | 
			
		||||
 | 
			
		||||
@ -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 = '';
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user