Bug 812372: Rename DocumentViewerImpl to nsDocumentViewer for consistency. [r=ehsan]
authorScott Johnson <sjohnson@mozilla.com>
Wed, 28 Nov 2012 18:26:39 -0600
changeset 114427 91dfecde7a96c0d9e40fdd79701d4dc4917f6010
parent 114426 95afbeaf4fe9f1686e226ddf1978b6384577a142
child 114428 7b516748a65c26b1999e20ea37276694c266181b
push id23917
push useremorley@mozilla.com
push dateThu, 29 Nov 2012 14:20:29 +0000
treeherdermozilla-central@c72d38e7a212 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs812372
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 812372: Rename DocumentViewerImpl to nsDocumentViewer for consistency. [r=ehsan]
browser/base/content/browser-fullZoom.js
browser/base/content/test/browser_bug321000.js
content/base/src/nsDocument.cpp
content/media/MediaResource.cpp
layout/base/nsDocumentViewer.cpp
layout/base/nsPresShell.cpp
layout/generic/nsSubDocumentFrame.cpp
toolkit/components/viewsource/content/viewPartialSource.js
--- a/browser/base/content/browser-fullZoom.js
+++ b/browser/base/content/browser-fullZoom.js
@@ -269,21 +269,21 @@ var FullZoom = {
    * Set the zoom level for the current tab.
    *
    * Per nsPresContext::setFullZoom, we can set the zoom to its current value
    * without significant impact on performance, as the setting is only applied
    * if it differs from the current setting.  In fact getting the zoom and then
    * checking ourselves if it differs costs more.
    * 
    * And perhaps we should always set the zoom even if it was more expensive,
-   * since DocumentViewerImpl::SetTextZoom claims that child documents can have
+   * since nsDocumentViewer::SetTextZoom claims that child documents can have
    * a different text zoom (although it would be unusual), and it implies that
    * those child text zooms should get updated when the parent zoom gets set,
    * and perhaps the same is true for full zoom
-   * (although DocumentViewerImpl::SetFullZoom doesn't mention it).
+   * (although nsDocumentViewer::SetFullZoom doesn't mention it).
    *
    * So when we apply new zoom values to the browser, we simply set the zoom.
    * We don't check first to see if the new value is the same as the current
    * one.
    **/
   _applyPrefToSetting: function FullZoom__applyPrefToSetting(aValue, aBrowser) {
     if ((!this.siteSpecific) || gInPrintPreviewMode)
       return;
--- a/browser/base/content/test/browser_bug321000.js
+++ b/browser/base/content/test/browser_bug321000.js
@@ -66,15 +66,15 @@ function test_paste(aCurrentTest) {
   gBrowser.selectedBrowser.focus();
 
   // Focus the element and wait for focus event.
   info("About to focus " + element.id);
   element.addEventListener("focus", function() {
     element.removeEventListener("focus", arguments.callee, false);
     executeSoon(function() {
       // Pasting is async because the Accel+V codepath ends up going through
-      // DocumentViewerImpl::FireClipboardEvent.
+      // nsDocumentViewer::FireClipboardEvent.
       info("Pasting into " + element.id);
       EventUtils.synthesizeKey("v", { accelKey: true });
     });
   }, false);
   element.focus();
 }
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -6769,17 +6769,17 @@ nsDocument::Destroy()
   for (i = 0; i < count; ++i) {
     mChildren.ChildAt(i)->DestroyContent();
   }
   mInUnlinkOrDeletion = oldVal;
 
   mLayoutHistoryState = nullptr;
 
   // Shut down our external resource map.  We might not need this for
-  // leak-fixing if we fix DocumentViewerImpl to do cycle-collection, but
+  // leak-fixing if we fix nsDocumentViewer to do cycle-collection, but
   // tearing down all those frame trees right now is the right thing to do.
   mExternalResourceMap.Shutdown();
 
   // XXX We really should let cycle collection do this, but that currently still
   //     leaks (see https://bugzilla.mozilla.org/show_bug.cgi?id=406684).
   nsContentUtils::ReleaseWrapper(static_cast<nsINode*>(this), this);
 }
 
--- a/content/media/MediaResource.cpp
+++ b/content/media/MediaResource.cpp
@@ -721,17 +721,17 @@ void ChannelMediaResource::CloseChannel(
 
   if (mChannel) {
     if (mSuspendCount > 0) {
       // Resume the channel before we cancel it
       PossiblyResume();
     }
     // The status we use here won't be passed to the decoder, since
     // we've already revoked the listener. It can however be passed
-    // to DocumentViewerImpl::LoadComplete if our channel is the one
+    // to nsDocumentViewer::LoadComplete if our channel is the one
     // that kicked off creation of a video document. We don't want that
     // document load to think there was an error.
     // NS_ERROR_PARSED_DATA_CACHED is the best thing we have for that
     // at the moment.
     mChannel->Cancel(NS_ERROR_PARSED_DATA_CACHED);
     mChannel = nullptr;
   }
 }
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -190,17 +190,17 @@ GetPrintingLog()
 
 #define PRT_YESNO(_p) ((_p)?"YES":"NO")
 #else
 #define PRT_YESNO(_p)
 #define PR_PL(_p1)
 #endif
 //-----------------------------------------------------
 
-class DocumentViewerImpl;
+class nsDocumentViewer;
 class nsPrintEventDispatcher;
 
 // a small delegate class used to avoid circular references
 
 class nsDocViewerSelectionListener : public nsISelectionListener
 {
 public:
 
@@ -214,21 +214,21 @@ public:
                        : mDocViewer(NULL)
                        , mGotSelectionState(false)
                        , mSelectionWasCollapsed(false)
                        {
                        }
 
   virtual              ~nsDocViewerSelectionListener() {}
 
-  nsresult             Init(DocumentViewerImpl *aDocViewer);
+  nsresult             Init(nsDocumentViewer *aDocViewer);
 
 protected:
 
-  DocumentViewerImpl*  mDocViewer;
+  nsDocumentViewer*  mDocViewer;
   bool                 mGotSelectionState;
   bool                 mSelectionWasCollapsed;
 
 };
 
 
 /** editor Implementation of the FocusListener interface
  */
@@ -240,41 +240,41 @@ public:
   nsDocViewerFocusListener();
   /** default destructor
    */
   virtual ~nsDocViewerFocusListener();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMEVENTLISTENER
 
-  nsresult             Init(DocumentViewerImpl *aDocViewer);
+  nsresult             Init(nsDocumentViewer *aDocViewer);
 
 private:
-    DocumentViewerImpl*  mDocViewer;
+    nsDocumentViewer*  mDocViewer;
 };
 
 
 //-------------------------------------------------------------
-class DocumentViewerImpl : public nsIContentViewer,
+class nsDocumentViewer : public nsIContentViewer,
                            public nsIContentViewerEdit,
                            public nsIContentViewerFile,
                            public nsIMarkupDocumentViewer,
                            public nsIDocumentViewerPrint
 
 #ifdef NS_PRINTING
                            , public nsIWebBrowserPrint
 #endif
 
 {
   friend class nsDocViewerSelectionListener;
   friend class nsPagePrintTimer;
   friend class nsPrintEngine;
 
 public:
-  DocumentViewerImpl();
+  nsDocumentViewer();
 
   NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
 
   // nsISupports interface...
   NS_DECL_ISUPPORTS
 
   // nsIContentViewer interface...
   NS_DECL_NSICONTENTVIEWER
@@ -308,17 +308,17 @@ public:
   static void DispatchAfterPrint(nsIDocument* aTop)
   {
     DispatchEventToWindowTree(aTop, NS_LITERAL_STRING("afterprint"));
   }
   static void DispatchEventToWindowTree(nsIDocument* aTop,
                                         const nsAString& aEvent);
 
 protected:
-  virtual ~DocumentViewerImpl();
+  virtual ~nsDocumentViewer();
 
 private:
   /**
    * Creates a view manager, root view, and widget for the root view, setting
    * mViewManager and mWindow.
    * @param aSize the initial size in appunits
    * @param aContainerView the container view to hook our root view up
    * to as a child, or null if this will be the root view manager
@@ -466,21 +466,21 @@ protected:
   bool mHidden;
 };
 
 class nsPrintEventDispatcher
 {
 public:
   nsPrintEventDispatcher(nsIDocument* aTop) : mTop(aTop)
   {
-    DocumentViewerImpl::DispatchBeforePrint(mTop);
+    nsDocumentViewer::DispatchBeforePrint(mTop);
   }
   ~nsPrintEventDispatcher()
   {
-    DocumentViewerImpl::DispatchAfterPrint(mTop);
+    nsDocumentViewer::DispatchAfterPrint(mTop);
   }
 
   nsCOMPtr<nsIDocument> mTop;
 };
 
 class nsDocumentShownDispatcher : public nsRunnable
 {
 public:
@@ -490,33 +490,33 @@ public:
   NS_IMETHOD Run();
 
 private:
   nsCOMPtr<nsIDocument> mDocument;
 };
 
 
 //------------------------------------------------------------------
-// DocumentViewerImpl
+// nsDocumentViewer
 //------------------------------------------------------------------
 // Class IDs
 static NS_DEFINE_CID(kViewManagerCID,       NS_VIEW_MANAGER_CID);
 
 //------------------------------------------------------------------
 nsresult
 NS_NewContentViewer(nsIContentViewer** aResult)
 {
-  *aResult = new DocumentViewerImpl();
+  *aResult = new nsDocumentViewer();
 
   NS_ADDREF(*aResult);
 
   return NS_OK;
 }
 
-void DocumentViewerImpl::PrepareToStartLoad()
+void nsDocumentViewer::PrepareToStartLoad()
 {
   mStopped          = false;
   mLoaded           = false;
   mAttachedToParent = false;
   mDeferredWindowClose = false;
   mCallerIsClosingWindow = false;
 
 #ifdef NS_PRINTING
@@ -536,45 +536,45 @@ void DocumentViewerImpl::PrepareToStartL
 #ifdef DEBUG
   mDebugFile = nullptr;
 #endif
 
 #endif // NS_PRINTING
 }
 
 // Note: operator new zeros our memory, so no need to init things to null.
-DocumentViewerImpl::DocumentViewerImpl()
+nsDocumentViewer::nsDocumentViewer()
   : mTextZoom(1.0), mPageZoom(1.0), mMinFontSize(0),
     mIsSticky(true),
 #ifdef NS_PRINT_PREVIEW
     mPrintPreviewZoom(1.0),
 #endif
     mHintCharsetSource(kCharsetUninitialized),
     mInitializedForPrintPreview(false),
     mHidden(false)
 {
   PrepareToStartLoad();
 }
 
-NS_IMPL_ADDREF(DocumentViewerImpl)
-NS_IMPL_RELEASE(DocumentViewerImpl)
-
-NS_INTERFACE_MAP_BEGIN(DocumentViewerImpl)
+NS_IMPL_ADDREF(nsDocumentViewer)
+NS_IMPL_RELEASE(nsDocumentViewer)
+
+NS_INTERFACE_MAP_BEGIN(nsDocumentViewer)
     NS_INTERFACE_MAP_ENTRY(nsIContentViewer)
     NS_INTERFACE_MAP_ENTRY(nsIMarkupDocumentViewer)
     NS_INTERFACE_MAP_ENTRY(nsIContentViewerFile)
     NS_INTERFACE_MAP_ENTRY(nsIContentViewerEdit)
     NS_INTERFACE_MAP_ENTRY(nsIDocumentViewerPrint)
     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContentViewer)
 #ifdef NS_PRINTING
     NS_INTERFACE_MAP_ENTRY(nsIWebBrowserPrint)
 #endif
 NS_INTERFACE_MAP_END
 
-DocumentViewerImpl::~DocumentViewerImpl()
+nsDocumentViewer::~nsDocumentViewer()
 {
   if (mDocument) {
     Close(nullptr);
     mDocument->Destroy();
   }
 
   NS_ASSERTION(!mPresShell && !mPresContext,
                "User did not call nsIContentViewer::Destroy");
@@ -593,37 +593,37 @@ DocumentViewerImpl::~DocumentViewerImpl(
  * This method is called by the Document Loader once a document has
  * been created for a particular data stream...  The content viewer
  * must cache this document for later use when Init(...) is called.
  *
  * This method is also called when an out of band document.write() happens.
  * In that case, the document passed in is the same as the previous document.
  */
 NS_IMETHODIMP
-DocumentViewerImpl::LoadStart(nsISupports *aDoc)
+nsDocumentViewer::LoadStart(nsISupports *aDoc)
 {
 #ifdef NOISY_VIEWER
-  printf("DocumentViewerImpl::LoadStart\n");
+  printf("nsDocumentViewer::LoadStart\n");
 #endif
 
   nsresult rv = NS_OK;
   if (!mDocument) {
     mDocument = do_QueryInterface(aDoc, &rv);
   }
   else if (mDocument == aDoc) {
     // Reset the document viewer's state back to what it was
     // when the document load started.
     PrepareToStartLoad();
   }
 
   return rv;
 }
 
 nsresult
-DocumentViewerImpl::SyncParentSubDocMap()
+nsDocumentViewer::SyncParentSubDocMap()
 {
   nsCOMPtr<nsIDocShellTreeItem> item(do_QueryReferent(mContainer));
   nsCOMPtr<nsPIDOMWindow> pwin(do_GetInterface(item));
   nsCOMPtr<nsIContent> content;
 
   if (mDocument && pwin) {
     content = do_QueryInterface(pwin->GetFrameElementInternal());
   }
@@ -649,50 +649,50 @@ DocumentViewerImpl::SyncParentSubDocMap(
       }
     }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetContainer(nsISupports* aContainer)
+nsDocumentViewer::SetContainer(nsISupports* aContainer)
 {
   mContainer = do_GetWeakReference(aContainer);
   if (mPresContext) {
     mPresContext->SetContainer(aContainer);
   }
 
   // We're loading a new document into the window where this document
   // viewer lives, sync the parent document's frame element -> sub
   // document map
 
   return SyncParentSubDocMap();
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetContainer(nsISupports** aResult)
+nsDocumentViewer::GetContainer(nsISupports** aResult)
 {
    NS_ENSURE_ARG_POINTER(aResult);
 
    *aResult = nullptr;
    nsCOMPtr<nsISupports> container = do_QueryReferent(mContainer);
    container.swap(*aResult);
    return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::Init(nsIWidget* aParentWidget,
+nsDocumentViewer::Init(nsIWidget* aParentWidget,
                          const nsIntRect& aBounds)
 {
   return InitInternal(aParentWidget, nullptr, aBounds, true);
 }
 
 nsresult
-DocumentViewerImpl::InitPresentationStuff(bool aDoInitialReflow)
+nsDocumentViewer::InitPresentationStuff(bool aDoInitialReflow)
 {
   if (GetIsPrintPreview())
     return NS_OK;
 
   NS_ASSERTION(!mPresShell,
                "Someone should have destroyed the presshell!");
 
   // Create the style set...
@@ -813,17 +813,17 @@ CreatePresContext(nsIDocument* aDocument
   return new nsRootPresContext(aDocument, aType);
 }
 
 //-----------------------------------------------
 // This method can be used to initial the "presentation"
 // The aDoCreation indicates whether it should create
 // all the new objects or just initialize the existing ones
 nsresult
-DocumentViewerImpl::InitInternal(nsIWidget* aParentWidget,
+nsDocumentViewer::InitInternal(nsIWidget* aParentWidget,
                                  nsISupports *aState,
                                  const nsIntRect& aBounds,
                                  bool aDoCreation,
                                  bool aNeedMakeCX /*= true*/,
                                  bool aForceSetNewDocument /* = true*/)
 {
   if (mIsPageMode) {
     // XXXbz should the InitInternal in SetPageMode just pass false
@@ -950,41 +950,41 @@ DocumentViewerImpl::InitInternal(nsIWidg
     // MakeWindow())...
 
     rv = InitPresentationStuff(!makeCX);
   }
 
   return rv;
 }
 
-void DocumentViewerImpl::SetNavigationTiming(nsDOMNavigationTiming* timing)
+void nsDocumentViewer::SetNavigationTiming(nsDOMNavigationTiming* timing)
 {
   NS_ASSERTION(mDocument, "Must have a document to set navigation timing.");
   if (mDocument) {
     mDocument->SetNavigationTiming(timing);
   }
 }
 
 //
 // LoadComplete(aStatus)
 //
 //   aStatus - The status returned from loading the document.
 //
 // This method is called by the container when the document has been
 // completely loaded.
 //
 NS_IMETHODIMP
-DocumentViewerImpl::LoadComplete(nsresult aStatus)
+nsDocumentViewer::LoadComplete(nsresult aStatus)
 {
   /* We need to protect ourself against auto-destruction in case the
      window is closed while processing the OnLoad event.  See bug
      http://bugzilla.mozilla.org/show_bug.cgi?id=78445 for more
      explanation.
   */
-  nsRefPtr<DocumentViewerImpl> kungFuDeathGrip(this);
+  nsRefPtr<nsDocumentViewer> kungFuDeathGrip(this);
 
   // Flush out layout so it's up-to-date by the time onload is called.
   // Note that this could destroy the window, so do this before
   // checking for our mDocument and its window.
   if (mPresShell && !mStopped) {
     // Hold strong ref because this could conceivably run script
     nsCOMPtr<nsIPresShell> shell = mPresShell;
     shell->FlushPendingNotifications(Flush_Layout);
@@ -1085,17 +1085,17 @@ DocumentViewerImpl::LoadComplete(nsresul
     mCachedPrintWebProgressListner = nullptr;
   }
 #endif
 
   return rv;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::PermitUnload(bool aCallerClosesWindow, bool *aPermitUnload)
+nsDocumentViewer::PermitUnload(bool aCallerClosesWindow, bool *aPermitUnload)
 {
   *aPermitUnload = true;
 
   if (!mDocument || mInPermitUnload || mCallerIsClosingWindow) {
     return NS_OK;
   }
 
   // First, get the script global object from the document...
@@ -1122,17 +1122,17 @@ DocumentViewerImpl::PermitUnload(bool aC
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Dispatching to |window|, but using |document| as the target.
   event->SetTarget(mDocument);
   event->SetTrusted(true);
 
   // In evil cases we might be destroyed while handling the
   // onbeforeunload event, don't let that happen. (see also bug#331040)
-  nsRefPtr<DocumentViewerImpl> kungFuDeathGrip(this);
+  nsRefPtr<nsDocumentViewer> kungFuDeathGrip(this);
 
   {
     // Never permit popups from the beforeunload handler, no matter
     // how we get here.
     nsAutoPopupStatePusher popupStatePusher(openAbused, true);
 
     mInPermitUnload = true;
     nsEventDispatcher::DispatchDOMEvent(window, nullptr, event, mPresContext,
@@ -1220,17 +1220,17 @@ DocumentViewerImpl::PermitUnload(bool aC
 
   if (aCallerClosesWindow && *aPermitUnload)
     mCallerIsClosingWindow = true;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::ResetCloseWindow()
+nsDocumentViewer::ResetCloseWindow()
 {
   mCallerIsClosingWindow = false;
 
   nsCOMPtr<nsIDocShellTreeNode> docShellNode(do_QueryReferent(mContainer));
   if (docShellNode) {
     int32_t childCount;
     docShellNode->GetChildCount(&childCount);
 
@@ -1249,17 +1249,17 @@ DocumentViewerImpl::ResetCloseWindow()
         }
       }
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::PageHide(bool aIsUnload)
+nsDocumentViewer::PageHide(bool aIsUnload)
 {
   mHidden = true;
 
   if (!mDocument) {
     return NS_ERROR_NULL_POINTER;
   }
 
   mDocument->OnPageHide(!aIsUnload, nullptr);
@@ -1341,17 +1341,17 @@ AttachContainerRecurse(nsIDocShell* aShe
   for (int32_t i = 0; i < childCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> childItem;
     node->GetChildAt(i, getter_AddRefs(childItem));
     AttachContainerRecurse(nsCOMPtr<nsIDocShell>(do_QueryInterface(childItem)));
   }
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::Open(nsISupports *aState, nsISHEntry *aSHEntry)
+nsDocumentViewer::Open(nsISupports *aState, nsISHEntry *aSHEntry)
 {
   NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_INITIALIZED);
 
   if (mDocument)
     mDocument->SetContainer(nsCOMPtr<nsISupports>(do_QueryReferent(mContainer)));
 
   nsresult rv = InitInternal(mParentWidget, aState, mBounds, false);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1408,17 +1408,17 @@ DocumentViewerImpl::Open(nsISupports *aS
 
     mAttachedToParent = true;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::Close(nsISHEntry *aSHEntry)
+nsDocumentViewer::Close(nsISHEntry *aSHEntry)
 {
   // All callers are supposed to call close to break circular
   // references.  If we do this stuff in the destructor, the
   // destructor might never be called (especially if we're being
   // used from JS.
 
   mSHEntry = aSHEntry;
 
@@ -1498,17 +1498,17 @@ DetachContainerRecurse(nsIDocShell *aShe
   for (int32_t i = 0; i < childCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> childItem;
     node->GetChildAt(i, getter_AddRefs(childItem));
     DetachContainerRecurse(nsCOMPtr<nsIDocShell>(do_QueryInterface(childItem)));
   }
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::Destroy()
+nsDocumentViewer::Destroy()
 {
   NS_ASSERTION(mDocument, "No document in Destroy()!");
 
 #ifdef NS_PRINTING
   // Here is where we check to see if the document was still being prepared 
   // for printing when it was asked to be destroy from someone externally
   // This usually happens if the document is unloaded while the user is in the
   // Print Dialog
@@ -1671,17 +1671,17 @@ DocumentViewerImpl::Destroy()
   mWindow = nullptr;
   mViewManager = nullptr;
   mContainer = nullptr;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::Stop(void)
+nsDocumentViewer::Stop(void)
 {
   NS_ASSERTION(mDocument, "Stop called too early or too late");
   if (mDocument) {
     mDocument->StopDocumentLoad();
   }
 
   if (!mHidden && (mLoaded || mStopped) && mPresContext && !mSHEntry)
     mPresContext->SetImageAnimationMode(imgIContainer::kDontAnimMode);
@@ -1693,30 +1693,30 @@ DocumentViewerImpl::Stop(void)
     nsCOMPtr<nsIPresShell> shellDeathGrip(mPresShell); // bug 378682
     mPresShell->UnsuppressPainting();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetDOMDocument(nsIDOMDocument **aResult)
+nsDocumentViewer::GetDOMDocument(nsIDOMDocument **aResult)
 {
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
   return CallQueryInterface(mDocument, aResult);
 }
 
 NS_IMETHODIMP_(nsIDocument *)
-DocumentViewerImpl::GetDocument()
+nsDocumentViewer::GetDocument()
 {
   return mDocument;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetDOMDocument(nsIDOMDocument *aDocument)
+nsDocumentViewer::SetDOMDocument(nsIDOMDocument *aDocument)
 {
   // Assumptions:
   //
   // 1) this document viewer has been initialized with a call to Init().
   // 2) the stylesheets associated with the document have been added
   // to the document.
 
   // XXX Right now, this method assumes that the layout of the current
@@ -1730,17 +1730,17 @@ DocumentViewerImpl::SetDOMDocument(nsIDO
 
   nsCOMPtr<nsIDocument> newDoc = do_QueryInterface(aDocument);
   NS_ENSURE_TRUE(newDoc, NS_ERROR_UNEXPECTED);
 
   return SetDocumentInternal(newDoc, false);
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetDocumentInternal(nsIDocument* aDocument,
+nsDocumentViewer::SetDocumentInternal(nsIDocument* aDocument,
                                         bool aForceReuseInnerWindow)
 {
   MOZ_ASSERT(aDocument);
 
   // Set new container
   nsCOMPtr<nsISupports> container = do_QueryReferent(mContainer);
   aDocument->SetContainer(container);
 
@@ -1790,67 +1790,67 @@ DocumentViewerImpl::SetDocumentInternal(
     mWindow = nullptr;
     InitInternal(mParentWidget, nullptr, mBounds, true, true, false);
   }
 
   return rv;
 }
 
 nsIPresShell*
-DocumentViewerImpl::GetPresShell()
+nsDocumentViewer::GetPresShell()
 {
   return mPresShell;
 }
 
 nsPresContext*
-DocumentViewerImpl::GetPresContext()
+nsDocumentViewer::GetPresContext()
 {
   return mPresContext;
 }
 
 nsIViewManager*
-DocumentViewerImpl::GetViewManager()
+nsDocumentViewer::GetViewManager()
 {
   return mViewManager;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetPresShell(nsIPresShell** aResult)
+nsDocumentViewer::GetPresShell(nsIPresShell** aResult)
 {
   nsIPresShell* shell = GetPresShell();
   NS_IF_ADDREF(*aResult = shell);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetPresContext(nsPresContext** aResult)
+nsDocumentViewer::GetPresContext(nsPresContext** aResult)
 {
   nsPresContext* pc = GetPresContext();
   NS_IF_ADDREF(*aResult = pc);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetBounds(nsIntRect& aResult)
+nsDocumentViewer::GetBounds(nsIntRect& aResult)
 {
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
   aResult = mBounds;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetPreviousViewer(nsIContentViewer** aViewer)
+nsDocumentViewer::GetPreviousViewer(nsIContentViewer** aViewer)
 {
   *aViewer = mPreviousViewer;
   NS_IF_ADDREF(*aViewer);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetPreviousViewer(nsIContentViewer* aViewer)
+nsDocumentViewer::SetPreviousViewer(nsIContentViewer* aViewer)
 {
   // NOTE:  |Show| sets |mPreviousViewer| to null without calling this
   // function.
 
   if (aViewer) {
     NS_ASSERTION(!mPreviousViewer,
                  "can't set previous viewer when there already is one");
 
@@ -1873,17 +1873,17 @@ DocumentViewerImpl::SetPreviousViewer(ns
     }
   }
 
   mPreviousViewer = aViewer;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetBounds(const nsIntRect& aBounds)
+nsDocumentViewer::SetBounds(const nsIntRect& aBounds)
 {
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
 
   mBounds = aBounds;
   if (mWindow) {
     if (!mAttachedToParent) {
       // Don't have the widget repaint. Layout will generate repaint requests
       // during reflow.
@@ -1908,28 +1908,28 @@ DocumentViewerImpl::SetBounds(const nsIn
     nsCOMPtr<nsIContentViewer> previousViewer = mPreviousViewer;
     previousViewer->SetBounds(aBounds);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::Move(int32_t aX, int32_t aY)
+nsDocumentViewer::Move(int32_t aX, int32_t aY)
 {
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
   mBounds.MoveTo(aX, aY);
   if (mWindow) {
     mWindow->Move(aX, aY);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::Show(void)
+nsDocumentViewer::Show(void)
 {
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
 
   // We don't need the previous viewer anymore since we're not
   // displaying it.
   if (mPreviousViewer) {
     // This little dance *may* only be to keep
     // PresShell::EndObservingDocument happy, but I'm not sure.
@@ -2034,17 +2034,17 @@ DocumentViewerImpl::Show(void)
   // Notify observers that a new page has been shown. This will get run
   // from the event loop after we actually draw the page.
   NS_DispatchToMainThread(new nsDocumentShownDispatcher(mDocument));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::Hide(void)
+nsDocumentViewer::Hide(void)
 {
   if (!mAttachedToParent && mWindow) {
     mWindow->Show(false);
   }
 
   if (!mPresShell)
     return NS_OK;
 
@@ -2084,33 +2084,33 @@ DocumentViewerImpl::Hide(void)
   if (base_win && !mAttachedToParent) {
     base_win->SetParentWidget(nullptr);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetSticky(bool *aSticky)
+nsDocumentViewer::GetSticky(bool *aSticky)
 {
   *aSticky = mIsSticky;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetSticky(bool aSticky)
+nsDocumentViewer::SetSticky(bool aSticky)
 {
   mIsSticky = aSticky;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::RequestWindowClose(bool* aCanClose)
+nsDocumentViewer::RequestWindowClose(bool* aCanClose)
 {
 #ifdef NS_PRINTING
   if (mPrintIsPending || (mPrintEngine && mPrintEngine->GetIsPrinting())) {
     *aCanClose = false;
     mDeferredWindowClose = true;
   } else
 #endif
     *aCanClose = true;
@@ -2130,17 +2130,17 @@ static bool
 PrependUserSheet(nsIStyleSheet *aSheet, void *aData)
 {
   nsStyleSet *styleSet = static_cast<nsStyleSet*>(aData);
   styleSet->PrependStyleSheet(nsStyleSet::eUserSheet, aSheet);
   return true;
 }
 
 nsresult
-DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument,
+nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument,
                                    nsStyleSet** aStyleSet)
 {
   // Make sure this does the same thing as PresShell::AddSheet wrt ordering.
 
   // this should eventually get expanded to allow for creating
   // different sets for different media
   nsStyleSet *styleSet = new nsStyleSet();
 
@@ -2246,26 +2246,26 @@ DocumentViewerImpl::CreateStyleSet(nsIDo
   }
 
   // Caller will handle calling EndUpdate, per contract.
   *aStyleSet = styleSet;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::ClearHistoryEntry()
+nsDocumentViewer::ClearHistoryEntry()
 {
   mSHEntry = nullptr;
   return NS_OK;
 }
 
 //-------------------------------------------------------
 
 nsresult
-DocumentViewerImpl::MakeWindow(const nsSize& aSize, nsIView* aContainerView)
+nsDocumentViewer::MakeWindow(const nsSize& aSize, nsIView* aContainerView)
 {
   if (GetIsPrintPreview())
     return NS_OK;
 
   bool shouldAttach = ShouldAttachToTopLevel();
 
   if (shouldAttach) {
     // If the old view is already attached to our parent, detach
@@ -2334,29 +2334,29 @@ DocumentViewerImpl::MakeWindow(const nsS
   // go to the scrolled view as soon as the Window is created instead of going to
   // the browser window (this enables keyboard scrolling of the document)
   // mWindow->SetFocus();
 
   return rv;
 }
 
 void
-DocumentViewerImpl::DetachFromTopLevelWidget()
+nsDocumentViewer::DetachFromTopLevelWidget()
 {
   if (mViewManager) {
     nsIView* oldView = mViewManager->GetRootView();
     if (oldView && oldView->IsAttachedToTopLevel()) {
       oldView->DetachFromTopLevelWidget();
     }
   }
   mAttachedToParent = false;
 }
 
 nsIView*
-DocumentViewerImpl::FindContainerView()
+nsDocumentViewer::FindContainerView()
 {
   nsIView* containerView = nullptr;
 
   if (mContainer) {
     nsCOMPtr<nsIDocShellTreeItem> docShellItem = do_QueryReferent(mContainer);
     nsCOMPtr<nsPIDOMWindow> pwin(do_GetInterface(docShellItem));
     if (pwin) {
       nsCOMPtr<nsIContent> containerElement = do_QueryInterface(pwin->GetFrameElementInternal());
@@ -2402,17 +2402,17 @@ DocumentViewerImpl::FindContainerView()
       }
     }
   }
 
   return containerView;
 }
 
 nsresult
-DocumentViewerImpl::CreateDeviceContext(nsIView* aContainerView)
+nsDocumentViewer::CreateDeviceContext(nsIView* aContainerView)
 {
   NS_PRECONDITION(!mPresShell && !mWindow,
                   "This will screw up our existing presentation");
   NS_PRECONDITION(mDocument, "Gotta have a document here");
   
   nsIDocument* doc = mDocument->GetDisplayDocument();
   if (doc) {
     NS_ASSERTION(!aContainerView, "External resource document embedded somewhere?");
@@ -2442,17 +2442,17 @@ DocumentViewerImpl::CreateDeviceContext(
 
   mDeviceContext = new nsDeviceContext();
   mDeviceContext->Init(widget);
   return NS_OK;
 }
 
 // Return the selection for the document. Note that text fields have their
 // own selection, which cannot be accessed with this method.
-nsresult DocumentViewerImpl::GetDocumentSelection(nsISelection **aSelection)
+nsresult nsDocumentViewer::GetDocumentSelection(nsISelection **aSelection)
 {
   NS_ENSURE_ARG_POINTER(aSelection);
   if (!mPresShell) {
     return NS_ERROR_NOT_INITIALIZED;
   }
 
   nsCOMPtr<nsISelectionController> selcon;
   selcon = do_QueryInterface(mPresShell);
@@ -2461,29 +2461,29 @@ nsresult DocumentViewerImpl::GetDocument
                                 aSelection);
   return NS_ERROR_FAILURE;
 }
 
 /* ========================================================================================
  * nsIContentViewerEdit
  * ======================================================================================== */
 
-NS_IMETHODIMP DocumentViewerImpl::ClearSelection()
+NS_IMETHODIMP nsDocumentViewer::ClearSelection()
 {
   nsresult rv;
   nsCOMPtr<nsISelection> selection;
 
   // use nsCopySupport::GetSelectionForCopy() ?
   rv = GetDocumentSelection(getter_AddRefs(selection));
   if (NS_FAILED(rv)) return rv;
 
   return selection->CollapseToStart();
 }
 
-NS_IMETHODIMP DocumentViewerImpl::SelectAll()
+NS_IMETHODIMP nsDocumentViewer::SelectAll()
 {
   // XXX this is a temporary implementation copied from nsWebShell
   // for now. I think nsDocument and friends should have some helper
   // functions to make this easier.
   nsCOMPtr<nsISelection> selection;
   nsresult rv;
 
   // use nsCopySupport::GetSelectionForCopy() ?
@@ -2509,23 +2509,23 @@ NS_IMETHODIMP DocumentViewerImpl::Select
 
   rv = selection->RemoveAllRanges();
   if (NS_FAILED(rv)) return rv;
 
   rv = selection->SelectAllChildren(bodyNode);
   return rv;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::CopySelection()
+NS_IMETHODIMP nsDocumentViewer::CopySelection()
 {
   nsCopySupport::FireClipboardEvent(NS_COPY, mPresShell, nullptr);
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::CopyLinkLocation()
+NS_IMETHODIMP nsDocumentViewer::CopyLinkLocation()
 {
   NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_INITIALIZED);
   nsCOMPtr<nsIDOMNode> node;
   GetPopupLinkNode(getter_AddRefs(node));
   // make noise if we're not in a link
   NS_ENSURE_TRUE(node, NS_ERROR_FAILURE);
 
   nsCOMPtr<dom::Element> elm(do_QueryInterface(node));
@@ -2540,38 +2540,38 @@ NS_IMETHODIMP DocumentViewerImpl::CopyLi
   nsCOMPtr<nsIClipboardHelper> clipboard(do_GetService("@mozilla.org/widget/clipboardhelper;1", &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // copy the href onto the clipboard
   nsCOMPtr<nsIDOMDocument> doc = do_QueryInterface(mDocument);
   return clipboard->CopyString(locationText, doc);
 }
 
-NS_IMETHODIMP DocumentViewerImpl::CopyImage(int32_t aCopyFlags)
+NS_IMETHODIMP nsDocumentViewer::CopyImage(int32_t aCopyFlags)
 {
   NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_INITIALIZED);
   nsCOMPtr<nsIImageLoadingContent> node;
   GetPopupImageNode(getter_AddRefs(node));
   // make noise if we're not in an image
   NS_ENSURE_TRUE(node, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsILoadContext> loadContext(do_QueryReferent(mContainer));
   return nsCopySupport::ImageCopy(node, loadContext, aCopyFlags);
 }
 
 
-NS_IMETHODIMP DocumentViewerImpl::GetCopyable(bool *aCopyable)
+NS_IMETHODIMP nsDocumentViewer::GetCopyable(bool *aCopyable)
 {
   NS_ENSURE_ARG_POINTER(aCopyable);
   *aCopyable = nsCopySupport::CanCopy(mDocument);
   return NS_OK;
 }
 
 /* AString getContents (in string mimeType, in boolean selectionOnly); */
-NS_IMETHODIMP DocumentViewerImpl::GetContents(const char *mimeType, bool selectionOnly, nsAString& aOutValue)
+NS_IMETHODIMP nsDocumentViewer::GetContents(const char *mimeType, bool selectionOnly, nsAString& aOutValue)
 {
   aOutValue.Truncate();
 
   NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_INITIALIZED);
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_INITIALIZED);
 
   // Now we have the selection.  Make sure it's nonzero:
   nsCOMPtr<nsISelection> sel;
@@ -2586,17 +2586,17 @@ NS_IMETHODIMP DocumentViewerImpl::GetCon
   }
 
   // call the copy code
   return nsCopySupport::GetContents(nsDependentCString(mimeType), 0, sel,
                                     mDocument, aOutValue);
 }
 
 /* readonly attribute boolean canGetContents; */
-NS_IMETHODIMP DocumentViewerImpl::GetCanGetContents(bool *aCanGetContents)
+NS_IMETHODIMP nsDocumentViewer::GetCanGetContents(bool *aCanGetContents)
 {
   NS_ENSURE_ARG_POINTER(aCanGetContents);
   *aCanGetContents = false;
   NS_ENSURE_STATE(mDocument);
   *aCanGetContents = nsCopySupport::CanCopy(mDocument);
   return NS_OK;
 }
 
@@ -2604,17 +2604,17 @@ NS_IMETHODIMP DocumentViewerImpl::GetCan
 /* ========================================================================================
  * nsIContentViewerFile
  * ======================================================================================== */
 /** ---------------------------------------------------
  *  See documentation above in the nsIContentViewerfile class definition
  *	@update 01/24/00 dwc
  */
 NS_IMETHODIMP
-DocumentViewerImpl::Print(bool              aSilent,
+nsDocumentViewer::Print(bool              aSilent,
                           FILE *            aDebugFile,
                           nsIPrintSettings* aPrintSettings)
 {
 #ifdef NS_PRINTING
   nsCOMPtr<nsIPrintSettings> printSettings;
 
 #ifdef DEBUG
   nsresult rv = NS_ERROR_FAILURE;
@@ -2639,41 +2639,41 @@ DocumentViewerImpl::Print(bool          
   return Print(printSettings, nullptr);
 #else
   return NS_ERROR_FAILURE;
 #endif
 }
 
 /* [noscript] void printWithParent (in nsIDOMWindow aParentWin, in nsIPrintSettings aThePrintSettings, in nsIWebProgressListener aWPListener); */
 NS_IMETHODIMP 
-DocumentViewerImpl::PrintWithParent(nsIDOMWindow*, nsIPrintSettings *aThePrintSettings, nsIWebProgressListener *aWPListener)
+nsDocumentViewer::PrintWithParent(nsIDOMWindow*, nsIPrintSettings *aThePrintSettings, nsIWebProgressListener *aWPListener)
 {
 #ifdef NS_PRINTING
   return Print(aThePrintSettings, aWPListener);
 #else
   return NS_ERROR_FAILURE;
 #endif
 }
 
 // nsIContentViewerFile interface
 NS_IMETHODIMP
-DocumentViewerImpl::GetPrintable(bool *aPrintable)
+nsDocumentViewer::GetPrintable(bool *aPrintable)
 {
   NS_ENSURE_ARG_POINTER(aPrintable);
 
   *aPrintable = !GetIsPrinting();
 
   return NS_OK;
 }
 
 //*****************************************************************************
 // nsIMarkupDocumentViewer
 //*****************************************************************************
 
-NS_IMETHODIMP DocumentViewerImpl::ScrollToNode(nsIDOMNode* aNode)
+NS_IMETHODIMP nsDocumentViewer::ScrollToNode(nsIDOMNode* aNode)
 {
   NS_ENSURE_ARG(aNode);
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
   nsCOMPtr<nsIPresShell> presShell;
   NS_ENSURE_SUCCESS(GetPresShell(getter_AddRefs(presShell)), NS_ERROR_FAILURE);
 
   // Get the nsIContent interface, because that's what we need to
   // get the primary frame
@@ -2689,17 +2689,17 @@ NS_IMETHODIMP DocumentViewerImpl::Scroll
                                        nsIPresShell::SCROLL_ALWAYS),
                                      nsIPresShell::ScrollAxis(),
                                      nsIPresShell::SCROLL_OVERFLOW_HIDDEN),
     NS_ERROR_FAILURE);
   return NS_OK;
 }
 
 void
-DocumentViewerImpl::CallChildren(CallChildFunc aFunc, void* aClosure)
+nsDocumentViewer::CallChildren(CallChildFunc aFunc, void* aClosure)
 {
   nsCOMPtr<nsIDocShellTreeNode> docShellNode(do_QueryReferent(mContainer));
   if (docShellNode)
   {
     int32_t i;
     int32_t n;
     docShellNode->GetChildCount(&n);
     for (i=0; i < n; i++)
@@ -2805,17 +2805,17 @@ SetExtResourceFullZoom(nsIDocument* aDoc
       ctxt->SetFullZoom(ZoomInfo->mZoom);
     }
   }
 
   return true;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetTextZoom(float aTextZoom)
+nsDocumentViewer::SetTextZoom(float aTextZoom)
 {
   if (GetIsPrintPreview()) {
     return NS_OK;
   }
 
   mTextZoom = aTextZoom;
 
   // Set the text zoom on all children of mContainer (even if our zoom didn't
@@ -2833,26 +2833,26 @@ DocumentViewerImpl::SetTextZoom(float aT
 
   // And do the external resources
   mDocument->EnumerateExternalResources(SetExtResourceTextZoom, &ZoomInfo);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetTextZoom(float* aTextZoom)
+nsDocumentViewer::GetTextZoom(float* aTextZoom)
 {
   NS_ENSURE_ARG_POINTER(aTextZoom);
   nsPresContext* pc = GetPresContext();
   *aTextZoom = pc ? pc->TextZoom() : 1.0f;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetMinFontSize(int32_t aMinFontSize)
+nsDocumentViewer::SetMinFontSize(int32_t aMinFontSize)
 {
   if (GetIsPrintPreview()) {
     return NS_OK;
   }
 
   mMinFontSize = aMinFontSize;
 
   // Set the min font on all children of mContainer (even if our min font didn't
@@ -2870,26 +2870,26 @@ DocumentViewerImpl::SetMinFontSize(int32
   // And do the external resources
   mDocument->EnumerateExternalResources(SetExtResourceMinFontSize,
                                         NS_INT32_TO_PTR(aMinFontSize));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetMinFontSize(int32_t* aMinFontSize)
+nsDocumentViewer::GetMinFontSize(int32_t* aMinFontSize)
 {
   NS_ENSURE_ARG_POINTER(aMinFontSize);
   nsPresContext* pc = GetPresContext();
   *aMinFontSize = pc ? pc->MinFontSize(nullptr) : 0;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetFullZoom(float aFullZoom)
+nsDocumentViewer::SetFullZoom(float aFullZoom)
 {
 #ifdef NS_PRINT_PREVIEW
   if (GetIsPrintPreview()) {
     nsPresContext* pc = GetPresContext();
     NS_ENSURE_TRUE(pc, NS_OK);
     nsCOMPtr<nsIPresShell> shell = pc->GetPresShell();
     NS_ENSURE_TRUE(shell, NS_OK);
 
@@ -2926,17 +2926,17 @@ DocumentViewerImpl::SetFullZoom(float aF
 
   // And do the external resources
   mDocument->EnumerateExternalResources(SetExtResourceFullZoom, &ZoomInfo);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetFullZoom(float* aFullZoom)
+nsDocumentViewer::GetFullZoom(float* aFullZoom)
 {
   NS_ENSURE_ARG_POINTER(aFullZoom);
 #ifdef NS_PRINT_PREVIEW
   if (GetIsPrintPreview()) {
     *aFullZoom = mPrintPreviewZoom;
     return NS_OK;
   }
 #endif
@@ -2951,38 +2951,38 @@ static void
 SetChildAuthorStyleDisabled(nsIMarkupDocumentViewer* aChild, void* aClosure)
 {
   bool styleDisabled  = *static_cast<bool*>(aClosure);
   aChild->SetAuthorStyleDisabled(styleDisabled);
 }
 
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetAuthorStyleDisabled(bool aStyleDisabled)
+nsDocumentViewer::SetAuthorStyleDisabled(bool aStyleDisabled)
 {
   if (mPresShell) {
     mPresShell->SetAuthorStyleDisabled(aStyleDisabled);
   }
   CallChildren(SetChildAuthorStyleDisabled, &aStyleDisabled);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetAuthorStyleDisabled(bool* aStyleDisabled)
+nsDocumentViewer::GetAuthorStyleDisabled(bool* aStyleDisabled)
 {
   if (mPresShell) {
     *aStyleDisabled = mPresShell->GetAuthorStyleDisabled();
   } else {
     *aStyleDisabled = false;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetDefaultCharacterSet(nsACString& aDefaultCharacterSet)
+nsDocumentViewer::GetDefaultCharacterSet(nsACString& aDefaultCharacterSet)
 {
   if (mDefaultCharacterSet.IsEmpty())
   {
     const nsAdoptingCString& defCharset =
       Preferences::GetLocalizedCString("intl.charset.default");
 
     if (!defCharset.IsEmpty()) {
       mDefaultCharacterSet = defCharset;
@@ -2997,231 +2997,231 @@ DocumentViewerImpl::GetDefaultCharacterS
 static void
 SetChildDefaultCharacterSet(nsIMarkupDocumentViewer* aChild, void* aClosure)
 {
   const nsACString* charset = static_cast<nsACString*>(aClosure);
   aChild->SetDefaultCharacterSet(*charset);
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetDefaultCharacterSet(const nsACString& aDefaultCharacterSet)
+nsDocumentViewer::SetDefaultCharacterSet(const nsACString& aDefaultCharacterSet)
 {
   mDefaultCharacterSet = aDefaultCharacterSet;  // this does a copy of aDefaultCharacterSet
   // now set the default char set on all children of mContainer
   CallChildren(SetChildDefaultCharacterSet, (void*) &aDefaultCharacterSet);
   return NS_OK;
 }
 
 // XXX: SEMANTIC CHANGE!
 //      returns a copy of the string.  Caller is responsible for freeing result
 //      using Recycle(aForceCharacterSet)
-NS_IMETHODIMP DocumentViewerImpl::GetForceCharacterSet(nsACString& aForceCharacterSet)
+NS_IMETHODIMP nsDocumentViewer::GetForceCharacterSet(nsACString& aForceCharacterSet)
 {
   aForceCharacterSet = mForceCharacterSet;
   return NS_OK;
 }
 
 static void
 SetChildForceCharacterSet(nsIMarkupDocumentViewer* aChild, void* aClosure)
 {
   const nsACString* charset = static_cast<nsACString*>(aClosure);
   aChild->SetForceCharacterSet(*charset);
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetForceCharacterSet(const nsACString& aForceCharacterSet)
+nsDocumentViewer::SetForceCharacterSet(const nsACString& aForceCharacterSet)
 {
   mForceCharacterSet = aForceCharacterSet;
   // now set the force char set on all children of mContainer
   CallChildren(SetChildForceCharacterSet, (void*) &aForceCharacterSet);
   return NS_OK;
 }
 
 // XXX: SEMANTIC CHANGE!
 //      returns a copy of the string.  Caller is responsible for freeing result
 //      using Recycle(aHintCharacterSet)
-NS_IMETHODIMP DocumentViewerImpl::GetHintCharacterSet(nsACString& aHintCharacterSet)
+NS_IMETHODIMP nsDocumentViewer::GetHintCharacterSet(nsACString& aHintCharacterSet)
 {
 
   if(kCharsetUninitialized == mHintCharsetSource) {
     aHintCharacterSet.Truncate();
   } else {
     aHintCharacterSet = mHintCharset;
     // this can't possibly be right.  we can't set a value just because somebody got a related value!
     //mHintCharsetSource = kCharsetUninitialized;
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::GetHintCharacterSetSource(int32_t *aHintCharacterSetSource)
+NS_IMETHODIMP nsDocumentViewer::GetHintCharacterSetSource(int32_t *aHintCharacterSetSource)
 {
   NS_ENSURE_ARG_POINTER(aHintCharacterSetSource);
 
   *aHintCharacterSetSource = mHintCharsetSource;
   return NS_OK;
 }
 
 
-NS_IMETHODIMP DocumentViewerImpl::GetPrevDocCharacterSet(nsACString& aPrevDocCharacterSet)
+NS_IMETHODIMP nsDocumentViewer::GetPrevDocCharacterSet(nsACString& aPrevDocCharacterSet)
 {
   aPrevDocCharacterSet = mPrevDocCharacterSet;
 
   return NS_OK;
 }
 
 static void
 SetChildPrevDocCharacterSet(nsIMarkupDocumentViewer* aChild, void* aClosure)
 {
   const nsACString* charset = static_cast<nsACString*>(aClosure);
   aChild->SetPrevDocCharacterSet(*charset);
 }
 
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetPrevDocCharacterSet(const nsACString& aPrevDocCharacterSet)
+nsDocumentViewer::SetPrevDocCharacterSet(const nsACString& aPrevDocCharacterSet)
 {
   mPrevDocCharacterSet = aPrevDocCharacterSet;  
   CallChildren(SetChildPrevDocCharacterSet, (void*) &aPrevDocCharacterSet);
   return NS_OK;
 }
 
 
 static void
 SetChildHintCharacterSetSource(nsIMarkupDocumentViewer* aChild, void* aClosure)
 {
   aChild->SetHintCharacterSetSource(NS_PTR_TO_INT32(aClosure));
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetHintCharacterSetSource(int32_t aHintCharacterSetSource)
+nsDocumentViewer::SetHintCharacterSetSource(int32_t aHintCharacterSetSource)
 {
   mHintCharsetSource = aHintCharacterSetSource;
   // now set the hint char set source on all children of mContainer
   CallChildren(SetChildHintCharacterSetSource,
                       NS_INT32_TO_PTR(aHintCharacterSetSource));
   return NS_OK;
 }
 
 static void
 SetChildHintCharacterSet(nsIMarkupDocumentViewer* aChild, void* aClosure)
 {
   const nsACString* charset = static_cast<nsACString*>(aClosure);
   aChild->SetHintCharacterSet(*charset);
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::SetHintCharacterSet(const nsACString& aHintCharacterSet)
+nsDocumentViewer::SetHintCharacterSet(const nsACString& aHintCharacterSet)
 {
   mHintCharset = aHintCharacterSet;
   // now set the hint char set on all children of mContainer
   CallChildren(SetChildHintCharacterSet, (void*) &aHintCharacterSet);
   return NS_OK;
 }
 
 static void
 SetChildBidiOptions(nsIMarkupDocumentViewer* aChild, void* aClosure)
 {
   aChild->SetBidiOptions(NS_PTR_TO_INT32(aClosure));
 }
 
-NS_IMETHODIMP DocumentViewerImpl::SetBidiTextDirection(uint8_t aTextDirection)
+NS_IMETHODIMP nsDocumentViewer::SetBidiTextDirection(uint8_t aTextDirection)
 {
   uint32_t bidiOptions;
 
   GetBidiOptions(&bidiOptions);
   SET_BIDI_OPTION_DIRECTION(bidiOptions, aTextDirection);
   SetBidiOptions(bidiOptions);
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::GetBidiTextDirection(uint8_t* aTextDirection)
+NS_IMETHODIMP nsDocumentViewer::GetBidiTextDirection(uint8_t* aTextDirection)
 {
   uint32_t bidiOptions;
 
   if (aTextDirection) {
     GetBidiOptions(&bidiOptions);
     *aTextDirection = GET_BIDI_OPTION_DIRECTION(bidiOptions);
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::SetBidiTextType(uint8_t aTextType)
+NS_IMETHODIMP nsDocumentViewer::SetBidiTextType(uint8_t aTextType)
 {
   uint32_t bidiOptions;
 
   GetBidiOptions(&bidiOptions);
   SET_BIDI_OPTION_TEXTTYPE(bidiOptions, aTextType);
   SetBidiOptions(bidiOptions);
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::GetBidiTextType(uint8_t* aTextType)
+NS_IMETHODIMP nsDocumentViewer::GetBidiTextType(uint8_t* aTextType)
 {
   uint32_t bidiOptions;
 
   if (aTextType) {
     GetBidiOptions(&bidiOptions);
     *aTextType = GET_BIDI_OPTION_TEXTTYPE(bidiOptions);
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::SetBidiNumeral(uint8_t aNumeral)
+NS_IMETHODIMP nsDocumentViewer::SetBidiNumeral(uint8_t aNumeral)
 {
   uint32_t bidiOptions;
 
   GetBidiOptions(&bidiOptions);
   SET_BIDI_OPTION_NUMERAL(bidiOptions, aNumeral);
   SetBidiOptions(bidiOptions);
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::GetBidiNumeral(uint8_t* aNumeral)
+NS_IMETHODIMP nsDocumentViewer::GetBidiNumeral(uint8_t* aNumeral)
 {
   uint32_t bidiOptions;
 
   if (aNumeral) {
     GetBidiOptions(&bidiOptions);
     *aNumeral = GET_BIDI_OPTION_NUMERAL(bidiOptions);
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::SetBidiSupport(uint8_t aSupport)
+NS_IMETHODIMP nsDocumentViewer::SetBidiSupport(uint8_t aSupport)
 {
   uint32_t bidiOptions;
 
   GetBidiOptions(&bidiOptions);
   SET_BIDI_OPTION_SUPPORT(bidiOptions, aSupport);
   SetBidiOptions(bidiOptions);
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::GetBidiSupport(uint8_t* aSupport)
+NS_IMETHODIMP nsDocumentViewer::GetBidiSupport(uint8_t* aSupport)
 {
   uint32_t bidiOptions;
 
   if (aSupport) {
     GetBidiOptions(&bidiOptions);
     *aSupport = GET_BIDI_OPTION_SUPPORT(bidiOptions);
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::SetBidiOptions(uint32_t aBidiOptions)
+NS_IMETHODIMP nsDocumentViewer::SetBidiOptions(uint32_t aBidiOptions)
 {
   if (mPresContext) {
     mPresContext->SetBidi(aBidiOptions, true); // could cause reflow
   }
   // now set bidi on all children of mContainer
   CallChildren(SetChildBidiOptions, NS_INT32_TO_PTR(aBidiOptions));
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::GetBidiOptions(uint32_t* aBidiOptions)
+NS_IMETHODIMP nsDocumentViewer::GetBidiOptions(uint32_t* aBidiOptions)
 {
   if (aBidiOptions) {
     if (mPresContext) {
       *aBidiOptions = mPresContext->GetBidi();
     }
     else
       *aBidiOptions = IBMBIDI_DEFAULT_BIDI_OPTIONS;
   }
@@ -3231,24 +3231,24 @@ NS_IMETHODIMP DocumentViewerImpl::GetBid
 static void
 AppendChildSubtree(nsIMarkupDocumentViewer* aChild, void* aClosure)
 {
   nsTArray<nsCOMPtr<nsIMarkupDocumentViewer> >& array =
     *static_cast<nsTArray<nsCOMPtr<nsIMarkupDocumentViewer> >*>(aClosure);
   aChild->AppendSubtree(array);
 }
 
-NS_IMETHODIMP DocumentViewerImpl::AppendSubtree(nsTArray<nsCOMPtr<nsIMarkupDocumentViewer> >& aArray)
+NS_IMETHODIMP nsDocumentViewer::AppendSubtree(nsTArray<nsCOMPtr<nsIMarkupDocumentViewer> >& aArray)
 {
   aArray.AppendElement(this);
   CallChildren(AppendChildSubtree, &aArray);
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::ChangeMaxLineBoxWidth(int32_t aMaxLineBoxWidth)
+NS_IMETHODIMP nsDocumentViewer::ChangeMaxLineBoxWidth(int32_t aMaxLineBoxWidth)
 {
   // Change the max line box width for all children.
   struct LineBoxInfo lbi = { aMaxLineBoxWidth };
   CallChildren(ChangeChildMaxLineBoxWidth, &lbi);
 
   // Now, change our max line box width.
   // Convert to app units, since our input is in CSS pixels.
   nscoord mlbw = nsPresContext::CSSPixelsToAppUnits(aMaxLineBoxWidth);
@@ -3256,17 +3256,17 @@ NS_IMETHODIMP DocumentViewerImpl::Change
   if (presShell) {
     presShell->SetMaxLineBoxWidth(mlbw);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetContentSize(int32_t* aWidth, int32_t* aHeight)
+nsDocumentViewer::GetContentSize(int32_t* aWidth, int32_t* aHeight)
 {
    NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
 
    // Skip doing this on docshell-less documents for now
    nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryReferent(mContainer));
    NS_ENSURE_TRUE(docShellAsItem, NS_ERROR_NOT_AVAILABLE);
    
    nsCOMPtr<nsIDocShellTreeItem> docShellParent;
@@ -3313,33 +3313,33 @@ DocumentViewerImpl::GetContentSize(int32
    *aHeight = presContext->AppUnitsToDevPixels(shellArea.height);
 
    return NS_OK;
 }
 
 
 NS_IMPL_ISUPPORTS1(nsDocViewerSelectionListener, nsISelectionListener)
 
-nsresult nsDocViewerSelectionListener::Init(DocumentViewerImpl *aDocViewer)
+nsresult nsDocViewerSelectionListener::Init(nsDocumentViewer *aDocViewer)
 {
   mDocViewer = aDocViewer;
   return NS_OK;
 }
 
 /*
  * GetPopupNode, GetPopupLinkNode and GetPopupImageNode are helpers
  * for the cmd_copyLink / cmd_copyImageLocation / cmd_copyImageContents family
  * of commands. The focus controller stores the popup node, these retrieve
  * them and munge appropriately. Note that we have to store the popup node
  * rather than retrieving it from EventStateManager::GetFocusedContent because
  * not all content (images included) can receive focus.
  */
 
 nsresult
-DocumentViewerImpl::GetPopupNode(nsIDOMNode** aNode)
+nsDocumentViewer::GetPopupNode(nsIDOMNode** aNode)
 {
   NS_ENSURE_ARG_POINTER(aNode);
 
   *aNode = nullptr;
 
   // get the document
   nsIDocument* document = GetDocument();
   NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
@@ -3370,17 +3370,17 @@ DocumentViewerImpl::GetPopupNode(nsIDOMN
     node.swap(*aNode);
   }
 
   return NS_OK;
 }
 
 // GetPopupLinkNode: return popup link node or fail
 nsresult
-DocumentViewerImpl::GetPopupLinkNode(nsIDOMNode** aNode)
+nsDocumentViewer::GetPopupLinkNode(nsIDOMNode** aNode)
 {
   NS_ENSURE_ARG_POINTER(aNode);
 
   // you get null unless i say so
   *aNode = nullptr;
 
   // find popup node
   nsCOMPtr<nsIDOMNode> node;
@@ -3407,17 +3407,17 @@ DocumentViewerImpl::GetPopupLinkNode(nsI
   }
 
   // if we have no node, fail
   return NS_ERROR_FAILURE;
 }
 
 // GetPopupLinkNode: return popup image node or fail
 nsresult
-DocumentViewerImpl::GetPopupImageNode(nsIImageLoadingContent** aNode)
+nsDocumentViewer::GetPopupImageNode(nsIImageLoadingContent** aNode)
 {
   NS_ENSURE_ARG_POINTER(aNode);
 
   // you get null unless i say so
   *aNode = nullptr;
 
   // find popup node
   nsCOMPtr<nsIDOMNode> node;
@@ -3436,20 +3436,20 @@ DocumentViewerImpl::GetPopupImageNode(ns
  * These two functions -- GetInLink and GetInImage -- are kind of annoying
  * in that they only get called from the controller (in
  * nsDOMWindowController::IsCommandEnabled). The actual construction of the
  * context menus in communicator (nsContextMenu.js) has its own, redundant
  * tests. No big deal, but good to keep in mind if we ever clean context
  * menus.
  */
 
-NS_IMETHODIMP DocumentViewerImpl::GetInLink(bool* aInLink)
+NS_IMETHODIMP nsDocumentViewer::GetInLink(bool* aInLink)
 {
 #ifdef DEBUG_dr
-  printf("dr :: DocumentViewerImpl::GetInLink\n");
+  printf("dr :: nsDocumentViewer::GetInLink\n");
 #endif
 
   NS_ENSURE_ARG_POINTER(aInLink);
 
   // we're not in a link unless i say so
   *aInLink = false;
 
   // get the popup link
@@ -3458,20 +3458,20 @@ NS_IMETHODIMP DocumentViewerImpl::GetInL
   if (NS_FAILED(rv)) return rv;
   NS_ENSURE_TRUE(node, NS_ERROR_FAILURE);
 
   // if we made it here, we're in a link
   *aInLink = true;
   return NS_OK;
 }
 
-NS_IMETHODIMP DocumentViewerImpl::GetInImage(bool* aInImage)
+NS_IMETHODIMP nsDocumentViewer::GetInImage(bool* aInImage)
 {
 #ifdef DEBUG_dr
-  printf("dr :: DocumentViewerImpl::GetInImage\n");
+  printf("dr :: nsDocumentViewer::GetInImage\n");
 #endif
 
   NS_ENSURE_ARG_POINTER(aInImage);
 
   // we're not in an image unless i say so
   *aInImage = false;
 
   // get the popup image
@@ -3558,30 +3558,30 @@ nsDocViewerFocusListener::HandleEvent(ns
       selCon->RepaintSelection(nsISelectionController::SELECTION_NORMAL);
     }
   }
 
   return NS_OK;
 }
 
 nsresult
-nsDocViewerFocusListener::Init(DocumentViewerImpl *aDocViewer)
+nsDocViewerFocusListener::Init(nsDocumentViewer *aDocViewer)
 {
   mDocViewer = aDocViewer;
   return NS_OK;
 }
 
 /** ---------------------------------------------------
  *  From nsIWebBrowserPrint
  */
 
 #ifdef NS_PRINTING
 
 NS_IMETHODIMP
-DocumentViewerImpl::Print(nsIPrintSettings*       aPrintSettings,
+nsDocumentViewer::Print(nsIPrintSettings*       aPrintSettings,
                           nsIWebProgressListener* aWebProgressListener)
 {
 
 #ifdef MOZ_XUL
   // Temporary code for Bug 136185 / Bug 240490
   nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocument));
   if (xulDoc) {
     nsPrintEngine::ShowPrintErrorDialog(NS_ERROR_GFX_PRINTER_NO_XUL);
@@ -3666,17 +3666,17 @@ DocumentViewerImpl::Print(nsIPrintSettin
   rv = mPrintEngine->Print(aPrintSettings, aWebProgressListener);
   if (NS_FAILED(rv)) {
     OnDonePrinting();
   }
   return rv;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::PrintPreview(nsIPrintSettings* aPrintSettings, 
+nsDocumentViewer::PrintPreview(nsIPrintSettings* aPrintSettings, 
                                  nsIDOMWindow *aChildDOMWin, 
                                  nsIWebProgressListener* aWebProgressListener)
 {
 #if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)
   NS_WARN_IF_FALSE(IsInitializedForPrintPreview(),
                    "Using docshell.printPreview is the preferred way for print previewing!");
 
   NS_ENSURE_ARG_POINTER(aChildDOMWin);
@@ -3741,17 +3741,17 @@ DocumentViewerImpl::PrintPreview(nsIPrin
   return rv;
 #else
   return NS_ERROR_FAILURE;
 #endif
 }
 
 //----------------------------------------------------------------------
 NS_IMETHODIMP
-DocumentViewerImpl::PrintPreviewNavigate(int16_t aType, int32_t aPageNum)
+nsDocumentViewer::PrintPreviewNavigate(int16_t aType, int32_t aPageNum)
 {
   if (!GetIsPrintPreview() ||
       mPrintEngine->GetIsCreatingPrintPreview())
     return NS_ERROR_FAILURE;
 
   nsIScrollableFrame* sf =
     mPrintEngine->GetPrintPreviewPresShell()->GetRootScrollFrameAsScrollable();
   if (!sf)
@@ -3831,170 +3831,170 @@ DocumentViewerImpl::PrintPreviewNavigate
     sf->ScrollTo(nsPoint(pt.x, newYPosn), nsIScrollableFrame::INSTANT);
   }
   return NS_OK;
 
 }
 
 /* readonly attribute nsIPrintSettings globalPrintSettings; */
 NS_IMETHODIMP
-DocumentViewerImpl::GetGlobalPrintSettings(nsIPrintSettings * *aGlobalPrintSettings)
+nsDocumentViewer::GetGlobalPrintSettings(nsIPrintSettings * *aGlobalPrintSettings)
 {
   return nsPrintEngine::GetGlobalPrintSettings(aGlobalPrintSettings);
 }
 
 /* readonly attribute boolean doingPrint; */
 // XXX This always returns false for subdocuments
 NS_IMETHODIMP
-DocumentViewerImpl::GetDoingPrint(bool *aDoingPrint)
+nsDocumentViewer::GetDoingPrint(bool *aDoingPrint)
 {
   NS_ENSURE_ARG_POINTER(aDoingPrint);
   
   *aDoingPrint = false;
   if (mPrintEngine) {
     // XXX shouldn't this be GetDoingPrint() ?
     return mPrintEngine->GetDoingPrintPreview(aDoingPrint);
   } 
   return NS_OK;
 }
 
 /* readonly attribute boolean doingPrintPreview; */
 // XXX This always returns false for subdocuments
 NS_IMETHODIMP
-DocumentViewerImpl::GetDoingPrintPreview(bool *aDoingPrintPreview)
+nsDocumentViewer::GetDoingPrintPreview(bool *aDoingPrintPreview)
 {
   NS_ENSURE_ARG_POINTER(aDoingPrintPreview);
 
   *aDoingPrintPreview = false;
   if (mPrintEngine) {
     return mPrintEngine->GetDoingPrintPreview(aDoingPrintPreview);
   }
   return NS_OK;
 }
 
 /* readonly attribute nsIPrintSettings currentPrintSettings; */
 NS_IMETHODIMP
-DocumentViewerImpl::GetCurrentPrintSettings(nsIPrintSettings * *aCurrentPrintSettings)
+nsDocumentViewer::GetCurrentPrintSettings(nsIPrintSettings * *aCurrentPrintSettings)
 {
   NS_ENSURE_ARG_POINTER(aCurrentPrintSettings);
 
   *aCurrentPrintSettings = nullptr;
   NS_ENSURE_TRUE(mPrintEngine, NS_ERROR_FAILURE);
 
   return mPrintEngine->GetCurrentPrintSettings(aCurrentPrintSettings);
 }
 
 
 /* readonly attribute nsIDOMWindow currentChildDOMWindow; */
 NS_IMETHODIMP 
-DocumentViewerImpl::GetCurrentChildDOMWindow(nsIDOMWindow * *aCurrentChildDOMWindow)
+nsDocumentViewer::GetCurrentChildDOMWindow(nsIDOMWindow * *aCurrentChildDOMWindow)
 {
   NS_ENSURE_ARG_POINTER(aCurrentChildDOMWindow);
   *aCurrentChildDOMWindow = nullptr;
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 /* void cancel (); */
 NS_IMETHODIMP
-DocumentViewerImpl::Cancel()
+nsDocumentViewer::Cancel()
 {
   NS_ENSURE_TRUE(mPrintEngine, NS_ERROR_FAILURE);
   return mPrintEngine->Cancelled();
 }
 
 /* void exitPrintPreview (); */
 NS_IMETHODIMP
-DocumentViewerImpl::ExitPrintPreview()
+nsDocumentViewer::ExitPrintPreview()
 {
   if (GetIsPrinting())
     return NS_ERROR_FAILURE;
   NS_ENSURE_TRUE(mPrintEngine, NS_ERROR_FAILURE);
 
   if (GetIsPrintPreview()) {
     ReturnToGalleyPresentation();
   }
   return NS_OK;
 }
 
 //----------------------------------------------------------------------------------
 // Enumerate all the documents for their titles
 NS_IMETHODIMP
-DocumentViewerImpl::EnumerateDocumentNames(uint32_t* aCount,
+nsDocumentViewer::EnumerateDocumentNames(uint32_t* aCount,
                                            PRUnichar*** aResult)
 {
 #ifdef NS_PRINTING
   NS_ENSURE_ARG(aCount);
   NS_ENSURE_ARG_POINTER(aResult);
   NS_ENSURE_TRUE(mPrintEngine, NS_ERROR_FAILURE);
 
   return mPrintEngine->EnumerateDocumentNames(aCount, aResult);
 #else
   return NS_ERROR_FAILURE;
 #endif
 }
 
 /* readonly attribute boolean isFramesetFrameSelected; */
 NS_IMETHODIMP 
-DocumentViewerImpl::GetIsFramesetFrameSelected(bool *aIsFramesetFrameSelected)
+nsDocumentViewer::GetIsFramesetFrameSelected(bool *aIsFramesetFrameSelected)
 {
 #ifdef NS_PRINTING
   *aIsFramesetFrameSelected = false;
   NS_ENSURE_TRUE(mPrintEngine, NS_ERROR_FAILURE);
 
   return mPrintEngine->GetIsFramesetFrameSelected(aIsFramesetFrameSelected);
 #else
   return NS_ERROR_FAILURE;
 #endif
 }
 
 /* readonly attribute long printPreviewNumPages; */
 NS_IMETHODIMP
-DocumentViewerImpl::GetPrintPreviewNumPages(int32_t *aPrintPreviewNumPages)
+nsDocumentViewer::GetPrintPreviewNumPages(int32_t *aPrintPreviewNumPages)
 {
 #ifdef NS_PRINTING
   NS_ENSURE_ARG_POINTER(aPrintPreviewNumPages);
   NS_ENSURE_TRUE(mPrintEngine, NS_ERROR_FAILURE);
 
   return mPrintEngine->GetPrintPreviewNumPages(aPrintPreviewNumPages);
 #else
   return NS_ERROR_FAILURE;
 #endif
 }
 
 /* readonly attribute boolean isFramesetDocument; */
 NS_IMETHODIMP
-DocumentViewerImpl::GetIsFramesetDocument(bool *aIsFramesetDocument)
+nsDocumentViewer::GetIsFramesetDocument(bool *aIsFramesetDocument)
 {
 #ifdef NS_PRINTING
   *aIsFramesetDocument = false;
   NS_ENSURE_TRUE(mPrintEngine, NS_ERROR_FAILURE);
 
   return mPrintEngine->GetIsFramesetDocument(aIsFramesetDocument);
 #else
   return NS_ERROR_FAILURE;
 #endif
 }
 
 /* readonly attribute boolean isIFrameSelected; */
 NS_IMETHODIMP 
-DocumentViewerImpl::GetIsIFrameSelected(bool *aIsIFrameSelected)
+nsDocumentViewer::GetIsIFrameSelected(bool *aIsIFrameSelected)
 {
 #ifdef NS_PRINTING
   *aIsIFrameSelected = false;
   NS_ENSURE_TRUE(mPrintEngine, NS_ERROR_FAILURE);
 
   return mPrintEngine->GetIsIFrameSelected(aIsIFrameSelected);
 #else
   return NS_ERROR_FAILURE;
 #endif
 }
 
 /* readonly attribute boolean isRangeSelection; */
 NS_IMETHODIMP 
-DocumentViewerImpl::GetIsRangeSelection(bool *aIsRangeSelection)
+nsDocumentViewer::GetIsRangeSelection(bool *aIsRangeSelection)
 {
 #ifdef NS_PRINTING
   *aIsRangeSelection = false;
   NS_ENSURE_TRUE(mPrintEngine, NS_ERROR_FAILURE);
 
   return mPrintEngine->GetIsRangeSelection(aIsRangeSelection);
 #else
   return NS_ERROR_FAILURE;
@@ -4003,17 +4003,17 @@ DocumentViewerImpl::GetIsRangeSelection(
 
 //----------------------------------------------------------------------------------
 // Printing/Print Preview Helpers
 //----------------------------------------------------------------------------------
 
 //----------------------------------------------------------------------------------
 // Walks the document tree and tells each DocShell whether Printing/PP is happening
 void 
-DocumentViewerImpl::SetIsPrintingInDocShellTree(nsIDocShellTreeNode* aParentNode, 
+nsDocumentViewer::SetIsPrintingInDocShellTree(nsIDocShellTreeNode* aParentNode, 
                                                 bool                 aIsPrintingOrPP, 
                                                 bool                 aStartAtTop)
 {
   nsCOMPtr<nsIDocShellTreeItem> parentItem(do_QueryInterface(aParentNode));
 
   // find top of "same parent" tree
   if (aStartAtTop) {
     if (aIsPrintingOrPP) {
@@ -4053,17 +4053,17 @@ DocumentViewerImpl::SetIsPrintingInDocSh
       SetIsPrintingInDocShellTree(childAsNode, aIsPrintingOrPP, false);
     }
   }
 
 }
 #endif // NS_PRINTING
 
 bool
-DocumentViewerImpl::ShouldAttachToTopLevel()
+nsDocumentViewer::ShouldAttachToTopLevel()
 {
   if (!mParentWidget)
     return false;
 
   nsCOMPtr<nsIDocShellTreeItem> containerItem = do_QueryReferent(mContainer);
   if (!containerItem)
     return false;
 
@@ -4093,45 +4093,45 @@ bool CollectDocuments(nsIDocument* aDocu
   if (aDocument) {
     static_cast<nsCOMArray<nsIDocument>*>(aData)->AppendObject(aDocument);
     aDocument->EnumerateSubDocuments(CollectDocuments, aData);
   }
   return true;
 }
 
 void
-DocumentViewerImpl::DispatchEventToWindowTree(nsIDocument* aDoc,
+nsDocumentViewer::DispatchEventToWindowTree(nsIDocument* aDoc,
                                               const nsAString& aEvent)
 {
   nsCOMArray<nsIDocument> targets;
   CollectDocuments(aDoc, &targets);
   for (int32_t i = 0; i < targets.Count(); ++i) {
     nsIDocument* d = targets[i];
     nsContentUtils::DispatchTrustedEvent(d, d->GetWindow(),
                                          aEvent, false, false, nullptr);
   }
 }
 
 //------------------------------------------------------------
 // XXX this always returns false for subdocuments
 bool
-DocumentViewerImpl::GetIsPrinting()
+nsDocumentViewer::GetIsPrinting()
 {
 #ifdef NS_PRINTING
   if (mPrintEngine) {
     return mPrintEngine->GetIsPrinting();
   }
 #endif
   return false; 
 }
 
 //------------------------------------------------------------
 // Notification from the PrintEngine of the current Printing status
 void
-DocumentViewerImpl::SetIsPrinting(bool aIsPrinting)
+nsDocumentViewer::SetIsPrinting(bool aIsPrinting)
 {
 #ifdef NS_PRINTING
   // Set all the docShells in the docshell tree to be printing.
   // that way if anyone of them tries to "navigate" it can't
   nsCOMPtr<nsIDocShellTreeNode> docShellTreeNode(do_QueryReferent(mContainer));
   if (docShellTreeNode || !aIsPrinting) {
     SetIsPrintingInDocShellTree(docShellTreeNode, aIsPrinting, true);
   } else {
@@ -4144,30 +4144,30 @@ DocumentViewerImpl::SetIsPrinting(bool a
 #endif
 }
 
 //------------------------------------------------------------
 // The PrintEngine holds the current value
 // this called from inside the DocViewer.
 // XXX it always returns false for subdocuments
 bool
-DocumentViewerImpl::GetIsPrintPreview()
+nsDocumentViewer::GetIsPrintPreview()
 {
 #ifdef NS_PRINTING
   if (mPrintEngine) {
     return mPrintEngine->GetIsPrintPreview();
   }
 #endif
   return false; 
 }
 
 //------------------------------------------------------------
 // Notification from the PrintEngine of the current PP status
 void
-DocumentViewerImpl::SetIsPrintPreview(bool aIsPrintPreview)
+nsDocumentViewer::SetIsPrintPreview(bool aIsPrintPreview)
 {
 #ifdef NS_PRINTING
   // Set all the docShells in the docshell tree to be printing.
   // that way if anyone of them tries to "navigate" it can't
   nsCOMPtr<nsIDocShellTreeNode> docShellTreeNode(do_QueryReferent(mContainer));
   if (docShellTreeNode || !aIsPrintPreview) {
     SetIsPrintingInDocShellTree(docShellTreeNode, aIsPrintPreview, true);
   }
@@ -4187,17 +4187,17 @@ DocumentViewerImpl::SetIsPrintPreview(bo
 }
 
 //----------------------------------------------------------------------------------
 // nsIDocumentViewerPrint IFace
 //----------------------------------------------------------------------------------
 
 //------------------------------------------------------------
 void
-DocumentViewerImpl::IncrementDestroyRefCount()
+nsDocumentViewer::IncrementDestroyRefCount()
 {
   ++mDestroyRefCount;
 }
 
 //------------------------------------------------------------
 
 #if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)
 //------------------------------------------------------------
@@ -4222,17 +4222,17 @@ ResetFocusState(nsIDocShell* aDocShell)
     nsCOMPtr<nsIDOMWindow> win = do_GetInterface(currentContainer);
     if (win)
       fm->ClearFocus(win);
   }
 }
 #endif // NS_PRINTING && NS_PRINT_PREVIEW
 
 void
-DocumentViewerImpl::ReturnToGalleyPresentation()
+nsDocumentViewer::ReturnToGalleyPresentation()
 {
 #if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)
   if (!GetIsPrintPreview()) {
     NS_ERROR("Wow, we should never get here!");
     return;
   }
 
   SetIsPrintPreview(false);
@@ -4260,17 +4260,17 @@ DocumentViewerImpl::ReturnToGalleyPresen
 // notification (we do not get rid of the PrintEngine)
 // 
 // One small caveat: 
 //   This IS called from two places in this module for cleaning
 //   up when an error occurred during the start up printing 
 //   and print preview
 //
 void
-DocumentViewerImpl::OnDonePrinting() 
+nsDocumentViewer::OnDonePrinting() 
 {
 #if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)
   if (mPrintEngine) {
     if (GetIsPrintPreview()) {
       mPrintEngine->DestroyPrintingData();
     } else {
       mPrintEngine->Destroy();
       mPrintEngine = nullptr;
@@ -4290,17 +4290,17 @@ DocumentViewerImpl::OnDonePrinting()
         mDocument = nullptr;
       }
       mClosingWhilePrinting = false;
     }
   }
 #endif // NS_PRINTING && NS_PRINT_PREVIEW
 }
 
-NS_IMETHODIMP DocumentViewerImpl::SetPageMode(bool aPageMode, nsIPrintSettings* aPrintSettings)
+NS_IMETHODIMP nsDocumentViewer::SetPageMode(bool aPageMode, nsIPrintSettings* aPrintSettings)
 {
   // XXX Page mode is only partially working; it's currently used for
   // reftests that require a paginated context
   mIsPageMode = aPageMode;
 
   if (mPresShell) {
     DestroyPresShell();
   }
@@ -4325,75 +4325,75 @@ NS_IMETHODIMP DocumentViewerImpl::SetPag
   }
   InitInternal(mParentWidget, nullptr, mBounds, true, false);
 
   Show();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetHistoryEntry(nsISHEntry **aHistoryEntry)
+nsDocumentViewer::GetHistoryEntry(nsISHEntry **aHistoryEntry)
 {
   NS_IF_ADDREF(*aHistoryEntry = mSHEntry);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetIsTabModalPromptAllowed(bool *aAllowed)
+nsDocumentViewer::GetIsTabModalPromptAllowed(bool *aAllowed)
 {
   *aAllowed = !(mInPermitUnload || mHidden);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocumentViewerImpl::GetIsHidden(bool *aHidden)
+nsDocumentViewer::GetIsHidden(bool *aHidden)
 {
   *aHidden = mHidden;
   return NS_OK;
 }
 
 void
-DocumentViewerImpl::DestroyPresShell()
+nsDocumentViewer::DestroyPresShell()
 {
   // Break circular reference (or something)
   mPresShell->EndObservingDocument();
 
   nsCOMPtr<nsISelection> selection;
   GetDocumentSelection(getter_AddRefs(selection));
   nsCOMPtr<nsISelectionPrivate> selPrivate = do_QueryInterface(selection);
   if (selPrivate && mSelectionListener)
     selPrivate->RemoveSelectionListener(mSelectionListener);
 
   nsAutoScriptBlocker scriptBlocker;
   mPresShell->Destroy();
   mPresShell = nullptr;
 }
 
 void
-DocumentViewerImpl::DestroyPresContext()
+nsDocumentViewer::DestroyPresContext()
 {
   mPresContext->SetContainer(nullptr);
   mPresContext->SetLinkHandler(nullptr);
   mPresContext = nullptr;
 }
 
 bool
-DocumentViewerImpl::IsInitializedForPrintPreview()
+nsDocumentViewer::IsInitializedForPrintPreview()
 {
   return mInitializedForPrintPreview;
 }
 
 void
-DocumentViewerImpl::InitializeForPrintPreview()
+nsDocumentViewer::InitializeForPrintPreview()
 {
   mInitializedForPrintPreview = true;
 }
 
 void
-DocumentViewerImpl::SetPrintPreviewPresentation(nsIViewManager* aViewManager,
+nsDocumentViewer::SetPrintPreviewPresentation(nsIViewManager* aViewManager,
                                                 nsPresContext* aPresContext,
                                                 nsIPresShell* aPresShell)
 {
   if (mPresShell) {
     DestroyPresShell();
   }
 
   mWindow = nullptr;
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -1134,17 +1134,17 @@ PresShell::SetPreferenceStyleRules(bool 
     return NS_ERROR_NULL_POINTER;
   }
 
   nsPIDOMWindow *window = mDocument->GetWindow();
 
   // If the document doesn't have a window there's no need to notify
   // its presshell about changes to preferences since the document is
   // in a state where it doesn't matter any more (see
-  // DocumentViewerImpl::Close()).
+  // nsDocumentViewer::Close()).
 
   if (!window) {
     return NS_ERROR_NULL_POINTER;
   } 
 
   NS_PRECONDITION(mPresContext, "presContext cannot be null");
   if (mPresContext) {
     // first, make sure this is not a chrome shell 
@@ -1470,17 +1470,17 @@ nsresult PresShell::SetPrefFocusRules(vo
     }
   }
   return result;
 }
 
 void
 PresShell::AddUserSheet(nsISupports* aSheet)
 {
-  // Make sure this does what DocumentViewerImpl::CreateStyleSet does wrt
+  // Make sure this does what nsDocumentViewer::CreateStyleSet does wrt
   // ordering. We want this new sheet to come after all the existing stylesheet
   // service sheets, but before other user sheets; see nsIStyleSheetService.idl
   // for the ordering.  Just remove and readd all the nsStyleSheetService
   // sheets.
   nsCOMPtr<nsIStyleSheetService> dummy =
     do_GetService(NS_STYLESHEETSERVICE_CONTRACTID);
 
   mStyleSet->BeginUpdate();
@@ -1503,17 +1503,17 @@ PresShell::AddUserSheet(nsISupports* aSh
   mStyleSet->EndUpdate();
 
   ReconstructStyleData();
 }
 
 void
 PresShell::AddAgentSheet(nsISupports* aSheet)
 {
-  // Make sure this does what DocumentViewerImpl::CreateStyleSet does
+  // Make sure this does what nsDocumentViewer::CreateStyleSet does
   // wrt ordering.
   nsCOMPtr<nsIStyleSheet> sheet = do_QueryInterface(aSheet);
   if (!sheet) {
     return;
   }
 
   mStyleSet->AppendStyleSheet(nsStyleSet::eAgentSheet, sheet);
   ReconstructStyleData();
@@ -7489,17 +7489,17 @@ PresShell::DoReflow(nsIFrame* target, bo
   // Don't pass size directly to the reflow state, since a
   // constrained height implies page/column breaking.
   nsSize reflowSize(size.width, NS_UNCONSTRAINEDSIZE);
   nsHTMLReflowState reflowState(mPresContext, target, rcx, reflowSize);
 
   if (rootFrame == target) {
     // When the root frame is being reflowed with unconstrained height
     // (which happens when we're called from
-    // DocumentViewerImpl::SizeToContent), we're effectively doing a
+    // nsDocumentViewer::SizeToContent), we're effectively doing a
     // vertical resize, since it changes the meaning of percentage
     // heights even if no heights actually changed.  The same applies
     // when we reflow again after that computation.  This is an unusual
     // case, and isn't caught by nsHTMLReflowState::InitResizeFlags.
     bool hasUnconstrainedHeight = size.height == NS_UNCONSTRAINEDSIZE;
 
     if (hasUnconstrainedHeight || mLastRootReflowHadUnconstrainedHeight) {
       reflowState.mFlags.mVResize = true;
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -138,17 +138,17 @@ nsSubDocumentFrame::Init(nsIContent*    
   // really need it or not, and the inner view will get it as the
   // parent.
   if (!HasView()) {
     rv = nsContainerFrame::CreateViewForFrame(this, true);
     NS_ENSURE_SUCCESS(rv, rv);
   }
   EnsureInnerView();
 
-  // Set the primary frame now so that DocumentViewerImpl::FindContainerView
+  // Set the primary frame now so that nsDocumentViewer::FindContainerView
   // called from within EndSwapDocShellsForViews below can find it if needed.
   aContent->SetPrimaryFrame(this);
 
   // If we have a detached subdoc's root view on our frame loader, re-insert
   // it into the view tree. This happens when we've been reframed, and
   // ensures the presentation persists across reframes. If the frame element
   // has changed documents however, we blow away the presentation.
   nsRefPtr<nsFrameLoader> frameloader = FrameLoader();
--- a/toolkit/components/viewsource/content/viewPartialSource.js
+++ b/toolkit/components/viewsource/content/viewPartialSource.js
@@ -63,17 +63,17 @@ function viewPartialSourceForSelection(s
   var endOffset = range.endOffset;
 
   // let the ancestor be an element
   if (ancestorContainer.nodeType == Node.TEXT_NODE ||
       ancestorContainer.nodeType == Node.CDATA_SECTION_NODE)
     ancestorContainer = ancestorContainer.parentNode;
 
   // for selectAll, let's use the entire document, including <html>...</html>
-  // @see DocumentViewerImpl::SelectAll() for how selectAll is implemented
+  // @see nsDocumentViewer::SelectAll() for how selectAll is implemented
   try {
     if (ancestorContainer == doc.body)
       ancestorContainer = doc.documentElement;
   } catch (e) { }
 
   // each path is a "child sequence" (a.k.a. "tumbler") that
   // descends from the ancestor down to the boundary point
   var startPath = getPath(ancestorContainer, startContainer);