Bug 1443080 - Use the static call for static methods (not instance) r=Ehsan
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 16 Mar 2018 14:29:15 +0100
changeset 408509 e6c8f65ed72339bde6ed674f36ac1f6aa7d80b26
parent 408508 6a0b4d9ef4fdfd9bcc9a5d842dfdba0e3749206d
child 408510 777cffb761a26a740f11fb5a810970afb8856386
push id33645
push userrgurzau@mozilla.com
push dateFri, 16 Mar 2018 17:49:51 +0000
treeherdermozilla-central@3b10b50a72d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1443080
milestone61.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 1443080 - Use the static call for static methods (not instance) r=Ehsan MozReview-Commit-ID: JwHh4bzxuTR
accessible/base/nsAccessibilityService.cpp
accessible/xpcom/xpcAccessibilityService.cpp
dom/base/Link.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsGlobalWindowOuter.cpp
dom/canvas/CanvasRenderingContext2D.cpp
dom/canvas/CanvasRenderingContext2D.h
dom/canvas/ImageBitmapRenderingContext.cpp
dom/canvas/WebGLRenderbuffer.cpp
dom/html/input/InputType.cpp
dom/indexedDB/ActorsParent.cpp
dom/indexedDB/FileInfo.cpp
dom/ipc/ColorPickerParent.cpp
dom/ipc/TabChild.cpp
dom/media/systemservices/CamerasChild.h
dom/media/systemservices/MediaParent.cpp
dom/media/webaudio/blink/HRTFPanner.cpp
dom/media/webspeech/synth/ipc/SpeechSynthesisChild.cpp
dom/presentation/PresentationConnectionList.cpp
dom/webbrowserpersist/WebBrowserPersistRemoteDocument.cpp
dom/xbl/nsBindingManager.cpp
dom/xul/XULDocument.cpp
editor/libeditor/HTMLAnonymousNodeEditor.cpp
editor/libeditor/HTMLEditRules.cpp
extensions/spellcheck/src/mozInlineSpellChecker.cpp
extensions/spellcheck/src/mozSpellChecker.cpp
gfx/gl/GLReadTexImageHelper.cpp
gfx/ipc/SharedDIB.cpp
gfx/src/nsFontMetrics.cpp
ipc/glue/IPCStreamUtils.cpp
js/src/jsnum.cpp
js/src/perf/jsperf.cpp
js/src/vm/Runtime.cpp
js/src/vm/TypedArrayObject.h
js/xpconnect/loader/URLPreloader.h
js/xpconnect/wrappers/XrayWrapper.cpp
js/xpconnect/wrappers/XrayWrapper.h
layout/base/AccessibleCaretEventHub.cpp
layout/base/PresShell.cpp
layout/base/ServoRestyleManager.cpp
layout/base/nsCounterManager.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGridContainerFrame.cpp
layout/generic/nsSimplePageSequenceFrame.cpp
layout/mathml/nsMathMLContainerFrame.cpp
layout/painting/ActiveLayerTracker.cpp
layout/painting/FrameLayerBuilder.cpp
layout/painting/nsCSSRenderingGradients.cpp
layout/style/RuleProcessorCache.h
layout/svg/SVGTextFrame.cpp
layout/svg/nsSVGIntegrationUtils.cpp
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsSplitterFrame.cpp
media/webrtc/signaling/gtest/rtpsources_unittests.cpp
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
netwerk/cache/nsCacheService.cpp
rdf/base/nsRDFXMLSerializer.cpp
security/manager/ssl/PSMContentListener.cpp
toolkit/components/extensions/MatchPattern.cpp
toolkit/components/places/nsNavHistoryResult.cpp
toolkit/components/printingui/ipc/PrintingParent.cpp
toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
toolkit/profile/nsToolkitProfileService.cpp
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsConsoleWriter.cpp
uriloader/exthandler/ExternalHelperAppParent.cpp
widget/nsBaseWidget.cpp
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -1760,17 +1760,17 @@ GetOrCreateAccService(uint32_t aNewConsu
 }
 
 void
 MaybeShutdownAccService(uint32_t aFormerConsumer)
 {
   nsAccessibilityService* accService =
     nsAccessibilityService::gAccessibilityService;
 
-  if (!accService || accService->IsShutdown()) {
+  if (!accService || nsAccessibilityService::IsShutdown()) {
     return;
   }
 
   // Still used by XPCOM
   if (nsCoreUtils::AccEventObserversExist() ||
       xpcAccessibilityService::IsInUse() ||
       accService->HasXPCDocuments()) {
     // In case the XPCOM flag was unset (possibly because of the shutdown
@@ -1858,16 +1858,16 @@ ReadPlatformDisabledState()
 }
 
 void
 PrefChanged(const char* aPref, void* aClosure)
 {
   if (ReadPlatformDisabledState() == ePlatformIsDisabled) {
     // Force shut down accessibility.
     nsAccessibilityService* accService = nsAccessibilityService::gAccessibilityService;
-    if (accService && !accService->IsShutdown()) {
+    if (accService && !nsAccessibilityService::IsShutdown()) {
       accService->Shutdown();
     }
   }
 }
 
 }
 }
--- a/accessible/xpcom/xpcAccessibilityService.cpp
+++ b/accessible/xpcom/xpcAccessibilityService.cpp
@@ -34,17 +34,17 @@ xpcAccessibilityService::ShutdownCallbac
   }
 }
 
 NS_IMETHODIMP_(MozExternalRefCountType)
 xpcAccessibilityService::AddRef(void)
 {
   MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(xpcAccessibilityService)
   MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");
-  if (!mRefCnt.isThreadSafe)
+  if (!nsAutoRefCnt::isThreadSafe)
     NS_ASSERT_OWNINGTHREAD(xpcAccessibilityService);
   nsrefcnt count = ++mRefCnt;
   NS_LOG_ADDREF(this, count, "xpcAccessibilityService", sizeof(*this));
 
   // We want refcount to be > 1 because one reference is added in the XPCOM
   // accessibility service getter.
   if (mRefCnt > 1) {
     if (mShutdownTimer) {
@@ -58,25 +58,25 @@ xpcAccessibilityService::AddRef(void)
   return count;
 }
 
 NS_IMETHODIMP_(MozExternalRefCountType)
 xpcAccessibilityService::Release(void)
 {
   MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");
 
-  if (!mRefCnt.isThreadSafe) {
+  if (!nsAutoRefCnt::isThreadSafe) {
     NS_ASSERT_OWNINGTHREAD(xpcAccessibilityService);
   }
 
   nsrefcnt count = --mRefCnt;
   NS_LOG_RELEASE(this, count, "xpcAccessibilityService");
 
   if (count == 0) {
-    if (!mRefCnt.isThreadSafe) {
+    if (!nsAutoRefCnt::isThreadSafe) {
       NS_ASSERT_OWNINGTHREAD(xpcAccessibilityService);
     }
 
     mRefCnt = 1; /* stabilize */
     delete (this);
     return 0;
   }
 
--- a/dom/base/Link.cpp
+++ b/dom/base/Link.cpp
@@ -179,17 +179,17 @@ Link::TryDNSPrefetchOrPreconnectOrPrefet
       }
     }
   }
 
   if (linkTypes & nsStyleLinkElement::ePRECONNECT) {
     nsCOMPtr<nsIURI> uri(GetURI());
     if (uri && mElement->OwnerDoc()) {
       mElement->OwnerDoc()->MaybePreconnect(uri,
-        mElement->AttrValueToCORSMode(mElement->GetParsedAttr(nsGkAtoms::crossorigin)));
+        Element::AttrValueToCORSMode(mElement->GetParsedAttr(nsGkAtoms::crossorigin)));
       return;
     }
   }
 
   if (linkTypes & nsStyleLinkElement::eDNS_PREFETCH) {
     if (nsHTMLDNSPrefetch::IsAllowed(mElement->OwnerDoc())) {
       nsHTMLDNSPrefetch::PrefetchLow(this);
     }
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -324,17 +324,17 @@ nsDOMWindowUtils::GetDocCharsetIsForced(
 NS_IMETHODIMP
 nsDOMWindowUtils::GetPhysicalMillimeterInCSSPixels(float* aPhysicalMillimeter)
 {
   nsPresContext* presContext = GetPresContext();
   if (!presContext) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
-  *aPhysicalMillimeter = presContext->AppUnitsToFloatCSSPixels(
+  *aPhysicalMillimeter = nsPresContext::AppUnitsToFloatCSSPixels(
     presContext->PhysicalMillimetersToAppUnits(1));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::GetDocumentMetadata(const nsAString& aName,
                                       nsAString& aValue)
 {
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -6144,17 +6144,17 @@ nsGlobalWindowOuter::EnterModalState()
       EventStateManager::GetActiveEventStateManager());
   if (activeESM && activeESM->GetPresContext()) {
     nsIPresShell* activeShell = activeESM->GetPresContext()->GetPresShell();
     if (activeShell && (
         nsContentUtils::ContentIsCrossDocDescendantOf(activeShell->GetDocument(), mDoc) ||
         nsContentUtils::ContentIsCrossDocDescendantOf(mDoc, activeShell->GetDocument()))) {
       EventStateManager::ClearGlobalActiveContent(activeESM);
 
-      activeShell->SetCapturingContent(nullptr, 0);
+      nsIPresShell::SetCapturingContent(nullptr, 0);
 
       if (activeShell) {
         RefPtr<nsFrameSelection> frameSelection = activeShell->FrameSelection();
         frameSelection->SetDragState(false);
       }
     }
   }
 
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -4037,17 +4037,17 @@ CanvasRenderingContext2D::SetFontInterna
   nsFont resizedFont(fontStyle->mFont);
   // Create a font group working in units of CSS pixels instead of the usual
   // device pixels, to avoid being affected by page zoom. nsFontMetrics will
   // convert nsFont size in app units to device pixels for the font group, so
   // here we first apply to the size the equivalent of a conversion from device
   // pixels to CSS pixels, to adjust for the difference in expectations from
   // other nsFontMetrics clients.
   resizedFont.size =
-    (fontStyle->mSize * c->AppUnitsPerDevPixel()) / c->AppUnitsPerCSSPixel();
+    (fontStyle->mSize * c->AppUnitsPerDevPixel()) / nsPresContext::AppUnitsPerCSSPixel();
 
   nsFontMetrics::Params params;
   params.language = fontStyle->mLanguage;
   params.explicitLanguage = fontStyle->mExplicitLanguage;
   params.userFontSet = c->GetUserFontSet();
   params.textPerf = c->GetTextPerfMetrics();
   RefPtr<nsFontMetrics> metrics =
     c->DeviceContext()->GetMetricsFor(resizedFont, params);
--- a/dom/canvas/CanvasRenderingContext2D.h
+++ b/dom/canvas/CanvasRenderingContext2D.h
@@ -1152,17 +1152,17 @@ protected:
 
     nsIPresShell *ps = GetPresShell();
     nsPresContext *pc;
 
     if (!ps) goto FINISH;
     pc = ps->GetPresContext();
     if (!pc) goto FINISH;
     devPixel = pc->AppUnitsPerDevPixel();
-    cssPixel = pc->AppUnitsPerCSSPixel();
+    cssPixel = nsPresContext::AppUnitsPerCSSPixel();
 
   FINISH:
     if (aPerDevPixel)
       *aPerDevPixel = devPixel;
     if (aPerCSSPixel)
       *aPerCSSPixel = cssPixel;
   }
 
--- a/dom/canvas/ImageBitmapRenderingContext.cpp
+++ b/dom/canvas/ImageBitmapRenderingContext.cpp
@@ -228,17 +228,17 @@ ImageBitmapRenderingContext::GetCanvasLa
   if (aOldLayer) {
     imageLayer = static_cast<ImageLayer*>(aOldLayer);
   } else {
     imageLayer = aManager->CreateImageLayer();
   }
 
   RefPtr<ImageContainer> imageContainer = imageLayer->GetContainer();
   if (!imageContainer) {
-    imageContainer = aManager->CreateImageContainer();
+    imageContainer = LayerManager::CreateImageContainer();
     imageLayer->SetContainer(imageContainer);
   }
 
   AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
   RefPtr<layers::Image> image = ClipToIntrinsicSize();
   if (!image) {
     return nullptr;
   }
--- a/dom/canvas/WebGLRenderbuffer.cpp
+++ b/dom/canvas/WebGLRenderbuffer.cpp
@@ -204,17 +204,17 @@ WebGLRenderbuffer::RenderbufferStorage(c
         mContext->ErrorInvalidOperation("%s: `samples` is out of the valid range.", funcName);
         return;
     }
 
     // Validation complete.
 
     const GLenum error = DoRenderbufferStorage(samples, usage, width, height);
     if (error) {
-        const char* errorName = mContext->ErrorName(error);
+        const char* errorName = WebGLContext::ErrorName(error);
         mContext->GenerateWarning("%s generated error %s", funcName, errorName);
         return;
     }
 
     mContext->OnDataAllocCall();
 
     mSamples = samples;
     mFormat = usage;
--- a/dom/html/input/InputType.cpp
+++ b/dom/html/input/InputType.cpp
@@ -446,17 +446,17 @@ InputType::ParseDate(const nsAString& aV
   // class.
   return mInputElement->ParseDate(aValue, aYear, aMonth, aDay);
 }
 
 bool
 InputType::ParseTime(const nsAString& aValue, uint32_t* aResult) const
 {
   // see comment in InputType::ParseDate().
-  return mInputElement->ParseTime(aValue, aResult);
+  return mozilla::dom::HTMLInputElement::ParseTime(aValue, aResult);
 }
 
 bool
 InputType::ParseMonth(const nsAString& aValue, uint32_t* aYear,
                       uint32_t* aMonth) const
 {
   // see comment in InputType::ParseDate().
   return mInputElement->ParseMonth(aValue, aYear, aMonth);
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -9960,17 +9960,17 @@ SerializeStructuredCloneFiles(
         file.mType != StructuredCloneFile::eWasmCompiled) {
       continue;
     }
 
     const int64_t fileId = file.mFileInfo->Id();
     MOZ_ASSERT(fileId > 0);
 
     nsCOMPtr<nsIFile> nativeFile =
-      fileManager->GetCheckedFileForId(directory, fileId);
+      mozilla::dom::indexedDB::FileManager::GetCheckedFileForId(directory, fileId);
     if (NS_WARN_IF(!nativeFile)) {
       IDB_REPORT_INTERNAL_ERR();
       return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
     }
 
     switch (file.mType) {
       case StructuredCloneFile::eBlob: {
         RefPtr<FileBlobImpl> impl = new FileBlobImpl(nativeFile);
@@ -11502,17 +11502,17 @@ UpdateRefcountFunction::Reset()
         }
 
         mJournalDirectory = aFileManager->GetJournalDirectory();
         if (NS_WARN_IF(!mJournalDirectory)) {
           return NS_ERROR_FAILURE;
         }
       }
 
-      nsCOMPtr<nsIFile> file = aFileManager->GetFileForId(mDirectory, aId);
+      nsCOMPtr<nsIFile> file = FileManager::GetFileForId(mDirectory, aId);
       if (NS_WARN_IF(!file)) {
         return NS_ERROR_FAILURE;
       }
 
       nsresult rv;
       int64_t fileSize;
 
       if (aFileManager->EnforcingQuota()) {
@@ -11532,17 +11532,17 @@ UpdateRefcountFunction::Reset()
         MOZ_ASSERT(quotaManager);
 
         quotaManager->DecreaseUsageForOrigin(aFileManager->Type(),
                                              aFileManager->Group(),
                                              aFileManager->Origin(),
                                              fileSize);
       }
 
-      file = aFileManager->GetFileForId(mJournalDirectory, aId);
+      file = FileManager::GetFileForId(mJournalDirectory, aId);
       if (NS_WARN_IF(!file)) {
         return NS_ERROR_FAILURE;
       }
 
       rv = file->Remove(false);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
@@ -11660,17 +11660,17 @@ UpdateRefcountFunction::CreateJournals()
   if (NS_WARN_IF(!journalDirectory)) {
     return NS_ERROR_FAILURE;
   }
 
   for (uint32_t i = 0; i < mJournalsToCreateBeforeCommit.Length(); i++) {
     int64_t id = mJournalsToCreateBeforeCommit[i];
 
     nsCOMPtr<nsIFile> file =
-      mFileManager->GetFileForId(journalDirectory, id);
+      FileManager::GetFileForId(journalDirectory, id);
     if (NS_WARN_IF(!file)) {
       return NS_ERROR_FAILURE;
     }
 
     nsresult rv = file->Create(nsIFile::NORMAL_FILE_TYPE, 0644);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
@@ -11693,17 +11693,17 @@ UpdateRefcountFunction::RemoveJournals(c
 
   nsCOMPtr<nsIFile> journalDirectory = mFileManager->GetJournalDirectory();
   if (NS_WARN_IF(!journalDirectory)) {
     return NS_ERROR_FAILURE;
   }
 
   for (uint32_t index = 0; index < aJournals.Length(); index++) {
     nsCOMPtr<nsIFile> file =
-      mFileManager->GetFileForId(journalDirectory, aJournals[index]);
+      FileManager::GetFileForId(journalDirectory, aJournals[index]);
     if (NS_WARN_IF(!file)) {
       return NS_ERROR_FAILURE;
     }
 
     if (NS_FAILED(file->Remove(false))) {
       NS_WARNING("Failed to removed journal!");
     }
   }
--- a/dom/indexedDB/FileInfo.cpp
+++ b/dom/indexedDB/FileInfo.cpp
@@ -258,17 +258,17 @@ CleanupFileRunnable::Run()
 FileInfo::GetFileForFileInfo(FileInfo* aFileInfo)
 {
   FileManager* fileManager = aFileInfo->Manager();
   nsCOMPtr<nsIFile> directory = fileManager->GetDirectory();
   if (NS_WARN_IF(!directory)) {
     return nullptr;
   }
 
-  nsCOMPtr<nsIFile> file = fileManager->GetFileForId(directory,
+  nsCOMPtr<nsIFile> file = FileManager::GetFileForId(directory,
                                                      aFileInfo->Id());
   if (NS_WARN_IF(!file)) {
     return nullptr;
   }
 
   return file.forget();
 }
 
--- a/dom/ipc/ColorPickerParent.cpp
+++ b/dom/ipc/ColorPickerParent.cpp
@@ -26,17 +26,17 @@ ColorPickerParent::ColorPickerShownCallb
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 ColorPickerParent::ColorPickerShownCallback::Done(const nsAString& aColor)
 {
   if (mColorPickerParent) {
-    Unused << mColorPickerParent->Send__delete__(mColorPickerParent,
+    Unused << ColorPickerParent::Send__delete__(mColorPickerParent,
                                                  nsString(aColor));
   }
   return NS_OK;
 }
 
 void
 ColorPickerParent::ColorPickerShownCallback::Destroy()
 {
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1719,17 +1719,17 @@ TabChild::HandleRealMouseButtonEvent(con
     pendingLayerization =
       APZCCallbackHelper::SendSetTargetAPZCNotification(mPuppetWidget, document,
                                                         aEvent, aGuid,
                                                         aInputBlockId);
   }
 
   InputAPZContext context(aGuid, aInputBlockId, nsEventStatus_eIgnore);
   if (pendingLayerization) {
-    context.SetPendingLayerization();
+    InputAPZContext::SetPendingLayerization();
   }
 
   WidgetMouseEvent localEvent(aEvent);
   localEvent.mWidget = mPuppetWidget;
   APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
       mPuppetWidget->GetDefaultScale());
   DispatchWidgetEventViaAPZ(localEvent);
 
--- a/dom/media/systemservices/CamerasChild.h
+++ b/dom/media/systemservices/CamerasChild.h
@@ -69,32 +69,32 @@ template <class T> class LockAndDispatch
 // something like device enumeration to complete.
 
 class CamerasSingleton {
 public:
   CamerasSingleton();
   ~CamerasSingleton();
 
   static OffTheBooksMutex& Mutex() {
-    return gTheInstance.get()->mCamerasMutex;
+    return Singleton<mozilla::camera::CamerasSingleton>::get()->mCamerasMutex;
   }
 
   static CamerasChild*& Child() {
     Mutex().AssertCurrentThreadOwns();
-    return gTheInstance.get()->mCameras;
+    return Singleton<mozilla::camera::CamerasSingleton>::get()->mCameras;
   }
 
   static nsCOMPtr<nsIThread>& Thread() {
     Mutex().AssertCurrentThreadOwns();
-    return gTheInstance.get()->mCamerasChildThread;
+    return Singleton<mozilla::camera::CamerasSingleton>::get()->mCamerasChildThread;
   }
 
   static nsCOMPtr<nsIThread>& FakeDeviceChangeEventThread() {
     Mutex().AssertCurrentThreadOwns();
-    return gTheInstance.get()->mFakeDeviceChangeEventThread;
+    return Singleton<mozilla::camera::CamerasSingleton>::get()->mFakeDeviceChangeEventThread;
   }
 
   static bool InShutdown() {
     return gTheInstance.get()->mInShutdown;
   }
 
   static void StartShutdown() {
     gTheInstance.get()->mInShutdown = true;
--- a/dom/media/systemservices/MediaParent.cpp
+++ b/dom/media/systemservices/MediaParent.cpp
@@ -67,17 +67,17 @@ class OriginKeyStore : public nsISupport
                     nsCString& aResult, bool aPersist = false)
     {
       nsAutoCString principalString;
       PrincipalInfoToString(aPrincipalInfo, principalString);
 
       OriginKey* key;
       if (!mKeys.Get(principalString, &key)) {
         nsCString salt; // Make a new one
-        nsresult rv = GenerateRandomName(salt, key->EncodedLength);
+        nsresult rv = GenerateRandomName(salt, OriginKey::EncodedLength);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return rv;
         }
         key = new OriginKey(salt);
         mKeys.Put(principalString, key);
       }
       if (aPersist && !key->mSecondsStamp) {
         key->mSecondsStamp = PR_Now() / PR_USEC_PER_SEC;
--- a/dom/media/webaudio/blink/HRTFPanner.cpp
+++ b/dom/media/webaudio/blink/HRTFPanner.cpp
@@ -100,17 +100,17 @@ int HRTFPanner::calculateDesiredAzimuthI
     // Convert the azimuth angle from the range -180 -> +180 into the range 0 -> 360.
     // The azimuth index may then be calculated from this positive value.
     if (azimuth < 0)
         azimuth += 360.0;
 
     HRTFDatabase* database = m_databaseLoader->database();
     MOZ_ASSERT(database);
 
-    int numberOfAzimuths = database->numberOfAzimuths();
+    int numberOfAzimuths = HRTFDatabase::numberOfAzimuths();
     const double angleBetweenAzimuths = 360.0 / numberOfAzimuths;
 
     // Calculate the azimuth index and the blend (0 -> 1) for interpolation.
     double desiredAzimuthIndexFloat = azimuth / angleBetweenAzimuths;
     int desiredAzimuthIndex = static_cast<int>(desiredAzimuthIndexFloat);
     azimuthBlend = desiredAzimuthIndexFloat - static_cast<double>(desiredAzimuthIndex);
 
     // We don't immediately start using this azimuth index, but instead approach this index from the last index we rendered at.
--- a/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.cpp
+++ b/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.cpp
@@ -112,17 +112,17 @@ SpeechSynthesisRequestChild::RecvOnEnd(c
   mTask->mActor = nullptr;
 
   if (aIsError) {
     mTask->DispatchErrorImpl(aElapsedTime, aCharIndex);
   } else {
     mTask->DispatchEndImpl(aElapsedTime, aCharIndex);
   }
 
-  actor->Send__delete__(actor);
+  SpeechSynthesisRequestChild::Send__delete__(actor);
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 SpeechSynthesisRequestChild::RecvOnPause(const float& aElapsedTime,
                                          const uint32_t& aCharIndex)
 {
--- a/dom/presentation/PresentationConnectionList.cpp
+++ b/dom/presentation/PresentationConnectionList.cpp
@@ -88,30 +88,30 @@ PresentationConnectionList::FindConnecti
   for (ConnectionArrayIndex i = 0; i < mConnections.Length(); i++) {
     nsAutoString id;
     mConnections[i]->GetId(id);
     if (id == nsAutoString(aId)) {
       return i;
     }
   }
 
-  return mConnections.NoIndex;
+  return ConnectionArray::NoIndex;
 }
 
 void
 PresentationConnectionList::NotifyStateChange(const nsAString& aSessionId,
                                               PresentationConnection* aConnection)
 {
   if (!aConnection) {
     MOZ_ASSERT(false, "PresentationConnection can not be null.");
     return;
   }
 
   bool connectionFound =
-    FindConnectionById(aSessionId) != mConnections.NoIndex ? true : false;
+    FindConnectionById(aSessionId) != ConnectionArray::NoIndex ? true : false;
 
   PresentationConnectionListBinding::ClearCachedConnectionsValue(this);
   switch (aConnection->State()) {
     case PresentationConnectionState::Connected:
       if (!connectionFound) {
         mConnections.AppendElement(aConnection);
         if (mGetConnectionListPromise) {
           if (!nsContentUtils::ShouldResistFingerprinting()) {
--- a/dom/webbrowserpersist/WebBrowserPersistRemoteDocument.cpp
+++ b/dom/webbrowserpersist/WebBrowserPersistRemoteDocument.cpp
@@ -23,17 +23,17 @@ WebBrowserPersistRemoteDocument
 , mAttrs(aAttrs)
 , mPostData(aPostData)
 {
 }
 
 WebBrowserPersistRemoteDocument::~WebBrowserPersistRemoteDocument()
 {
     if (mActor) {
-        Unused << mActor->Send__delete__(mActor);
+        Unused << WebBrowserPersistDocumentParent::Send__delete__(mActor);
         // That will call mActor->ActorDestroy, which calls this->ActorDestroy
         // (whether or not the IPC send succeeds).
     }
     MOZ_ASSERT(!mActor);
 }
 
 void
 WebBrowserPersistRemoteDocument::ActorDestroy(void)
--- a/dom/xbl/nsBindingManager.cpp
+++ b/dom/xbl/nsBindingManager.cpp
@@ -330,17 +330,17 @@ nsBindingManager::LoadBindingDocument(ns
 }
 
 void
 nsBindingManager::RemoveFromAttachedQueue(nsXBLBinding* aBinding)
 {
   // Don't remove items here as that could mess up an executing
   // ProcessAttachedQueue. Instead, null the entry in the queue.
   size_t index = mAttachedStack.IndexOf(aBinding);
-  if (index != mAttachedStack.NoIndex) {
+  if (index != nsBindingList::NoIndex) {
     mAttachedStack[index] = nullptr;
   }
 }
 
 nsresult
 nsBindingManager::AddToAttachedQueue(nsXBLBinding* aBinding)
 {
   mAttachedStack.AppendElement(aBinding);
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -3341,17 +3341,17 @@ XULDocument::OverlayForwardReference::Re
     if (id.IsEmpty()) {
         // mOverlay is a direct child of <overlay> and has no id.
         // Insert it under the root element in the base document.
         Element* root = mDocument->GetRootElement();
         if (!root) {
             return eResolve_Error;
         }
 
-        rv = mDocument->InsertElement(root, mOverlay, notify);
+        rv = XULDocument::InsertElement(root, mOverlay, notify);
         if (NS_FAILED(rv)) return eResolve_Error;
 
         target = mOverlay;
     }
     else {
         // The hook-up element has an id, try to match it with an element
         // with the same id in the base document.
         target = mDocument->GetElementById(id);
--- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp
+++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp
@@ -210,17 +210,17 @@ HTMLEditor::CreateAnonymousElement(nsAto
 
   ManualNACPtr newContent(newContentRaw.forget());
 
   // Must style the new element, otherwise the PostRecreateFramesFor call
   // below will do nothing.
   if (ServoStyleSet* styleSet = ps->StyleSet()->GetAsServo()) {
     // Sometimes editor likes to append anonymous content to elements
     // in display:none subtrees, so avoid styling in those cases.
-    if (styleSet->MayTraverseFrom(newContent)) {
+    if (ServoStyleSet::MayTraverseFrom(newContent)) {
       styleSet->StyleNewSubtree(newContent);
     }
   }
 
   ElementDeletionObserver* observer =
     new ElementDeletionObserver(newContent, &aParentContent);
   NS_ADDREF(observer); // NodeWillBeDestroyed releases.
   aParentContent.AddMutationObserver(observer);
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -1740,17 +1740,17 @@ HTMLEditRules::WillInsertBreak(Selection
 
     atStartOfSelection = firstRange->StartRef();
     if (NS_WARN_IF(!atStartOfSelection.IsSet())) {
       return NS_ERROR_FAILURE;
     }
     MOZ_ASSERT(atStartOfSelection.IsSetAndValid());
 
     blockParent =
-      mHTMLEditor->GetBlock(*atStartOfSelection.GetContainer(), host);
+      HTMLEditor::GetBlock(*atStartOfSelection.GetContainer(), host);
     if (NS_WARN_IF(!blockParent)) {
       return NS_ERROR_UNEXPECTED;
     }
     if (NS_WARN_IF(blockParent == host)) {
       // Didn't create a new block for some reason, fall back to <br>
       rv = InsertBRElement(aSelection, atStartOfSelection);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
@@ -2699,18 +2699,18 @@ HTMLEditRules::WillDeleteSelection(Selec
       if (startCiteNode && !endCiteNode) {
         aAction = nsIEditor::eNext;
       } else if (!startCiteNode && endCiteNode) {
         aAction = nsIEditor::ePrevious;
       }
 
       // Figure out block parents
       NS_ENSURE_STATE(mHTMLEditor);
-      nsCOMPtr<Element> leftParent = mHTMLEditor->GetBlock(*startNode);
-      nsCOMPtr<Element> rightParent = mHTMLEditor->GetBlock(*endNode);
+      nsCOMPtr<Element> leftParent = HTMLEditor::GetBlock(*startNode);
+      nsCOMPtr<Element> rightParent = HTMLEditor::GetBlock(*endNode);
 
       // Are endpoint block parents the same?  Use default deletion
       if (leftParent && leftParent == rightParent) {
         NS_ENSURE_STATE(mHTMLEditor);
         mHTMLEditor->DeleteSelectionImpl(aAction, aStripWrappers);
       } else {
         // Deleting across blocks.  Are the blocks of same type?
         NS_ENSURE_STATE(leftParent && rightParent);
--- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp
@@ -1492,17 +1492,17 @@ nsresult mozInlineSpellChecker::DoSpellC
     // this is sufficient.
     if (aStatus->mNoCheckRange &&
         aStatus->mNoCheckRange->IsPointInRange(*beginNode, beginOffset, erv)) {
       continue;
     }
 
     // check spelling and add to selection if misspelled
     bool isMisspelled;
-    aWordUtil.NormalizeWord(wordText);
+    mozInlineSpellWordUtil::NormalizeWord(wordText);
     nsresult rv = mSpellCheck->CheckCurrentWordNoSuggest(wordText,
                                                          &isMisspelled);
     if (NS_FAILED(rv))
       continue;
 
     wordsChecked++;
     if (isMisspelled) {
       // misspelled words count extra toward the max
--- a/extensions/spellcheck/src/mozSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozSpellChecker.cpp
@@ -48,17 +48,17 @@ mozSpellChecker::~mozSpellChecker()
     //    mPersonalDictionary->Save();
     mPersonalDictionary->EndSession();
   }
   mSpellCheckingEngine = nullptr;
   mPersonalDictionary = nullptr;
 
   if (mEngine) {
     MOZ_ASSERT(XRE_IsContentProcess());
-    mEngine->Send__delete__(mEngine);
+    RemoteSpellcheckEngineChild::Send__delete__(mEngine);
     MOZ_ASSERT(!mEngine);
   }
 }
 
 nsresult
 mozSpellChecker::Init()
 {
   mSpellCheckingEngine = nullptr;
--- a/gfx/gl/GLReadTexImageHelper.cpp
+++ b/gfx/gl/GLReadTexImageHelper.cpp
@@ -147,17 +147,17 @@ GLReadTexImageHelper::TextureImageProgra
 }
 
 bool
 GLReadTexImageHelper::DidGLErrorOccur(const char* str)
 {
     GLenum error = mGL->fGetError();
     if (error != LOCAL_GL_NO_ERROR) {
         printf_stderr("GL ERROR: %s (0x%04x) %s\n",
-                      mGL->GLErrorToString(error), error, str);
+                      GLContext::GLErrorToString(error), error, str);
         return true;
     }
 
     return false;
 }
 
 bool
 GetActualReadFormats(GLContext* gl,
--- a/gfx/ipc/SharedDIB.cpp
+++ b/gfx/ipc/SharedDIB.cpp
@@ -32,17 +32,17 @@ SharedDIB::Create(uint32_t aSize)
 }
 
 bool
 SharedDIB::IsValid()
 {
   if (!mShMem)
     return false;
 
-  return mShMem->IsHandleValid(mShMem->handle());
+  return base::SharedMemory::IsHandleValid(mShMem->handle());
 }
 
 nsresult
 SharedDIB::Close()
 {
   delete mShMem;
 
   mShMem = nullptr;
--- a/gfx/src/nsFontMetrics.cpp
+++ b/gfx/src/nsFontMetrics.cpp
@@ -133,17 +133,17 @@ nsFontMetrics::nsFontMetrics(const nsFon
                        aFont.synthesis & NS_FONT_SYNTHESIS_WEIGHT,
                        aFont.synthesis & NS_FONT_SYNTHESIS_STYLE,
                        aFont.languageOverride);
 
     aFont.AddFontFeaturesToStyle(&style, mOrientation == gfxFont::eVertical);
     aFont.AddFontVariationsToStyle(&style);
 
     gfxFloat devToCssSize = gfxFloat(mP2A) /
-        gfxFloat(mDeviceContext->AppUnitsPerCSSPixel());
+        gfxFloat(nsDeviceContext::AppUnitsPerCSSPixel());
     mFontGroup = gfxPlatform::GetPlatform()->
         CreateFontGroup(aFont.fontlist, &style, aParams.textPerf,
                         aParams.userFontSet, devToCssSize);
 }
 
 nsFontMetrics::~nsFontMetrics()
 {
     // Should not be dropped by stylo
--- a/ipc/glue/IPCStreamUtils.cpp
+++ b/ipc/glue/IPCStreamUtils.cpp
@@ -269,17 +269,17 @@ CleanupIPCStream(IPCStream& aValue, bool
       MOZ_ASSERT(fdSetActor);
 
       // FileDescriptorSet doesn't clear its fds in its ActorDestroy, so we
       // unconditionally forget them here.  The fds themselves are auto-closed in
       // ~FileDescriptor since they originated in this process.
       fdSetActor->ForgetFileDescriptors(fds);
 
       if (!aConsumedByIPC) {
-        Unused << fdSetActor->Send__delete__(fdSetActor);
+        Unused << FileDescriptorSetChild::Send__delete__(fdSetActor);
       }
 
     } else if (streamWithFds.optionalFds().type() ==
                OptionalFileDescriptorSet::TPFileDescriptorSetParent) {
 
       AutoTArray<FileDescriptor, 4> fds;
 
       auto fdSetActor = static_cast<FileDescriptorSetParent*>(
@@ -287,17 +287,17 @@ CleanupIPCStream(IPCStream& aValue, bool
       MOZ_ASSERT(fdSetActor);
 
       // FileDescriptorSet doesn't clear its fds in its ActorDestroy, so we
       // unconditionally forget them here.  The fds themselves are auto-closed in
       // ~FileDescriptor since they originated in this process.
       fdSetActor->ForgetFileDescriptors(fds);
 
       if (!aConsumedByIPC) {
-        Unused << fdSetActor->Send__delete__(fdSetActor);
+        Unused << FileDescriptorSetParent::Send__delete__(fdSetActor);
       }
     }
 
     return;
   }
 
   MOZ_ASSERT(aValue.type() == IPCStream::TIPCRemoteStream);
   IPCRemoteStreamType& remoteInputStream =
@@ -395,31 +395,31 @@ DeserializeIPCStream(const IPCStream& aV
 
     auto fdSetActor = static_cast<FileDescriptorSetParent*>(
       streamWithFds.optionalFds().get_PFileDescriptorSetParent());
     MOZ_ASSERT(fdSetActor);
 
     fdSetActor->ForgetFileDescriptors(fds);
     MOZ_ASSERT(!fds.IsEmpty());
 
-    if (!fdSetActor->Send__delete__(fdSetActor)) {
+    if (!FileDescriptorSetParent::Send__delete__(fdSetActor)) {
       // child process is gone, warn and allow actor to clean up normally
       NS_WARNING("Failed to delete fd set actor.");
     }
   } else if (streamWithFds.optionalFds().type() ==
              OptionalFileDescriptorSet::TPFileDescriptorSetChild) {
 
     auto fdSetActor = static_cast<FileDescriptorSetChild*>(
       streamWithFds.optionalFds().get_PFileDescriptorSetChild());
     MOZ_ASSERT(fdSetActor);
 
     fdSetActor->ForgetFileDescriptors(fds);
     MOZ_ASSERT(!fds.IsEmpty());
 
-    Unused << fdSetActor->Send__delete__(fdSetActor);
+    Unused << FileDescriptorSetChild::Send__delete__(fdSetActor);
   }
 
   return InputStreamHelper::DeserializeInputStream(streamWithFds.stream(), fds);
 }
 
 already_AddRefed<nsIInputStream>
 DeserializeIPCStream(const OptionalIPCStream& aValue)
 {
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -1300,17 +1300,17 @@ FracNumberToCString(JSContext* cx, ToCSt
          * This is V8's implementation of the algorithm described in the
          * following paper:
          *
          *   Printing floating-point numbers quickly and accurately with integers.
          *   Florian Loitsch, PLDI 2010.
          */
         const double_conversion::DoubleToStringConverter& converter
             = double_conversion::DoubleToStringConverter::EcmaScriptConverter();
-        double_conversion::StringBuilder builder(cbuf->sbuf, cbuf->sbufSize);
+        double_conversion::StringBuilder builder(cbuf->sbuf, js::ToCStringBuf::sbufSize);
         converter.ToShortest(d, &builder);
         numStr = builder.Finalize();
     } else {
         if (!EnsureDtoaState(cx))
             return nullptr;
         numStr = cbuf->dbuf = js_dtobasestr(cx->dtoaState, base, d);
     }
     return numStr;
--- a/js/src/perf/jsperf.cpp
+++ b/js/src/perf/jsperf.cpp
@@ -89,17 +89,17 @@ pm_reset(JSContext* cx, unsigned argc, V
 static bool
 pm_canMeasureSomething(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     PerfMeasurement* p = GetPM(cx, args.thisv(), "canMeasureSomething");
     if (!p)
         return false;
 
-    args.rval().setBoolean(p->canMeasureSomething());
+    args.rval().setBoolean(PerfMeasurement::canMeasureSomething());
     return true;
 }
 
 static const uint8_t PM_FATTRS = JSPROP_READONLY | JSPROP_PERMANENT;
 static const JSFunctionSpec pm_fns[] = {
     JS_FN("start",               pm_start,               0, PM_FATTRS),
     JS_FN("stop",                pm_stop,                0, PM_FATTRS),
     JS_FN("reset",               pm_reset,               0, PM_FATTRS),
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -593,17 +593,17 @@ JSContext::requestInterrupt(InterruptMod
     jitStackLimit = UINTPTR_MAX;
 
     if (mode == JSContext::RequestInterruptUrgent) {
         // If this interrupt is urgent (slow script dialog for instance), take
         // additional steps to interrupt corner cases where the above fields are
         // not regularly polled. Wake ilooping Ion code, irregexp JIT code and
         // Atomics.wait()
         interruptRegExpJit_ = true;
-        fx.lock();
+        FutexThread::lock();
         if (fx.isWaiting())
             fx.wake(FutexThread::WakeForJSInterrupt);
         fx.unlock();
         jit::InterruptRunningCode(this);
         wasm::InterruptRunningCode(this);
     }
 }
 
--- a/js/src/vm/TypedArrayObject.h
+++ b/js/src/vm/TypedArrayObject.h
@@ -151,17 +151,17 @@ class TypedArrayObject : public NativeOb
     }
     uint32_t length() const {
         return lengthValue(const_cast<TypedArrayObject*>(this)).toInt32();
     }
 
     bool hasInlineElements() const;
     void setInlineElements();
     uint8_t* elementsRaw() const {
-        return *(uint8_t **)((((char *)this) + this->dataOffset()));
+        return *(uint8_t **)((((char *)this) + js::TypedArrayObject::dataOffset()));
     }
     uint8_t* elements() const {
         assertZeroLengthArrayData();
         return elementsRaw();
     }
 
 #ifdef DEBUG
     void assertZeroLengthArrayData() const;
--- a/js/xpconnect/loader/URLPreloader.h
+++ b/js/xpconnect/loader/URLPreloader.h
@@ -121,17 +121,17 @@ protected:
         }
 
         ~AutoBeginReading()
         {
             auto& reader = GetSingleton();
 
             MonitorAutoLock mal(reader.mMonitor);
 
-            while (!reader.mReaderInitialized && reader.sInitialized) {
+            while (!reader.mReaderInitialized && URLPreloader::sInitialized) {
                 mal.Wait();
             }
         }
     };
 
 private:
     // Represents a key for an entry in the URI cache, based on its file or JAR
     // location.
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -953,17 +953,17 @@ bool
 JSXrayTraits::construct(JSContext* cx, HandleObject wrapper,
                         const JS::CallArgs& args, const js::Wrapper& baseInstance)
 {
     JSXrayTraits& self = JSXrayTraits::singleton;
     JS::RootedObject holder(cx, self.ensureHolder(cx, wrapper));
     if (!holder)
         return false;
 
-    if (self.getProtoKey(holder) == JSProto_Function) {
+    if (xpc::JSXrayTraits::getProtoKey(holder) == JSProto_Function) {
         JSProtoKey standardConstructor = constructorFor(holder);
         if (standardConstructor == JSProto_Null)
             return baseInstance.construct(cx, wrapper, args);
 
         const js::Class* clasp = js::ProtoKeyToClass(standardConstructor);
         MOZ_ASSERT(clasp);
         if (!(clasp->flags & JSCLASS_HAS_XRAYED_CONSTRUCTOR))
             return baseInstance.construct(cx, wrapper, args);
--- a/js/xpconnect/wrappers/XrayWrapper.h
+++ b/js/xpconnect/wrappers/XrayWrapper.h
@@ -273,17 +273,17 @@ public:
     virtual bool enumerateNames(JSContext* cx, JS::HandleObject wrapper, unsigned flags,
                                 JS::AutoIdVector& props);
 
     static bool call(JSContext* cx, JS::HandleObject wrapper,
                      const JS::CallArgs& args, const js::Wrapper& baseInstance)
     {
         JSXrayTraits& self = JSXrayTraits::singleton;
         JS::RootedObject holder(cx, self.ensureHolder(cx, wrapper));
-        if (self.getProtoKey(holder) == JSProto_Function)
+        if (xpc::JSXrayTraits::getProtoKey(holder) == JSProto_Function)
             return baseInstance.call(cx, wrapper, args);
 
         JS::RootedValue v(cx, JS::ObjectValue(*wrapper));
         js::ReportIsNotFunction(cx, v);
         return false;
     }
 
     static bool construct(JSContext* cx, JS::HandleObject wrapper,
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -48,33 +48,33 @@ public:
   nsEventStatus OnPress(AccessibleCaretEventHub* aContext,
                         const nsPoint& aPoint,
                         int32_t aTouchId,
                         EventClassID aEventClass) override
   {
     nsEventStatus rv = nsEventStatus_eIgnore;
 
     if (NS_SUCCEEDED(aContext->mManager->PressCaret(aPoint, aEventClass))) {
-      aContext->SetState(aContext->PressCaretState());
+      aContext->SetState(AccessibleCaretEventHub::PressCaretState());
       rv = nsEventStatus_eConsumeNoDefault;
     } else {
-      aContext->SetState(aContext->PressNoCaretState());
+      aContext->SetState(AccessibleCaretEventHub::PressNoCaretState());
     }
 
     aContext->mPressPoint = aPoint;
     aContext->mActiveTouchId = aTouchId;
 
     return rv;
   }
 
   MOZ_CAN_RUN_SCRIPT
   void OnScrollStart(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollStart();
-    aContext->SetState(aContext->ScrollState());
+    aContext->SetState(AccessibleCaretEventHub::ScrollState());
   }
 
   MOZ_CAN_RUN_SCRIPT
   void OnScrollPositionChanged(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollPositionChanged();
   }
 
@@ -117,29 +117,29 @@ public:
   const char* Name() const override { return "PressCaretState"; }
 
   MOZ_CAN_RUN_SCRIPT
   nsEventStatus OnMove(AccessibleCaretEventHub* aContext,
                        const nsPoint& aPoint) override
   {
     if (aContext->MoveDistanceIsLarge(aPoint)) {
       if (NS_SUCCEEDED(aContext->mManager->DragCaret(aPoint))) {
-        aContext->SetState(aContext->DragCaretState());
+        aContext->SetState(AccessibleCaretEventHub::DragCaretState());
       }
     }
 
     return nsEventStatus_eConsumeNoDefault;
   }
 
   MOZ_CAN_RUN_SCRIPT
   nsEventStatus OnRelease(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->ReleaseCaret();
     aContext->mManager->TapCaret(aContext->mPressPoint);
-    aContext->SetState(aContext->NoActionState());
+    aContext->SetState(AccessibleCaretEventHub::NoActionState());
 
     return nsEventStatus_eConsumeNoDefault;
   }
 
   nsEventStatus OnLongTap(AccessibleCaretEventHub* aContext,
                           const nsPoint& aPoint) override
   {
     return nsEventStatus_eConsumeNoDefault;
@@ -163,17 +163,17 @@ public:
 
     return nsEventStatus_eConsumeNoDefault;
   }
 
   MOZ_CAN_RUN_SCRIPT
   nsEventStatus OnRelease(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->ReleaseCaret();
-    aContext->SetState(aContext->NoActionState());
+    aContext->SetState(AccessibleCaretEventHub::NoActionState());
 
     return nsEventStatus_eConsumeNoDefault;
   }
 };
 
 // -----------------------------------------------------------------------------
 // PressNoCaretState
 //
@@ -182,52 +182,52 @@ class AccessibleCaretEventHub::PressNoCa
 {
 public:
   const char* Name() const override { return "PressNoCaretState"; }
 
   nsEventStatus OnMove(AccessibleCaretEventHub* aContext,
                        const nsPoint& aPoint) override
   {
     if (aContext->MoveDistanceIsLarge(aPoint)) {
-      aContext->SetState(aContext->NoActionState());
+      aContext->SetState(AccessibleCaretEventHub::NoActionState());
     }
 
     return nsEventStatus_eIgnore;
   }
 
   nsEventStatus OnRelease(AccessibleCaretEventHub* aContext) override
   {
-    aContext->SetState(aContext->NoActionState());
+    aContext->SetState(AccessibleCaretEventHub::NoActionState());
 
     return nsEventStatus_eIgnore;
   }
 
   MOZ_CAN_RUN_SCRIPT
   nsEventStatus OnLongTap(AccessibleCaretEventHub* aContext,
                           const nsPoint& aPoint) override
   {
-    aContext->SetState(aContext->LongTapState());
+    aContext->SetState(AccessibleCaretEventHub::LongTapState());
 
     return aContext->GetState()->OnLongTap(aContext, aPoint);
   }
 
   MOZ_CAN_RUN_SCRIPT
   void OnScrollStart(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollStart();
-    aContext->SetState(aContext->ScrollState());
+    aContext->SetState(AccessibleCaretEventHub::ScrollState());
   }
 
   MOZ_CAN_RUN_SCRIPT
   void OnBlur(AccessibleCaretEventHub* aContext,
               bool aIsLeavingDocument) override
   {
     aContext->mManager->OnBlur();
     if (aIsLeavingDocument) {
-      aContext->SetState(aContext->NoActionState());
+      aContext->SetState(AccessibleCaretEventHub::NoActionState());
     }
   }
 
   MOZ_CAN_RUN_SCRIPT
   void OnSelectionChanged(AccessibleCaretEventHub* aContext,
                           nsIDOMDocument* aDoc,
                           nsISelection* aSel,
                           int16_t aReason) override
@@ -260,32 +260,32 @@ class AccessibleCaretEventHub::ScrollSta
 {
 public:
   const char* Name() const override { return "ScrollState"; }
 
   MOZ_CAN_RUN_SCRIPT
   void OnScrollEnd(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollEnd();
-    aContext->SetState(aContext->NoActionState());
+    aContext->SetState(AccessibleCaretEventHub::NoActionState());
   }
 
   MOZ_CAN_RUN_SCRIPT
   void OnScrollPositionChanged(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollPositionChanged();
   }
 
   MOZ_CAN_RUN_SCRIPT
   void OnBlur(AccessibleCaretEventHub* aContext,
               bool aIsLeavingDocument) override
   {
     aContext->mManager->OnBlur();
     if (aIsLeavingDocument) {
-      aContext->SetState(aContext->NoActionState());
+      aContext->SetState(AccessibleCaretEventHub::NoActionState());
     }
   }
 };
 
 // -----------------------------------------------------------------------------
 // LongTapState
 //
 class AccessibleCaretEventHub::LongTapState
@@ -303,28 +303,28 @@ public:
     // showing up on desktop Firefox (because that happens on long-tap-up, if
     // the long-tap was not cancelled). So we return eIgnore instead.
     aContext->mManager->SelectWordOrShortcut(aPoint);
     return nsEventStatus_eIgnore;
   }
 
   nsEventStatus OnRelease(AccessibleCaretEventHub* aContext) override
   {
-    aContext->SetState(aContext->NoActionState());
+    aContext->SetState(AccessibleCaretEventHub::NoActionState());
 
     // Do not consume the release since the press is not consumed in
     // PressNoCaretState either.
     return nsEventStatus_eIgnore;
   }
 
   MOZ_CAN_RUN_SCRIPT
   void OnScrollStart(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollStart();
-    aContext->SetState(aContext->ScrollState());
+    aContext->SetState(AccessibleCaretEventHub::ScrollState());
   }
 
   MOZ_CAN_RUN_SCRIPT
   void OnReflow(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnReflow();
   }
 };
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -8207,17 +8207,17 @@ PresShell::GetCurrentItemAndPositionForE
         // need to know about trees? Something like nsINodelessChildCreator which
         // could provide the current focus coordinates?
         if (treeBox) {
           treeBox->EnsureRowIsVisible(currentIndex);
           int32_t firstVisibleRow, rowHeight;
           treeBox->GetFirstVisibleRow(&firstVisibleRow);
           treeBox->GetRowHeight(&rowHeight);
 
-          extraTreeY += presContext->CSSPixelsToAppUnits(
+          extraTreeY += nsPresContext::CSSPixelsToAppUnits(
                           (currentIndex - firstVisibleRow + 1) * rowHeight);
           istree = true;
 
           nsCOMPtr<nsITreeColumns> cols;
           treeBox->GetColumns(getter_AddRefs(cols));
           if (cols) {
             nsCOMPtr<nsITreeColumn> col;
             cols->GetFirstColumn(getter_AddRefs(col));
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -596,17 +596,17 @@ UpdateBackdropIfNeeded(nsIFrame* aFrame,
 
   // NOTE(emilio): We can't use the changes handled for the owner of the
   // backdrop frame, since it's out of flow, and parented to the viewport or
   // canvas frame (depending on the `position` value).
   MOZ_ASSERT(backdropFrame->GetParent()->IsViewportFrame() ||
              backdropFrame->GetParent()->IsCanvasFrame());
   nsTArray<nsIFrame*> wrappersToRestyle;
   ServoRestyleState state(aStyleSet, aChangeList, wrappersToRestyle);
-  aFrame->UpdateStyleOfOwnedChildFrame(backdropFrame, newContext, state);
+  nsIFrame::UpdateStyleOfOwnedChildFrame(backdropFrame, newContext, state);
 }
 
 static void
 UpdateFirstLetterIfNeeded(nsIFrame* aFrame, ServoRestyleState& aRestyleState)
 {
   MOZ_ASSERT(!aFrame->IsFrameOfType(nsIFrame::eBlockFrame),
              "You're probably duplicating work with UpdatePseudoElementStyles!");
   if (!aFrame->HasFirstLetterChild()) {
--- a/layout/base/nsCounterManager.cpp
+++ b/layout/base/nsCounterManager.cpp
@@ -48,30 +48,30 @@ nsCounterUseNode::InitTextFrame(nsGenCon
 
 // assign the correct |mValueAfter| value to a node that has been inserted
 // Should be called immediately after calling |Insert|.
 void
 nsCounterUseNode::Calc(nsCounterList* aList)
 {
   NS_ASSERTION(!aList->IsDirty(),
                "Why are we calculating with a dirty list?");
-  mValueAfter = aList->ValueBefore(this);
+  mValueAfter = nsCounterList::ValueBefore(this);
 }
 
 // assign the correct |mValueAfter| value to a node that has been inserted
 // Should be called immediately after calling |Insert|.
 void
 nsCounterChangeNode::Calc(nsCounterList* aList)
 {
   NS_ASSERTION(!aList->IsDirty(), "Why are we calculating with a dirty list?");
   if (mType == RESET) {
     mValueAfter = mChangeValue;
   } else {
     NS_ASSERTION(mType == INCREMENT, "invalid type");
-    mValueAfter = nsCounterManager::IncrementCounter(aList->ValueBefore(this),
+    mValueAfter = nsCounterManager::IncrementCounter(nsCounterList::ValueBefore(this),
                                                      mChangeValue);
   }
 }
 
 // The text that should be displayed for this counter.
 void
 nsCounterUseNode::GetText(nsString& aResult)
 {
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1084,18 +1084,18 @@ nsHTMLScrollFrame::Reflow(nsPresContext*
       reflowHScrollbar || reflowVScrollbar || reflowScrollCorner ||
       (GetStateBits() & NS_FRAME_IS_DIRTY) ||
       didHaveHScrollbar != state.mShowHScrollbar ||
       didHaveVScrollbar != state.mShowVScrollbar ||
       !oldScrollAreaBounds.IsEqualEdges(newScrollAreaBounds) ||
       !oldScrolledAreaBounds.IsEqualEdges(newScrolledAreaBounds)) {
     if (!mHelper.mSuppressScrollbarUpdate) {
       mHelper.mSkippedScrollbarLayout = false;
-      mHelper.SetScrollbarVisibility(mHelper.mHScrollbarBox, state.mShowHScrollbar);
-      mHelper.SetScrollbarVisibility(mHelper.mVScrollbarBox, state.mShowVScrollbar);
+      ScrollFrameHelper::SetScrollbarVisibility(mHelper.mHScrollbarBox, state.mShowHScrollbar);
+      ScrollFrameHelper::SetScrollbarVisibility(mHelper.mVScrollbarBox, state.mShowVScrollbar);
       // place and reflow scrollbars
       nsRect insideBorderArea =
         nsRect(nsPoint(state.mComputedBorder.left, state.mComputedBorder.top),
                state.mInsideBorderSize);
       mHelper.LayoutScrollbars(state.mBoxState, insideBorderArea,
                               oldScrollAreaBounds);
     } else {
       mHelper.mSkippedScrollbarLayout = true;
@@ -5037,49 +5037,49 @@ nsXULScrollFrame::AddRemoveScrollbar(nsB
 {
   if (aHorizontal) {
      if (mHelper.mNeverHasHorizontalScrollbar || !mHelper.mHScrollbarBox)
        return false;
 
      nsSize hSize = mHelper.mHScrollbarBox->GetXULPrefSize(aState);
      nsBox::AddMargin(mHelper.mHScrollbarBox, hSize);
 
-     mHelper.SetScrollbarVisibility(mHelper.mHScrollbarBox, aAdd);
+     ScrollFrameHelper::SetScrollbarVisibility(mHelper.mHScrollbarBox, aAdd);
 
      // We can't directly pass mHasHorizontalScrollbar as the bool outparam for
      // AddRemoveScrollbar() because it's a bool:1 bitfield. Hence this var:
      bool hasHorizontalScrollbar;
      bool fit = AddRemoveScrollbar(hasHorizontalScrollbar,
                                    mHelper.mScrollPort.y,
                                    mHelper.mScrollPort.height,
                                    hSize.height, aOnRightOrBottom, aAdd);
      mHelper.mHasHorizontalScrollbar = hasHorizontalScrollbar;
      if (!fit) {
-       mHelper.SetScrollbarVisibility(mHelper.mHScrollbarBox, !aAdd);
+       ScrollFrameHelper::SetScrollbarVisibility(mHelper.mHScrollbarBox, !aAdd);
      }
      return fit;
   } else {
      if (mHelper.mNeverHasVerticalScrollbar || !mHelper.mVScrollbarBox)
        return false;
 
      nsSize vSize = mHelper.mVScrollbarBox->GetXULPrefSize(aState);
      nsBox::AddMargin(mHelper.mVScrollbarBox, vSize);
 
-     mHelper.SetScrollbarVisibility(mHelper.mVScrollbarBox, aAdd);
+     ScrollFrameHelper::SetScrollbarVisibility(mHelper.mVScrollbarBox, aAdd);
 
      // We can't directly pass mHasVerticalScrollbar as the bool outparam for
      // AddRemoveScrollbar() because it's a bool:1 bitfield. Hence this var:
      bool hasVerticalScrollbar;
      bool fit = AddRemoveScrollbar(hasVerticalScrollbar,
                                    mHelper.mScrollPort.x,
                                    mHelper.mScrollPort.width,
                                    vSize.width, aOnRightOrBottom, aAdd);
      mHelper.mHasVerticalScrollbar = hasVerticalScrollbar;
      if (!fit) {
-       mHelper.SetScrollbarVisibility(mHelper.mVScrollbarBox, !aAdd);
+       ScrollFrameHelper::SetScrollbarVisibility(mHelper.mVScrollbarBox, !aAdd);
      }
      return fit;
   }
 }
 
 bool
 nsXULScrollFrame::AddRemoveScrollbar(bool& aHasScrollbar, nscoord& aXY,
                                      nscoord& aSize, nscoord aSbSize,
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -3620,17 +3620,17 @@ MeasuringReflow(nsIFrame*           aChi
   // ReflowInput::COMPUTE_SIZE_USE_AUTO_BSIZE.
   childRI.SetBResize(true);
 
   ReflowOutput childSize(childRI);
   nsReflowStatus childStatus;
   const uint32_t flags = NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW;
   parent->ReflowChild(aChild, pc, childSize, childRI, wm,
                       LogicalPoint(wm), nsSize(), flags, childStatus);
-  parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm,
+  nsContainerFrame::FinishReflowChild(aChild, pc, childSize, &childRI, wm,
                             LogicalPoint(wm), nsSize(), flags);
 #ifdef DEBUG
     parent->DeleteProperty(nsContainerFrame::DebugReflowingWithInfiniteISize());
 #endif
   return childSize.BSize(wm);
 }
 
 /**
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -191,34 +191,34 @@ nsSimplePageSequenceFrame::Reflow(nsPres
     nsIntMargin unwriteableTwips;
     mPageData->mPrintSettings->GetUnwriteableMarginInTwips(unwriteableTwips);
     NS_ASSERTION(unwriteableTwips.left  >= 0 && unwriteableTwips.top >= 0 &&
                  unwriteableTwips.right >= 0 && unwriteableTwips.bottom >= 0,
                  "Unwriteable twips should be non-negative");
 
     nsIntMargin marginTwips;
     mPageData->mPrintSettings->GetMarginInTwips(marginTwips);
-    mMargin = aPresContext->CSSTwipsToAppUnits(marginTwips + unwriteableTwips);
+    mMargin = nsPresContext::CSSTwipsToAppUnits(marginTwips + unwriteableTwips);
 
     int16_t printType;
     mPageData->mPrintSettings->GetPrintRange(&printType);
     mPrintRangeType = printType;
 
     nsIntMargin edgeTwips;
     mPageData->mPrintSettings->GetEdgeInTwips(edgeTwips);
 
     // sanity check the values. three inches are sometimes needed
     int32_t inchInTwips = NS_INCHES_TO_INT_TWIPS(3.0);
     edgeTwips.top    = clamped(edgeTwips.top,    0, inchInTwips);
     edgeTwips.bottom = clamped(edgeTwips.bottom, 0, inchInTwips);
     edgeTwips.left   = clamped(edgeTwips.left,   0, inchInTwips);
     edgeTwips.right  = clamped(edgeTwips.right,  0, inchInTwips);
 
     mPageData->mEdgePaperMargin =
-      aPresContext->CSSTwipsToAppUnits(edgeTwips + unwriteableTwips);
+      nsPresContext::CSSTwipsToAppUnits(edgeTwips + unwriteableTwips);
   }
 
   // *** Special Override ***
   // If this is a sub-sdoc (meaning it doesn't take the whole page)
   // and if this Document is in the upper left hand corner
   // we need to suppress the top margin or it will reflow too small
 
   nsSize pageSize = aPresContext->GetPageSize();
--- a/layout/mathml/nsMathMLContainerFrame.cpp
+++ b/layout/mathml/nsMathMLContainerFrame.cpp
@@ -1363,17 +1363,17 @@ AddInterFrameSpacingToSize(ReflowOutput&
     return 0;
   }
   if (parentContent->IsAnyOfMathMLElements(nsGkAtoms::math,
                                            nsGkAtoms::mtd_)) {
     gap = GetInterFrameSpacingFor(aFrame->StyleFont()->mScriptLevel,
                                   parent, aFrame);
     // add our own italic correction
     nscoord leftCorrection = 0, italicCorrection = 0;
-    aFrame->GetItalicCorrection(aDesiredSize.mBoundingMetrics,
+    nsMathMLContainerFrame::GetItalicCorrection(aDesiredSize.mBoundingMetrics,
                                 leftCorrection, italicCorrection);
     gap += leftCorrection;
     if (gap) {
       aDesiredSize.mBoundingMetrics.leftBearing += gap;
       aDesiredSize.mBoundingMetrics.rightBearing += gap;
       aDesiredSize.mBoundingMetrics.width += gap;
       aDesiredSize.Width() += gap;
     }
--- a/layout/painting/ActiveLayerTracker.cpp
+++ b/layout/painting/ActiveLayerTracker.cpp
@@ -262,17 +262,17 @@ IncrementScaleRestyleCountIfNeeded(nsIFr
   RuleNodeCacheConditions dummy;
   bool dummyBool;
   nsStyleTransformMatrix::TransformReferenceBox refBox(aFrame);
   Matrix4x4 transform =
     nsStyleTransformMatrix::ReadTransforms(transformList->mHead,
                                            aFrame->StyleContext(),
                                            presContext,
                                            dummy, refBox,
-                                           presContext->AppUnitsPerCSSPixel(),
+                                           nsPresContext::AppUnitsPerCSSPixel(),
                                            &dummyBool);
   Matrix transform2D;
   if (!transform.Is2D(&transform2D)) {
     // We don't attempt to handle 3D transforms; just assume the scale changed.
     aActivity->mPreviousTransformScale = Nothing();
     IncrementMutationCount(&aActivity->mRestyleCounts[LayerActivity::ACTIVITY_SCALE]);
     return;
   }
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -1790,17 +1790,17 @@ public:
     }
 
     mDrawTarget = mTextureClient->BorrowDrawTarget();
     return mDrawTarget;
   }
 
   already_AddRefed<ImageContainer> CreateImageAndImageContainer()
   {
-    RefPtr<ImageContainer> container = mLayerManager->CreateImageContainer();
+    RefPtr<ImageContainer> container = LayerManager::CreateImageContainer();
     RefPtr<Image> image = CreateImage();
 
     if (!image) {
       return nullptr;
     }
     container->SetCurrentImageInTransaction(image);
 
     return container.forget();
--- a/layout/painting/nsCSSRenderingGradients.cpp
+++ b/layout/painting/nsCSSRenderingGradients.cpp
@@ -868,18 +868,18 @@ nsCSSGradientRenderer::Paint(gfxContext&
       matrix.PreTranslate(mLineStart);
       matrix.PreScale(1.0, mRadiusX/mRadiusY);
       matrix.PreTranslate(-mLineStart);
     }
   }
   // Use a pattern transform to take account of source and dest rects
   matrix.PreTranslate(gfxPoint(mPresContext->CSSPixelsToDevPixels(aSrc.x),
                                mPresContext->CSSPixelsToDevPixels(aSrc.y)));
-  matrix.PreScale(gfxFloat(mPresContext->CSSPixelsToAppUnits(aSrc.width))/aDest.width,
-                  gfxFloat(mPresContext->CSSPixelsToAppUnits(aSrc.height))/aDest.height);
+  matrix.PreScale(gfxFloat(nsPresContext::CSSPixelsToAppUnits(aSrc.width))/aDest.width,
+                  gfxFloat(nsPresContext::CSSPixelsToAppUnits(aSrc.height))/aDest.height);
   gradientPattern->SetMatrix(matrix);
 
   if (stopDelta == 0.0) {
     // Non-repeating gradient with all stops in same place -> just add
     // first stop and last stop, both at position 0.
     // Repeating gradient with all stops in the same place, or radial
     // gradient with radius of 0 -> just paint the last stop color.
     // We use firstStop offset to keep |stops| with same units (will later normalize to 0).
@@ -1057,20 +1057,20 @@ nsCSSGradientRenderer::BuildWebRenderDis
   LayoutDevicePoint tileToClip = clipBounds.BottomRight() - firstTileBounds.TopLeft();
   LayoutDeviceRect gradientBounds = LayoutDeviceRect(firstTileBounds.TopLeft(),
                                                      LayoutDeviceSize(tileToClip.x, tileToClip.y));
 
   // Calculate the tile spacing, which is the repeat size minus the tile size
   LayoutDeviceSize tileSpacing = tileRepeat - firstTileBounds.Size();
 
   // srcTransform is used for scaling the gradient to match aSrc
-  LayoutDeviceRect srcTransform = LayoutDeviceRect(mPresContext->CSSPixelsToAppUnits(aSrc.x),
-                                                   mPresContext->CSSPixelsToAppUnits(aSrc.y),
-                                                   aDest.width / ((float)mPresContext->CSSPixelsToAppUnits(aSrc.width)),
-                                                   aDest.height / ((float)mPresContext->CSSPixelsToAppUnits(aSrc.height)));
+  LayoutDeviceRect srcTransform = LayoutDeviceRect(nsPresContext::CSSPixelsToAppUnits(aSrc.x),
+                                                   nsPresContext::CSSPixelsToAppUnits(aSrc.y),
+                                                   aDest.width / ((float)nsPresContext::CSSPixelsToAppUnits(aSrc.width)),
+                                                   aDest.height / ((float)nsPresContext::CSSPixelsToAppUnits(aSrc.height)));
 
   lineStart.x = (lineStart.x - srcTransform.x) * srcTransform.width;
   lineStart.y = (lineStart.y - srcTransform.y) * srcTransform.height;
 
   if (mGradient->mShape == NS_STYLE_GRADIENT_SHAPE_LINEAR) {
     lineEnd.x = (lineEnd.x - srcTransform.x) * srcTransform.width;
     lineEnd.y = (lineEnd.y - srcTransform.y) * srcTransform.height;
 
--- a/layout/style/RuleProcessorCache.h
+++ b/layout/style/RuleProcessorCache.h
@@ -74,17 +74,17 @@ private:
       : nsExpirationTracker<nsCSSRuleProcessor,3>(
           10000, "RuleProcessorCache::ExpirationTracker",
           SystemGroup::EventTargetFor(TaskCategory::Other))
       , mCache(aCache) {}
 
     void RemoveObjectIfTracked(nsCSSRuleProcessor* aRuleProcessor);
 
     virtual void NotifyExpired(nsCSSRuleProcessor* aRuleProcessor) override {
-      mCache->RemoveRuleProcessor(aRuleProcessor);
+      mozilla::RuleProcessorCache::RemoveRuleProcessor(aRuleProcessor);
     }
 
   private:
     RuleProcessorCache* mCache;
   };
 
   RuleProcessorCache() : mExpirationTracker(this) {}
   ~RuleProcessorCache();
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -90,20 +90,20 @@ AppUnitsToGfxUnits(const nsPoint& aPoint
 
 /**
  * Converts a gfxRect that is in app units to CSS pixels using the specified
  * nsPresContext and returns it as a gfxRect.
  */
 static gfxRect
 AppUnitsToFloatCSSPixels(const gfxRect& aRect, const nsPresContext* aContext)
 {
-  return gfxRect(aContext->AppUnitsToFloatCSSPixels(aRect.x),
-                 aContext->AppUnitsToFloatCSSPixels(aRect.y),
-                 aContext->AppUnitsToFloatCSSPixels(aRect.width),
-                 aContext->AppUnitsToFloatCSSPixels(aRect.height));
+  return gfxRect(nsPresContext::AppUnitsToFloatCSSPixels(aRect.x),
+                 nsPresContext::AppUnitsToFloatCSSPixels(aRect.y),
+                 nsPresContext::AppUnitsToFloatCSSPixels(aRect.width),
+                 nsPresContext::AppUnitsToFloatCSSPixels(aRect.height));
 }
 
 /**
  * Scales a gfxRect around a given point.
  *
  * @param aRect The rectangle to scale.
  * @param aPoint The point around which to scale.
  * @param aScale The scale amount.
@@ -796,18 +796,17 @@ TextRenderedRun::GetTransformFromUserSpa
   // We transform to device pixels positioned such that painting the text frame
   // at (0,0) with aItem will result in the text being in the right place.
 
   gfxMatrix m;
   if (!mFrame) {
     return m;
   }
 
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   // Glyph position in user space.
   m.PreTranslate(mPosition / cssPxPerDevPx);
 
   // Take into account any font size scaling and scaling due to textLength="".
   m.PreScale(1.0 / mFontSizeScaleFactor, 1.0 / mFontSizeScaleFactor);
 
   // Rotation due to rotate="" or a <textPath>.
@@ -837,18 +836,17 @@ gfxMatrix
 TextRenderedRun::GetTransformFromRunUserSpaceToUserSpace(
                                                   nsPresContext* aContext) const
 {
   gfxMatrix m;
   if (!mFrame) {
     return m;
   }
 
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   nscoord start, end;
   GetClipEdges(start, end);
 
   // Glyph position in user space.
   m.PreTranslate(mPosition);
 
   // Rotation due to rotate="" or a <textPath>.
@@ -885,17 +883,17 @@ TextRenderedRun::GetTransformFromRunUser
     return m;
   }
 
   nscoord start, end;
   GetClipEdges(start, end);
 
   // Translate by the horizontal distance into the text frame this
   // rendered run is.
-  gfxFloat appPerCssPx = aContext->AppUnitsPerCSSPixel();
+  gfxFloat appPerCssPx = nsPresContext::AppUnitsPerCSSPixel();
   gfxPoint t = IsVertical() ? gfxPoint(0, start / appPerCssPx)
                             : gfxPoint(start / appPerCssPx, 0);
   return m.PreTranslate(t);
 }
 
 SVGBBox
 TextRenderedRun::GetRunUserSpaceRect(nsPresContext* aContext,
                                      uint32_t aFlags) const
@@ -968,18 +966,18 @@ TextRenderedRun::GetRunUserSpaceRect(nsP
                                                   fillInAppUnits.width,
                                                   fillInAppUnits.height),
                                           aContext);
 
   // Scale the rectangle up due to any mFontSizeScaleFactor.  We scale
   // it around the text's origin.
   ScaleAround(fill,
               textRun->IsVertical()
-                ? gfxPoint(aContext->AppUnitsToFloatCSSPixels(baseline), 0.0)
-                : gfxPoint(0.0, aContext->AppUnitsToFloatCSSPixels(baseline)),
+                ? gfxPoint(nsPresContext::AppUnitsToFloatCSSPixels(baseline), 0.0)
+                : gfxPoint(0.0, nsPresContext::AppUnitsToFloatCSSPixels(baseline)),
               1.0 / mFontSizeScaleFactor);
 
   // Include the fill if requested.
   if (aFlags & eIncludeFill) {
     r = fill;
   }
 
   // Include the stroke if requested.
@@ -1092,18 +1090,17 @@ TextRenderedRun::GetAdvanceWidth() const
 int32_t
 TextRenderedRun::GetCharNumAtPosition(nsPresContext* aContext,
                                       const gfxPoint& aPoint) const
 {
   if (mTextFrameContentLength == 0) {
     return -1;
   }
 
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   // Convert the point from user space into run user space, and take
   // into account any mFontSizeScaleFactor.
   gfxMatrix m = GetTransformFromRunUserSpaceToUserSpace(aContext);
   if (!m.Invert()) {
     return -1;
   }
   gfxPoint p = m.TransformPoint(aPoint) / cssPxPerDevPx * mFontSizeScaleFactor;
@@ -2618,29 +2615,27 @@ gfxFloat
 CharIterator::GetGlyphAdvance(nsPresContext* aContext) const
 {
   uint32_t offset, length;
   GetOriginalGlyphOffsets(offset, length);
 
   gfxSkipCharsIterator it = TextFrame()->EnsureTextRun(nsTextFrame::eInflated);
   Range range = ConvertOriginalToSkipped(it, offset, length);
 
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   gfxFloat advance = mTextRun->GetAdvanceWidth(range, nullptr);
   return aContext->AppUnitsToGfxUnits(advance) *
          mLengthAdjustScaleFactor * cssPxPerDevPx;
 }
 
 gfxFloat
 CharIterator::GetAdvance(nsPresContext* aContext) const
 {
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   uint32_t offset = mSkipCharsIterator.GetSkippedOffset();
   gfxFloat advance = mTextRun->
     GetAdvanceWidth(Range(offset, offset + 1), nullptr);
   return aContext->AppUnitsToGfxUnits(advance) *
          mLengthAdjustScaleFactor * cssPxPerDevPx;
 }
 
@@ -2652,18 +2647,17 @@ CharIterator::GetGlyphPartialAdvance(uin
   GetOriginalGlyphOffsets(offset, length);
 
   NS_ASSERTION(aPartLength <= length, "invalid aPartLength value");
   length = aPartLength;
 
   gfxSkipCharsIterator it = TextFrame()->EnsureTextRun(nsTextFrame::eInflated);
   Range range = ConvertOriginalToSkipped(it, offset, length);
 
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   gfxFloat advance = mTextRun->GetAdvanceWidth(range, nullptr);
   return aContext->AppUnitsToGfxUnits(advance) *
          mLengthAdjustScaleFactor * cssPxPerDevPx;
 }
 
 bool
 CharIterator::NextCharacter()
@@ -3626,17 +3620,17 @@ SVGTextFrame::PaintSVG(gfxContext& aCont
       return;
     }
   }
 
   // SVG frames' PaintSVG methods paint in CSS px, but normally frames paint in
   // dev pixels. Here we multiply a CSS-px-to-dev-pixel factor onto aTransform
   // so our non-SVG nsTextFrame children paint correctly.
   auto auPerDevPx = presContext->AppUnitsPerDevPixel();
-  float cssPxPerDevPx = presContext->AppUnitsToFloatCSSPixels(auPerDevPx);
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(auPerDevPx);
   gfxMatrix canvasTMForChildren = aTransform;
   canvasTMForChildren.PreScale(cssPxPerDevPx, cssPxPerDevPx);
   initialMatrix.PreScale(1 / cssPxPerDevPx, 1 / cssPxPerDevPx);
 
   gfxContextMatrixAutoSaveRestore matSR(&aContext);
   aContext.NewPath();
   aContext.Multiply(canvasTMForChildren);
   gfxMatrix currentMatrix = aContext.CurrentMatrixDouble();
@@ -3812,17 +3806,17 @@ SVGTextFrame::ReflowSVG()
       r.UnionEdges(run.GetUserSpaceRect(presContext, runFlags));
     }
   }
 
   if (r.IsEmpty()) {
     mRect.SetEmpty();
   } else {
     mRect =
-      nsLayoutUtils::RoundGfxRectToAppRect(r.ToThebesRect(), presContext->AppUnitsPerCSSPixel());
+      nsLayoutUtils::RoundGfxRectToAppRect(r.ToThebesRect(), nsPresContext::AppUnitsPerCSSPixel());
 
     // Due to rounding issues when we have a transform applied, we sometimes
     // don't include an additional row of pixels.  For now, just inflate our
     // covered region.
     mRect.Inflate(presContext->AppUnitsPerDevPixel());
   }
 
   if (mState & NS_FRAME_FIRST_REFLOW) {
@@ -4178,18 +4172,17 @@ SVGTextFrame::GetSubStringLength(nsICont
       textLength += textRun->GetAdvanceWidth(range, nullptr);
     }
 
     // Advance, ready for next call:
     frameStartTextElementCharIndex += untrimmedLength;
   }
 
   nsPresContext* presContext = PresContext();
-  float cssPxPerDevPx = presContext->
-    AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
 
   *aResult = presContext->AppUnitsToGfxUnits(textLength) *
                cssPxPerDevPx / mFontSizeScaleFactor;
   return NS_OK;
 }
 
 nsresult
 SVGTextFrame::GetSubStringLengthSlowFallback(nsIContent* aContent,
@@ -4254,18 +4247,17 @@ SVGTextFrame::GetSubStringLengthSlowFall
       // Accumulate the advance.
       textLength += textRun->GetAdvanceWidth(range, nullptr);
     }
 
     run = runIter.Next();
   }
 
   nsPresContext* presContext = PresContext();
-  float cssPxPerDevPx = presContext->
-    AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
 
   *aResult = presContext->AppUnitsToGfxUnits(textLength) *
                cssPxPerDevPx / mFontSizeScaleFactor;
   return NS_OK;
 }
 
 /**
  * Implements the SVG DOM GetCharNumAtPosition method for the specified
@@ -4405,18 +4397,17 @@ SVGTextFrame::GetExtentOfChar(nsIContent
   CharIterator it(this, CharIterator::eAddressable, aContent);
   if (!it.AdvanceToSubtree() ||
       !it.Next(aCharNum)) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   nsPresContext* presContext = PresContext();
 
-  float cssPxPerDevPx = presContext->
-    AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
 
   // We need to return the extent of the whole glyph.
   uint32_t startIndex = it.GlyphStartTextElementCharIndex();
 
   // The ascent and descent gives the height of the glyph.
   gfxFloat ascent, descent;
   GetAscentAndDescentInAppUnits(it.TextFrame(), ascent, descent);
 
@@ -5271,18 +5262,17 @@ SVGTextFrame::DoGlyphPositioning()
   }
   if (!mPositions[0].IsAngleSpecified()) {
     mPositions[0].mAngle = 0.0;
   }
 
   nsPresContext* presContext = PresContext();
   bool vertical = GetWritingMode().IsVertical();
 
-  float cssPxPerDevPx = presContext->
-    AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
   double factor = cssPxPerDevPx / mFontSizeScaleFactor;
 
   // Determine how much to compress or expand glyph positions due to
   // textLength="" and lengthAdjust="".
   double adjustment = 0.0;
   mLengthAdjustScaleFactor = 1.0f;
   if (adjustingTextLength) {
     nscoord frameLength = vertical ? PrincipalChildList().FirstChild()->GetRect().height
@@ -5572,17 +5562,17 @@ SVGTextFrame::UpdateFontSizeScaleFactor(
   }
 
   if (min == nscoord_MAX) {
     // No text, so no need for scaling.
     mFontSizeScaleFactor = 1.0;
     return mFontSizeScaleFactor != oldFontSizeScaleFactor;
   }
 
-  double minSize = presContext->AppUnitsToFloatCSSPixels(min);
+  double minSize = nsPresContext::AppUnitsToFloatCSSPixels(min);
 
   if (geometricPrecision) {
     // We want to ensure minSize is scaled to PRECISE_SIZE.
     mFontSizeScaleFactor = PRECISE_SIZE / minSize;
     return mFontSizeScaleFactor != oldFontSizeScaleFactor;
   }
 
   // When we are non-display, we could be painted in different coordinate
@@ -5594,24 +5584,24 @@ SVGTextFrame::UpdateFontSizeScaleFactor(
   if (!(mState & NS_FRAME_IS_NONDISPLAY)) {
     gfxMatrix m(GetCanvasTM());
     if (!m.IsSingular()) {
       contextScale = GetContextScale(m);
     }
   }
   mLastContextScale = contextScale;
 
-  double maxSize = presContext->AppUnitsToFloatCSSPixels(max);
+  double maxSize = nsPresContext::AppUnitsToFloatCSSPixels(max);
 
   // But we want to ignore any scaling required due to HiDPI displays, since
   // regular CSS text frames will still create text runs using the font size
   // in CSS pixels, and we want SVG text to have the same rendering as HTML
   // text for regular font sizes.
   float cssPxPerDevPx =
-    presContext->AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+    nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
   contextScale *= cssPxPerDevPx;
 
   double minTextRunSize = minSize * contextScale;
   double maxTextRunSize = maxSize * contextScale;
 
   if (minTextRunSize >= CLAMP_MIN_SIZE &&
       maxTextRunSize <= CLAMP_MAX_SIZE) {
     // We are already in the ideal font size range for all text frames,
@@ -5653,19 +5643,18 @@ SVGTextFrame::TransformFramePointToTextC
 
   UpdateGlyphPositioning();
 
   nsPresContext* presContext = PresContext();
 
   // Add in the mRect offset to aPoint, as that will have been taken into
   // account when transforming the point from the ancestor frame down
   // to this one.
-  float cssPxPerDevPx = presContext->
-    AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
-  float factor = presContext->AppUnitsPerCSSPixel();
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+  float factor = nsPresContext::AppUnitsPerCSSPixel();
   Point framePosition(NSAppUnitsToFloatPixels(mRect.x, factor),
                       NSAppUnitsToFloatPixels(mRect.y, factor));
   Point pointInUserSpace = aPoint * cssPxPerDevPx + framePosition;
 
   // Find the closest rendered run for the text frames beneath aChildFrame.
   TextRenderedRunIterator it(this, TextRenderedRunIterator::eAllFrames,
                              aChildFrame);
   TextRenderedRun hit;
@@ -5762,17 +5751,17 @@ SVGTextFrame::TransformFrameRectFromText
 
       // Union it into the result.
       result.UnionRect(result, rectInUserSpace);
     }
   }
 
   // Subtract the mRect offset from the result, as our user space for
   // this frame is relative to the top-left of mRect.
-  float factor = presContext->AppUnitsPerCSSPixel();
+  float factor = nsPresContext::AppUnitsPerCSSPixel();
   gfxPoint framePosition(NSAppUnitsToFloatPixels(mRect.x, factor),
                          NSAppUnitsToFloatPixels(mRect.y, factor));
 
   return result - framePosition;
 }
 
 void
 SVGTextFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -210,18 +210,18 @@ nsSVGIntegrationUtils::GetContinuationUn
 nsSVGIntegrationUtils::GetSVGCoordContextForNonSVGFrame(nsIFrame* aNonSVGFrame)
 {
   NS_ASSERTION(!aNonSVGFrame->IsFrameOfType(nsIFrame::eSVG),
                "SVG frames should not get here");
   nsIFrame* firstFrame =
     nsLayoutUtils::FirstContinuationOrIBSplitSibling(aNonSVGFrame);
   nsRect r = nsLayoutUtils::GetAllInFlowRectsUnion(firstFrame, firstFrame);
   nsPresContext* presContext = firstFrame->PresContext();
-  return gfx::Size(presContext->AppUnitsToFloatCSSPixels(r.width),
-                   presContext->AppUnitsToFloatCSSPixels(r.height));
+  return gfx::Size(nsPresContext::AppUnitsToFloatCSSPixels(r.width),
+                   nsPresContext::AppUnitsToFloatCSSPixels(r.height));
 }
 
 gfxRect
 nsSVGIntegrationUtils::GetSVGBBoxForNonSVGFrame(nsIFrame* aNonSVGFrame,
                                                 bool aUnionContinuations)
 {
   // Except for nsSVGOuterSVGFrame, we shouldn't be getting here with SVG
   // frames at all. This function is for elements that are laid out using the
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -1433,17 +1433,17 @@ nsMenuPopupFrame::SetPopupPosition(nsIFr
     // If we can't reach a root pres context, don't bother continuing:
     if (!rootPresContext) {
       return NS_OK;
     }
 
     // If anchored to a rectangle, use that rectangle. Otherwise, determine the
     // rectangle from the anchor.
     if (mAnchorType == MenuPopupAnchorType_Rect) {
-      anchorRect = ToAppUnits(mScreenRect, presContext->AppUnitsPerCSSPixel());
+      anchorRect = ToAppUnits(mScreenRect, nsPresContext::AppUnitsPerCSSPixel());
     }
     else {
       // if the frame is not specified, use the anchor node passed to OpenPopup. If
       // that wasn't specified either, use the root frame. Note that mAnchorContent
       // might be a different document so its presshell must be used.
       if (!aAnchorFrame) {
         if (mAnchorContent) {
           aAnchorFrame = mAnchorContent->GetPrimaryFrame();
@@ -1515,40 +1515,40 @@ nsMenuPopupFrame::SetPopupPosition(nsIFr
       // with no anchor, the popup is positioned relative to the root frame
       anchorRect = rootScreenRect;
       screenPoint = anchorRect.TopLeft() + nsPoint(margin.left, margin.top);
     }
 
     // mXPos and mYPos specify an additonal offset passed to OpenPopup that
     // should be added to the position.  We also add the offset to the anchor
     // pos so a later flip/resize takes the offset into account.
-    nscoord anchorXOffset = presContext->CSSPixelsToAppUnits(mXPos);
+    nscoord anchorXOffset = nsPresContext::CSSPixelsToAppUnits(mXPos);
     if (IsDirectionRTL()) {
       screenPoint.x -= anchorXOffset;
       anchorRect.x -= anchorXOffset;
     } else {
       screenPoint.x += anchorXOffset;
       anchorRect.x += anchorXOffset;
     }
-    nscoord anchorYOffset = presContext->CSSPixelsToAppUnits(mYPos);
+    nscoord anchorYOffset = nsPresContext::CSSPixelsToAppUnits(mYPos);
     screenPoint.y += anchorYOffset;
     anchorRect.y += anchorYOffset;
 
     // If this is a noautohide popup, set the screen coordinates of the popup.
     // This way, the popup stays at the location where it was opened even when
     // the window is moved. Popups at the parent level follow the parent
     // window as it is moved and remained anchored, so we want to maintain the
     // anchoring instead.
     if (isNoAutoHide &&
         (popupLevel != ePopupLevelParent || mAnchorType == MenuPopupAnchorType_Rect)) {
       // Account for the margin that will end up being added to the screen coordinate
       // the next time SetPopupPosition is called.
       mAnchorType = MenuPopupAnchorType_Point;
-      mScreenRect.x = presContext->AppUnitsToIntCSSPixels(screenPoint.x - margin.left);
-      mScreenRect.y = presContext->AppUnitsToIntCSSPixels(screenPoint.y - margin.top);
+      mScreenRect.x = nsPresContext::AppUnitsToIntCSSPixels(screenPoint.x - margin.left);
+      mScreenRect.y = nsPresContext::AppUnitsToIntCSSPixels(screenPoint.y - margin.top);
     }
   }
   else {
     // The popup is positioned at a screen coordinate.
     // First convert the screen position in mScreenRect from CSS pixels into
     // device pixels, ignoring any zoom as mScreenRect holds unzoomed screen
     // coordinates.
     int32_t factor = devContext->AppUnitsPerDevPixelAtUnitFullZoom();
@@ -2408,18 +2408,18 @@ nsMenuPopupFrame::MoveTo(const CSSIntPoi
     margin.left += nsPresContext::CSSPixelsToAppUnits(LookAndFeel::GetInt(
                      LookAndFeel::eIntID_ContextMenuOffsetHorizontal));
     margin.top += nsPresContext::CSSPixelsToAppUnits(LookAndFeel::GetInt(
                      LookAndFeel::eIntID_ContextMenuOffsetVertical));
   }
 
   nsPresContext* presContext = PresContext();
   mAnchorType = MenuPopupAnchorType_Point;
-  mScreenRect.x = aPos.x - presContext->AppUnitsToIntCSSPixels(margin.left);
-  mScreenRect.y = aPos.y - presContext->AppUnitsToIntCSSPixels(margin.top);
+  mScreenRect.x = aPos.x - nsPresContext::AppUnitsToIntCSSPixels(margin.left);
+  mScreenRect.y = aPos.y - nsPresContext::AppUnitsToIntCSSPixels(margin.top);
 
   SetPopupPosition(nullptr, true, false, true);
 
   RefPtr<Element> popup = mContent->AsElement();
   if (aUpdateAttrs && (popup->HasAttr(kNameSpaceID_None, nsGkAtoms::left) ||
                        popup->HasAttr(kNameSpaceID_None, nsGkAtoms::top)))
   {
     nsAutoString left, top;
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -691,19 +691,19 @@ nsSplitterFrameInner::MouseDown(nsIDOMEv
 
     // skip over any splitters
     if (atom != nsGkAtoms::splitter) {
         nsSize prefSize = childBox->GetXULPrefSize(state);
         nsSize minSize = childBox->GetXULMinSize(state);
         nsSize maxSize = nsBox::BoundsCheckMinMax(minSize, childBox->GetXULMaxSize(state));
         prefSize = nsBox::BoundsCheck(minSize, prefSize, maxSize);
 
-        mOuter->AddMargin(childBox, minSize);
-        mOuter->AddMargin(childBox, prefSize);
-        mOuter->AddMargin(childBox, maxSize);
+        nsSplitterFrame::AddMargin(childBox, minSize);
+        nsSplitterFrame::AddMargin(childBox, prefSize);
+        nsSplitterFrame::AddMargin(childBox, maxSize);
 
         nscoord flex = childBox->GetXULFlex();
 
         nsMargin margin(0,0,0,0);
         childBox->GetXULMargin(margin);
         nsRect r(childBox->GetRect());
         r.Inflate(margin);
 
--- a/media/webrtc/signaling/gtest/rtpsources_unittests.cpp
+++ b/media/webrtc/signaling/gtest/rtpsources_unittests.cpp
@@ -107,17 +107,17 @@ public:
     EXPECT_TRUE(history.Empty());
     EXPECT_FALSE(history.mHasEvictedEntry);
   }
 
   // Tests that a value inserted into the jitter window will age into long term
   // storage
   void TestAgeIntoLongTerm() {
     RtpSourceHistory history;
-    constexpr int64_t jitterWindow = history.kMinJitterWindow;
+    constexpr int64_t jitterWindow = RtpSourceHistory::kMinJitterWindow;
     constexpr int64_t jitter = jitterWindow / 2;
     constexpr int64_t timeNow0 = 100000;
     constexpr int64_t time0 = timeNow0;
     constexpr int64_t time1 = timeNow0 + jitter;
     // Prune at timeNow1 should evict time0
     constexpr int64_t timeNow1 = time0 + jitterWindow + 1;
     // Prune at timeNow2 should evict time1
     constexpr int64_t timeNow2 = time1 + jitterWindow + 1;
@@ -208,17 +208,17 @@ public:
     EXPECT_TRUE(history.Empty());
     EXPECT_EQ(history.mDetailedHistory.size(), static_cast<size_t>(0));
     EXPECT_FALSE(history.mHasEvictedEntry);
   }
 
   void TestSinglePrune() {
     RtpSourceHistory history;
     constexpr int64_t timeNow = 10000;
-    constexpr int64_t jitter = history.kMinJitterWindow / 2;
+    constexpr int64_t jitter = RtpSourceHistory::kMinJitterWindow / 2;
     const int64_t jitterAdjusted = timeNow + jitter;
 
     history.Insert(timeNow, jitterAdjusted, 0, false);
     history.Prune(timeNow + (jitter * 3) + 1);
     EXPECT_EQ(history.mDetailedHistory.size(), static_cast<size_t>(0));
     EXPECT_TRUE(history.mHasEvictedEntry);
     EXPECT_EQ(jitterAdjusted, history.mLatestEviction.jitterAdjustedTimestamp);
   }
@@ -344,9 +344,9 @@ TEST_F(RtpSourcesTest, TestMaximumAudioL
 TEST_F(RtpSourcesTest, TestEmptyPrune) { TestEmptyPrune(); }
 TEST_F(RtpSourcesTest, TestSinglePrune) { TestSinglePrune(); }
 TEST_F(RtpSourcesTest, TestKeyManipulation) { TestKeyManipulation(); }
 TEST_F(RtpSourcesTest, TestObserveOneCsrc) { TestObserveOneCsrc(); }
 TEST_F(RtpSourcesTest, TestObserveTwoCsrcs) { TestObserveTwoCsrcs(); }
 TEST_F(RtpSourcesTest, TestObserveCsrcWithAudioLevel) {
   TestObserveCsrcWithAudioLevel();
 }
-}
\ No newline at end of file
+}
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -196,17 +196,17 @@ nsresult
 JsepSessionImpl::CreateOfferMsection(const JsepOfferOptions& options,
                                      JsepTransceiver& transceiver,
                                      Sdp* local)
 {
   JsepTrack& sendTrack(transceiver.mSendTrack);
   JsepTrack& recvTrack(transceiver.mRecvTrack);
 
   SdpMediaSection::Protocol protocol(
-      mSdpHelper.GetProtocolForMediaType(sendTrack.GetMediaType()));
+      SdpHelper::GetProtocolForMediaType(sendTrack.GetMediaType()));
 
   const Sdp* answer(GetAnswer());
   const SdpMediaSection* lastAnswerMsection = nullptr;
 
   if (answer &&
       (local->GetMediaSectionCount() < answer->GetMediaSectionCount())) {
     lastAnswerMsection =
       &answer->GetMediaSection(local->GetMediaSectionCount());
@@ -225,17 +225,17 @@ JsepSessionImpl::CreateOfferMsection(con
 
   // Some of this stuff (eg; mid) sticks around even if disabled
   if (lastAnswerMsection) {
     nsresult rv = mSdpHelper.CopyStickyParams(*lastAnswerMsection, msection);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   if (transceiver.IsStopped()) {
-    mSdpHelper.DisableMsection(local, msection);
+    SdpHelper::DisableMsection(local, msection);
     return NS_OK;
   }
 
   msection->SetPort(9);
 
   // We don't do this in AddTransportAttributes because that is also used for
   // making answers, and we don't want to unconditionally set rtcp-mux there.
   if (mSdpHelper.HasRtcp(msection->GetProtocol())) {
@@ -597,17 +597,17 @@ JsepSessionImpl::CreateAnswerMsection(co
                            "0.0.0.0");
 
   nsresult rv = mSdpHelper.CopyStickyParams(remoteMsection, &msection);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (mSdpHelper.MsectionIsDisabled(remoteMsection) ||
       // JS might have stopped this
       transceiver.IsStopped()) {
-    mSdpHelper.DisableMsection(sdp, &msection);
+    SdpHelper::DisableMsection(sdp, &msection);
     return NS_OK;
   }
 
   SdpSetupAttribute::Role role;
   rv = DetermineAnswererSetupRole(remoteMsection, &role);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = AddTransportAttributes(&msection, role);
@@ -619,17 +619,17 @@ JsepSessionImpl::CreateAnswerMsection(co
   // Add extmap attributes. This logic will probably be moved to the track,
   // since it can be specified on a per-sender basis in JS.
   // We will need some validation to ensure that the ids are identical for
   // RTP streams that are bundled together, though (bug 1406529).
   AddCommonExtmaps(remoteMsection, &msection);
 
   if (msection.GetFormats().empty()) {
     // Could not negotiate anything. Disable m-section.
-    mSdpHelper.DisableMsection(sdp, &msection);
+    SdpHelper::DisableMsection(sdp, &msection);
   }
 
   return NS_OK;
 }
 
 nsresult
 JsepSessionImpl::DetermineAnswererSetupRole(
     const SdpMediaSection& remoteMsection,
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -1427,17 +1427,17 @@ nsCacheService::EvictEntriesForClient(co
 
 nsresult
 nsCacheService::IsStorageEnabledForPolicy(nsCacheStoragePolicy  storagePolicy,
                                           bool *              result)
 {
     if (gService == nullptr) return NS_ERROR_NOT_AVAILABLE;
     nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHESERVICE_ISSTORAGEENABLEDFORPOLICY));
 
-    *result = gService->IsStorageEnabledForPolicy_Locked(storagePolicy);
+    *result = nsCacheService::IsStorageEnabledForPolicy_Locked(storagePolicy);
     return NS_OK;
 }
 
 
 nsresult
 nsCacheService::DoomEntry(nsCacheSession   *session,
                           const nsACString &key,
                           nsICacheListener *listener)
--- a/rdf/base/nsRDFXMLSerializer.cpp
+++ b/rdf/base/nsRDFXMLSerializer.cpp
@@ -1013,38 +1013,38 @@ private:
     nsRDFXMLSerializer* mParent;
 };
 
 NS_IMPL_ISUPPORTS(QNameCollector, rdfITripleVisitor)
 nsresult
 QNameCollector::Visit(nsIRDFNode* aSubject, nsIRDFResource* aPredicate,
                       nsIRDFNode* aObject, bool aTruthValue)
 {
-    if (aPredicate == mParent->kRDF_type) {
+    if (aPredicate == nsRDFXMLSerializer::kRDF_type) {
         // try to get a type QName for aObject, should be a resource
         nsCOMPtr<nsIRDFResource> resType = do_QueryInterface(aObject);
         if (!resType) {
             // ignore error
             return NS_OK;
         }
         if (mParent->mQNames.Get(resType, nullptr)) {
             return NS_OK;
         }
         mParent->RegisterQName(resType);
         return NS_OK;
     }
 
     if (mParent->mQNames.Get(aPredicate, nullptr)) {
         return NS_OK;
     }
-    if (aPredicate == mParent->kRDF_instanceOf ||
-        aPredicate == mParent->kRDF_nextVal)
+    if (aPredicate == nsRDFXMLSerializer::kRDF_instanceOf ||
+        aPredicate == nsRDFXMLSerializer::kRDF_nextVal)
         return NS_OK;
     bool isOrdinal = false;
-    mParent->gRDFC->IsOrdinalProperty(aPredicate, &isOrdinal);
+    nsRDFXMLSerializer::gRDFC->IsOrdinalProperty(aPredicate, &isOrdinal);
     if (isOrdinal)
         return NS_OK;
 
     mParent->RegisterQName(aPredicate);
 
     return NS_OK;
 }
 
--- a/security/manager/ssl/PSMContentListener.cpp
+++ b/security/manager/ssl/PSMContentListener.cpp
@@ -266,17 +266,17 @@ PSMContentDownloaderParent::OnStopReques
 }
 
 mozilla::ipc::IPCResult
 PSMContentDownloaderParent::RecvDivertToParentUsing(mozilla::net::PChannelDiverterParent* diverter)
 {
   MOZ_ASSERT(diverter);
   auto p = static_cast<mozilla::net::ChannelDiverterParent*>(diverter);
   p->DivertTo(this);
-  mozilla::Unused << p->Send__delete__(p);
+  mozilla::Unused << ChannelDiverterParent::Send__delete__(p);
   return IPC_OK();
 }
 
 void
 PSMContentDownloaderParent::ActorDestroy(ActorDestroyReason why)
 {
   mIPCOpen = false;
 }
--- a/toolkit/components/extensions/MatchPattern.cpp
+++ b/toolkit/components/extensions/MatchPattern.cpp
@@ -95,17 +95,17 @@ AtomSet::Add(nsAtom* aAtom)
     mElems.InsertElementAt(index, aAtom);
   }
 }
 
 void
 AtomSet::Remove(nsAtom* aAtom)
 {
   auto index = mElems.BinaryIndexOf(aAtom);
-  if (index != mElems.NoIndex) {
+  if (index != ArrayType::NoIndex) {
     mElems.RemoveElementAt(index);
   }
 }
 
 
 /*****************************************************************************
  * URLInfo
  *****************************************************************************/
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -4150,17 +4150,17 @@ nsNavHistoryResult::AddHistoryObserver(n
       nsNavHistory* history = nsNavHistory::GetHistoryService();
       NS_ASSERTION(history, "Can't create history service");
       history->AddObserver(this, true);
       mIsHistoryObserver = true;
   }
   // Don't add duplicate observers.  In some case we don't unregister when
   // children are cleared (see ClearChildren) and the next FillChildren call
   // will try to add the observer again.
-  if (mHistoryObservers.IndexOf(aNode) == mHistoryObservers.NoIndex) {
+  if (mHistoryObservers.IndexOf(aNode) == QueryObserverList::NoIndex) {
     mHistoryObservers.AppendElement(aNode);
   }
 }
 
 
 void
 nsNavHistoryResult::AddAllBookmarksObserver(nsNavHistoryQueryResultNode* aNode)
 {
@@ -4171,17 +4171,17 @@ nsNavHistoryResult::AddAllBookmarksObser
       return;
     }
     bookmarks->AddObserver(this, true);
     mIsAllBookmarksObserver = true;
   }
   // Don't add duplicate observers.  In some case we don't unregister when
   // children are cleared (see ClearChildren) and the next FillChildren call
   // will try to add the observer again.
-  if (mAllBookmarksObservers.IndexOf(aNode) == mAllBookmarksObservers.NoIndex) {
+  if (mAllBookmarksObservers.IndexOf(aNode) == QueryObserverList::NoIndex) {
     mAllBookmarksObservers.AppendElement(aNode);
   }
 }
 
 
 void
 nsNavHistoryResult::AddMobilePrefsObserver(nsNavHistoryQueryResultNode* aNode)
 {
@@ -4212,17 +4212,17 @@ nsNavHistoryResult::AddBookmarkFolderObs
     }
     bookmarks->AddObserver(this, true);
     mIsBookmarkFolderObserver = true;
   }
   // Don't add duplicate observers.  In some case we don't unregister when
   // children are cleared (see ClearChildren) and the next FillChildren call
   // will try to add the observer again.
   FolderObserverList* list = BookmarkFolderObserversForId(aFolder, true);
-  if (list->IndexOf(aNode) == list->NoIndex) {
+  if (list->IndexOf(aNode) == FolderObserverList::NoIndex) {
     list->AppendElement(aNode);
   }
 }
 
 
 void
 nsNavHistoryResult::RemoveHistoryObserver(nsNavHistoryQueryResultNode* aNode)
 {
@@ -4385,17 +4385,17 @@ nsNavHistoryResult::GetRoot(nsINavHistor
   return NS_OK;
 }
 
 
 void
 nsNavHistoryResult::requestRefresh(nsNavHistoryContainerResultNode* aContainer)
 {
   // Don't add twice the same container.
-  if (mRefreshParticipants.IndexOf(aContainer) == mRefreshParticipants.NoIndex)
+  if (mRefreshParticipants.IndexOf(aContainer) == ContainerObserverList::NoIndex)
     mRefreshParticipants.AppendElement(aContainer);
 }
 
 // nsINavBookmarkObserver implementation
 
 // Here, it is important that we create a COPY of the observer array. Some
 // observers will requery themselves, which may cause the observer array to
 // be modified or added to.
--- a/toolkit/components/printingui/ipc/PrintingParent.cpp
+++ b/toolkit/components/printingui/ipc/PrintingParent.cpp
@@ -182,19 +182,19 @@ PrintingParent::RecvShowPrintDialog(PPri
   PrintData resultData;
   nsresult rv = ShowPrintDialog(aParent, aData, &resultData);
 
   // The child has been spinning an event loop while waiting
   // to hear about the print settings. We return the results
   // with an async message which frees the child process from
   // its nested event loop.
   if (NS_FAILED(rv)) {
-    mozilla::Unused << aDialog->Send__delete__(aDialog, rv);
+    mozilla::Unused << PPrintingParent::PPrintSettingsDialogParent::Send__delete__(aDialog, rv);
   } else {
-    mozilla::Unused << aDialog->Send__delete__(aDialog, resultData);
+    mozilla::Unused << PPrintingParent::PPrintSettingsDialogParent::Send__delete__(aDialog, resultData);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 PrintingParent::RecvSavePrintSettings(const PrintData& aData,
                                       const bool& aUsePrinterNamePrefix,
                                       const uint32_t& aFlags,
--- a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
+++ b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
@@ -731,17 +731,17 @@ class MinidumpWriter {
       struct link_map map;
       if (!dumper_->CopyFromProcess(&map, GetCrashThread(), ptr, sizeof(map)))
         return false;
 
       ptr = map.l_next;
       dso_count++;
     }
 
-    MDRVA linkmap_rva = minidump_writer_.kInvalidMDRVA;
+    MDRVA linkmap_rva = MinidumpFileWriter::kInvalidMDRVA;
     if (dso_count > 0) {
       // If we have at least one DSO, create an array of MDRawLinkMap
       // entries in the minidump file.
       TypedMDRVA<MDRawLinkMap> linkmap(&minidump_writer_);
       if (!linkmap.AllocateArray(dso_count))
         return false;
       linkmap_rva = linkmap.location().rva;
       int idx = 0;
--- a/toolkit/profile/nsToolkitProfileService.cpp
+++ b/toolkit/profile/nsToolkitProfileService.cpp
@@ -401,20 +401,20 @@ NS_IMPL_ISUPPORTS(nsToolkitProfileServic
                   nsIToolkitProfileService)
 
 nsresult
 nsToolkitProfileService::Init()
 {
     NS_ASSERTION(gDirServiceProvider, "No dirserviceprovider!");
     nsresult rv;
 
-    rv = gDirServiceProvider->GetUserAppDataDirectory(getter_AddRefs(mAppData));
+    rv = nsXREDirProvider::GetUserAppDataDirectory(getter_AddRefs(mAppData));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    rv = gDirServiceProvider->GetUserLocalDataDirectory(getter_AddRefs(mTempData));
+    rv = nsXREDirProvider::GetUserLocalDataDirectory(getter_AddRefs(mTempData));
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = mAppData->Clone(getter_AddRefs(mListFile));
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = mListFile->AppendNative(NS_LITERAL_CSTRING("profiles.ini"));
     NS_ENSURE_SUCCESS(rv, rv);
 
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -3367,17 +3367,17 @@ XREMain::XRE_mainInit(bool* aExitFlag)
 
   nsCOMPtr<nsIFile> xreBinDirectory;
   xreBinDirectory = mDirProvider.GetGREBinDir();
 
   if ((mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) &&
       NS_SUCCEEDED(
         CrashReporter::SetExceptionHandler(xreBinDirectory))) {
     nsCOMPtr<nsIFile> file;
-    rv = mDirProvider.GetUserAppDataDirectory(getter_AddRefs(file));
+    rv = nsXREDirProvider::GetUserAppDataDirectory(getter_AddRefs(file));
     if (NS_SUCCEEDED(rv)) {
       CrashReporter::SetUserAppDataDirectory(file);
     }
     if (mAppData->crashReporterURL)
       CrashReporter::SetServerURL(nsDependentCString(mAppData->crashReporterURL));
 
     // We overwrite this once we finish starting up.
     CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("StartupCrash"),
--- a/toolkit/xre/nsConsoleWriter.cpp
+++ b/toolkit/xre/nsConsoleWriter.cpp
@@ -29,17 +29,17 @@ WriteConsoleLog()
     rv = XRE_GetFileFromPath(logFileEnv, getter_AddRefs(lfile));
     if (NS_FAILED(rv))
       return;
   }
   else {
     if (!gLogConsoleErrors)
       return;
 
-    rv = gDirServiceProvider->GetUserAppDataDirectory(getter_AddRefs(lfile));
+    rv = nsXREDirProvider::GetUserAppDataDirectory(getter_AddRefs(lfile));
     if (NS_FAILED(rv))
       return;
 
     lfile->AppendNative(NS_LITERAL_CSTRING("console.log"));
   }
 
   PRFileDesc *file;
   rv = lfile->OpenNSPRFileDesc(PR_WRONLY | PR_APPEND | PR_CREATE_FILE,
--- a/uriloader/exthandler/ExternalHelperAppParent.cpp
+++ b/uriloader/exthandler/ExternalHelperAppParent.cpp
@@ -191,17 +191,17 @@ ExternalHelperAppParent::RecvDivertToPar
 {
   MOZ_ASSERT(diverter);
   UpdateContentContext(mListener, contentContext);
   auto p = static_cast<mozilla::net::ChannelDiverterParent*>(diverter);
   p->DivertTo(this);
 #ifdef DEBUG
   mDiverted = true;
 #endif
-  Unused << p->Send__delete__(p);
+  Unused << ChannelDiverterParent::Send__delete__(p);
   return IPC_OK();
 }
 
 //
 // nsIStreamListener
 //
 
 NS_IMETHODIMP
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1074,17 +1074,17 @@ nsBaseWidget::ProcessUntransformedAPZEve
 
   // Make a copy of the original event for the APZCCallbackHelper helpers that
   // we call later, because the event passed to DispatchEvent can get mutated in
   // ways that we don't want (i.e. touch points can get stripped out).
   nsEventStatus status;
   UniquePtr<WidgetEvent> original(aEvent->Duplicate());
   DispatchEvent(aEvent, status);
 
-  if (mAPZC && !context.WasRoutedToChildProcess() && aInputBlockId) {
+  if (mAPZC && !InputAPZContext::WasRoutedToChildProcess() && aInputBlockId) {
     // EventStateManager did not route the event into the child process.
     // It's safe to communicate to APZ that the event has been processed.
     // TODO: Eventually we'll be able to move the SendSetTargetAPZCNotification
     // call into APZEventState::Process*Event() as well.
     if (WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent()) {
       if (touchEvent->mMessage == eTouchStart) {
         if (gfxPrefs::TouchActionEnabled()) {
           APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(this,