Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
authorSimon Giesecke <sgiesecke@mozilla.com>
Wed, 23 Sep 2020 15:17:15 +0000
changeset 550009 1f4532c736251ab25bacbfde219264a5b9b492ef
parent 550008 134746c4644d339d2c82405aacc380862f6195a4
child 550010 d402a579fb2d73dd898cbe44adb1ec17b9de0697
push id37807
push userdluca@mozilla.com
push dateThu, 24 Sep 2020 09:34:15 +0000
treeherdermozilla-central@7b98b01d238e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, geckoview-reviewers, agi
bugs1650145
milestone83.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 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi Differential Revision: https://phabricator.services.mozilla.com/D82325
accessible/base/nsCoreUtils.h
accessible/generic/ImageAccessible.cpp
accessible/windows/msaa/nsWinUtils.cpp
caps/BasePrincipal.cpp
caps/ContentPrincipal.cpp
caps/DomainPolicy.cpp
caps/nsJSPrincipals.cpp
caps/nsScriptSecurityManager.cpp
chrome/nsChromeRegistry.cpp
docshell/base/BrowsingContext.cpp
docshell/base/nsDocShell.cpp
docshell/base/nsPingListener.cpp
dom/base/AnonymousContent.cpp
dom/base/DOMImplementation.cpp
dom/base/DOMParser.cpp
dom/base/Document.cpp
dom/base/Document.h
dom/base/Element.cpp
dom/base/Element.h
dom/base/EventSource.cpp
dom/base/FormData.cpp
dom/base/IdentifierMapEntry.h
dom/base/ImageEncoder.cpp
dom/base/PostMessageEvent.cpp
dom/base/ThirdPartyUtil.cpp
dom/base/nsContentAreaDragDrop.cpp
dom/base/nsContentSink.cpp
dom/base/nsContentUtils.cpp
dom/base/nsContentUtils.h
dom/base/nsCopySupport.cpp
dom/base/nsDOMAttributeMap.cpp
dom/base/nsDOMDataChannel.cpp
dom/base/nsDOMSerializer.cpp
dom/base/nsFrameMessageManager.cpp
dom/base/nsGlobalWindowInner.cpp
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsHTMLContentSerializer.cpp
dom/base/nsINode.h
dom/base/nsPlainTextSerializer.cpp
dom/base/nsTreeSanitizer.cpp
dom/base/nsWindowMemoryReporter.cpp
dom/base/nsXHTMLContentSerializer.cpp
dom/base/nsXMLContentSerializer.cpp
dom/bindings/Exceptions.cpp
dom/bindings/Exceptions.h
dom/cache/CacheOpParent.cpp
dom/cache/DBAction.cpp
dom/cache/DBSchema.cpp
dom/cache/ReadStream.cpp
dom/cache/TypeUtils.cpp
dom/clients/manager/ClientInfo.cpp
dom/console/ConsoleReportCollector.cpp
dom/events/AsyncEventDispatcher.cpp
dom/events/CompositionEvent.cpp
dom/events/DataTransfer.cpp
dom/events/EventDispatcher.cpp
dom/events/EventListenerManager.cpp
dom/events/InputEvent.cpp
dom/events/KeyEventHandler.cpp
dom/events/TextComposition.cpp
dom/events/WheelEvent.cpp
dom/fetch/EmptyBody.cpp
dom/fetch/FetchDriver.cpp
dom/fetch/FetchDriver.h
dom/fetch/InternalHeaders.cpp
dom/fetch/InternalHeaders.h
dom/fetch/InternalResponse.cpp
dom/fetch/InternalResponse.h
dom/fetch/Request.cpp
dom/file/BlobSet.cpp
dom/file/EmptyBlobImpl.cpp
dom/file/FileReader.h
dom/file/MultipartBlobImpl.cpp
dom/file/MultipartBlobImpl.h
dom/file/TemporaryFileBlobImpl.cpp
dom/file/ipc/FileCreatorParent.cpp
dom/file/ipc/RemoteLazyInputStream.cpp
dom/file/uri/BlobURLProtocolHandler.cpp
dom/filesystem/compat/FileSystemDirectoryEntry.h
dom/html/HTMLAnchorElement.h
dom/html/HTMLAreaElement.h
dom/html/HTMLCanvasElement.cpp
dom/html/HTMLFormElement.cpp
dom/html/HTMLIFrameElement.h
dom/html/HTMLImageElement.h
dom/html/HTMLInputElement.cpp
dom/html/HTMLLinkElement.cpp
dom/html/HTMLLinkElement.h
dom/html/HTMLMediaElement.cpp
dom/html/HTMLMenuElement.cpp
dom/html/HTMLOptionElement.cpp
dom/html/HTMLScriptElement.cpp
dom/html/HTMLScriptElement.h
dom/html/HTMLSharedElement.cpp
dom/html/HTMLStyleElement.cpp
dom/html/HTMLTextAreaElement.cpp
dom/html/MediaDocument.h
dom/html/nsGenericHTMLElement.cpp
dom/html/nsGenericHTMLElement.h
dom/html/nsGenericHTMLFrameElement.cpp
dom/html/nsHTMLDocument.cpp
dom/indexedDB/ActorsParent.cpp
dom/indexedDB/SchemaUpgrades.cpp
dom/indexedDB/ScriptErrorHelper.cpp
dom/ipc/BrowserChild.cpp
dom/ipc/BrowserParent.cpp
dom/ipc/ClonedErrorHolder.cpp
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/ProcessPriorityManager.cpp
dom/ipc/SharedMap.h
dom/jsurl/nsJSProtocolHandler.cpp
dom/l10n/tests/gtest/TestL10nOverlays.cpp
dom/localstorage/ActorsParent.cpp
dom/media/MediaDecoder.cpp
dom/media/MediaInfo.h
dom/media/MediaManager.cpp
dom/media/MediaRecorder.cpp
dom/media/MediaStreamError.h
dom/media/MediaTrackGraph.cpp
dom/media/eme/EMEUtils.cpp
dom/media/eme/MediaKeySystemAccess.cpp
dom/media/gmp/CDMStorageIdProvider.cpp
dom/media/gmp/GMPServiceChild.cpp
dom/media/gmp/GMPServiceParent.cpp
dom/media/gmp/GMPUtils.cpp
dom/media/gtest/TestCDMStorage.cpp
dom/media/gtest/TestGMPRemoveAndDelete.cpp
dom/media/mediacontrol/MediaControlUtils.h
dom/media/mediacontrol/MediaStatusManager.cpp
dom/media/ogg/OggDemuxer.cpp
dom/media/platforms/android/AndroidDataEncoder.cpp
dom/media/webaudio/AudioContext.cpp
dom/media/webaudio/WebAudioUtils.cpp
dom/media/webrtc/common/browser_logging/WebRtcLog.cpp
dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp
dom/media/webrtc/libwebrtcglue/WebrtcMediaCodecVP8VideoCodec.cpp
dom/media/webspeech/synth/SpeechSynthesisUtterance.cpp
dom/media/webspeech/synth/nsSpeechTask.cpp
dom/messagechannel/MessagePort.cpp
dom/network/TCPSocket.cpp
dom/network/UDPSocket.cpp
dom/notification/Notification.cpp
dom/payments/PaymentActionResponse.cpp
dom/payments/PaymentRequest.cpp
dom/payments/PaymentRequestManager.cpp
dom/payments/PaymentRequestService.cpp
dom/payments/ipc/PaymentRequestParent.cpp
dom/plugins/base/nsPluginHost.cpp
dom/plugins/ipc/PluginHangUIParent.cpp
dom/plugins/ipc/PluginModuleParent.cpp
dom/presentation/PresentationConnection.cpp
dom/presentation/provider/MulticastDNSDeviceProvider.cpp
dom/prototype/PrototypeDocumentContentSink.cpp
dom/push/PushNotifier.cpp
dom/quota/ActorsParent.cpp
dom/script/ScriptLoader.cpp
dom/security/CSPEvalChecker.cpp
dom/security/FramingChecker.cpp
dom/security/ReferrerInfo.cpp
dom/security/featurepolicy/test/gtest/TestFeaturePolicyParser.cpp
dom/security/fuzztest/csp_fuzzer.cpp
dom/security/nsCSPContext.cpp
dom/security/nsCSPParser.cpp
dom/security/nsCSPService.cpp
dom/security/nsCSPUtils.cpp
dom/security/nsContentSecurityManager.cpp
dom/security/nsContentSecurityUtils.cpp
dom/security/nsMixedContentBlocker.cpp
dom/security/sanitizer/Sanitizer.cpp
dom/security/test/gtest/TestCSPParser.cpp
dom/serviceworkers/FetchEventOpChild.cpp
dom/serviceworkers/ServiceWorkerEvents.cpp
dom/serviceworkers/ServiceWorkerManager.cpp
dom/serviceworkers/ServiceWorkerManager.h
dom/serviceworkers/ServiceWorkerPrivate.cpp
dom/serviceworkers/ServiceWorkerPrivateImpl.cpp
dom/serviceworkers/ServiceWorkerScriptCache.cpp
dom/serviceworkers/ServiceWorkerUnregisterJob.cpp
dom/serviceworkers/ServiceWorkerUpdateJob.cpp
dom/serviceworkers/test/gtest/TestReadWrite.cpp
dom/smil/SMILCSSProperty.cpp
dom/storage/LocalStorageManager.cpp
dom/storage/SessionStorageManager.cpp
dom/storage/StorageDBThread.cpp
dom/storage/StorageDBThread.h
dom/storage/StorageIPC.cpp
dom/storage/StorageObserver.cpp
dom/storage/StorageObserver.h
dom/svg/SVGAElement.cpp
dom/svg/SVGElement.cpp
dom/svg/SVGScriptElement.cpp
dom/svg/SVGStyleElement.cpp
dom/system/IOUtils.cpp
dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp
dom/webbrowserpersist/WebBrowserPersistSerializeParent.cpp
dom/webbrowserpersist/nsWebBrowserPersist.cpp
dom/websocket/WebSocket.cpp
dom/workers/ChromeWorker.cpp
dom/workers/MessageEventRunnable.cpp
dom/workers/RuntimeService.cpp
dom/workers/WorkerDebugger.cpp
dom/workers/WorkerError.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerPrivate.h
dom/workers/WorkerScope.cpp
dom/workers/remoteworkers/RemoteWorkerChild.cpp
dom/workers/sharedworkers/SharedWorker.cpp
dom/xhr/XMLHttpRequestMainThread.cpp
dom/xml/XMLStylesheetProcessingInstruction.cpp
dom/xml/nsXMLContentSink.cpp
dom/xslt/xpath/txExprParser.cpp
dom/xslt/xslt/txInstructions.cpp
dom/xslt/xslt/txKeyFunctionCall.cpp
dom/xslt/xslt/txMozillaXSLTProcessor.cpp
dom/xslt/xslt/txStylesheetCompileHandlers.cpp
dom/xslt/xslt/txStylesheetCompiler.cpp
dom/xslt/xslt/txUnknownHandler.cpp
dom/xul/nsXULContentSink.cpp
dom/xul/nsXULPopupListener.cpp
dom/xul/nsXULPrototypeCache.cpp
editor/composer/nsEditingSession.cpp
editor/libeditor/CSSEditUtils.cpp
editor/libeditor/ChangeAttributeTransaction.cpp
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorCommands.cpp
editor/libeditor/HTMLAbsPositionEditor.cpp
editor/libeditor/HTMLEditSubActionHandler.cpp
editor/libeditor/HTMLEditor.cpp
editor/libeditor/HTMLEditor.h
editor/libeditor/HTMLEditorCommands.cpp
editor/libeditor/HTMLEditorDataTransfer.cpp
editor/libeditor/HTMLEditorObjectResizer.cpp
editor/libeditor/HTMLStyleEditor.cpp
editor/libeditor/TypeInState.cpp
editor/libeditor/WSRunObject.cpp
extensions/permissions/PermissionManager.cpp
extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineParent.cpp
extensions/spellcheck/hunspell/glue/mozHunspell.cpp
gfx/config/gfxConfig.h
gfx/config/gfxConfigManager.cpp
gfx/layers/CompositionRecorder.cpp
gfx/tests/gtest/TestConfigManager.cpp
gfx/thebes/gfxASurface.cpp
gfx/thebes/gfxPlatformFontList.cpp
gfx/thebes/gfxSVGGlyphs.cpp
gfx/thebes/gfxUserFontSet.cpp
gfx/thebes/gfxUtils.cpp
gfx/vr/service/OculusSession.cpp
image/ImageCacheKey.cpp
image/ImageMemoryReporter.cpp
image/RasterImage.cpp
image/imgLoader.cpp
intl/strres/nsStringBundle.cpp
ipc/glue/InputStreamUtils.cpp
ipc/glue/MessageChannel.cpp
ipc/testshell/TestShellParent.cpp
js/xpconnect/loader/ScriptPreloader.cpp
js/xpconnect/loader/URLPreloader.cpp
js/xpconnect/src/Sandbox.cpp
js/xpconnect/src/XPCComponents.cpp
js/xpconnect/src/XPCConvert.cpp
js/xpconnect/src/XPCJSRuntime.cpp
js/xpconnect/src/XPCWrappedJSClass.cpp
js/xpconnect/src/XPCWrappedNativeInfo.cpp
js/xpconnect/wrappers/XrayWrapper.cpp
layout/base/PresShell.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/forms/nsButtonFrameRenderer.cpp
layout/forms/nsFileControlFrame.cpp
layout/forms/nsSearchControlFrame.cpp
layout/generic/ScrollbarActivity.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsImageFrame.cpp
layout/style/FontFaceSet.cpp
layout/style/Loader.cpp
layout/style/Loader.h
layout/style/StreamLoader.cpp
layout/style/nsCSSPseudoElements.cpp
layout/svg/SVGObserverUtils.cpp
layout/tools/layout-debug/src/nsLayoutDebugCLH.cpp
layout/xul/nsImageBoxFrame.cpp
layout/xul/nsResizerFrame.cpp
layout/xul/nsSplitterFrame.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
modules/libjar/nsIZipReader.idl
modules/libjar/nsJAR.cpp
modules/libjar/zipwriter/nsZipHeader.cpp
modules/libpref/Preferences.cpp
netwerk/base/DefaultURI.cpp
netwerk/base/FuzzySecurityInfo.cpp
netwerk/base/Predictor.cpp
netwerk/base/nsBaseChannel.cpp
netwerk/base/nsIOService.cpp
netwerk/base/nsNetUtil.cpp
netwerk/base/nsNetUtil.h
netwerk/base/nsPACMan.cpp
netwerk/base/nsProtocolProxyService.cpp
netwerk/base/nsSimpleURI.cpp
netwerk/base/nsStandardURL.cpp
netwerk/base/nsURIHashKey.h
netwerk/base/nsURLHelperOSX.cpp
netwerk/base/nsURLHelperUnix.cpp
netwerk/cache/nsDiskCacheDeviceSQL.cpp
netwerk/cache2/CacheEntry.cpp
netwerk/cache2/CacheStorageService.cpp
netwerk/cache2/OldWrappers.cpp
netwerk/cookie/CookiePersistentStorage.cpp
netwerk/cookie/CookieService.cpp
netwerk/dns/DNS.cpp
netwerk/dns/TRR.cpp
netwerk/dns/TRR.h
netwerk/dns/TRRService.cpp
netwerk/dns/nsDNSService2.cpp
netwerk/dns/nsEffectiveTLDService.cpp
netwerk/ipc/DocumentLoadListener.cpp
netwerk/ipc/NeckoParent.cpp
netwerk/mime/nsMIMEHeaderParamImpl.cpp
netwerk/mime/nsMIMEHeaderParamImpl.h
netwerk/protocol/about/nsAboutBlank.cpp
netwerk/protocol/ftp/FTPChannelParent.cpp
netwerk/protocol/ftp/nsFtpConnectionThread.cpp
netwerk/protocol/gio/nsGIOProtocolHandler.cpp
netwerk/protocol/http/CachePushChecker.cpp
netwerk/protocol/http/Http2Compression.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/InterceptedChannel.cpp
netwerk/protocol/http/InterceptedHttpChannel.cpp
netwerk/protocol/http/NullHttpTransaction.cpp
netwerk/protocol/http/TRRServiceChannel.cpp
netwerk/protocol/http/nsCORSListenerProxy.cpp
netwerk/protocol/http/nsHttp.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
netwerk/protocol/http/nsHttpConnectionInfo.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/http/nsHttpHeaderArray.cpp
netwerk/protocol/http/nsHttpResponseHead.cpp
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/http/nsServerTiming.cpp
netwerk/streamconv/converters/nsFTPDirListingConv.cpp
netwerk/streamconv/converters/nsIndexedToHTML.cpp
netwerk/test/fuzz/TestHttpFuzzing.cpp
netwerk/test/gtest/TestCookie.cpp
netwerk/test/gtest/TestPACMan.cpp
netwerk/test/gtest/TestStandardURL.cpp
netwerk/test/gtest/TestURIMutator.cpp
netwerk/url-classifier/UrlClassifierFeatureCryptominingProtection.cpp
netwerk/url-classifier/UrlClassifierFeatureFingerprintingProtection.cpp
netwerk/url-classifier/UrlClassifierFeatureFlash.cpp
netwerk/url-classifier/UrlClassifierFeatureLoginReputation.cpp
netwerk/url-classifier/UrlClassifierFeaturePhishingProtection.cpp
netwerk/url-classifier/UrlClassifierFeatureSocialTrackingProtection.cpp
netwerk/url-classifier/UrlClassifierFeatureTrackingProtection.cpp
parser/html/nsHtml5Highlighter.cpp
parser/html/nsHtml5StreamParser.cpp
parser/html/nsHtml5TreeBuilderCppSupplement.h
parser/html/nsHtml5TreeOpExecutor.cpp
parser/html/nsParserUtils.cpp
parser/htmlparser/nsExpatDriver.cpp
security/apps/AppSignatureVerification.cpp
security/manager/ssl/DataStorage.cpp
security/manager/ssl/nsCertOverrideService.cpp
security/manager/ssl/tests/gtest/TLSIntoleranceTest.cpp
storage/mozStorageService.cpp
toolkit/components/alerts/nsAlertsService.cpp
toolkit/components/antitracking/URLDecorationStripper.cpp
toolkit/components/extensions/ExtensionPolicyService.cpp
toolkit/components/extensions/WebExtensionPolicy.h
toolkit/components/places/Database.cpp
toolkit/components/places/FaviconHelpers.cpp
toolkit/components/places/History.cpp
toolkit/components/places/SQLFunctions.cpp
toolkit/components/places/nsFaviconService.cpp
toolkit/components/places/nsNavBookmarks.cpp
toolkit/components/places/nsNavHistory.cpp
toolkit/components/places/nsNavHistoryResult.cpp
toolkit/components/reputationservice/ApplicationReputation.cpp
toolkit/components/resistfingerprinting/nsRFPService.cpp
toolkit/components/satchel/nsFormFillController.cpp
toolkit/components/sessionstore/SessionStoreListener.cpp
toolkit/components/sessionstore/SessionStoreUtils.cpp
toolkit/components/telemetry/core/TelemetryCommon.cpp
toolkit/components/url-classifier/Classifier.cpp
toolkit/components/url-classifier/LookupCache.cpp
toolkit/components/url-classifier/VariableLengthPrefixSet.cpp
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp
toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
toolkit/components/url-classifier/tests/gtest/Common.cpp
toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp
toolkit/components/windowwatcher/nsWindowWatcher.cpp
toolkit/crashreporter/nsExceptionHandler.cpp
toolkit/mozapps/extensions/AddonContentPolicy.cpp
toolkit/profile/nsToolkitProfileService.cpp
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsXREDirProvider.cpp
tools/profiler/core/shared-libraries-linux.cc
tools/profiler/core/shared-libraries-macos.cc
tools/profiler/core/shared-libraries-win32.cc
tools/profiler/gecko/ProfilerChild.cpp
uriloader/exthandler/android/nsAndroidHandlerApp.cpp
uriloader/exthandler/android/nsMIMEInfoAndroid.cpp
uriloader/exthandler/android/nsOSHelperAppService.h
uriloader/exthandler/nsExternalHelperAppService.cpp
uriloader/exthandler/win/nsMIMEInfoWin.cpp
uriloader/exthandler/win/nsOSHelperAppService.cpp
uriloader/prefetch/nsOfflineCacheUpdate.cpp
uriloader/preload/FetchPreloader.cpp
uriloader/preload/PreloadService.cpp
widget/GfxInfoBase.h
widget/android/AndroidAlerts.cpp
widget/android/AndroidBridge.cpp
widget/android/AndroidBridge.h
widget/android/WebExecutorSupport.cpp
widget/cocoa/nsChildView.mm
widget/cocoa/nsColorPicker.mm
widget/cocoa/nsFilePicker.mm
widget/cocoa/nsIconLoaderService.mm
widget/gtk/MPRISServiceHandler.cpp
widget/gtk/MPRISServiceHandler.h
widget/gtk/nsWindow.cpp
widget/windows/GfxInfo.cpp
widget/windows/KeyboardLayout.cpp
widget/windows/TSFTextStore.cpp
widget/windows/WinIMEHandler.cpp
widget/windows/WinUtils.cpp
widget/windows/WindowsSMTCProvider.cpp
widget/windows/nsClipboard.cpp
widget/windows/nsDataObj.cpp
widget/windows/nsDeviceContextSpecWin.cpp
widget/windows/nsPrintDialogUtil.cpp
widget/windows/nsSound.cpp
xpcom/base/nsDumpUtils.cpp
xpcom/base/nsDumpUtils.h
xpcom/base/nsIMemoryReporter.idl
xpcom/base/nsMemoryInfoDumper.cpp
xpcom/base/nsMemoryReporterManager.cpp
xpcom/components/ManifestParser.cpp
xpcom/ds/nsObserverService.cpp
xpcom/glue/FileUtils.cpp
xpcom/io/SpecialSystemDirectory.cpp
xpcom/io/nsAppFileLocationProvider.cpp
xpcom/io/nsLocalFileUnix.cpp
xpcom/io/nsLocalFileWin.cpp
xpcom/tests/gtest/TestTArray2.cpp
--- a/accessible/base/nsCoreUtils.h
+++ b/accessible/base/nsCoreUtils.h
@@ -56,17 +56,17 @@ class nsCoreUtils {
    * @param  aRowIndex    [in] row index
    * @param  aColumn      [in] column object
    * @param  aPseudoElm   [in] pseudo element inside the cell, see
    *                       XULTreeElement for available values
    */
   MOZ_CAN_RUN_SCRIPT
   static void DispatchClickEvent(mozilla::dom::XULTreeElement* aTree,
                                  int32_t aRowIndex, nsTreeColumn* aColumn,
-                                 const nsAString& aPseudoElt = EmptyString());
+                                 const nsAString& aPseudoElt = u""_ns);
 
   /**
    * Send mouse event to the given element.
    *
    * @param aMessage     [in] an event message (see EventForwards.h)
    * @param aX           [in] x coordinate in dev pixels
    * @param aY           [in] y coordinate in dev pixels
    * @param aContent     [in] the element
--- a/accessible/generic/ImageAccessible.cpp
+++ b/accessible/generic/ImageAccessible.cpp
@@ -122,17 +122,17 @@ bool ImageAccessible::DoAction(uint8_t a
   uri->GetSpec(utf8spec);
   NS_ConvertUTF8toUTF16 spec(utf8spec);
 
   dom::Document* document = mContent->OwnerDoc();
   nsCOMPtr<nsPIDOMWindowOuter> piWindow = document->GetWindow();
   if (!piWindow) return false;
 
   RefPtr<mozilla::dom::BrowsingContext> tmp;
-  return NS_SUCCEEDED(piWindow->Open(spec, EmptyString(), EmptyString(),
+  return NS_SUCCEEDED(piWindow->Open(spec, u""_ns, u""_ns,
                                      /* aLoadInfo = */ nullptr,
                                      /* aForceNoOpener = */ false,
                                      getter_AddRefs(tmp)));
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // ImageAccessible
 
--- a/accessible/windows/msaa/nsWinUtils.cpp
+++ b/accessible/windows/msaa/nsWinUtils.cpp
@@ -44,17 +44,17 @@ already_AddRefed<nsICSSDeclaration> nsWi
 
   // Returns number of items in style declaration
   nsCOMPtr<nsPIDOMWindowInner> window = elm->OwnerDoc()->GetInnerWindow();
   if (!window) return nullptr;
 
   ErrorResult dummy;
   nsCOMPtr<Element> domElement(do_QueryInterface(elm));
   nsCOMPtr<nsICSSDeclaration> cssDecl =
-      window->GetComputedStyle(*domElement, EmptyString(), dummy);
+      window->GetComputedStyle(*domElement, u""_ns, dummy);
   dummy.SuppressException();
   return cssDecl.forget();
 }
 
 bool nsWinUtils::MaybeStartWindowEmulation() {
   // Register window class that'll be used for document accessibles associated
   // with tabs.
   if (IPCAccessibilityActive()) return false;
--- a/caps/BasePrincipal.cpp
+++ b/caps/BasePrincipal.cpp
@@ -788,19 +788,19 @@ BasePrincipal::GetExposableSpec(nsACStri
   aSpec.Truncate();
   nsCOMPtr<nsIURI> prinURI;
   nsresult rv = GetURI(getter_AddRefs(prinURI));
   if (NS_FAILED(rv) || !prinURI) {
     return NS_OK;
   }
   nsCOMPtr<nsIURI> clone;
   rv = NS_MutateURI(prinURI)
-           .SetQuery(EmptyCString())
-           .SetRef(EmptyCString())
-           .SetUserPass(EmptyCString())
+           .SetQuery(""_ns)
+           .SetRef(""_ns)
+           .SetUserPass(""_ns)
            .Finalize(clone);
   NS_ENSURE_SUCCESS(rv, rv);
   return clone->GetAsciiSpec(aSpec);
 }
 
 NS_IMETHODIMP
 BasePrincipal::GetPrepath(nsACString& aPath) {
   aPath.Truncate();
--- a/caps/ContentPrincipal.cpp
+++ b/caps/ContentPrincipal.cpp
@@ -476,17 +476,17 @@ ContentPrincipal::GetSiteOrigin(nsACStri
       return rv;
     }
   }
 
   // NOTE: Calling `SetHostPort` with a portless domain is insufficient to clear
   // the port, so an extra `SetPort` call has to be made.
   nsCOMPtr<nsIURI> siteUri;
   NS_MutateURI mutator(mURI);
-  mutator.SetUserPass(EmptyCString()).SetPort(-1);
+  mutator.SetUserPass(""_ns).SetPort(-1);
   if (gotBaseDomain) {
     mutator.SetHost(baseDomain);
   }
   rv = mutator.Finalize(siteUri);
   MOZ_ASSERT(NS_SUCCEEDED(rv), "failed to create siteUri");
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = GenerateOriginNoSuffixFromURI(siteUri, aSiteOrigin);
--- a/caps/DomainPolicy.cpp
+++ b/caps/DomainPolicy.cpp
@@ -129,20 +129,19 @@ void DomainPolicy::ApplyClone(const Doma
   CopyURIs(aClone->blocklist(), mBlocklist);
   CopyURIs(aClone->allowlist(), mAllowlist);
   CopyURIs(aClone->superBlocklist(), mSuperBlocklist);
   CopyURIs(aClone->superAllowlist(), mSuperAllowlist);
 }
 
 static already_AddRefed<nsIURI> GetCanonicalClone(nsIURI* aURI) {
   nsCOMPtr<nsIURI> clone;
-  nsresult rv = NS_MutateURI(aURI)
-                    .SetUserPass(EmptyCString())
-                    .SetPathQueryRef(EmptyCString())
-                    .Finalize(clone);
+  nsresult rv =
+      NS_MutateURI(aURI).SetUserPass(""_ns).SetPathQueryRef(""_ns).Finalize(
+          clone);
   NS_ENSURE_SUCCESS(rv, nullptr);
   return clone.forget();
 }
 
 NS_IMPL_ISUPPORTS(DomainSet, nsIDomainSet)
 
 NS_IMETHODIMP
 DomainSet::Add(nsIURI* aDomain) {
--- a/caps/nsJSPrincipals.cpp
+++ b/caps/nsJSPrincipals.cpp
@@ -345,17 +345,17 @@ static bool WritePrincipalInfo(JSStructu
 
 /* static */
 bool nsJSPrincipals::WritePrincipalInfo(JSStructuredCloneWriter* aWriter,
                                         const PrincipalInfo& aInfo) {
   if (aInfo.type() == PrincipalInfo::TNullPrincipalInfo) {
     const NullPrincipalInfo& nullInfo = aInfo;
     return JS_WriteUint32Pair(aWriter, SCTAG_DOM_NULL_PRINCIPAL, 0) &&
            ::WritePrincipalInfo(aWriter, nullInfo.attrs(), nullInfo.spec(),
-                                EmptyCString(), EmptyCString());
+                                ""_ns, ""_ns);
   }
   if (aInfo.type() == PrincipalInfo::TSystemPrincipalInfo) {
     return JS_WriteUint32Pair(aWriter, SCTAG_DOM_SYSTEM_PRINCIPAL, 0);
   }
   if (aInfo.type() == PrincipalInfo::TExpandedPrincipalInfo) {
     const ExpandedPrincipalInfo& expanded = aInfo;
     if (!JS_WriteUint32Pair(aWriter, SCTAG_DOM_EXPANDED_PRINCIPAL, 0) ||
         !JS_WriteUint32Pair(aWriter, expanded.allowlist().Length(), 0)) {
--- a/caps/nsScriptSecurityManager.cpp
+++ b/caps/nsScriptSecurityManager.cpp
@@ -478,17 +478,17 @@ bool nsScriptSecurityManager::ContentSec
         CopyUTF8toUTF16(nsDependentCString(file), fileName);
       }
     } else {
       MOZ_ASSERT(!JS_IsExceptionPending(cx));
     }
     csp->LogViolationDetails(nsIContentSecurityPolicy::VIOLATION_TYPE_EVAL,
                              nullptr,  // triggering element
                              cspEventListener, fileName, scriptSample, lineNum,
-                             columnNum, EmptyString(), EmptyString());
+                             columnNum, u""_ns, u""_ns);
   }
 
   return evalOK;
 }
 
 // static
 bool nsScriptSecurityManager::JSPrincipalsSubsume(JSPrincipals* first,
                                                   JSPrincipals* second) {
@@ -1028,22 +1028,21 @@ nsresult nsScriptSecurityManager::Report
       do_GetService(NS_CONSOLESERVICE_CONTRACTID));
   NS_ENSURE_TRUE(console, NS_ERROR_FAILURE);
   nsCOMPtr<nsIScriptError> error(do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
   NS_ENSURE_TRUE(error, NS_ERROR_FAILURE);
 
   // using category of "SOP" so we can link to MDN
   if (aInnerWindowID != 0) {
     rv = error->InitWithWindowID(
-        message, EmptyString(), EmptyString(), 0, 0, nsIScriptError::errorFlag,
-        "SOP"_ns, aInnerWindowID, true /* From chrome context */);
+        message, u""_ns, u""_ns, 0, 0, nsIScriptError::errorFlag, "SOP"_ns,
+        aInnerWindowID, true /* From chrome context */);
   } else {
-    rv = error->Init(message, EmptyString(), EmptyString(), 0, 0,
-                     nsIScriptError::errorFlag, "SOP", aFromPrivateWindow,
-                     true /* From chrome context */);
+    rv = error->Init(message, u""_ns, u""_ns, 0, 0, nsIScriptError::errorFlag,
+                     "SOP", aFromPrivateWindow, true /* From chrome context */);
   }
   NS_ENSURE_SUCCESS(rv, rv);
   console->LogMessage(error);
   return NS_OK;
 }
 
 nsresult nsScriptSecurityManager::ReportError(const char* aMessageTag,
                                               nsIURI* aSource, nsIURI* aTarget,
--- a/chrome/nsChromeRegistry.cpp
+++ b/chrome/nsChromeRegistry.cpp
@@ -67,20 +67,20 @@ void nsChromeRegistry::LogMessageWithCon
   va_start(args, aMsg);
   mozilla::SmprintfPointer formatted = mozilla::Vsmprintf(aMsg, args);
   va_end(args);
   if (!formatted) return;
 
   nsCString spec;
   if (aURL) aURL->GetSpec(spec);
 
-  rv = error->Init(
-      NS_ConvertUTF8toUTF16(formatted.get()), NS_ConvertUTF8toUTF16(spec),
-      EmptyString(), aLineNumber, 0, flags, "chrome registration",
-      false /* from private window */, true /* from chrome context */);
+  rv = error->Init(NS_ConvertUTF8toUTF16(formatted.get()),
+                   NS_ConvertUTF8toUTF16(spec), u""_ns, aLineNumber, 0, flags,
+                   "chrome registration", false /* from private window */,
+                   true /* from chrome context */);
 
   if (NS_FAILED(rv)) return;
 
   console->LogMessage(error);
 }
 
 nsChromeRegistry::~nsChromeRegistry() { gChromeRegistry = nullptr; }
 
--- a/docshell/base/BrowsingContext.cpp
+++ b/docshell/base/BrowsingContext.cpp
@@ -356,17 +356,17 @@ already_AddRefed<BrowsingContext> Browsi
   }
 
   return context.forget();
 }
 
 already_AddRefed<BrowsingContext> BrowsingContext::CreateIndependent(
     Type aType) {
   RefPtr<BrowsingContext> bc(
-      CreateDetached(nullptr, nullptr, nullptr, EmptyString(), aType));
+      CreateDetached(nullptr, nullptr, nullptr, u""_ns, aType));
   bc->mWindowless = bc->IsContent();
   bc->mEmbeddedByThisProcess = true;
   bc->EnsureAttached();
   return bc.forget();
 }
 
 void BrowsingContext::EnsureAttached() {
   if (!mEverAttached) {
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -8302,17 +8302,17 @@ class InternalLoadEvent : public Runnabl
   InternalLoadEvent(nsDocShell* aDocShell, nsDocShellLoadState* aLoadState)
       : mozilla::Runnable("InternalLoadEvent"),
         mDocShell(aDocShell),
         mLoadState(aLoadState) {
     // For events, both target and filename should be the version of "null" they
     // expect. By the time the event is fired, both window targeting and file
     // downloading have been handled, so we should never have an internal load
     // event that retargets or had a download.
-    mLoadState->SetTarget(EmptyString());
+    mLoadState->SetTarget(u""_ns);
     mLoadState->SetFileName(VoidString());
   }
 
   NS_IMETHOD
   Run() override {
 #ifndef ANDROID
     MOZ_ASSERT(mLoadState->TriggeringPrincipal(),
                "InternalLoadEvent: Should always have a principal here");
@@ -8420,17 +8420,17 @@ nsresult nsDocShell::PerformRetargeting(
 
     // Since Content Policy checks are performed within docShell as well as
     // the ContentSecurityManager we need a reliable way to let certain
     // nsIContentPolicy consumers ignore duplicate calls.
     secCheckLoadInfo->SetSkipContentPolicyCheckForWebRequest(true);
 
     int16_t shouldLoad = nsIContentPolicy::ACCEPT;
     rv = NS_CheckContentLoadPolicy(aLoadState->URI(), secCheckLoadInfo,
-                                   EmptyCString(),  // mime guess
+                                   ""_ns,  // mime guess
                                    &shouldLoad);
 
     if (NS_FAILED(rv) || NS_CP_REJECTED(shouldLoad)) {
       if (NS_SUCCEEDED(rv) && shouldLoad == nsIContentPolicy::REJECT_TYPE) {
         return NS_ERROR_CONTENT_BLOCKED_SHOW_ALT;
       }
 
       return NS_ERROR_CONTENT_BLOCKED;
@@ -8520,27 +8520,27 @@ nsresult nsDocShell::PerformRetargeting(
       loadState->SetForceAllowDataURI(
           aLoadState->HasLoadFlags(INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI));
 
       loadState->SetHasValidUserGestureActivation(
           aLoadState->HasValidUserGestureActivation());
 
       rv = win->Open(NS_ConvertUTF8toUTF16(spec),
                      aLoadState->Target(),  // window name
-                     EmptyString(),         // Features
+                     u""_ns,                // Features
                      loadState,
                      true,  // aForceNoOpener
                      getter_AddRefs(newBC));
       MOZ_ASSERT(!newBC);
       return rv;
     }
 
     rv = win->OpenNoNavigate(NS_ConvertUTF8toUTF16(spec),
                              aLoadState->Target(),  // window name
-                             EmptyString(),         // Features
+                             u""_ns,                // Features
                              getter_AddRefs(newBC));
 
     // In some cases the Open call doesn't actually result in a new
     // window being opened.  We can detect these cases by examining the
     // document in |newBC|, if any.
     nsCOMPtr<nsPIDOMWindowOuter> piNewWin =
         newBC ? newBC->GetDOMWindow() : nullptr;
     if (piNewWin) {
@@ -8565,17 +8565,17 @@ nsresult nsDocShell::PerformRetargeting(
   }
 
   aLoadState->SetTargetBrowsingContext(targetContext);
   //
   // Transfer the load to the target BrowsingContext... Clear the window target
   // name to the empty string to prevent recursive retargeting!
   //
   // No window target
-  aLoadState->SetTarget(EmptyString());
+  aLoadState->SetTarget(u""_ns);
   // No forced download
   aLoadState->SetFileName(VoidString());
   return targetContext->InternalLoad(aLoadState);
 }
 
 bool nsDocShell::IsSameDocumentNavigation(nsDocShellLoadState* aLoadState,
                                           SameDocumentNavigationState& aState) {
   MOZ_ASSERT(aLoadState);
@@ -9708,18 +9708,17 @@ nsIPrincipal* nsDocShell::GetInheritedPr
       nsCOMPtr<nsISeekableStream> postDataSeekable =
           do_QueryInterface(aLoadState->PostDataStream());
       if (postDataSeekable) {
         aRv = postDataSeekable->Seek(nsISeekableStream::NS_SEEK_SET, 0);
         NS_ENSURE_SUCCESS(aRv, false);
       }
 
       // we really need to have a content type associated with this stream!!
-      postChannel->SetUploadStream(aLoadState->PostDataStream(), EmptyCString(),
-                                   -1);
+      postChannel->SetUploadStream(aLoadState->PostDataStream(), ""_ns, -1);
     }
 
     /* If there is a valid postdata *and* it is a History Load,
      * set up the cache key on the channel, to retrieve the
      * data *only* from the cache. If it is a normal reload, the
      * cache is free to go to the server for updated postdata.
      */
     if (cacheChannel && aCacheKey != 0) {
@@ -10514,17 +10513,17 @@ nsresult nsDocShell::ScrollToAnchor(bool
       //
       // When aNewHash contains "%00", unescaped string may be empty.
       // And GoToAnchor asserts if we ask it to scroll to an empty ref.
       presShell->GoToAnchor(uStr, scroll && !uStr.IsEmpty(),
                             ScrollFlags::ScrollSmoothAuto);
     }
   } else {
     // Tell the shell it's at an anchor, without scrolling.
-    presShell->GoToAnchor(EmptyString(), false);
+    presShell->GoToAnchor(u""_ns, false);
 
     // An empty anchor was found, but if it's a load from history,
     // we don't have to jump to the top of the page. Scrollbar
     // position will be restored by the caller, based on positions
     // stored in session history.
     if (aLoadType == LOAD_HISTORY || aLoadType == LOAD_RELOAD_NORMAL) {
       return NS_OK;
     }
@@ -11076,17 +11075,17 @@ nsresult nsDocShell::UpdateURLAndHistory
       // we'll just set mOSHE here.
       mOSHE = newSHEntry;
     }
   } else if (StaticPrefs::fission_sessionHistoryInParent()) {
     MOZ_LOG(gSHLog, LogLevel::Debug,
             ("document %p UpdateActiveEntry non-replace", this));
     UpdateActiveEntry(
         true, /* aPreviousScrollPos = */ Nothing(), aNewURI, aNewURI,
-        aDocument->NodePrincipal(), aDocument->GetCsp(), EmptyString(),
+        aDocument->NodePrincipal(), aDocument->GetCsp(), u""_ns,
         /* aScrollRestorationIsManual = */ Nothing(), aData, uriWasModified);
   } else {
     // Step 3.
     newSHEntry = mOSHE;
 
     MOZ_LOG(gSHLog, LogLevel::Debug, ("document %p step 3", this));
     // Since we're not changing which page we have loaded, pass
     // true for aCloneChildren.
@@ -11433,17 +11432,17 @@ nsresult nsDocShell::AddToSessionHistory
     uint32_t now = PRTimeToSeconds(PR_Now());
     if (expTime <= now) {
       expired = true;
     }
   }
 
   // Title is set in nsDocShell::SetTitle()
   entry->Create(aURI,                 // uri
-                EmptyString(),        // Title
+                u""_ns,               // Title
                 inputStream,          // Post data stream
                 cacheKey,             // CacheKey
                 mContentTypeHint,     // Content-type
                 triggeringPrincipal,  // Channel or provided principal
                 principalToInherit, partitionedPrincipalToInherit, csp,
                 HistoryID(), GetCreatedDynamically(), originalURI,
                 resultPrincipalURI, loadReplace, referrerInfo, srcdoc,
                 srcdocEntry, baseURI, saveLayoutState, expired);
@@ -12617,17 +12616,17 @@ nsresult nsDocShell::OnOverLink(nsIConte
   return rv;
 }
 
 nsresult nsDocShell::OnLeaveLink() {
   nsCOMPtr<nsIWebBrowserChrome> browserChrome(do_GetInterface(mTreeOwner));
   nsresult rv = NS_ERROR_FAILURE;
 
   if (browserChrome) {
-    rv = browserChrome->SetLinkStatus(EmptyString());
+    rv = browserChrome->SetLinkStatus(u""_ns);
   }
   return rv;
 }
 
 bool nsDocShell::ShouldBlockLoadingForBackButton() {
   if (!(mLoadType & LOAD_CMD_HISTORY) ||
       UserActivation::IsHandlingUserInput() ||
       !Preferences::GetBool("accessibility.blockjsredirection")) {
--- a/docshell/base/nsPingListener.cpp
+++ b/docshell/base/nsPingListener.cpp
@@ -125,21 +125,21 @@ static void SendPing(void* aClosure, nsI
     rv = httpInternal->SetDocumentURI(doc->GetDocumentURI());
     MOZ_ASSERT(NS_SUCCEEDED(rv));
   }
 
   rv = httpChan->SetRequestMethod("POST"_ns);
   MOZ_ASSERT(NS_SUCCEEDED(rv));
 
   // Remove extraneous request headers (to reduce request size)
-  rv = httpChan->SetRequestHeader("accept"_ns, EmptyCString(), false);
+  rv = httpChan->SetRequestHeader("accept"_ns, ""_ns, false);
   MOZ_ASSERT(NS_SUCCEEDED(rv));
-  rv = httpChan->SetRequestHeader("accept-language"_ns, EmptyCString(), false);
+  rv = httpChan->SetRequestHeader("accept-language"_ns, ""_ns, false);
   MOZ_ASSERT(NS_SUCCEEDED(rv));
-  rv = httpChan->SetRequestHeader("accept-encoding"_ns, EmptyCString(), false);
+  rv = httpChan->SetRequestHeader("accept-encoding"_ns, ""_ns, false);
   MOZ_ASSERT(NS_SUCCEEDED(rv));
 
   // Always send a Ping-To header.
   nsAutoCString pingTo;
   if (NS_SUCCEEDED(info->target->GetSpec(pingTo))) {
     rv = httpChan->SetRequestHeader("Ping-To"_ns, pingTo, false);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
   }
--- a/dom/base/AnonymousContent.cpp
+++ b/dom/base/AnonymousContent.cpp
@@ -211,13 +211,13 @@ void AnonymousContent::SetStyle(const ns
                                 const nsACString& aValue, ErrorResult& aRv) {
   if (!mContentNode->IsHTMLElement()) {
     aRv.Throw(NS_ERROR_NOT_AVAILABLE);
     return;
   }
 
   nsGenericHTMLElement* element = nsGenericHTMLElement::FromNode(mContentNode);
   nsCOMPtr<nsICSSDeclaration> declaration = element->Style();
-  declaration->SetProperty(aProperty, aValue, EmptyString(), IgnoreErrors());
+  declaration->SetProperty(aProperty, aValue, u""_ns, IgnoreErrors());
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/base/DOMImplementation.cpp
+++ b/dom/base/DOMImplementation.cpp
@@ -123,30 +123,30 @@ nsresult DOMImplementation::CreateHTMLDo
   *aDocument = nullptr;
 
   NS_ENSURE_STATE(mOwner);
 
   // Indicate that there is no internal subset (not just an empty one)
   RefPtr<DocumentType> doctype =
       NS_NewDOMDocumentType(mOwner->NodeInfoManager(),
                             nsGkAtoms::html,  // aName
-                            EmptyString(),    // aPublicId
-                            EmptyString(),    // aSystemId
+                            u""_ns,           // aPublicId
+                            u""_ns,           // aSystemId
                             VoidString());    // aInternalSubset
 
   nsCOMPtr<nsIGlobalObject> scriptHandlingObject =
       do_QueryReferent(mScriptObject);
 
   NS_ENSURE_STATE(!mScriptObject || scriptHandlingObject);
 
   nsCOMPtr<Document> doc;
-  nsresult rv = NS_NewDOMDocument(
-      getter_AddRefs(doc), EmptyString(), EmptyString(), doctype, mDocumentURI,
-      mBaseURI, mOwner->NodePrincipal(), true, scriptHandlingObject,
-      DocumentFlavorLegacyGuess);
+  nsresult rv =
+      NS_NewDOMDocument(getter_AddRefs(doc), u""_ns, u""_ns, doctype,
+                        mDocumentURI, mBaseURI, mOwner->NodePrincipal(), true,
+                        scriptHandlingObject, DocumentFlavorLegacyGuess);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<Element> root =
       doc->CreateElem(u"html"_ns, nullptr, kNameSpaceID_XHTML);
   rv = doc->AppendChildTo(root, false);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<Element> head =
--- a/dom/base/DOMParser.cpp
+++ b/dom/base/DOMParser.cpp
@@ -304,18 +304,18 @@ already_AddRefed<Document> DOMParser::Se
   nsCOMPtr<nsIScriptGlobalObject> scriptHandlingObject =
       do_QueryInterface(mOwner);
 
   // Try to inherit a style backend.
   NS_ASSERTION(mPrincipal, "Must have principal by now");
   NS_ASSERTION(mDocumentURI, "Must have document URI by now");
 
   nsCOMPtr<Document> doc;
-  nsresult rv = NS_NewDOMDocument(
-      getter_AddRefs(doc), EmptyString(), EmptyString(), nullptr, mDocumentURI,
-      mBaseURI, mPrincipal, true, scriptHandlingObject, aFlavor);
+  nsresult rv = NS_NewDOMDocument(getter_AddRefs(doc), u""_ns, u""_ns, nullptr,
+                                  mDocumentURI, mBaseURI, mPrincipal, true,
+                                  scriptHandlingObject, aFlavor);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     aRv.Throw(rv);
     return nullptr;
   }
 
   return doc.forget();
 }
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -2607,17 +2607,17 @@ void Document::ResetToURI(nsIURI* aURI, 
         }
       }
     }
   }
 
   mLastModified.Truncate();
   // XXXbz I guess we're assuming that the caller will either pass in
   // a channel with a useful type or call SetContentType?
-  SetContentTypeInternal(EmptyCString());
+  SetContentTypeInternal(""_ns);
   mContentLanguage.Truncate();
   mBaseTarget.Truncate();
 
   mXMLDeclarationBits = 0;
 
   // Now get our new principal
   if (aPrincipal) {
     SetPrincipals(aPrincipal, aPartitionedPrincipal);
@@ -4569,18 +4569,17 @@ void Document::EnsureInitializeInternalC
           Command::Undefined,
           ExecCommandParam::Boolean,
           nullptr));  // Not implemented yet.
 #endif  // #if 0
   // clang-format on
 }
 
 Document::InternalCommandData Document::ConvertToInternalCommand(
-    const nsAString& aHTMLCommandName,
-    const nsAString& aValue /* = EmptyString() */,
+    const nsAString& aHTMLCommandName, const nsAString& aValue /* = u""_ns */,
     nsAString* aAdjustedValue /* = nullptr */) {
   MOZ_ASSERT(!aAdjustedValue || aAdjustedValue->IsEmpty());
   EnsureInitializeInternalCommandDataHashtable();
   InternalCommandData commandData;
   if (!sInternalCommandDataHashtable->Get(aHTMLCommandName, &commandData)) {
     return InternalCommandData();
   }
   if (!aAdjustedValue) {
@@ -5220,17 +5219,17 @@ void Document::QueryCommandValue(const n
         commandManager->DoCommand(commandData.mXULCommandName, params, window);
     if (aRv.Failed()) {
       return;
     }
     params->GetString("result", aValue);
     return;
   }
 
-  aRv = params->SetCString("state_attribute", EmptyCString());
+  aRv = params->SetCString("state_attribute", ""_ns);
   if (aRv.Failed()) {
     return;
   }
 
   aRv = commandManager->GetCommandState(commandData.mXULCommandName, window,
                                         params);
   if (aRv.Failed()) {
     return;
@@ -7874,33 +7873,33 @@ already_AddRefed<Attr> Document::CreateA
   res = mNodeInfoManager->GetNodeInfo(name, nullptr, kNameSpaceID_None,
                                       ATTRIBUTE_NODE, getter_AddRefs(nodeInfo));
   if (NS_FAILED(res)) {
     rv.Throw(res);
     return nullptr;
   }
 
   RefPtr<Attr> attribute =
-      new (mNodeInfoManager) Attr(nullptr, nodeInfo.forget(), EmptyString());
+      new (mNodeInfoManager) Attr(nullptr, nodeInfo.forget(), u""_ns);
   return attribute.forget();
 }
 
 already_AddRefed<Attr> Document::CreateAttributeNS(
     const nsAString& aNamespaceURI, const nsAString& aQualifiedName,
     ErrorResult& rv) {
   RefPtr<mozilla::dom::NodeInfo> nodeInfo;
   rv = nsContentUtils::GetNodeInfoFromQName(aNamespaceURI, aQualifiedName,
                                             mNodeInfoManager, ATTRIBUTE_NODE,
                                             getter_AddRefs(nodeInfo));
   if (rv.Failed()) {
     return nullptr;
   }
 
   RefPtr<Attr> attribute =
-      new (mNodeInfoManager) Attr(nullptr, nodeInfo.forget(), EmptyString());
+      new (mNodeInfoManager) Attr(nullptr, nodeInfo.forget(), u""_ns);
   return attribute.forget();
 }
 
 void Document::ResolveScheduledSVGPresAttrs() {
   for (auto iter = mLazySVGPresElements.Iter(); !iter.Done(); iter.Next()) {
     SVGElement* svg = iter.Get()->GetKey();
     svg->UpdateContentDeclarationBlock();
   }
@@ -8173,17 +8172,17 @@ already_AddRefed<nsIURI> Document::Creat
   // Create new URI
   nsCOMPtr<nsIURI> uri = GetDomainURI();
   if (!uri) {
     return nullptr;
   }
 
   nsresult rv;
   rv = NS_MutateURI(uri)
-           .SetUserPass(EmptyCString())
+           .SetUserPass(""_ns)
            .SetPort(-1)  // we want to reset the port number if needed.
            .SetHostPort(aHostString)
            .Finalize(uri);
   if (NS_FAILED(rv)) {
     return nullptr;
   }
 
   return uri.forget();
@@ -8945,17 +8944,17 @@ Document* Document::Open(const Optional<
     nsCOMPtr<nsIURI> currentURI = GetDocumentURI();
     bool equalURIs;
     nsresult rv = currentURI->Equals(newURI, &equalURIs);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       aError.Throw(rv);
       return nullptr;
     }
     nsCOMPtr<nsIStructuredCloneContainer> stateContainer(mStateObjectContainer);
-    rv = shell->UpdateURLAndHistory(this, newURI, stateContainer, EmptyString(),
+    rv = shell->UpdateURLAndHistory(this, newURI, stateContainer, u""_ns,
                                     /* aReplace = */ true, currentURI,
                                     equalURIs);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       aError.Throw(rv);
       return nullptr;
     }
 
     // And use the security info of the caller document as well, since
@@ -9047,17 +9046,17 @@ void Document::Close(ErrorResult& rv) {
   }
 
   if (!mParser || !mParser->IsScriptCreated()) {
     return;
   }
 
   ++mWriteLevel;
   rv = (static_cast<nsHtml5Parser*>(mParser.get()))
-           ->Parse(EmptyString(), nullptr, true);
+           ->Parse(u""_ns, nullptr, true);
   --mWriteLevel;
 }
 
 void Document::WriteCommon(const Sequence<nsString>& aText,
                            bool aNewlineTerminate, mozilla::ErrorResult& rv) {
   // Fast path the common case
   if (aText.Length() == 1) {
     WriteCommon(aText[0], aNewlineTerminate, rv);
@@ -11836,19 +11835,19 @@ nsISupports* Document::GetCurrentContent
 Document* Document::GetTemplateContentsOwner() {
   if (!mTemplateContentsOwner) {
     bool hasHadScriptObject = true;
     nsIScriptGlobalObject* scriptObject =
         GetScriptHandlingObject(hasHadScriptObject);
 
     nsCOMPtr<Document> document;
     nsresult rv = NS_NewDOMDocument(getter_AddRefs(document),
-                                    EmptyString(),  // aNamespaceURI
-                                    EmptyString(),  // aQualifiedName
-                                    nullptr,        // aDoctype
+                                    u""_ns,   // aNamespaceURI
+                                    u""_ns,   // aQualifiedName
+                                    nullptr,  // aDoctype
                                     Document::GetDocumentURI(),
                                     Document::GetDocBaseURI(), NodePrincipal(),
                                     true,          // aLoadedAsData
                                     scriptObject,  // aEventObject
                                     DocumentFlavorHTML);
     NS_ENSURE_SUCCESS(rv, nullptr);
 
     mTemplateContentsOwner = document;
@@ -14773,19 +14772,19 @@ already_AddRefed<Document> Document::Con
   nsCOMPtr<nsIURI> uri;
   NS_NewURI(getter_AddRefs(uri), "about:blank");
   if (!uri) {
     rv.Throw(NS_ERROR_OUT_OF_MEMORY);
     return nullptr;
   }
 
   nsCOMPtr<Document> doc;
-  nsresult res = NS_NewDOMDocument(
-      getter_AddRefs(doc), VoidString(), EmptyString(), nullptr, uri, uri,
-      prin->GetPrincipal(), true, global, DocumentFlavorPlain);
+  nsresult res = NS_NewDOMDocument(getter_AddRefs(doc), VoidString(), u""_ns,
+                                   nullptr, uri, uri, prin->GetPrincipal(),
+                                   true, global, DocumentFlavorPlain);
   if (NS_FAILED(res)) {
     rv.Throw(res);
     return nullptr;
   }
 
   doc->SetReadyStateInternal(Document::READYSTATE_COMPLETE);
 
   return doc.forget();
--- a/dom/base/Document.h
+++ b/dom/base/Document.h
@@ -4112,18 +4112,17 @@ class Document : public nsINode,
    *                            corresponding internal command for
    *                            aHTMLCommandName or aValue is invalid for
    *                            found internal command when aAdjustedValue
    *                            is not nullptr.  Otherwise, returns a copy of
    *                            instance registered in
    *                            sInternalCommandDataHashtable.
    */
   static InternalCommandData ConvertToInternalCommand(
-      const nsAString& aHTMLCommandName,
-      const nsAString& aValue = EmptyString(),
+      const nsAString& aHTMLCommandName, const nsAString& aValue = u""_ns,
       nsAString* aAdjustedValue = nullptr);
 
   /**
    * AutoRunningExecCommandMarker is AutoRestorer for mIsRunningExecCommand.
    * Since it's a bit field, not a bool member, therefore, we cannot use
    * AutoRestorer for it.
    */
   class MOZ_STACK_CLASS AutoRunningExecCommandMarker final {
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -1292,18 +1292,18 @@ bool Element::ToggleAttribute(const nsAS
     if (aForce.WasPassed() && !aForce.Value()) {
       return false;
     }
     RefPtr<nsAtom> nameAtom = NS_AtomizeMainThread(nameToUse);
     if (!nameAtom) {
       aError.Throw(NS_ERROR_OUT_OF_MEMORY);
       return false;
     }
-    aError = SetAttr(kNameSpaceID_None, nameAtom, EmptyString(),
-                     aTriggeringPrincipal, true);
+    aError = SetAttr(kNameSpaceID_None, nameAtom, u""_ns, aTriggeringPrincipal,
+                     true);
     return true;
   }
   if (aForce.WasPassed() && aForce.Value()) {
     return true;
   }
   // Hold a strong reference here so that the atom or nodeinfo doesn't go
   // away during UnsetAttr. If it did UnsetAttr would be left with a
   // dangling pointer as argument without knowing it.
@@ -3673,17 +3673,17 @@ void Element::InsertAdjacentText(const n
 TextEditor* Element::GetTextEditorInternal() {
   TextControlElement* textControlElement = TextControlElement::FromNode(this);
   return textControlElement ? MOZ_KnownLive(textControlElement)->GetTextEditor()
                             : nullptr;
 }
 
 nsresult Element::SetBoolAttr(nsAtom* aAttr, bool aValue) {
   if (aValue) {
-    return SetAttr(kNameSpaceID_None, aAttr, EmptyString(), true);
+    return SetAttr(kNameSpaceID_None, aAttr, u""_ns, true);
   }
 
   return UnsetAttr(kNameSpaceID_None, aAttr, true);
 }
 
 void Element::GetEnumAttr(nsAtom* aAttr, const char* aDefault,
                           nsAString& aResult) const {
   GetEnumAttr(aAttr, aDefault, aDefault, aResult);
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -987,17 +987,17 @@ class Element : public FragmentOrElement
       }
     }
 
     return GetParsedAttr(nsGkAtoms::_class);
   }
 
 #ifdef DEBUG
   virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override {
-    List(out, aIndent, EmptyCString());
+    List(out, aIndent, ""_ns);
   }
   virtual void DumpContent(FILE* out, int32_t aIndent,
                            bool aDumpAll) const override;
   void List(FILE* out, int32_t aIndent, const nsCString& aPrefix) const;
   void ListAttributes(FILE* out) const;
 #endif
 
   /**
--- a/dom/base/EventSource.cpp
+++ b/dom/base/EventSource.cpp
@@ -1252,19 +1252,19 @@ nsresult EventSourceImpl::PrintErrorOnCo
   nsAutoString message;
   if (!aFormatStrings.IsEmpty()) {
     rv = strBundle->FormatStringFromName(aError, aFormatStrings, message);
   } else {
     rv = strBundle->GetStringFromName(aError, message);
   }
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = errObj->InitWithWindowID(
-      message, mScriptFile, EmptyString(), mScriptLine, mScriptColumn,
-      nsIScriptError::errorFlag, "Event Source", mInnerWindowID);
+  rv = errObj->InitWithWindowID(message, mScriptFile, u""_ns, mScriptLine,
+                                mScriptColumn, nsIScriptError::errorFlag,
+                                "Event Source", mInnerWindowID);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // print the error message directly to the JS console
   rv = console->LogMessage(errObj);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
--- a/dom/base/FormData.cpp
+++ b/dom/base/FormData.cpp
@@ -13,17 +13,17 @@
 
 #include "MultipartBlobImpl.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 FormData::FormData(nsISupports* aOwner, NotNull<const Encoding*> aEncoding,
                    Element* aSubmitter)
-    : HTMLFormSubmission(nullptr, EmptyString(), aEncoding, aSubmitter),
+    : HTMLFormSubmission(nullptr, u""_ns, aEncoding, aSubmitter),
       mOwner(aOwner) {}
 
 FormData::FormData(const FormData& aFormData)
     : HTMLFormSubmission(aFormData.mActionURL, aFormData.mTarget,
                          aFormData.mEncoding, aFormData.mSubmitter) {
   mOwner = aFormData.mOwner;
   mFormData = aFormData.mFormData.Clone();
 }
@@ -165,17 +165,17 @@ bool FormData::Has(const nsAString& aNam
   return false;
 }
 
 nsresult FormData::AddNameBlobOrNullPair(const nsAString& aName, Blob* aBlob) {
   RefPtr<File> file;
 
   if (!aBlob) {
     FormDataTuple* data = mFormData.AppendElement();
-    SetNameValuePair(data, aName, EmptyString(), true /* aWasNullBlob */);
+    SetNameValuePair(data, aName, u""_ns, true /* aWasNullBlob */);
     return NS_OK;
   }
 
   ErrorResult rv;
   file = GetOrCreateFileCalledBlob(*aBlob, rv);
   if (NS_WARN_IF(rv.Failed())) {
     return rv.StealNSResult();
   }
@@ -310,17 +310,17 @@ already_AddRefed<FormData> FormData::Con
 }
 
 // contentTypeWithCharset can be set to the contentType or
 // contentType+charset based on what the spec says.
 // See: https://fetch.spec.whatwg.org/#concept-bodyinit-extract
 nsresult FormData::GetSendInfo(nsIInputStream** aBody, uint64_t* aContentLength,
                                nsACString& aContentTypeWithCharset,
                                nsACString& aCharset) const {
-  FSMultipartFormData fs(nullptr, EmptyString(), UTF_8_ENCODING, nullptr);
+  FSMultipartFormData fs(nullptr, u""_ns, UTF_8_ENCODING, nullptr);
   nsresult rv = CopySubmissionDataTo(&fs);
   NS_ENSURE_SUCCESS(rv, rv);
 
   fs.GetContentType(aContentTypeWithCharset);
   aCharset.Truncate();
   *aContentLength = 0;
   NS_ADDREF(*aBody = fs.GetSubmissionBody(aContentLength));
 
--- a/dom/base/IdentifierMapEntry.h
+++ b/dom/base/IdentifierMapEntry.h
@@ -201,17 +201,17 @@ class IdentifierMapEntry : public PLDHas
 
     explicit OwningAtomOrString(const DependentAtomOrString& aOther)
         // aOther may have a null mString, so jump through a bit of a hoop in
         // that case.  I wish there were a way to just default-initialize
         // mString in that situation...  We could also make mString not const
         // and only assign to it if aOther.mString is not null, but having it be
         // const is nice.
         : mAtom(aOther.mAtom),
-          mString(aOther.mString ? *aOther.mString : EmptyString()) {}
+          mString(aOther.mString ? *aOther.mString : u""_ns) {}
 
     RefPtr<nsAtom> mAtom;
     nsString mString;
   };
 
   IdentifierMapEntry(const IdentifierMapEntry& aOther) = delete;
   IdentifierMapEntry& operator=(const IdentifierMapEntry& aOther) = delete;
 
--- a/dom/base/ImageEncoder.cpp
+++ b/dom/base/ImageEncoder.cpp
@@ -163,19 +163,18 @@ class EncodingRunnable : public Runnable
     nsresult rv = ImageEncoder::ExtractDataInternal(
         mType, mOptions, mImageBuffer.get(), mFormat, mSize, mUsePlaceholder,
         mImage, nullptr, nullptr, getter_AddRefs(stream), mEncoder);
 
     // If there are unrecognized custom parse options, we should fall back to
     // the default values for the encoder without any options at all.
     if (rv == NS_ERROR_INVALID_ARG && mUsingCustomOptions) {
       rv = ImageEncoder::ExtractDataInternal(
-          mType, EmptyString(), mImageBuffer.get(), mFormat, mSize,
-          mUsePlaceholder, mImage, nullptr, nullptr, getter_AddRefs(stream),
-          mEncoder);
+          mType, u""_ns, mImageBuffer.get(), mFormat, mSize, mUsePlaceholder,
+          mImage, nullptr, nullptr, getter_AddRefs(stream), mEncoder);
     }
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = NS_ReadInputStreamToBuffer(stream, aImgData, -1, aImgSize);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return rv;
   }
--- a/dom/base/PostMessageEvent.cpp
+++ b/dom/base/PostMessageEvent.cpp
@@ -138,28 +138,27 @@ PostMessageEvent::Run() {
           "TargetPrincipalDoesNotMatch", providedOrigin, targetOrigin);
 
       nsCOMPtr<nsIScriptError> errorObject =
           do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
       NS_ENSURE_SUCCESS(rv, rv);
 
       if (mCallerWindowID == 0) {
         rv = errorObject->Init(
-            errorText, NS_ConvertUTF8toUTF16(mScriptLocation.value()),
-            EmptyString(), 0, 0, nsIScriptError::errorFlag, "DOM Window",
-            mIsFromPrivateWindow, mProvidedPrincipal->IsSystemPrincipal());
+            errorText, NS_ConvertUTF8toUTF16(mScriptLocation.value()), u""_ns,
+            0, 0, nsIScriptError::errorFlag, "DOM Window", mIsFromPrivateWindow,
+            mProvidedPrincipal->IsSystemPrincipal());
       } else if (callerURI) {
-        rv = errorObject->InitWithSourceURI(errorText, callerURI, EmptyString(),
-                                            0, 0, nsIScriptError::errorFlag,
+        rv = errorObject->InitWithSourceURI(errorText, callerURI, u""_ns, 0, 0,
+                                            nsIScriptError::errorFlag,
                                             "DOM Window", mCallerWindowID);
       } else {
         rv = errorObject->InitWithWindowID(
-            errorText, NS_ConvertUTF8toUTF16(mScriptLocation.value()),
-            EmptyString(), 0, 0, nsIScriptError::errorFlag, "DOM Window",
-            mCallerWindowID);
+            errorText, NS_ConvertUTF8toUTF16(mScriptLocation.value()), u""_ns,
+            0, 0, nsIScriptError::errorFlag, "DOM Window", mCallerWindowID);
       }
       NS_ENSURE_SUCCESS(rv, rv);
 
       nsCOMPtr<nsIConsoleService> consoleService =
           do_GetService(NS_CONSOLESERVICE_CONTRACTID, &rv);
       NS_ENSURE_SUCCESS(rv, rv);
 
       return consoleService->LogMessage(errorObject);
@@ -214,18 +213,18 @@ PostMessageEvent::Run() {
 
   Sequence<OwningNonNull<MessagePort>> ports;
   if (!holder->TakeTransferredPortsAsSequence(ports)) {
     DispatchError(cx, targetWindow, eventTarget);
     return NS_OK;
   }
 
   event->InitMessageEvent(nullptr, u"message"_ns, CanBubble::eNo,
-                          Cancelable::eNo, messageData, mCallerOrigin,
-                          EmptyString(), source, ports);
+                          Cancelable::eNo, messageData, mCallerOrigin, u""_ns,
+                          source, ports);
 
   Dispatch(targetWindow, event);
   return NS_OK;
 }
 
 void PostMessageEvent::DispatchError(JSContext* aCx,
                                      nsGlobalWindowInner* aTargetWindow,
                                      mozilla::dom::EventTarget* aEventTarget) {
--- a/dom/base/ThirdPartyUtil.cpp
+++ b/dom/base/ThirdPartyUtil.cpp
@@ -107,17 +107,17 @@ nsresult ThirdPartyUtil::IsThirdPartyInt
   *aResult = IsThirdPartyInternal(aFirstDomain, secondDomain);
   return NS_OK;
 }
 
 nsCString ThirdPartyUtil::GetBaseDomainFromWindow(nsPIDOMWindowOuter* aWindow) {
   mozilla::dom::Document* doc = aWindow ? aWindow->GetExtantDoc() : nullptr;
 
   if (!doc) {
-    return EmptyCString();
+    return ""_ns;
   }
 
   return doc->GetBaseDomain();
 }
 
 NS_IMETHODIMP
 ThirdPartyUtil::GetPrincipalFromWindow(mozIDOMWindowProxy* aWin,
                                        nsIPrincipal** result) {
--- a/dom/base/nsContentAreaDragDrop.cpp
+++ b/dom/base/nsContentAreaDragDrop.cpp
@@ -172,17 +172,17 @@ nsresult CheckAndGetExtensionForMime(con
   nsresult rv;
 
   nsCOMPtr<nsIMIMEService> mimeService = do_GetService("@mozilla.org/mime;1");
   if (NS_WARN_IF(!mimeService)) {
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIMIMEInfo> mimeInfo;
-  rv = mimeService->GetFromTypeAndExtension(aMimeType, EmptyCString(),
+  rv = mimeService->GetFromTypeAndExtension(aMimeType, ""_ns,
                                             getter_AddRefs(mimeInfo));
   NS_ENSURE_SUCCESS(rv, rv);
 
   mimeInfo->GetPrimaryExtension(*aPrimaryExtension);
 
   if (aExtension.IsEmpty()) {
     *aIsValidExtension = false;
     return NS_OK;
@@ -443,17 +443,17 @@ nsresult DragDataProducer::GetImageData(
     CopyUTF8toUTF16(mimeType, mImageRequestMime);
 #else
     nsCOMPtr<nsIMIMEService> mimeService = do_GetService("@mozilla.org/mime;1");
     if (NS_WARN_IF(!mimeService)) {
       return NS_ERROR_FAILURE;
     }
 
     nsCOMPtr<nsIMIMEInfo> mimeInfo;
-    mimeService->GetFromTypeAndExtension(mimeType, EmptyCString(),
+    mimeService->GetFromTypeAndExtension(mimeType, ""_ns,
                                          getter_AddRefs(mimeInfo));
     if (mimeInfo) {
       nsAutoCString extension;
       imgUrl->GetFileExtension(extension);
 
       bool validExtension;
       if (extension.IsEmpty() ||
           NS_FAILED(mimeInfo->ExtensionExists(extension, &validExtension)) ||
--- a/dom/base/nsContentSink.cpp
+++ b/dom/base/nsContentSink.cpp
@@ -697,17 +697,17 @@ nsresult nsContentSink::ProcessStyleLink
       nullptr,
       url.forget(),
       nullptr,
       referrerInfo.forget(),
       CORS_NONE,
       aTitle,
       aMedia,
       aIntegrity,
-      /* nonce = */ EmptyString(),
+      /* nonce = */ u""_ns,
       aAlternate ? Loader::HasAlternateRel::Yes : Loader::HasAlternateRel::No,
       Loader::IsInline::No,
       Loader::IsExplicitlyEnabled::No,
   };
 
   auto loadResultOrErr =
       mCSSLoader->LoadStyleLink(info, mRunsToCompletion ? nullptr : this);
   if (loadResultOrErr.isErr()) {
@@ -1500,21 +1500,20 @@ void nsContentSink::NotifyDocElementCrea
 
   auto* win = nsGlobalWindowInner::Cast(aDoc->GetInnerWindow());
   bool fireInitialInsertion = !win || !win->DidFireDocElemInserted();
   if (win) {
     win->SetDidFireDocElemInserted();
   }
   if (fireInitialInsertion) {
     observerService->NotifyObservers(ToSupports(aDoc),
-                                     "initial-document-element-inserted",
-                                     EmptyString().get());
+                                     "initial-document-element-inserted", u"");
   }
-  observerService->NotifyObservers(
-      ToSupports(aDoc), "document-element-inserted", EmptyString().get());
+  observerService->NotifyObservers(ToSupports(aDoc),
+                                   "document-element-inserted", u"");
 
   nsContentUtils::DispatchChromeEvent(aDoc, ToSupports(aDoc),
                                       u"DOMDocElementInserted"_ns,
                                       CanBubble::eYes, Cancelable::eNo);
 }
 
 NS_IMETHODIMP
 nsContentSink::GetName(nsACString& aName) {
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -3274,17 +3274,17 @@ bool nsContentUtils::CanLoadImage(nsIURI
       aLoadingPrincipal,
       aLoadingPrincipal,  // triggering principal
       aNode, nsILoadInfo::SEC_ONLY_FOR_EXPLICIT_CONTENTSEC_CHECK,
       nsIContentPolicy::TYPE_INTERNAL_IMAGE);
 
   int16_t decision = nsIContentPolicy::ACCEPT;
 
   rv = NS_CheckContentLoadPolicy(aURI, secCheckLoadInfo,
-                                 EmptyCString(),  // mime guess
+                                 ""_ns,  // mime guess
                                  &decision, GetContentPolicy());
 
   return NS_SUCCEEDED(rv) && NS_CP_ACCEPTED(decision);
 }
 
 // static
 bool nsContentUtils::IsInPrivateBrowsing(Document* aDoc) {
   if (!aDoc) {
@@ -3749,20 +3749,19 @@ void nsContentUtils::LogSimpleConsoleErr
                                            bool aFromPrivateWindow,
                                            bool aFromChromeContext,
                                            uint32_t aErrorFlags) {
   nsCOMPtr<nsIScriptError> scriptError =
       do_CreateInstance(NS_SCRIPTERROR_CONTRACTID);
   if (scriptError) {
     nsCOMPtr<nsIConsoleService> console =
         do_GetService(NS_CONSOLESERVICE_CONTRACTID);
-    if (console &&
-        NS_SUCCEEDED(scriptError->Init(
-            aErrorText, EmptyString(), EmptyString(), 0, 0, aErrorFlags,
-            aCategory, aFromPrivateWindow, aFromChromeContext))) {
+    if (console && NS_SUCCEEDED(scriptError->Init(
+                       aErrorText, u""_ns, u""_ns, 0, 0, aErrorFlags, aCategory,
+                       aFromPrivateWindow, aFromChromeContext))) {
       console->LogMessage(scriptError);
     }
   }
 }
 
 /* static */
 nsresult nsContentUtils::ReportToConsole(
     uint32_t aErrorFlags, const nsACString& aCategory,
@@ -4978,19 +4977,19 @@ nsresult nsContentUtils::ConvertToPlainT
                                             nsAString& aResultBuffer,
                                             uint32_t aFlags,
                                             uint32_t aWrapCol) {
   nsCOMPtr<nsIURI> uri;
   NS_NewURI(getter_AddRefs(uri), "about:blank");
   nsCOMPtr<nsIPrincipal> principal =
       NullPrincipal::CreateWithoutOriginAttributes();
   RefPtr<Document> document;
-  nsresult rv = NS_NewDOMDocument(getter_AddRefs(document), EmptyString(),
-                                  EmptyString(), nullptr, uri, uri, principal,
-                                  true, nullptr, DocumentFlavorHTML);
+  nsresult rv =
+      NS_NewDOMDocument(getter_AddRefs(document), u""_ns, u""_ns, nullptr, uri,
+                        uri, principal, true, nullptr, DocumentFlavorHTML);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = nsContentUtils::ParseDocumentHTML(
       aSourceBuffer, document,
       !(aFlags & nsIDocumentEncoder::OutputNoScriptContent));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIDocumentEncoder> encoder = do_createDocumentEncoder("text/plain");
@@ -5280,19 +5279,19 @@ void nsContentUtils::TriggerLink(nsICont
     nsCOMPtr<nsIContentSecurityPolicy> csp = aContent->GetCsp();
 
     // Sanitize fileNames containing null characters by replacing them with
     // underscores.
     if (!fileName.IsVoid()) {
       fileName.ReplaceChar(char16_t(0), '_');
     }
     nsDocShell::Cast(docShell)->OnLinkClick(
-        aContent, aLinkURI, fileName.IsVoid() ? aTargetSpec : EmptyString(),
-        fileName, nullptr, nullptr, UserActivation::IsHandlingUserInput(),
-        aIsTrusted, triggeringPrincipal, csp);
+        aContent, aLinkURI, fileName.IsVoid() ? aTargetSpec : u""_ns, fileName,
+        nullptr, nullptr, UserActivation::IsHandlingUserInput(), aIsTrusted,
+        triggeringPrincipal, csp);
   }
 }
 
 /* static */
 void nsContentUtils::GetLinkLocation(Element* aElement,
                                      nsString& aLocationString) {
   nsCOMPtr<nsIURI> hrefURI = aElement->GetHrefURI();
   if (hrefURI) {
@@ -5871,17 +5870,17 @@ nsresult nsContentUtils::GetASCIIOrigin(
   nsresult rv = uri->GetAsciiHost(host);
 
   if (NS_SUCCEEDED(rv) && !host.IsEmpty()) {
     nsAutoCString userPass;
     uri->GetUserPass(userPass);
 
     nsAutoCString prePath;
     if (!userPass.IsEmpty()) {
-      rv = NS_MutateURI(uri).SetUserPass(EmptyCString()).Finalize(uri);
+      rv = NS_MutateURI(uri).SetUserPass(""_ns).Finalize(uri);
       NS_ENSURE_SUCCESS(rv, rv);
     }
 
     rv = uri->GetPrePath(prePath);
     NS_ENSURE_SUCCESS(rv, rv);
 
     aOrigin = prePath;
   } else {
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -1041,17 +1041,17 @@ class nsContentUtils {
 
   /**
    * Report a non-localized error message to the error console.
    *   @param aErrorText the error message
    *   @param aErrorFlags See nsIScriptError.
    *   @param aCategory Name of module reporting error.
    *   @param aDocument Reference to the document which triggered the message.
    *   @param [aURI=nullptr] (Optional) URI of resource containing error.
-   *   @param [aSourceLine=EmptyString()] (Optional) The text of the line that
+   *   @param [aSourceLine=u""_ns] (Optional) The text of the line that
               contains the error (may be empty).
    *   @param [aLineNumber=0] (Optional) Line number within resource
               containing error.
    *   @param [aColumnNumber=0] (Optional) Column number within resource
               containing error.
               If aURI is null, then aDocument->GetDocumentURI() is used.
    *   @param [aLocationMode] (Optional) Specifies the behavior if
               error location information is omitted.
@@ -1060,57 +1060,57 @@ class nsContentUtils {
     // Don't show location information in the error console.
     eOMIT_LOCATION,
     // Get location information from the currently executing script.
     eUSE_CALLING_LOCATION
   };
   static nsresult ReportToConsoleNonLocalized(
       const nsAString& aErrorText, uint32_t aErrorFlags,
       const nsACString& aCategory, const Document* aDocument,
-      nsIURI* aURI = nullptr, const nsString& aSourceLine = EmptyString(),
+      nsIURI* aURI = nullptr, const nsString& aSourceLine = u""_ns,
       uint32_t aLineNumber = 0, uint32_t aColumnNumber = 0,
       MissingErrorLocationMode aLocationMode = eUSE_CALLING_LOCATION);
 
   /**
    * Report a non-localized error message to the error console base on the
    * innerWindowID.
    *   @param aErrorText the error message
    *   @param aErrorFlags See nsIScriptError.
    *   @param aCategory Name of module reporting error.
    *   @param [aInnerWindowID] Inner window ID for document which triggered the
    *          message.
    *   @param [aURI=nullptr] (Optional) URI of resource containing error.
-   *   @param [aSourceLine=EmptyString()] (Optional) The text of the line that
+   *   @param [aSourceLine=u""_ns] (Optional) The text of the line that
               contains the error (may be empty).
    *   @param [aLineNumber=0] (Optional) Line number within resource
               containing error.
    *   @param [aColumnNumber=0] (Optional) Column number within resource
               containing error.
               If aURI is null, then aDocument->GetDocumentURI() is used.
    *   @param [aLocationMode] (Optional) Specifies the behavior if
               error location information is omitted.
    */
   static nsresult ReportToConsoleByWindowID(
       const nsAString& aErrorText, uint32_t aErrorFlags,
       const nsACString& aCategory, uint64_t aInnerWindowID,
-      nsIURI* aURI = nullptr, const nsString& aSourceLine = EmptyString(),
+      nsIURI* aURI = nullptr, const nsString& aSourceLine = u""_ns,
       uint32_t aLineNumber = 0, uint32_t aColumnNumber = 0,
       MissingErrorLocationMode aLocationMode = eUSE_CALLING_LOCATION);
 
   /**
    * Report a localized error message to the error console.
    *   @param aErrorFlags See nsIScriptError.
    *   @param aCategory Name of module reporting error.
    *   @param aDocument Reference to the document which triggered the message.
    *   @param aFile Properties file containing localized message.
    *   @param aMessageName Name of localized message.
    *   @param [aParams=empty-array] (Optional) Parameters to be substituted into
               localized message.
    *   @param [aURI=nullptr] (Optional) URI of resource containing error.
-   *   @param [aSourceLine=EmptyString()] (Optional) The text of the line that
+   *   @param [aSourceLine=u""_ns] (Optional) The text of the line that
               contains the error (may be empty).
    *   @param [aLineNumber=0] (Optional) Line number within resource
               containing error.
    *   @param [aColumnNumber=0] (Optional) Column number within resource
               containing error.
               If aURI is null, then aDocument->GetDocumentURI() is used.
    */
   enum PropertiesFile {
@@ -1130,17 +1130,17 @@ class nsContentUtils {
     eFORMS_PROPERTIES_en_US,
     eDOM_PROPERTIES_en_US,
     PropertiesFile_COUNT
   };
   static nsresult ReportToConsole(
       uint32_t aErrorFlags, const nsACString& aCategory,
       const Document* aDocument, PropertiesFile aFile, const char* aMessageName,
       const nsTArray<nsString>& aParams = nsTArray<nsString>(),
-      nsIURI* aURI = nullptr, const nsString& aSourceLine = EmptyString(),
+      nsIURI* aURI = nullptr, const nsString& aSourceLine = u""_ns,
       uint32_t aLineNumber = 0, uint32_t aColumnNumber = 0);
 
   static void ReportEmptyGetElementByIdArg(const Document* aDoc);
 
   static void LogMessageToConsole(const char* aMsg);
 
   static bool SpoofLocaleEnglish();
 
--- a/dom/base/nsCopySupport.cpp
+++ b/dom/base/nsCopySupport.cpp
@@ -616,17 +616,17 @@ static nsresult AppendImagePromise(nsITr
   rv = imgUrl->GetFileExtension(extension);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCString mimeType;
   rv = aImgRequest->GetMimeType(getter_Copies(mimeType));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMIMEInfo> mimeInfo;
-  mimeService->GetFromTypeAndExtension(mimeType, EmptyCString(),
+  mimeService->GetFromTypeAndExtension(mimeType, ""_ns,
                                        getter_AddRefs(mimeInfo));
   NS_ENSURE_TRUE(mimeInfo, NS_OK);
 
   nsAutoCString spec;
   rv = imgUrl->GetSpec(spec);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // pass out the image source string
--- a/dom/base/nsDOMAttributeMap.cpp
+++ b/dom/base/nsDOMAttributeMap.cpp
@@ -119,17 +119,17 @@ Attr* nsDOMAttributeMap::GetAttribute(mo
   nsAttrKey attr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom());
 
   RefPtr<Attr>& entryValue = mAttributeCache.GetOrInsert(attr);
   Attr* node = entryValue;
   if (!node) {
     // Newly inserted entry!
     RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfo;
     auto* nim = ni->NodeInfoManager();
-    entryValue = new (nim) Attr(this, ni.forget(), EmptyString());
+    entryValue = new (nim) Attr(this, ni.forget(), u""_ns);
     node = entryValue;
   }
 
   return node;
 }
 
 Attr* nsDOMAttributeMap::NamedGetter(const nsAString& aAttrName, bool& aFound) {
   aFound = false;
--- a/dom/base/nsDOMDataChannel.cpp
+++ b/dom/base/nsDOMDataChannel.cpp
@@ -279,17 +279,17 @@ nsresult nsDOMDataChannel::DoOnMessageAv
   }
   JSContext* cx = jsapi.cx();
 
   JS::Rooted<JS::Value> jsData(cx);
 
   if (aBinary) {
     if (mBinaryType == DC_BINARY_TYPE_BLOB) {
       RefPtr<Blob> blob =
-          Blob::CreateStringBlob(GetOwnerGlobal(), aData, EmptyString());
+          Blob::CreateStringBlob(GetOwnerGlobal(), aData, u""_ns);
       if (NS_WARN_IF(!blob)) {
         return NS_ERROR_FAILURE;
       }
 
       if (!ToJSValue(cx, blob, &jsData)) {
         return NS_ERROR_FAILURE;
       }
     } else if (mBinaryType == DC_BINARY_TYPE_ARRAYBUFFER) {
@@ -308,18 +308,18 @@ nsresult nsDOMDataChannel::DoOnMessageAv
     NS_ENSURE_TRUE(jsString, NS_ERROR_FAILURE);
 
     jsData.setString(jsString);
   }
 
   RefPtr<MessageEvent> event = new MessageEvent(this, nullptr, nullptr);
 
   event->InitMessageEvent(nullptr, u"message"_ns, CanBubble::eNo,
-                          Cancelable::eNo, jsData, mOrigin, EmptyString(),
-                          nullptr, Sequence<OwningNonNull<MessagePort>>());
+                          Cancelable::eNo, jsData, mOrigin, u""_ns, nullptr,
+                          Sequence<OwningNonNull<MessagePort>>());
   event->SetTrusted(true);
 
   DC_DEBUG(
       ("%p(%p): %s - Dispatching\n", this, (void*)mDataChannel, __FUNCTION__));
   ErrorResult err;
   DispatchEvent(*event, err);
   if (err.Failed()) {
     DC_ERROR(("%p(%p): %s - Failed to dispatch message", this,
--- a/dom/base/nsDOMSerializer.cpp
+++ b/dom/base/nsDOMSerializer.cpp
@@ -70,18 +70,17 @@ void nsDOMSerializer::SerializeToString(
                                         ErrorResult& aRv) {
   aStr.Truncate();
 
   if (!nsContentUtils::CanCallerAccess(&aRoot)) {
     aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
     return;
   }
 
-  nsCOMPtr<nsIDocumentEncoder> encoder =
-      SetUpEncoder(aRoot, EmptyString(), aRv);
+  nsCOMPtr<nsIDocumentEncoder> encoder = SetUpEncoder(aRoot, u""_ns, aRv);
   if (aRv.Failed()) {
     return;
   }
 
   nsresult rv = encoder->EncodeToString(aStr);
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
   }
--- a/dom/base/nsFrameMessageManager.cpp
+++ b/dom/base/nsFrameMessageManager.cpp
@@ -389,17 +389,17 @@ bool nsFrameMessageManager::GetParamsFor
     nsAutoString filename;
     uint32_t lineno = 0, column = 0;
     nsJSUtils::GetCallingLocation(aCx, filename, &lineno, &column);
     nsCOMPtr<nsIScriptError> error(
         do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
     error->Init(
         u"Sending message that cannot be cloned. Are "
         "you trying to send an XPCOM object?"_ns,
-        filename, EmptyString(), lineno, column, nsIScriptError::warningFlag,
+        filename, u""_ns, lineno, column, nsIScriptError::warningFlag,
         "chrome javascript", false /* from private window */,
         true /* from chrome context */);
     console->LogMessage(error);
   }
 
   // Not clonable, try JSON
   // XXX This is ugly but currently structured cloning doesn't handle
   //    properly cases when interface is implemented in JS and used
@@ -747,19 +747,18 @@ void nsFrameMessageManager::ReceiveMessa
                              u": message reply cannot be cloned. Are "
                              "you trying to send an XPCOM object?");
 
           nsCOMPtr<nsIConsoleService> console(
               do_GetService(NS_CONSOLESERVICE_CONTRACTID));
           if (console) {
             nsCOMPtr<nsIScriptError> error(
                 do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
-            error->Init(msg, EmptyString(), EmptyString(), 0, 0,
-                        nsIScriptError::warningFlag, "chrome javascript",
-                        false /* from private window */,
+            error->Init(msg, u""_ns, u""_ns, 0, 0, nsIScriptError::warningFlag,
+                        "chrome javascript", false /* from private window */,
                         true /* from chrome context */);
             console->LogMessage(error);
           }
 
           JS_ClearPendingException(cx);
           continue;
         }
       }
@@ -993,21 +992,21 @@ void MessageManagerReporter::CountRefere
     RefPtr<nsFrameMessageManager> mm = aMessageManager->mChildManagers[i];
     CountReferents(mm, aReferentCount);
   }
 }
 
 static void ReportReferentCount(
     const char* aManagerType, const MessageManagerReferentCount& aReferentCount,
     nsIHandleReportCallback* aHandleReport, nsISupports* aData) {
-#define REPORT(_path, _amount, _desc)                           \
-  do {                                                          \
-    aHandleReport->Callback(                                    \
-        EmptyCString(), _path, nsIMemoryReporter::KIND_OTHER,   \
-        nsIMemoryReporter::UNITS_COUNT, _amount, _desc, aData); \
+#define REPORT(_path, _amount, _desc)                                       \
+  do {                                                                      \
+    aHandleReport->Callback(""_ns, _path, nsIMemoryReporter::KIND_OTHER,    \
+                            nsIMemoryReporter::UNITS_COUNT, _amount, _desc, \
+                            aData);                                         \
   } while (0)
 
   REPORT(nsPrintfCString("message-manager/referent/%s/strong", aManagerType),
          aReferentCount.mStrong,
          nsPrintfCString("The number of strong referents held by the message "
                          "manager in the %s manager.",
                          aManagerType));
   REPORT(
@@ -1222,17 +1221,17 @@ void nsMessageManagerScriptExecutor::Try
       nsCString buffer;
       uint64_t written;
       if (NS_FAILED(NS_ReadInputStreamToString(input, buffer, -1, &written))) {
         return;
       }
 
       uint32_t size = (uint32_t)std::min(written, (uint64_t)UINT32_MAX);
       ScriptLoader::ConvertToUTF16(channel, (uint8_t*)buffer.get(), size,
-                                   EmptyString(), nullptr, dataStringBuf,
+                                   u""_ns, nullptr, dataStringBuf,
                                    dataStringLength);
     }
 
     if (!dataStringBuf || dataStringLength == 0) {
       return;
     }
 
     JS::UniqueTwoByteChars srcChars(dataStringBuf);
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -3553,17 +3553,17 @@ void nsGlobalWindowInner::Dump(const nsA
     fputs(cstr, fp);
     fflush(fp);
     free(cstr);
   }
 }
 
 void nsGlobalWindowInner::Alert(nsIPrincipal& aSubjectPrincipal,
                                 ErrorResult& aError) {
-  Alert(EmptyString(), aSubjectPrincipal, aError);
+  Alert(u""_ns, aSubjectPrincipal, aError);
 }
 
 void nsGlobalWindowInner::Alert(const nsAString& aMessage,
                                 nsIPrincipal& aSubjectPrincipal,
                                 ErrorResult& aError) {
   FORWARD_TO_OUTER_OR_THROW(AlertOuter, (aMessage, aSubjectPrincipal, aError),
                             aError, );
 }
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -2599,17 +2599,17 @@ void nsGlobalWindowOuter::DispatchDOMWin
     observerService->NotifyObservers(static_cast<nsIDOMWindow*>(this),
                                      principal->IsSystemPrincipal()
                                          ? "chrome-document-global-created"
                                          : "content-document-global-created",
                                      origin.get());
   }
 }
 
-void nsGlobalWindowOuter::ClearStatus() { SetStatusOuter(EmptyString()); }
+void nsGlobalWindowOuter::ClearStatus() { SetStatusOuter(u""_ns); }
 
 void nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) {
   MOZ_ASSERT(aDocShell);
 
   if (aDocShell == mDocShell) {
     return;
   }
 
@@ -5364,17 +5364,17 @@ Nullable<WindowProxyHolder> nsGlobalWind
     MOZ_DIAGNOSTIC_ASSERT(cv);
   } else {
     if (aDocShellToCloneInto) {
       bc = aDocShellToCloneInto->GetBrowsingContext();
     } else {
       AutoNoJSAPI nojsapi;
       auto printKind = aIsPreview == IsPreview::Yes ? PrintKind::PrintPreview
                                                     : PrintKind::Print;
-      aError = OpenInternal(EmptyString(), EmptyString(), EmptyString(),
+      aError = OpenInternal(u""_ns, u""_ns, u""_ns,
                             false,             // aDialog
                             false,             // aContentModal
                             true,              // aCalledNoScript
                             false,             // aDoJSFixups
                             true,              // aNavigate
                             nullptr, nullptr,  // No args
                             nullptr,           // aLoadState
                             false,             // aForceNoOpener
@@ -6034,18 +6034,18 @@ bool nsGlobalWindowOuter::GatherPostMess
   if (!aTargetOrigin.EqualsASCII("/") && !aTargetOrigin.EqualsASCII("*")) {
     nsCOMPtr<nsIURI> targetOriginURI;
     if (NS_FAILED(NS_NewURI(getter_AddRefs(targetOriginURI), aTargetOrigin))) {
       aError.Throw(NS_ERROR_DOM_SYNTAX_ERR);
       return false;
     }
 
     nsresult rv = NS_MutateURI(targetOriginURI)
-                      .SetUserPass(EmptyCString())
-                      .SetPathQueryRef(EmptyCString())
+                      .SetUserPass(""_ns)
+                      .SetPathQueryRef(""_ns)
                       .Finalize(aTargetOriginURI);
     if (NS_FAILED(rv)) {
       return false;
     }
   }
 
   if (!nsContentUtils::IsCallerChrome() && callerInnerWin &&
       callerInnerWin->GetOuterWindowInternal()) {
--- a/dom/base/nsHTMLContentSerializer.cpp
+++ b/dom/base/nsHTMLContentSerializer.cpp
@@ -223,18 +223,18 @@ nsHTMLContentSerializer::AppendElementSt
                      NS_ERROR_OUT_OF_MEMORY);
     }
   }
 
   // Even LI passed above have to go through this
   // for serializing attributes other than "value".
   nsAutoString dummyPrefix;
   NS_ENSURE_TRUE(
-      SerializeHTMLAttributes(aElement, aOriginalElement, dummyPrefix,
-                              EmptyString(), name, ns, *mOutput),
+      SerializeHTMLAttributes(aElement, aOriginalElement, dummyPrefix, u""_ns,
+                              name, ns, *mOutput),
       NS_ERROR_OUT_OF_MEMORY);
 
   NS_ENSURE_TRUE(AppendToString(kGreaterThan, *mOutput),
                  NS_ERROR_OUT_OF_MEMORY);
 
   if (ns == kNameSpaceID_XHTML &&
       (name == nsGkAtoms::script || name == nsGkAtoms::style ||
        name == nsGkAtoms::noscript || name == nsGkAtoms::noframes)) {
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -1515,17 +1515,17 @@ class nsINode : public mozilla::dom::Eve
   void AppendChildToChildList(nsIContent* aKid);
   void InsertChildToChildList(nsIContent* aKid, nsIContent* aNextSibling);
   void DisconnectChild(nsIContent* aKid);
 
  public:
   void LookupPrefix(const nsAString& aNamespace, nsAString& aResult);
   bool IsDefaultNamespace(const nsAString& aNamespaceURI) {
     nsAutoString defaultNamespace;
-    LookupNamespaceURI(EmptyString(), defaultNamespace);
+    LookupNamespaceURI(u""_ns, defaultNamespace);
     return aNamespaceURI.Equals(defaultNamespace);
   }
   void LookupNamespaceURI(const nsAString& aNamespacePrefix,
                           nsAString& aNamespaceURI);
 
   nsIContent* GetNextSibling() const { return mNextSibling; }
   nsIContent* GetPreviousSibling() const;
 
--- a/dom/base/nsPlainTextSerializer.cpp
+++ b/dom/base/nsPlainTextSerializer.cpp
@@ -1083,17 +1083,17 @@ bool nsPlainTextSerializer::MustSuppress
     // Might be nice, eventually, to output just the selected element.
     // Read more in bug 31994.
     return true;
   }
 
   return false;
 }
 
-void nsPlainTextSerializer::DoAddText() { DoAddText(true, EmptyString()); }
+void nsPlainTextSerializer::DoAddText() { DoAddText(true, u""_ns); }
 
 void nsPlainTextSerializer::DoAddText(bool aIsLineBreak,
                                       const nsAString& aText) {
   // If we don't want any output, just return
   if (!DoOutput()) {
     return;
   }
 
--- a/dom/base/nsTreeSanitizer.cpp
+++ b/dom/base/nsTreeSanitizer.cpp
@@ -1213,18 +1213,17 @@ void nsTreeSanitizer::SanitizeAttributes
     // loop again.
     --ac;
     i = ac;  // i will be decremented immediately thanks to the for loop
   }
 
   // If we've got HTML audio or video, add the controls attribute, because
   // otherwise the content is unplayable with scripts removed.
   if (aElement->IsAnyOfHTMLElements(nsGkAtoms::video, nsGkAtoms::audio)) {
-    aElement->SetAttr(kNameSpaceID_None, nsGkAtoms::controls, EmptyString(),
-                      false);
+    aElement->SetAttr(kNameSpaceID_None, nsGkAtoms::controls, u""_ns, false);
   }
 }
 
 bool nsTreeSanitizer::SanitizeURL(mozilla::dom::Element* aElement,
                                   int32_t aNamespace, nsAtom* aLocalName) {
   nsAutoString value;
   aElement->GetAttr(aNamespace, aLocalName, value);
 
--- a/dom/base/nsWindowMemoryReporter.cpp
+++ b/dom/base/nsWindowMemoryReporter.cpp
@@ -178,18 +178,18 @@ static void ReportAmount(const nsCString
                          nsISupports* aData) {
   if (aAmount == 0) {
     return;
   }
 
   nsAutoCString path(aBasePath);
   path += aPathTail;
 
-  aHandleReport->Callback(EmptyCString(), path, aKind, aUnits, aAmount,
-                          aDescription, aData);
+  aHandleReport->Callback(""_ns, path, aKind, aUnits, aAmount, aDescription,
+                          aData);
 }
 
 static void ReportSize(const nsCString& aBasePath, const char* aPathTail,
                        size_t aAmount, const nsCString& aDescription,
                        nsIHandleReportCallback* aHandleReport,
                        nsISupports* aData) {
   ReportAmount(aBasePath, aPathTail, aAmount, aDescription,
                nsIMemoryReporter::KIND_HEAP, nsIMemoryReporter::UNITS_BYTES,
@@ -520,17 +520,17 @@ nsWindowMemoryReporter::CollectReports(n
       continue;
     }
 
     nsAutoCString path;
     path.AppendLiteral("ghost-windows/");
     AppendWindowURI(window, path, aAnonymize);
 
     aHandleReport->Callback(
-        /* process = */ EmptyCString(), path, nsIMemoryReporter::KIND_OTHER,
+        /* process = */ ""_ns, path, nsIMemoryReporter::KIND_OTHER,
         nsIMemoryReporter::UNITS_COUNT,
         /* amount = */ 1,
         /* description = */ "A ghost window."_ns, aData);
   }
 
   // clang-format off
   MOZ_COLLECT_REPORT(
     "ghost-windows", KIND_OTHER, UNITS_COUNT, ghostWindows.Count(),
@@ -560,19 +560,19 @@ nsWindowMemoryReporter::CollectReports(n
   // reporter needs to be passed |windowPaths|.
   xpc::JSReporter::CollectReports(&windowPaths, &topWindowPaths, aHandleReport,
                                   aData, aAnonymize);
 
 #ifdef MOZ_XUL
   nsXULPrototypeCache::CollectMemoryReports(aHandleReport, aData);
 #endif
 
-#define REPORT(_path, _amount, _desc)                                          \
-  aHandleReport->Callback(EmptyCString(), nsLiteralCString(_path), KIND_OTHER, \
-                          UNITS_BYTES, _amount, nsLiteralCString(_desc),       \
+#define REPORT(_path, _amount, _desc)                                    \
+  aHandleReport->Callback(""_ns, nsLiteralCString(_path), KIND_OTHER,    \
+                          UNITS_BYTES, _amount, nsLiteralCString(_desc), \
                           aData);
 
   REPORT("window-objects/dom/element-nodes",
          windowTotalSizes.mDOMElementNodesSize,
          "This is the sum of all windows' 'dom/element-nodes' numbers.");
 
   REPORT("window-objects/dom/text-nodes", windowTotalSizes.mDOMTextNodesSize,
          "This is the sum of all windows' 'dom/text-nodes' numbers.");
--- a/dom/base/nsXHTMLContentSerializer.cpp
+++ b/dom/base/nsXHTMLContentSerializer.cpp
@@ -195,18 +195,17 @@ bool nsXHTMLContentSerializer::Serialize
   }
 
   // If we had to add a new namespace declaration, serialize
   // and push it on the namespace stack
   if (aAddNSAttr) {
     if (aTagPrefix.IsEmpty()) {
       // Serialize default namespace decl
       NS_ENSURE_TRUE(
-          SerializeAttr(EmptyString(), xmlnsStr, aTagNamespaceURI, aStr, true),
-          false);
+          SerializeAttr(u""_ns, xmlnsStr, aTagNamespaceURI, aStr, true), false);
     } else {
       // Serialize namespace decl
       NS_ENSURE_TRUE(
           SerializeAttr(xmlnsStr, aTagPrefix, aTagNamespaceURI, aStr, true),
           false);
     }
     PushNameSpaceDecl(aTagPrefix, aTagNamespaceURI, aOriginalElement);
   }
@@ -681,35 +680,33 @@ bool nsXHTMLContentSerializer::Serialize
     }
     currNode = currNode->GetPreviousSibling();
   }
   // If LI was not having "value", Set the "value" attribute for it.
   // Note that We are at the first LI in the selected range of OL.
   if (offset == 0 && found) {
     // offset = 0 => LI itself has the value attribute and we did not need to
     // traverse back. Just serialize value attribute like other tags.
-    NS_ENSURE_TRUE(
-        SerializeAttr(EmptyString(), u"value"_ns, valueStr, aStr, false),
-        false);
+    NS_ENSURE_TRUE(SerializeAttr(u""_ns, u"value"_ns, valueStr, aStr, false),
+                   false);
   } else if (offset == 1 && !found) {
     /*(offset = 1 && !found) means either LI is the first child node of OL
     and LI is not having "value" attribute.
     In that case we would not like to set "value" attribute to reduce the
     changes.
     */
     // do nothing...
   } else if (offset > 0) {
     // Set value attribute.
     nsAutoString valueStr;
 
     // As serializer needs to use this valueAttr we are creating here,
     valueStr.AppendInt(startVal + offset);
-    NS_ENSURE_TRUE(
-        SerializeAttr(EmptyString(), u"value"_ns, valueStr, aStr, false),
-        false);
+    NS_ENSURE_TRUE(SerializeAttr(u""_ns, u"value"_ns, valueStr, aStr, false),
+                   false);
   }
 
   return true;
 }
 
 bool nsXHTMLContentSerializer::IsFirstChildOfOL(nsIContent* aElement) {
   nsIContent* parent = aElement->GetParent();
   if (parent && parent->NodeName().LowerCaseEqualsLiteral("ol")) {
--- a/dom/base/nsXMLContentSerializer.cpp
+++ b/dom/base/nsXMLContentSerializer.cpp
@@ -712,17 +712,17 @@ uint32_t nsXMLContentSerializer::ScanNam
           // must declare the default namespace. We just found an xmlns
           // attribute that declares the default namespace to something
           // non-empty. We're going to ignore this attribute, for children we
           // will detect that we need to add it again and attributes aren't
           // affected by the default namespace.
           skipAttr = index;
         } else {
           // Default NS attribute does not have prefix (and the name is "xmlns")
-          PushNameSpaceDecl(EmptyString(), uriStr, aOriginalElement);
+          PushNameSpaceDecl(u""_ns, uriStr, aOriginalElement);
         }
       } else {
         PushNameSpaceDecl(nsDependentAtomString(attrName), uriStr,
                           aOriginalElement);
       }
     }
   }
   return skipAttr;
@@ -765,18 +765,17 @@ bool nsXMLContentSerializer::SerializeAt
   MaybeSerializeIsValue(aElement, aStr);
 
   // If we had to add a new namespace declaration, serialize
   // and push it on the namespace stack
   if (aAddNSAttr) {
     if (aTagPrefix.IsEmpty()) {
       // Serialize default namespace decl
       NS_ENSURE_TRUE(
-          SerializeAttr(EmptyString(), xmlnsStr, aTagNamespaceURI, aStr, true),
-          false);
+          SerializeAttr(u""_ns, xmlnsStr, aTagNamespaceURI, aStr, true), false);
     } else {
       // Serialize namespace decl
       NS_ENSURE_TRUE(
           SerializeAttr(xmlnsStr, aTagPrefix, aTagNamespaceURI, aStr, true),
           false);
     }
     PushNameSpaceDecl(aTagPrefix, aTagNamespaceURI, aOriginalElement);
   }
--- a/dom/bindings/Exceptions.cpp
+++ b/dom/bindings/Exceptions.cpp
@@ -169,17 +169,17 @@ already_AddRefed<Exception> CreateExcept
       }
       return DOMException::Create(aRv, aMessage);
     default:
       break;
   }
 
   // If not, use the default.
   RefPtr<Exception> exception =
-      new Exception(aMessage, aRv, EmptyCString(), nullptr, nullptr);
+      new Exception(aMessage, aRv, ""_ns, nullptr, nullptr);
   return exception.forget();
 }
 
 already_AddRefed<nsIStackFrame> GetCurrentJSStack(int32_t aMaxDepth) {
   // is there a current context available?
   JSContext* cx = nsContentUtils::GetCurrentJSContext();
 
   if (!cx || !js::GetContextRealm(cx)) {
--- a/dom/bindings/Exceptions.h
+++ b/dom/bindings/Exceptions.h
@@ -21,33 +21,32 @@ struct already_AddRefed;
 
 namespace mozilla {
 namespace dom {
 
 class Exception;
 
 // If we're throwing a DOMException and message is empty, the default
 // message for the nsresult in question will be used.
-bool Throw(JSContext* cx, nsresult rv,
-           const nsACString& message = EmptyCString());
+bool Throw(JSContext* cx, nsresult rv, const nsACString& message = ""_ns);
 
 // Create, throw and report an exception to a given window.
 void ThrowAndReport(nsPIDOMWindowInner* aWindow, nsresult aRv);
 
 // Both signatures of ThrowExceptionObject guarantee that an exception is set on
 // aCx before they return.
 void ThrowExceptionObject(JSContext* aCx, Exception* aException);
 
 // Create an exception object for the given nsresult and message. If we're
 // throwing a DOMException and aMessage is empty, the default message for the
 // nsresult in question will be used.
 //
 // This never returns null.
-already_AddRefed<Exception> CreateException(
-    nsresult aRv, const nsACString& aMessage = EmptyCString());
+already_AddRefed<Exception> CreateException(nsresult aRv,
+                                            const nsACString& aMessage = ""_ns);
 
 // aMaxDepth can be used to define a maximal depth for the stack trace. If the
 // value is -1, a default maximal depth will be selected.  Will return null if
 // there is no JS stack right now.
 already_AddRefed<nsIStackFrame> GetCurrentJSStack(int32_t aMaxDepth = -1);
 
 // Internal stuff not intended to be widely used.
 namespace exceptions {
--- a/dom/cache/CacheOpParent.cpp
+++ b/dom/cache/CacheOpParent.cpp
@@ -263,17 +263,17 @@ void CacheOpParent::ProcessCrossOriginRe
       principalInfo.ref().get_ContentPrincipalInfo();
 
   nsAutoCString corp;
   for (auto it = aResponses.cbegin(); it != aResponses.cend(); ++it) {
     if (it->mValue.type() != ResponseType::Opaque &&
         it->mValue.type() != ResponseType::Opaqueredirect) {
       continue;
     }
-    corp.Assign(EmptyCString());
+    corp.Assign(""_ns);
     for (auto headerIt = it->mValue.headers().cbegin();
          headerIt != it->mValue.headers().cend(); ++headerIt) {
       if (headerIt->name().Equals("Cross-Origin-Resource-Policy"_ns)) {
         corp = headerIt->value();
         break;
       }
     }
 
--- a/dom/cache/DBAction.cpp
+++ b/dom/cache/DBAction.cpp
@@ -221,32 +221,30 @@ nsresult OpenDBConnection(const QuotaInf
 
   nsCOMPtr<mozIStorageService> ss =
       do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID);
   if (NS_WARN_IF(!ss)) {
     return NS_ERROR_UNEXPECTED;
   }
 
   nsCOMPtr<mozIStorageConnection> conn;
-  rv = ss->OpenDatabaseWithFileURL(dbFileUrl, EmptyCString(),
-                                   getter_AddRefs(conn));
+  rv = ss->OpenDatabaseWithFileURL(dbFileUrl, ""_ns, getter_AddRefs(conn));
   if (rv == NS_ERROR_FILE_CORRUPTED) {
     NS_WARNING("Cache database corrupted. Recreating empty database.");
 
     conn = nullptr;
 
     // There is nothing else we can do to recover.  Also, this data can
     // be deleted by QuotaManager at any time anyways.
     rv = WipeDatabase(aQuotaInfo, aDBFile);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
-    rv = ss->OpenDatabaseWithFileURL(dbFileUrl, EmptyCString(),
-                                     getter_AddRefs(conn));
+    rv = ss->OpenDatabaseWithFileURL(dbFileUrl, ""_ns, getter_AddRefs(conn));
   }
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // Check the schema to make sure it is not too old.
   int32_t schemaVersion = 0;
   rv = conn->GetSchemaVersion(&schemaVersion);
@@ -255,18 +253,17 @@ nsresult OpenDBConnection(const QuotaInf
   }
   if (schemaVersion > 0 && schemaVersion < db::kFirstShippedSchemaVersion) {
     conn = nullptr;
     rv = WipeDatabase(aQuotaInfo, aDBFile);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
-    rv = ss->OpenDatabaseWithFileURL(dbFileUrl, EmptyCString(),
-                                     getter_AddRefs(conn));
+    rv = ss->OpenDatabaseWithFileURL(dbFileUrl, ""_ns, getter_AddRefs(conn));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
 
   rv = db::InitializeConnection(*conn);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -592,17 +592,17 @@ nsresult InitializeConnection(mozIStorag
   // NOT set PRAGMA encoding to UTF-16.
 
   nsresult rv = aConn.ExecuteSimpleSQL(pragmas);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // Limit fragmentation by growing the database by many pages at once.
-  rv = aConn.SetGrowthIncrement(kGrowthSize, EmptyCString());
+  rv = aConn.SetGrowthIncrement(kGrowthSize, ""_ns);
   if (rv == NS_ERROR_FILE_TOO_BIG) {
     NS_WARNING("Not enough disk space to set sqlite growth increment.");
     rv = NS_OK;
   }
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
--- a/dom/cache/ReadStream.cpp
+++ b/dom/cache/ReadStream.cpp
@@ -481,17 +481,17 @@ void ReadStream::Inner::MaybeAbortAsyncO
   OpenStreamFailed();
   mCondVar.NotifyAll();
 }
 
 void ReadStream::Inner::OpenStreamFailed() {
   MOZ_DIAGNOSTIC_ASSERT(!mStream);
   MOZ_DIAGNOSTIC_ASSERT(!mSnappyStream);
   mMutex.AssertCurrentThreadOwns();
-  Unused << NS_NewCStringInputStream(getter_AddRefs(mStream), EmptyCString());
+  Unused << NS_NewCStringInputStream(getter_AddRefs(mStream), ""_ns);
   mSnappyStream = mStream;
   mStream->Close();
   NoteClosed();
 }
 
 // ----------------------------------------------------------------------------
 
 NS_IMPL_ISUPPORTS(cache::ReadStream, nsIInputStream, ReadStream);
--- a/dom/cache/TypeUtils.cpp
+++ b/dom/cache/TypeUtils.cpp
@@ -418,17 +418,17 @@ void TypeUtils::ProcessURL(nsACString& a
   if (!aUrlWithoutQueryOut) {
     return;
   }
 
   MOZ_DIAGNOSTIC_ASSERT(aUrlQueryOut);
 
   if (queryLen < 0) {
     *aUrlWithoutQueryOut = aUrl;
-    *aUrlQueryOut = EmptyCString();
+    aUrlQueryOut->Truncate();
     return;
   }
 
   // ParsePath gives us query position relative to the start of the path
   queryPos += pathPos;
 
   *aUrlWithoutQueryOut = Substring(aUrl, 0, queryPos - 1);
   *aUrlQueryOut = Substring(aUrl, queryPos - 1, queryLen + 1);
--- a/dom/clients/manager/ClientInfo.cpp
+++ b/dom/clients/manager/ClientInfo.cpp
@@ -13,20 +13,21 @@ namespace mozilla {
 namespace dom {
 
 using mozilla::ipc::PrincipalInfo;
 using mozilla::ipc::PrincipalInfoToPrincipal;
 
 ClientInfo::ClientInfo(const nsID& aId, ClientType aType,
                        const mozilla::ipc::PrincipalInfo& aPrincipalInfo,
                        const TimeStamp& aCreationTime)
-    : mData(MakeUnique<IPCClientInfo>(
-          aId, mozilla::Nothing(), aType, aPrincipalInfo, aCreationTime,
-          EmptyCString(), mozilla::dom::FrameType::None, mozilla::Nothing(),
-          mozilla::Nothing())) {}
+    : mData(MakeUnique<IPCClientInfo>(aId, mozilla::Nothing(), aType,
+                                      aPrincipalInfo, aCreationTime, ""_ns,
+                                      mozilla::dom::FrameType::None,
+                                      mozilla::Nothing(), mozilla::Nothing())) {
+}
 
 ClientInfo::ClientInfo(const IPCClientInfo& aData)
     : mData(MakeUnique<IPCClientInfo>(aData)) {}
 
 ClientInfo::ClientInfo(const ClientInfo& aRight) { operator=(aRight); }
 
 ClientInfo& ClientInfo::operator=(const ClientInfo& aRight) {
   mData.reset();
--- a/dom/console/ConsoleReportCollector.cpp
+++ b/dom/console/ConsoleReportCollector.cpp
@@ -74,17 +74,17 @@ void ConsoleReportCollector::FlushReport
                                    report.mSourceFileURI.get())
                        .get());
         continue;
       }
     }
 
     nsContentUtils::ReportToConsoleByWindowID(
         errorText, report.mErrorFlags, report.mCategory, aInnerWindowID, uri,
-        EmptyString(), report.mLineNumber, report.mColumnNumber);
+        u""_ns, report.mLineNumber, report.mColumnNumber);
   }
 }
 
 void ConsoleReportCollector::FlushReportsToConsoleForServiceWorkerScope(
     const nsACString& aScope, ReportAction aAction) {
   nsTArray<PendingReport> reports;
 
   {
--- a/dom/events/AsyncEventDispatcher.cpp
+++ b/dom/events/AsyncEventDispatcher.cpp
@@ -21,17 +21,17 @@ using namespace dom;
 
 AsyncEventDispatcher::AsyncEventDispatcher(EventTarget* aTarget,
                                            WidgetEvent& aEvent)
     : CancelableRunnable("AsyncEventDispatcher"),
       mTarget(aTarget),
       mEventMessage(eUnidentifiedEvent) {
   MOZ_ASSERT(mTarget);
   RefPtr<Event> event =
-      EventDispatcher::CreateEvent(aTarget, nullptr, &aEvent, EmptyString());
+      EventDispatcher::CreateEvent(aTarget, nullptr, &aEvent, u""_ns);
   mEvent = std::move(event);
   mEventType.SetIsVoid(true);
   NS_ASSERTION(mEvent, "Should never fail to create an event");
   mEvent->DuplicatePrivateData();
   mEvent->SetTrusted(aEvent.IsTrusted());
 }
 
 NS_IMETHODIMP
--- a/dom/events/CompositionEvent.cpp
+++ b/dom/events/CompositionEvent.cpp
@@ -39,17 +39,17 @@ CompositionEvent::CompositionEvent(Event
 // static
 already_AddRefed<CompositionEvent> CompositionEvent::Constructor(
     const GlobalObject& aGlobal, const nsAString& aType,
     const CompositionEventInit& aParam) {
   nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
   RefPtr<CompositionEvent> e = new CompositionEvent(t, nullptr, nullptr);
   bool trusted = e->Init(t);
   e->InitCompositionEvent(aType, aParam.mBubbles, aParam.mCancelable,
-                          aParam.mView, aParam.mData, EmptyString());
+                          aParam.mView, aParam.mData, u""_ns);
   e->mDetail = aParam.mDetail;
   e->SetTrusted(trusted);
   e->SetComposed(aParam.mComposed);
   return e.forget();
 }
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(CompositionEvent, UIEvent, mRanges)
 
--- a/dom/events/DataTransfer.cpp
+++ b/dom/events/DataTransfer.cpp
@@ -406,17 +406,17 @@ void DataTransfer::ClearData(const Optio
 
   if (MozItemCount() == 0) {
     return;
   }
 
   if (aFormat.WasPassed()) {
     MozClearDataAtHelper(aFormat.Value(), 0, aSubjectPrincipal, aRv);
   } else {
-    MozClearDataAtHelper(EmptyString(), 0, aSubjectPrincipal, aRv);
+    MozClearDataAtHelper(u""_ns, 0, aSubjectPrincipal, aRv);
   }
 }
 
 void DataTransfer::SetMozCursor(const nsAString& aCursorState) {
   // Lock the cursor to an arrow during the drag.
   mCursorState = aCursorState.EqualsLiteral("default");
 }
 
--- a/dom/events/EventDispatcher.cpp
+++ b/dom/events/EventDispatcher.cpp
@@ -1015,18 +1015,18 @@ nsresult EventDispatcher::Dispatch(nsISu
           // Add a profiler label and a profiler marker for the actual
           // dispatch of the event.
           // This is a very hot code path, so we need to make sure not to
           // do this extra work when we're not profiling.
           if (!postVisitor.mDOMEvent) {
             // This is tiny bit slow, but happens only once per event.
             // Similar code also in EventListenerManager.
             nsCOMPtr<EventTarget> et = aEvent->mOriginalTarget;
-            RefPtr<Event> event = EventDispatcher::CreateEvent(
-                et, aPresContext, aEvent, EmptyString());
+            RefPtr<Event> event =
+                EventDispatcher::CreateEvent(et, aPresContext, aEvent, u""_ns);
             event.swap(postVisitor.mDOMEvent);
           }
           nsAutoString typeStr;
           postVisitor.mDOMEvent->GetType(typeStr);
           AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING(
               "EventDispatcher::Dispatch", OTHER, typeStr);
 
           nsCOMPtr<nsIDocShell> docShell;
@@ -1278,17 +1278,17 @@ nsresult EventDispatcher::DispatchDOMEve
   }
   if (aEventType.LowerCaseEqualsLiteral("mutationevent") ||
       aEventType.LowerCaseEqualsLiteral("mutationevents")) {
     return NS_NewDOMMutationEvent(aOwner, aPresContext, nullptr);
   }
   if (aEventType.LowerCaseEqualsLiteral("deviceorientationevent")) {
     DeviceOrientationEventInit init;
     RefPtr<Event> event =
-        DeviceOrientationEvent::Constructor(aOwner, EmptyString(), init);
+        DeviceOrientationEvent::Constructor(aOwner, u""_ns, init);
     event->MarkUninitialized();
     return event.forget();
   }
   if (aEventType.LowerCaseEqualsLiteral("devicemotionevent")) {
     return NS_NewDOMDeviceMotionEvent(aOwner, aPresContext, nullptr);
   }
   if (aEventType.LowerCaseEqualsLiteral("uievent") ||
       aEventType.LowerCaseEqualsLiteral("uievents")) {
@@ -1310,27 +1310,26 @@ nsresult EventDispatcher::DispatchDOMEve
   if (aEventType.LowerCaseEqualsLiteral("touchevent") &&
       TouchEvent::LegacyAPIEnabled(
           nsContentUtils::GetDocShellForEventTarget(aOwner),
           aCallerType == CallerType::System)) {
     return NS_NewDOMTouchEvent(aOwner, aPresContext, nullptr);
   }
   if (aEventType.LowerCaseEqualsLiteral("hashchangeevent")) {
     HashChangeEventInit init;
-    RefPtr<Event> event =
-        HashChangeEvent::Constructor(aOwner, EmptyString(), init);
+    RefPtr<Event> event = HashChangeEvent::Constructor(aOwner, u""_ns, init);
     event->MarkUninitialized();
     return event.forget();
   }
   if (aEventType.LowerCaseEqualsLiteral("customevent")) {
     return NS_NewDOMCustomEvent(aOwner, aPresContext, nullptr);
   }
   if (aEventType.LowerCaseEqualsLiteral("storageevent")) {
     RefPtr<Event> event =
-        StorageEvent::Constructor(aOwner, EmptyString(), StorageEventInit());
+        StorageEvent::Constructor(aOwner, u""_ns, StorageEventInit());
     event->MarkUninitialized();
     return event.forget();
   }
   if (aEventType.LowerCaseEqualsLiteral("focusevent")) {
     RefPtr<Event> event = NS_NewDOMFocusEvent(aOwner, aPresContext, nullptr);
     event->MarkUninitialized();
     return event.forget();
   }
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -812,18 +812,18 @@ nsresult EventListenerManager::SetEventH
     if (cx && !JS::DescribeScriptedCaller(cx, nullptr, &lineNum, &columnNum)) {
       JS_ClearPendingException(cx);
     }
 
     if (csp) {
       bool allowsInlineScript = true;
       rv = csp->GetAllowsInline(
           nsIContentPolicy::TYPE_SCRIPT,
-          EmptyString(),  // aNonce
-          true,  // aParserCreated (true because attribute event handler)
+          u""_ns,  // aNonce
+          true,    // aParserCreated (true because attribute event handler)
           aElement,
           nullptr,  // nsICSPEventListener
           aBody, lineNum, columnNum, &allowsInlineScript);
       NS_ENSURE_SUCCESS(rv, rv);
 
       // return early if CSP wants us to block inline scripts
       if (!allowsInlineScript) {
         return NS_OK;
@@ -1213,18 +1213,18 @@ void EventListenerManager::HandleEventIn
             hasListenerForCurrentGroup ||
             listener->mFlags.mInSystemGroup == aEvent->mFlags.mInSystemGroup;
         if (listener->IsListening(aEvent) &&
             (aEvent->IsTrusted() || listener->mFlags.mAllowUntrustedEvents)) {
           if (!*aDOMEvent) {
             // This is tiny bit slow, but happens only once per event.
             // Similar code also in EventDispatcher.
             nsCOMPtr<EventTarget> et = aEvent->mOriginalTarget;
-            RefPtr<Event> event = EventDispatcher::CreateEvent(
-                et, aPresContext, aEvent, EmptyString());
+            RefPtr<Event> event =
+                EventDispatcher::CreateEvent(et, aPresContext, aEvent, u""_ns);
             event.forget(aDOMEvent);
           }
           if (*aDOMEvent) {
             if (!aEvent->mCurrentTarget) {
               aEvent->mCurrentTarget = aCurrentTarget->GetTargetForDOMEvent();
               if (!aEvent->mCurrentTarget) {
                 break;
               }
--- a/dom/events/InputEvent.cpp
+++ b/dom/events/InputEvent.cpp
@@ -30,17 +30,17 @@ InputEvent::InputEvent(EventTarget* aOwn
 void InputEvent::GetData(nsAString& aData, CallerType aCallerType) {
   InternalEditorInputEvent* editorInputEvent = mEvent->AsEditorInputEvent();
   MOZ_ASSERT(editorInputEvent);
   // If clipboard event is disabled, user may not want to leak clipboard
   // information via DOM events.  If so, we should return empty string instead.
   if (mEvent->IsTrusted() && aCallerType != CallerType::System &&
       !StaticPrefs::dom_event_clipboardevents_enabled() &&
       ExposesClipboardDataOrDataTransfer(editorInputEvent->mInputType)) {
-    aData = editorInputEvent->mData.IsVoid() ? VoidString() : EmptyString();
+    aData = editorInputEvent->mData.IsVoid() ? VoidString() : u""_ns;
     return;
   }
   aData = editorInputEvent->mData;
 }
 
 already_AddRefed<DataTransfer> InputEvent::GetDataTransfer(
     CallerType aCallerType) {
   InternalEditorInputEvent* editorInputEvent = mEvent->AsEditorInputEvent();
@@ -53,17 +53,17 @@ already_AddRefed<DataTransfer> InputEven
   if (mEvent->IsTrusted() && aCallerType != CallerType::System &&
       !StaticPrefs::dom_event_clipboardevents_enabled() &&
       ExposesClipboardDataOrDataTransfer(editorInputEvent->mInputType)) {
     if (!editorInputEvent->mDataTransfer) {
       return nullptr;
     }
     return do_AddRef(
         new DataTransfer(editorInputEvent->mDataTransfer->GetParentObject(),
-                         editorInputEvent->mMessage, EmptyString()));
+                         editorInputEvent->mMessage, u""_ns));
   }
   return do_AddRef(editorInputEvent->mDataTransfer);
 }
 
 void InputEvent::GetInputType(nsAString& aInputType) {
   InternalEditorInputEvent* editorInputEvent = mEvent->AsEditorInputEvent();
   MOZ_ASSERT(editorInputEvent);
   if (editorInputEvent->mInputType == EditorInputType::eUnknown) {
--- a/dom/events/KeyEventHandler.cpp
+++ b/dom/events/KeyEventHandler.cpp
@@ -674,17 +674,17 @@ void KeyEventHandler::ReportKeyConflict(
   aKeyElement->GetAttr(kNameSpaceID_None, nsGkAtoms::id, id);
   AutoTArray<nsString, 3> params;
   params.AppendElement(aKey);
   params.AppendElement(aModifiers);
   params.AppendElement(id);
   nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
                                   "Key Event Handler"_ns, doc,
                                   nsContentUtils::eDOM_PROPERTIES, aMessageName,
-                                  params, nullptr, EmptyString(), 0);
+                                  params, nullptr, u""_ns, 0);
 }
 
 bool KeyEventHandler::ModifiersMatchMask(
     UIEvent* aEvent, const IgnoreModifierState& aIgnoreModifierState) {
   WidgetInputEvent* inputEvent = aEvent->WidgetEventPtr()->AsInputEvent();
   NS_ENSURE_TRUE(inputEvent, false);
 
   if (mKeyMask & cMetaMask) {
--- a/dom/events/TextComposition.cpp
+++ b/dom/events/TextComposition.cpp
@@ -590,18 +590,17 @@ nsresult TextComposition::RequestToCommi
   // If the request is performed synchronously, this must be already destroyed.
   if (Destroyed()) {
     return NS_OK;
   }
 
   // Otherwise, synthesize the commit in content.
   nsAutoString data(aDiscard ? EmptyString() : lastData);
   if (data == mLastData) {
-    DispatchCompositionEventRunnable(eCompositionCommitAsIs, EmptyString(),
-                                     true);
+    DispatchCompositionEventRunnable(eCompositionCommitAsIs, u""_ns, true);
   } else {
     DispatchCompositionEventRunnable(eCompositionCommit, data, true);
   }
   return NS_OK;
 }
 
 nsresult TextComposition::NotifyIME(IMEMessage aMessage) {
   NS_ENSURE_TRUE(mPresContext, NS_ERROR_NOT_AVAILABLE);
--- a/dom/events/WheelEvent.cpp
+++ b/dom/events/WheelEvent.cpp
@@ -86,17 +86,17 @@ already_AddRefed<WheelEvent> WheelEvent:
     const GlobalObject& aGlobal, const nsAString& aType,
     const WheelEventInit& aParam) {
   nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
   RefPtr<WheelEvent> e = new WheelEvent(t, nullptr, nullptr);
   bool trusted = e->Init(t);
   e->InitWheelEvent(aType, aParam.mBubbles, aParam.mCancelable, aParam.mView,
                     aParam.mDetail, aParam.mScreenX, aParam.mScreenY,
                     aParam.mClientX, aParam.mClientY, aParam.mButton,
-                    aParam.mRelatedTarget, EmptyString(), aParam.mDeltaX,
+                    aParam.mRelatedTarget, u""_ns, aParam.mDeltaX,
                     aParam.mDeltaY, aParam.mDeltaZ, aParam.mDeltaMode);
   e->InitializeExtraMouseEventDictionaryMembers(aParam);
   e->SetTrusted(trusted);
   e->SetComposed(aParam.mComposed);
   return e.forget();
 }
 
 }  // namespace dom
--- a/dom/fetch/EmptyBody.cpp
+++ b/dom/fetch/EmptyBody.cpp
@@ -48,17 +48,17 @@ EmptyBody::EmptyBody(nsIGlobalObject* aG
 EmptyBody::~EmptyBody() = default;
 
 /* static */
 already_AddRefed<EmptyBody> EmptyBody::Create(
     nsIGlobalObject* aGlobal, mozilla::ipc::PrincipalInfo* aPrincipalInfo,
     AbortSignalImpl* aAbortSignalImpl, const nsACString& aMimeType,
     ErrorResult& aRv) {
   nsCOMPtr<nsIInputStream> bodyStream;
-  aRv = NS_NewCStringInputStream(getter_AddRefs(bodyStream), EmptyCString());
+  aRv = NS_NewCStringInputStream(getter_AddRefs(bodyStream), ""_ns);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
   RefPtr<EmptyBody> emptyBody = new EmptyBody(
       aGlobal, aPrincipalInfo, aAbortSignalImpl, bodyStream.forget());
   emptyBody->OverrideMimeType(aMimeType);
   return emptyBody.forget();
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -796,18 +796,18 @@ nsresult FetchDriver::HttpFetch(
   NotifyNetworkMonitorAlternateStack(chan, std::move(mOriginStack));
 
   // if the preferred alternative data type in InternalRequest is not empty, set
   // the data type on the created channel and also create a
   // AlternativeDataStreamListener to be the stream listener of the channel.
   if (!aPreferredAlternativeDataType.IsEmpty()) {
     nsCOMPtr<nsICacheInfoChannel> cic = do_QueryInterface(chan);
     if (cic) {
-      cic->PreferAlternativeDataType(aPreferredAlternativeDataType,
-                                     EmptyCString(), true);
+      cic->PreferAlternativeDataType(aPreferredAlternativeDataType, ""_ns,
+                                     true);
       MOZ_ASSERT(!mAltDataListener);
       mAltDataListener = new AlternativeDataStreamListener(
           this, chan, aPreferredAlternativeDataType);
       rv = chan->AsyncOpen(mAltDataListener);
     } else {
       rv = chan->AsyncOpen(this);
     }
   } else {
--- a/dom/fetch/FetchDriver.h
+++ b/dom/fetch/FetchDriver.h
@@ -183,18 +183,17 @@ class FetchDriver final : public nsIStre
   FetchDriver(const FetchDriver&) = delete;
   FetchDriver& operator=(const FetchDriver&) = delete;
   ~FetchDriver();
 
   already_AddRefed<PreloaderBase> FindPreload(nsIURI* aURI);
 
   void UpdateReferrerInfoFromNewChannel(nsIChannel* aChannel);
 
-  nsresult HttpFetch(
-      const nsACString& aPreferredAlternativeDataType = EmptyCString());
+  nsresult HttpFetch(const nsACString& aPreferredAlternativeDataType = ""_ns);
   // Returns the filtered response sent to the observer.
   already_AddRefed<InternalResponse> BeginAndGetFilteredResponse(
       InternalResponse* aResponse, bool aFoundOpaqueRedirect);
   // Utility since not all cases need to do any post processing of the filtered
   // response.
   void FailWithNetworkError(nsresult rv);
 
   void SetRequestHeaders(nsIHttpChannel* aChannel,
--- a/dom/fetch/InternalHeaders.cpp
+++ b/dom/fetch/InternalHeaders.cpp
@@ -384,17 +384,17 @@ bool InternalHeaders::IsImmutable(ErrorR
 bool InternalHeaders::IsForbiddenRequestHeader(const nsCString& aName) const {
   return mGuard == HeadersGuardEnum::Request &&
          nsContentUtils::IsForbiddenRequestHeader(aName);
 }
 
 bool InternalHeaders::IsForbiddenRequestNoCorsHeader(
     const nsCString& aName) const {
   return mGuard == HeadersGuardEnum::Request_no_cors &&
-         !IsSimpleHeader(aName, EmptyCString());
+         !IsSimpleHeader(aName, ""_ns);
 }
 
 bool InternalHeaders::IsForbiddenRequestNoCorsHeader(
     const nsCString& aName, const nsACString& aValue) const {
   return mGuard == HeadersGuardEnum::Request_no_cors &&
          !IsSimpleHeader(aName, aValue);
 }
 
--- a/dom/fetch/InternalHeaders.h
+++ b/dom/fetch/InternalHeaders.h
@@ -131,17 +131,17 @@ class InternalHeaders final {
   bool IsImmutable(ErrorResult& aRv) const;
   bool IsForbiddenRequestHeader(const nsCString& aName) const;
   bool IsForbiddenRequestNoCorsHeader(const nsCString& aName) const;
   bool IsForbiddenRequestNoCorsHeader(const nsCString& aName,
                                       const nsACString& aValue) const;
   bool IsForbiddenResponseHeader(const nsCString& aName) const;
 
   bool IsInvalidMutableHeader(const nsCString& aName, ErrorResult& aRv) const {
-    return IsInvalidMutableHeader(aName, EmptyCString(), aRv);
+    return IsInvalidMutableHeader(aName, ""_ns, aRv);
   }
 
   bool IsInvalidMutableHeader(const nsCString& aName, const nsACString& aValue,
                               ErrorResult& aRv) const {
     return IsInvalidName(aName, aRv) || IsInvalidValue(aValue, aRv) ||
            IsImmutable(aRv) || IsForbiddenRequestHeader(aName) ||
            IsForbiddenRequestNoCorsHeader(aName, aValue) ||
            IsForbiddenResponseHeader(aName);
--- a/dom/fetch/InternalResponse.cpp
+++ b/dom/fetch/InternalResponse.cpp
@@ -320,17 +320,17 @@ already_AddRefed<InternalResponse> Inter
     ref = this;
   }
   return ref.forget();
 }
 
 already_AddRefed<InternalResponse> InternalResponse::OpaqueResponse() {
   MOZ_ASSERT(!mWrappedResponse,
              "Can't OpaqueResponse a already wrapped response");
-  RefPtr<InternalResponse> response = new InternalResponse(0, EmptyCString());
+  RefPtr<InternalResponse> response = new InternalResponse(0, ""_ns);
   response->mType = ResponseType::Opaque;
   response->mChannelInfo = mChannelInfo;
   if (mPrincipalInfo) {
     response->mPrincipalInfo =
         MakeUnique<mozilla::ipc::PrincipalInfo>(*mPrincipalInfo);
   }
   response->mWrappedResponse = this;
   return response.forget();
--- a/dom/fetch/InternalResponse.h
+++ b/dom/fetch/InternalResponse.h
@@ -54,17 +54,17 @@ class InternalResponse final {
     eCloneInputStream,
     eDontCloneInputStream,
   };
 
   already_AddRefed<InternalResponse> Clone(CloneType eCloneType);
 
   static already_AddRefed<InternalResponse> NetworkError(nsresult aRv) {
     MOZ_DIAGNOSTIC_ASSERT(NS_FAILED(aRv));
-    RefPtr<InternalResponse> response = new InternalResponse(0, EmptyCString());
+    RefPtr<InternalResponse> response = new InternalResponse(0, ""_ns);
     ErrorResult result;
     response->Headers()->SetGuard(HeadersGuardEnum::Immutable, result);
     MOZ_ASSERT(!result.Failed());
     response->mType = ResponseType::Error;
     response->mErrorCode = aRv;
     return response.forget();
   }
 
--- a/dom/fetch/Request.cpp
+++ b/dom/fetch/Request.cpp
@@ -220,17 +220,17 @@ void GetRequestURLFromWorker(nsIGlobalOb
   url->GetHash(fragment);
 
   // Note: URL::GetHash() includes the "#" and we want the fragment with out
   // the hash symbol.
   if (!fragment.IsEmpty()) {
     CopyUTF16toUTF8(Substring(fragment, 1), aURLfragment);
   }
 
-  url->SetHash(EmptyString());
+  url->SetHash(u""_ns);
   url->GetHref(aRequestURL);
 }
 
 class ReferrerSameOriginChecker final : public WorkerMainThreadRunnable {
  public:
   ReferrerSameOriginChecker(WorkerPrivate* aWorkerPrivate,
                             const nsAString& aReferrerURL, nsresult& aResult)
       : WorkerMainThreadRunnable(aWorkerPrivate,
--- a/dom/file/BlobSet.cpp
+++ b/dom/file/BlobSet.cpp
@@ -21,17 +21,17 @@ nsresult BlobSet::AppendVoidPtr(const vo
 
   void* data = malloc(aLength);
   if (!data) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   memcpy((char*)data, aData, aLength);
 
-  RefPtr<BlobImpl> blobImpl = new MemoryBlobImpl(data, aLength, EmptyString());
+  RefPtr<BlobImpl> blobImpl = new MemoryBlobImpl(data, aLength, u""_ns);
   return AppendBlobImpl(blobImpl);
 }
 
 nsresult BlobSet::AppendString(const nsAString& aString, bool nativeEOL) {
   nsCString utf8Str;
   if (NS_WARN_IF(!AppendUTF16toUTF8(aString, utf8Str, mozilla::fallible))) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
@@ -41,18 +41,17 @@ nsresult BlobSet::AppendString(const nsA
       utf8Str.ReplaceSubstring("\r\n", "\n");
       utf8Str.ReplaceSubstring("\r", "\n");
     }
 #ifdef XP_WIN
     utf8Str.ReplaceSubstring("\n", "\r\n");
 #endif
   }
 
-  RefPtr<StringBlobImpl> blobImpl =
-      StringBlobImpl::Create(utf8Str, EmptyString());
+  RefPtr<StringBlobImpl> blobImpl = StringBlobImpl::Create(utf8Str, u""_ns);
   return AppendBlobImpl(blobImpl);
 }
 
 nsresult BlobSet::AppendBlobImpl(BlobImpl* aBlobImpl) {
   NS_ENSURE_ARG_POINTER(aBlobImpl);
 
   // If aBlobImpl is a MultipartBlobImpl, let's append the sub-blobImpls
   // instead.
--- a/dom/file/EmptyBlobImpl.cpp
+++ b/dom/file/EmptyBlobImpl.cpp
@@ -20,17 +20,17 @@ already_AddRefed<BlobImpl> EmptyBlobImpl
 
 void EmptyBlobImpl::CreateInputStream(nsIInputStream** aStream,
                                       ErrorResult& aRv) {
   if (NS_WARN_IF(!aStream)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
-  nsresult rv = NS_NewCStringInputStream(aStream, EmptyCString());
+  nsresult rv = NS_NewCStringInputStream(aStream, ""_ns);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     aRv.Throw(rv);
     return;
   }
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/file/FileReader.h
+++ b/dom/file/FileReader.h
@@ -67,30 +67,30 @@ class FileReader final : public DOMEvent
                                                          DOMEventTargetHelper)
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
 
   // WebIDL
   static already_AddRefed<FileReader> Constructor(const GlobalObject& aGlobal);
   void ReadAsArrayBuffer(JSContext* aCx, Blob& aBlob, ErrorResult& aRv) {
-    ReadFileContent(aBlob, EmptyString(), FILE_AS_ARRAYBUFFER, aRv);
+    ReadFileContent(aBlob, u""_ns, FILE_AS_ARRAYBUFFER, aRv);
   }
 
   void ReadAsText(Blob& aBlob, const Optional<nsAString>& aLabel,
                   ErrorResult& aRv) {
     if (aLabel.WasPassed()) {
       ReadFileContent(aBlob, aLabel.Value(), FILE_AS_TEXT, aRv);
     } else {
-      ReadFileContent(aBlob, EmptyString(), FILE_AS_TEXT, aRv);
+      ReadFileContent(aBlob, u""_ns, FILE_AS_TEXT, aRv);
     }
   }
 
   void ReadAsDataURL(Blob& aBlob, ErrorResult& aRv) {
-    ReadFileContent(aBlob, EmptyString(), FILE_AS_DATAURL, aRv);
+    ReadFileContent(aBlob, u""_ns, FILE_AS_DATAURL, aRv);
   }
 
   void Abort();
 
   uint16_t ReadyState() const { return static_cast<uint16_t>(mReadyState); }
 
   DOMException* GetError() const { return mError; }
 
@@ -99,17 +99,17 @@ class FileReader final : public DOMEvent
   IMPL_EVENT_HANDLER(loadstart)
   IMPL_EVENT_HANDLER(progress)
   IMPL_EVENT_HANDLER(load)
   IMPL_EVENT_HANDLER(abort)
   IMPL_EVENT_HANDLER(error)
   IMPL_EVENT_HANDLER(loadend)
 
   void ReadAsBinaryString(Blob& aBlob, ErrorResult& aRv) {
-    ReadFileContent(aBlob, EmptyString(), FILE_AS_BINARY, aRv);
+    ReadFileContent(aBlob, u""_ns, FILE_AS_BINARY, aRv);
   }
 
   enum eDataFormat {
     FILE_AS_ARRAYBUFFER,
     FILE_AS_BINARY,
     FILE_AS_TEXT,
     FILE_AS_DATAURL
   };
--- a/dom/file/MultipartBlobImpl.cpp
+++ b/dom/file/MultipartBlobImpl.cpp
@@ -50,17 +50,17 @@ already_AddRefed<MultipartBlobImpl> Mult
 }
 
 void MultipartBlobImpl::CreateInputStream(nsIInputStream** aStream,
                                           ErrorResult& aRv) {
   *aStream = nullptr;
 
   uint32_t length = mBlobImpls.Length();
   if (length == 0 || mLength == 0) {
-    aRv = NS_NewCStringInputStream(aStream, EmptyCString());
+    aRv = NS_NewCStringInputStream(aStream, ""_ns);
     return;
   }
 
   if (length == 1) {
     BlobImpl* blobImpl = mBlobImpls.ElementAt(0);
     blobImpl->CreateInputStream(aStream, aRv);
     return;
   }
--- a/dom/file/MultipartBlobImpl.h
+++ b/dom/file/MultipartBlobImpl.h
@@ -34,22 +34,22 @@ class MultipartBlobImpl final : public B
 
   // Create as a blob
   static already_AddRefed<MultipartBlobImpl> Create(
       nsTArray<RefPtr<BlobImpl>>&& aBlobImpls, const nsAString& aContentType,
       ErrorResult& aRv);
 
   // Create as a file to be later initialized
   explicit MultipartBlobImpl(const nsAString& aName)
-      : BaseBlobImpl(aName, EmptyString(), MULTIPARTBLOBIMPL_UNKNOWN_LENGTH,
+      : BaseBlobImpl(aName, u""_ns, MULTIPARTBLOBIMPL_UNKNOWN_LENGTH,
                      MULTIPARTBLOBIMPL_UNKNOWN_LAST_MODIFIED) {}
 
   // Create as a blob to be later initialized
   MultipartBlobImpl()
-      : BaseBlobImpl(EmptyString(), MULTIPARTBLOBIMPL_UNKNOWN_LENGTH) {}
+      : BaseBlobImpl(u""_ns, MULTIPARTBLOBIMPL_UNKNOWN_LENGTH) {}
 
   void InitializeBlob(bool aCrossOriginIsolated, ErrorResult& aRv);
 
   void InitializeBlob(const Sequence<Blob::BlobPart>& aData,
                       const nsAString& aContentType, bool aNativeEOL,
                       bool aCrossOriginIsolated, ErrorResult& aRv);
 
   already_AddRefed<BlobImpl> CreateSlice(uint64_t aStart, uint64_t aLength,
--- a/dom/file/TemporaryFileBlobImpl.cpp
+++ b/dom/file/TemporaryFileBlobImpl.cpp
@@ -91,17 +91,17 @@ class TemporaryFileInputStream final : p
 
   nsCOMPtr<nsIFile> mFile;
 };
 
 }  // namespace
 
 TemporaryFileBlobImpl::TemporaryFileBlobImpl(nsIFile* aFile,
                                              const nsAString& aContentType)
-    : FileBlobImpl(aFile, EmptyString(), aContentType)
+    : FileBlobImpl(aFile, u""_ns, aContentType)
 #ifdef DEBUG
       ,
       mInputStreamCreated(false)
 #endif
 {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   // This must be considered a blob.
--- a/dom/file/ipc/FileCreatorParent.cpp
+++ b/dom/file/ipc/FileCreatorParent.cpp
@@ -122,17 +122,17 @@ nsresult FileCreatorParent::CreateBlobIm
     impl->SetType(aType);
   }
 
   if (aLastModifiedPassed) {
     impl->SetLastModified(aLastModified);
   }
 
   if (!aIsFromNsIFile) {
-    impl->SetMozFullPath(EmptyString());
+    impl->SetMozFullPath(u""_ns);
   }
 
   impl.forget(aBlobImpl);
   return NS_OK;
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/file/ipc/RemoteLazyInputStream.cpp
+++ b/dom/file/ipc/RemoteLazyInputStream.cpp
@@ -350,17 +350,17 @@ RemoteLazyInputStream::CloneWithRange(ui
   MutexAutoLock lock(mMutex);
 
   if (mState == eClosed) {
     return NS_BASE_STREAM_CLOSED;
   }
 
   // Too short or out of range.
   if (aLength == 0 || aStart >= mLength) {
-    return NS_NewCStringInputStream(aResult, EmptyCString());
+    return NS_NewCStringInputStream(aResult, ""_ns);
   }
 
   MOZ_ASSERT(mActor);
 
   RefPtr<RemoteLazyInputStream> stream = mActor->CreateStream();
   if (!stream) {
     return NS_ERROR_FAILURE;
   }
--- a/dom/file/uri/BlobURLProtocolHandler.cpp
+++ b/dom/file/uri/BlobURLProtocolHandler.cpp
@@ -253,37 +253,36 @@ class BlobURLsReporter final : public ns
             specialDesc += " them in this report.";
           }
         }
 
         const nsACString& descString =
             specialDesc.IsEmpty() ? static_cast<const nsACString&>(desc)
                                   : static_cast<const nsACString&>(specialDesc);
         if (isMemoryFile) {
-          aCallback->Callback(EmptyCString(), path, KIND_OTHER, UNITS_BYTES,
+          aCallback->Callback(""_ns, path, KIND_OTHER, UNITS_BYTES,
                               size / refCount, descString, aData);
         } else {
-          aCallback->Callback(EmptyCString(), path, KIND_OTHER, UNITS_COUNT, 1,
+          aCallback->Callback(""_ns, path, KIND_OTHER, UNITS_COUNT, 1,
                               descString, aData);
         }
         continue;
       }
 
       // Just report the path for the MediaSource.
       nsAutoCString path;
       path = "media-source-urls/";
       BuildPath(path, key, info, aAnonymize);
 
       constexpr auto desc =
           "An object URL allocated with URL.createObjectURL; the referenced "
           "data cannot be freed until all URLs for it have been explicitly "
           "invalidated with URL.revokeObjectURL."_ns;
 
-      aCallback->Callback(EmptyCString(), path, KIND_OTHER, UNITS_COUNT, 1,
-                          desc, aData);
+      aCallback->Callback(""_ns, path, KIND_OTHER, UNITS_COUNT, 1, desc, aData);
     }
 
     return NS_OK;
   }
 
   // Initialize info->mStack to record JS stack info, if enabled.
   // The string generated here is used in ReportCallback, below.
   static void GetJSStackForBlob(DataInfo* aInfo) {
--- a/dom/filesystem/compat/FileSystemDirectoryEntry.h
+++ b/dom/filesystem/compat/FileSystemDirectoryEntry.h
@@ -37,25 +37,25 @@ class FileSystemDirectoryEntry : public 
                            ErrorResult& aRv) const override;
 
   virtual already_AddRefed<FileSystemDirectoryReader> CreateReader();
 
   void GetFile(
       const Optional<nsAString>& aPath, const FileSystemFlags& aFlag,
       const Optional<OwningNonNull<FileSystemEntryCallback>>& aSuccessCallback,
       const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) {
-    GetInternal(aPath.WasPassed() ? aPath.Value() : EmptyString(), aFlag,
+    GetInternal(aPath.WasPassed() ? aPath.Value() : u""_ns, aFlag,
                 aSuccessCallback, aErrorCallback, eGetFile);
   }
 
   void GetDirectory(
       const Optional<nsAString>& aPath, const FileSystemFlags& aFlag,
       const Optional<OwningNonNull<FileSystemEntryCallback>>& aSuccessCallback,
       const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) {
-    GetInternal(aPath.WasPassed() ? aPath.Value() : EmptyString(), aFlag,
+    GetInternal(aPath.WasPassed() ? aPath.Value() : u""_ns, aFlag,
                 aSuccessCallback, aErrorCallback, eGetDirectory);
   }
 
   enum GetInternalType { eGetFile, eGetDirectory };
 
   virtual void GetInternal(
       const nsAString& aPath, const FileSystemFlags& aFlag,
       const Optional<OwningNonNull<FileSystemEntryCallback>>& aSuccessCallback,
--- a/dom/html/HTMLAnchorElement.h
+++ b/dom/html/HTMLAnchorElement.h
@@ -97,17 +97,17 @@ class HTMLAnchorElement final : public n
   void GetRel(DOMString& aValue) { GetHTMLAttr(nsGkAtoms::rel, aValue); }
   void SetRel(const nsAString& aValue, mozilla::ErrorResult& rv) {
     SetHTMLAttr(nsGkAtoms::rel, aValue, rv);
   }
   void SetReferrerPolicy(const nsAString& aValue, mozilla::ErrorResult& rv) {
     SetHTMLAttr(nsGkAtoms::referrerpolicy, aValue, rv);
   }
   void GetReferrerPolicy(DOMString& aPolicy) {
-    GetEnumAttr(nsGkAtoms::referrerpolicy, EmptyCString().get(), aPolicy);
+    GetEnumAttr(nsGkAtoms::referrerpolicy, "", aPolicy);
   }
   nsDOMTokenList* RelList();
   void GetHreflang(DOMString& aValue) {
     GetHTMLAttr(nsGkAtoms::hreflang, aValue);
   }
   void SetHreflang(const nsAString& aValue, mozilla::ErrorResult& rv) {
     SetHTMLAttr(nsGkAtoms::hreflang, aValue, rv);
   }
--- a/dom/html/HTMLAreaElement.h
+++ b/dom/html/HTMLAreaElement.h
@@ -98,17 +98,17 @@ class HTMLAreaElement final : public nsG
     SetHTMLAttr(nsGkAtoms::rel, aRel, aError);
   }
   nsDOMTokenList* RelList();
 
   void SetReferrerPolicy(const nsAString& aValue, mozilla::ErrorResult& rv) {
     SetHTMLAttr(nsGkAtoms::referrerpolicy, aValue, rv);
   }
   void GetReferrerPolicy(nsAString& aReferrer) {
-    GetEnumAttr(nsGkAtoms::referrerpolicy, EmptyCString().get(), aReferrer);
+    GetEnumAttr(nsGkAtoms::referrerpolicy, "", aReferrer);
   }
 
   // The Link::GetOrigin is OK for us
 
   // Link::Link::GetProtocol is OK for us
   // Link::Link::SetProtocol is OK for us
 
   // The Link::GetUsername is OK for us
--- a/dom/html/HTMLCanvasElement.cpp
+++ b/dom/html/HTMLCanvasElement.cpp
@@ -762,17 +762,17 @@ nsresult HTMLCanvasElement::ToDataURLImp
 
   nsCOMPtr<nsIInputStream> stream;
   rv =
       ExtractData(aCx, aSubjectPrincipal, type, params, getter_AddRefs(stream));
 
   // If there are unrecognized custom parse options, we should fall back to
   // the default values for the encoder without any options at all.
   if (rv == NS_ERROR_INVALID_ARG && usingCustomParseOptions) {
-    rv = ExtractData(aCx, aSubjectPrincipal, type, EmptyString(),
+    rv = ExtractData(aCx, aSubjectPrincipal, type, u""_ns,
                      getter_AddRefs(stream));
   }
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   // build data URL string
   aDataURL = u"data:"_ns + type + u";base64,"_ns;
 
@@ -880,17 +880,17 @@ already_AddRefed<File> HTMLCanvasElement
 nsresult HTMLCanvasElement::MozGetAsFileImpl(const nsAString& aName,
                                              const nsAString& aType,
                                              nsIPrincipal& aSubjectPrincipal,
                                              File** aResult) {
   nsCOMPtr<nsIInputStream> stream;
   nsAutoString type(aType);
   nsresult rv =
       ExtractData(nsContentUtils::GetCurrentJSContext(), aSubjectPrincipal,
-                  type, EmptyString(), getter_AddRefs(stream));
+                  type, u""_ns, getter_AddRefs(stream));
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint64_t imgSize;
   void* imgData = nullptr;
   rv = NS_ReadInputStreamToBuffer(stream, &imgData, -1, &imgSize);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsPIDOMWindowInner> win =
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -1716,20 +1716,20 @@ nsresult HTMLFormElement::GetActionURL(n
     // let's log a message to the console that we are upgrading a request
     nsAutoCString scheme;
     rv = actionURL->GetScheme(scheme);
     NS_ENSURE_SUCCESS(rv, rv);
     CopyUTF8toUTF16(scheme, *params.AppendElement());
 
     CSP_LogLocalizedStr(
         "upgradeInsecureRequest", params,
-        EmptyString(),  // aSourceFile
-        EmptyString(),  // aScriptSample
-        0,              // aLineNumber
-        0,              // aColumnNumber
+        u""_ns,  // aSourceFile
+        u""_ns,  // aScriptSample
+        0,       // aLineNumber
+        0,       // aColumnNumber
         nsIScriptError::warningFlag, "upgradeInsecureRequest"_ns,
         document->InnerWindowID(),
         !!document->NodePrincipal()->OriginAttributesRef().mPrivateBrowsingId);
   }
 
   //
   // Assign to the output
   //
@@ -2108,17 +2108,17 @@ HTMLFormElement::WalkRadioGroup(const ns
     nsCOMPtr<nsIFormControl> control;
     uint32_t len = GetElementCount();
     for (uint32_t i = 0; i < len; i++) {
       control = GetElementAt(i);
       if (control->ControlType() == NS_FORM_INPUT_RADIO) {
         nsCOMPtr<Element> controlElement = do_QueryInterface(control);
         if (controlElement &&
             controlElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
-                                        EmptyString(), eCaseMatters) &&
+                                        u""_ns, eCaseMatters) &&
             !aVisitor->Visit(control)) {
           break;
         }
       }
     }
     return NS_OK;
   }
 
--- a/dom/html/HTMLIFrameElement.h
+++ b/dom/html/HTMLIFrameElement.h
@@ -134,17 +134,17 @@ class HTMLIFrameElement final : public n
   }
   void SetMarginHeight(const nsAString& aMarginHeight, ErrorResult& aError) {
     SetHTMLAttr(nsGkAtoms::marginheight, aMarginHeight, aError);
   }
   void SetReferrerPolicy(const nsAString& aReferrer, ErrorResult& aError) {
     SetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer, aError);
   }
   void GetReferrerPolicy(nsAString& aReferrer) {
-    GetEnumAttr(nsGkAtoms::referrerpolicy, EmptyCString().get(), aReferrer);
+    GetEnumAttr(nsGkAtoms::referrerpolicy, "", aReferrer);
   }
   Document* GetSVGDocument(nsIPrincipal& aSubjectPrincipal) {
     return GetContentDocument(aSubjectPrincipal);
   }
   bool Mozbrowser() const { return GetBoolAttr(nsGkAtoms::mozbrowser); }
   void SetMozbrowser(bool aAllow, ErrorResult& aError) {
     SetHTMLBoolAttr(nsGkAtoms::mozbrowser, aAllow, aError);
   }
--- a/dom/html/HTMLImageElement.h
+++ b/dom/html/HTMLImageElement.h
@@ -171,17 +171,17 @@ class HTMLImageElement final : public ns
   }
   void SetBorder(const nsAString& aBorder, ErrorResult& aError) {
     SetHTMLAttr(nsGkAtoms::border, aBorder, aError);
   }
   void SetReferrerPolicy(const nsAString& aReferrer, ErrorResult& aError) {
     SetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer, aError);
   }
   void GetReferrerPolicy(nsAString& aReferrer) {
-    GetEnumAttr(nsGkAtoms::referrerpolicy, EmptyCString().get(), aReferrer);
+    GetEnumAttr(nsGkAtoms::referrerpolicy, "", aReferrer);
   }
   void SetDecoding(const nsAString& aDecoding, ErrorResult& aError) {
     SetHTMLAttr(nsGkAtoms::decoding, aDecoding, aError);
   }
   void GetDecoding(nsAString& aValue);
 
   enum class Loading : uint8_t {
     Eager,
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -1619,17 +1619,17 @@ nsGenericHTMLElement* HTMLInputElement::
 
   return static_cast<nsGenericHTMLElement*>(element);
 }
 
 void HTMLInputElement::SetValue(Decimal aValue, CallerType aCallerType) {
   MOZ_ASSERT(!aValue.isInfinity(), "aValue must not be Infinity!");
 
   if (aValue.isNaN()) {
-    SetValue(EmptyString(), aCallerType, IgnoreErrors());
+    SetValue(u""_ns, aCallerType, IgnoreErrors());
     return;
   }
 
   nsAutoString value;
   mInputType->ConvertNumberToString(aValue, value);
   SetValue(value, aCallerType, IgnoreErrors());
 }
 
@@ -1747,31 +1747,31 @@ void HTMLInputElement::SetValueAsDate(JS
   } else {
     milliseconds = UnspecifiedNaN<double>();
   }
 
   // At this point we know we're not a file input, so we can just pass "not
   // system" as the caller type, since the caller type only matters in the file
   // input case.
   if (IsNaN(milliseconds)) {
-    SetValue(EmptyString(), CallerType::NonSystem, aRv);
+    SetValue(u""_ns, CallerType::NonSystem, aRv);
     return;
   }
 
   if (mType != NS_FORM_INPUT_MONTH) {
     SetValue(Decimal::fromDouble(milliseconds), CallerType::NonSystem);
     return;
   }
 
   // type=month expects the value to be number of months.
   double year = JS::YearFromTime(milliseconds);
   double month = JS::MonthFromTime(milliseconds);
 
   if (IsNaN(year) || IsNaN(month)) {
-    SetValue(EmptyString(), CallerType::NonSystem, aRv);
+    SetValue(u""_ns, CallerType::NonSystem, aRv);
     return;
   }
 
   int32_t months = MonthsSinceJan1970(year, month + 1);
   SetValue(Decimal(int32_t(months)), CallerType::NonSystem);
 }
 
 void HTMLInputElement::SetValueAsNumber(double aValueAsNumber,
@@ -3038,17 +3038,17 @@ bool HTMLInputElement::DispatchSelectEve
   // returning false)
   return (status == nsEventStatus_eIgnore);
 }
 
 void HTMLInputElement::SelectAll(nsPresContext* aPresContext) {
   nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
 
   if (formControlFrame) {
-    formControlFrame->SetFormProperty(nsGkAtoms::select, EmptyString());
+    formControlFrame->SetFormProperty(nsGkAtoms::select, u""_ns);
   }
 }
 
 bool HTMLInputElement::NeedToInitializeEditorForEvent(
     EventChainPreVisitor& aVisitor) const {
   // We only need to initialize the editor for single line input controls
   // because they are lazily initialized.  We don't need to initialize the
   // control for certain types of events, because we know that those events are
@@ -6737,20 +6737,20 @@ void HTMLInputElement::SetFilePickerFilt
         continue;
       }
       extensionListStr = u"*"_ns + token;
       filterName = extensionListStr;
       atLeastOneFileExtensionFilter = true;
     } else {
       //... if no image/audio/video filter is found, check mime types filters
       nsCOMPtr<nsIMIMEInfo> mimeInfo;
-      if (NS_FAILED(mimeService->GetFromTypeAndExtension(
-              NS_ConvertUTF16toUTF8(token),
-              EmptyCString(),  // No extension
-              getter_AddRefs(mimeInfo))) ||
+      if (NS_FAILED(
+              mimeService->GetFromTypeAndExtension(NS_ConvertUTF16toUTF8(token),
+                                                   ""_ns,  // No extension
+                                                   getter_AddRefs(mimeInfo))) ||
           !mimeInfo) {
         allMimeTypeFiltersAreValid = false;
         continue;
       }
 
       // Get a name for the filter: first try the description, then the mime
       // type name if there is no description
       mimeInfo->GetDescription(filterName);
--- a/dom/html/HTMLLinkElement.cpp
+++ b/dom/html/HTMLLinkElement.cpp
@@ -486,17 +486,17 @@ void HTMLLinkElement::AddSizeOfExcluding
 }
 
 JSObject* HTMLLinkElement::WrapNode(JSContext* aCx,
                                     JS::Handle<JSObject*> aGivenProto) {
   return HTMLLinkElement_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 void HTMLLinkElement::GetAs(nsAString& aResult) {
-  GetEnumAttr(nsGkAtoms::as, EmptyCString().get(), aResult);
+  GetEnumAttr(nsGkAtoms::as, "", aResult);
 }
 
 static const nsAttrValue::EnumTable kAsAttributeTable[] = {
     {"", DESTINATION_INVALID},      {"audio", DESTINATION_AUDIO},
     {"font", DESTINATION_FONT},     {"image", DESTINATION_IMAGE},
     {"script", DESTINATION_SCRIPT}, {"style", DESTINATION_STYLE},
     {"track", DESTINATION_TRACK},   {"video", DESTINATION_VIDEO},
     {"fetch", DESTINATION_FETCH},   {nullptr, 0}};
@@ -693,33 +693,29 @@ void HTMLLinkElement::UpdatePreload(nsAt
     } else {
       oldPolicyType = nsIContentPolicy::TYPE_INVALID;
     }
   } else if (aName == nsGkAtoms::type) {
     nsAutoString oldType;
     nsAutoString notUsed;
     if (aOldValue) {
       aOldValue->ToString(oldType);
-    } else {
-      oldType = EmptyString();
     }
     nsAutoString oldMimeType;
     nsContentUtils::SplitMimeType(oldType, oldMimeType, notUsed);
     if (CheckPreloadAttrs(asAttr, oldMimeType, media, OwnerDoc())) {
       oldPolicyType = asPolicyType;
     } else {
       oldPolicyType = nsIContentPolicy::TYPE_INVALID;
     }
   } else {
     MOZ_ASSERT(aName == nsGkAtoms::media);
     nsAutoString oldMedia;
     if (aOldValue) {
       aOldValue->ToString(oldMedia);
-    } else {
-      oldMedia = EmptyString();
     }
     if (CheckPreloadAttrs(asAttr, mimeType, oldMedia, OwnerDoc())) {
       oldPolicyType = asPolicyType;
     } else {
       oldPolicyType = nsIContentPolicy::TYPE_INVALID;
     }
   }
 
--- a/dom/html/HTMLLinkElement.h
+++ b/dom/html/HTMLLinkElement.h
@@ -155,17 +155,17 @@ class HTMLLinkElement final : public nsG
   }
   void SetIntegrity(const nsAString& aIntegrity, ErrorResult& aRv) {
     SetHTMLAttr(nsGkAtoms::integrity, aIntegrity, aRv);
   }
   void SetReferrerPolicy(const nsAString& aReferrer, ErrorResult& aError) {
     SetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer, aError);
   }
   void GetReferrerPolicy(nsAString& aReferrer) {
-    GetEnumAttr(nsGkAtoms::referrerpolicy, EmptyCString().get(), aReferrer);
+    GetEnumAttr(nsGkAtoms::referrerpolicy, "", aReferrer);
   }
   void GetImageSrcset(nsAString& aImageSrcset) {
     GetHTMLAttr(nsGkAtoms::imagesrcset, aImageSrcset);
   }
   void SetImageSrcset(const nsAString& aImageSrcset, ErrorResult& aError) {
     SetHTMLAttr(nsGkAtoms::imagesrcset, aImageSrcset, aError);
   }
   void GetImageSizes(nsAString& aImageSizes) {
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -5381,28 +5381,28 @@ void HTMLMediaElement::EndSrcMediaStream
 static already_AddRefed<AudioTrack> CreateAudioTrack(
     AudioStreamTrack* aStreamTrack, nsIGlobalObject* aOwnerGlobal) {
   nsAutoString id;
   nsAutoString label;
   aStreamTrack->GetId(id);
   aStreamTrack->GetLabel(label, CallerType::System);
 
   return MediaTrackList::CreateAudioTrack(aOwnerGlobal, id, u"main"_ns, label,
-                                          EmptyString(), true, aStreamTrack);
+                                          u""_ns, true, aStreamTrack);
 }
 
 static already_AddRefed<VideoTrack> CreateVideoTrack(
     VideoStreamTrack* aStreamTrack, nsIGlobalObject* aOwnerGlobal) {
   nsAutoString id;
   nsAutoString label;
   aStreamTrack->GetId(id);
   aStreamTrack->GetLabel(label, CallerType::System);
 
   return MediaTrackList::CreateVideoTrack(aOwnerGlobal, id, u"main"_ns, label,
-                                          EmptyString(), aStreamTrack);
+                                          u""_ns, aStreamTrack);
 }
 
 void HTMLMediaElement::NotifyMediaStreamTrackAdded(
     const RefPtr<MediaStreamTrack>& aTrack) {
   MOZ_ASSERT(aTrack);
 
   if (aTrack->Ended()) {
     return;
@@ -6770,17 +6770,17 @@ void HTMLMediaElement::SetRequestHeaders
   SetAcceptHeader(aChannel);
 
   // Apache doesn't send Content-Length when gzip transfer encoding is used,
   // which prevents us from estimating the video length (if explicit
   // Content-Duration and a length spec in the container are not present either)
   // and from seeking. So, disable the standard "Accept-Encoding: gzip,deflate"
   // that we usually send. See bug 614760.
   DebugOnly<nsresult> rv =
-      aChannel->SetRequestHeader("Accept-Encoding"_ns, EmptyCString(), false);
+      aChannel->SetRequestHeader("Accept-Encoding"_ns, ""_ns, false);
   MOZ_ASSERT(NS_SUCCEEDED(rv));
 
   // Set the Referrer header
   //
   // FIXME: Shouldn't this use the Element constructor? Though I guess it
   // doesn't matter as no HTMLMediaElement supports the referrerinfo attribute.
   auto referrerInfo = MakeRefPtr<ReferrerInfo>(*OwnerDoc());
   rv = aChannel->SetReferrerInfoWithoutClone(referrerInfo);
--- a/dom/html/HTMLMenuElement.cpp
+++ b/dom/html/HTMLMenuElement.cpp
@@ -73,17 +73,17 @@ already_AddRefed<nsIMenuBuilder> HTMLMen
   return builder.forget();
 }
 
 void HTMLMenuElement::Build(nsIMenuBuilder* aBuilder) {
   if (!aBuilder) {
     return;
   }
 
-  BuildSubmenu(EmptyString(), this, aBuilder);
+  BuildSubmenu(u""_ns, this, aBuilder);
 }
 
 nsresult HTMLMenuElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
                                        const nsAttrValue* aValue,
                                        const nsAttrValue* aOldValue,
                                        nsIPrincipal* aSubjectPrincipal,
                                        bool aNotify) {
   if (aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::type) {
--- a/dom/html/HTMLOptionElement.cpp
+++ b/dom/html/HTMLOptionElement.cpp
@@ -335,18 +335,18 @@ already_AddRefed<HTMLOptionElement> HTML
     if (aError.Failed()) {
       return nullptr;
     }
   }
 
   if (aDefaultSelected) {
     // We're calling SetAttr directly because we want to pass
     // aNotify == false.
-    aError = option->SetAttr(kNameSpaceID_None, nsGkAtoms::selected,
-                             EmptyString(), false);
+    aError =
+        option->SetAttr(kNameSpaceID_None, nsGkAtoms::selected, u""_ns, false);
     if (aError.Failed()) {
       return nullptr;
     }
   }
 
   option->SetSelected(aSelected);
   option->SetSelectedChanged(false);
 
--- a/dom/html/HTMLScriptElement.cpp
+++ b/dom/html/HTMLScriptElement.cpp
@@ -187,26 +187,25 @@ void HTMLScriptElement::FreezeExecutionA
                                                 OwnerDoc(), GetBaseURI());
 
       if (!mUri) {
         AutoTArray<nsString, 2> params = {u"src"_ns, src};
 
         nsContentUtils::ReportToConsole(
             nsIScriptError::warningFlag, "HTML"_ns, OwnerDoc(),
             nsContentUtils::eDOM_PROPERTIES, "ScriptSourceInvalidUri", params,
-            nullptr, EmptyString(), GetScriptLineNumber(),
-            GetScriptColumnNumber());
+            nullptr, u""_ns, GetScriptLineNumber(), GetScriptColumnNumber());
       }
     } else {
       AutoTArray<nsString, 1> params = {u"src"_ns};
 
       nsContentUtils::ReportToConsole(
           nsIScriptError::warningFlag, "HTML"_ns, OwnerDoc(),
           nsContentUtils::eDOM_PROPERTIES, "ScriptSourceEmpty", params, nullptr,
-          EmptyString(), GetScriptLineNumber(), GetScriptColumnNumber());
+          u""_ns, GetScriptLineNumber(), GetScriptColumnNumber());
     }
 
     // At this point mUri will be null for invalid URLs.
     mExternal = true;
   }
 
   bool async = (mExternal || mIsModule) && Async();
   bool defer = mExternal && Defer();
--- a/dom/html/HTMLScriptElement.h
+++ b/dom/html/HTMLScriptElement.h
@@ -122,18 +122,17 @@ class HTMLScriptElement final : public n
   void SetIntegrity(const nsAString& aIntegrity, ErrorResult& aRv) {
     SetHTMLAttr(nsGkAtoms::integrity, aIntegrity, aRv);
   }
   void SetReferrerPolicy(const nsAString& aReferrerPolicy,
                          ErrorResult& aError) {
     SetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrerPolicy, aError);
   }
   void GetReferrerPolicy(nsAString& aReferrerPolicy) {
-    GetEnumAttr(nsGkAtoms::referrerpolicy, EmptyCString().get(),
-                aReferrerPolicy);
+    GetEnumAttr(nsGkAtoms::referrerpolicy, "", aReferrerPolicy);
   }
 
  protected:
   virtual ~HTMLScriptElement();
 
   virtual bool GetAsyncState() override { return Async(); }
 
   virtual JSObject* WrapNode(JSContext* aCx,
--- a/dom/html/HTMLSharedElement.cpp
+++ b/dom/html/HTMLSharedElement.cpp
@@ -187,17 +187,17 @@ static void SetBaseTargetUsingFirstBaseW
 
       nsString target;
       child->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::target, target);
       aDocument->SetBaseTarget(target);
       return;
     }
   }
 
-  aDocument->SetBaseTarget(EmptyString());
+  aDocument->SetBaseTarget(u""_ns);
 }
 
 nsresult HTMLSharedElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
                                          const nsAttrValue* aValue,
                                          const nsAttrValue* aOldValue,
                                          nsIPrincipal* aSubjectPrincipal,
                                          bool aNotify) {
   if (aNamespaceID == kNameSpaceID_None) {
--- a/dom/html/HTMLStyleElement.cpp
+++ b/dom/html/HTMLStyleElement.cpp
@@ -179,20 +179,20 @@ Maybe<LinkStyle::SheetInfo> HTMLStyleEle
       *OwnerDoc(),
       this,
       nullptr,
       do_AddRef(mTriggeringPrincipal),
       MakeAndAddRef<ReferrerInfo>(*this),
       CORS_NONE,
       title,
       media,
-      /* integrity = */ EmptyString(),
+      /* integrity = */ u""_ns,
       /* nsStyleUtil::CSPAllowsInlineStyle takes care of nonce checking for
          inline styles. Bug 1607011 */
-      /* nonce = */ EmptyString(),
+      /* nonce = */ u""_ns,
       HasAlternateRel::No,
       IsInline::Yes,
       IsExplicitlyEnabled::No,
   });
 }
 
 JSObject* HTMLStyleElement::WrapNode(JSContext* aCx,
                                      JS::Handle<JSObject*> aGivenProto) {
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -171,17 +171,17 @@ void HTMLTextAreaElement::Select() {
   }
 }
 
 NS_IMETHODIMP
 HTMLTextAreaElement::SelectAll(nsPresContext* aPresContext) {
   nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
 
   if (formControlFrame) {
-    formControlFrame->SetFormProperty(nsGkAtoms::select, EmptyString());
+    formControlFrame->SetFormProperty(nsGkAtoms::select, u""_ns);
   }
 
   return NS_OK;
 }
 
 bool HTMLTextAreaElement::IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable,
                                           int32_t* aTabIndex) {
   if (nsGenericHTMLFormElementWithState::IsHTMLFocusable(
--- a/dom/html/MediaDocument.h
+++ b/dom/html/MediaDocument.h
@@ -76,17 +76,17 @@ class MediaDocument : public nsHTMLDocum
   //
   // Also see MediaDocument.properties if you want to define format names
   // for a new subclass. aWidth and aHeight are pixels for |ImageDocument|,
   // but could be in other units for other 'media', in which case you have to
   // define format names accordingly.
   void UpdateTitleAndCharset(const nsACString& aTypeStr, nsIChannel* aChannel,
                              const char* const* aFormatNames = sFormatNames,
                              int32_t aWidth = 0, int32_t aHeight = 0,
-                             const nsAString& aStatus = EmptyString());
+                             const nsAString& aStatus = u""_ns);
 
   nsCOMPtr<nsIStringBundle> mStringBundle;
   nsCOMPtr<nsIStringBundle> mStringBundleEnglish;
   static const char* const sFormatNames[4];
 
  private:
   enum { eWithNoInfo, eWithFile, eWithDim, eWithDimAndFile };
 
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -454,18 +454,17 @@ nsresult nsGenericHTMLElement::BindToTre
   // nonce by copying and resetting the internal nonce value.
   if (HasFlag(NODE_HAS_NONCE_AND_HEADER_CSP) && IsInComposedDoc() &&
       OwnerDoc()->GetBrowsingContext()) {
     nsContentUtils::AddScriptRunner(NS_NewRunnableFunction(
         "nsGenericHTMLElement::ResetNonce::Runnable",
         [self = RefPtr<nsGenericHTMLElement>(this)]() {
           nsAutoString nonce;
           self->GetNonce(nonce);
-          self->SetAttr(kNameSpaceID_None, nsGkAtoms::nonce, EmptyString(),
-                        true);
+          self->SetAttr(kNameSpaceID_None, nsGkAtoms::nonce, u""_ns, true);
           self->SetNonce(nonce);
         }));
   }
 
   // We need to consider a labels element is moved to another subtree
   // with different root, it needs to update labels list and its root
   // as well.
   nsExtendedDOMSlots* slots = GetExistingExtendedDOMSlots();
@@ -688,38 +687,38 @@ nsresult nsGenericHTMLElement::AfterSetA
       ToggleStates(changedStates, aNotify);
       if (recomputeDirectionality) {
         dir = RecomputeDirectionality(this, aNotify);
       }
       SetDirectionalityOnDescendants(this, dir, aNotify);
     } else if (aName == nsGkAtoms::contenteditable) {
       int32_t editableCountDelta = 0;
       if (aOldValue && (aOldValue->Equals(u"true"_ns, eIgnoreCase) ||
-                        aOldValue->Equals(EmptyString(), eIgnoreCase))) {
+                        aOldValue->Equals(u""_ns, eIgnoreCase))) {
         editableCountDelta = -1;
       }
       if (aValue && (aValue->Equals(u"true"_ns, eIgnoreCase) ||
-                     aValue->Equals(EmptyString(), eIgnoreCase))) {
+                     aValue->Equals(u""_ns, eIgnoreCase))) {
         ++editableCountDelta;
       }
       ChangeEditableState(editableCountDelta);
     } else if (aName == nsGkAtoms::accesskey) {
-      if (aValue && !aValue->Equals(EmptyString(), eIgnoreCase)) {
+      if (aValue && !aValue->Equals(u""_ns, eIgnoreCase)) {
         SetFlags(NODE_HAS_ACCESSKEY);
         RegAccessKey();
       }
     } else if (aName == nsGkAtoms::inert &&
                StaticPrefs::html5_inert_enabled()) {
       if (aValue) {
         AddStates(NS_EVENT_STATE_MOZINERT);
       } else {
         RemoveStates(NS_EVENT_STATE_MOZINERT);
       }
     } else if (aName == nsGkAtoms::name) {
-      if (aValue && !aValue->Equals(EmptyString(), eIgnoreCase)) {
+      if (aValue && !aValue->Equals(u""_ns, eIgnoreCase)) {
         // This may not be quite right because we can have subclass code run
         // before here. But in practice subclasses don't care about this flag,
         // and in particular selector matching does not care.  Otherwise we'd
         // want to handle it like we handle id attributes (in PreIdMaybeChange
         // and PostIdMaybeChange).
         SetHasName();
         if (CanHaveName(NodeInfo()->NameAtom())) {
           AddToNameTable(aValue->GetAtomValue());
--- a/dom/html/nsGenericHTMLElement.h
+++ b/dom/html/nsGenericHTMLElement.h
@@ -738,17 +738,17 @@ class nsGenericHTMLElement : public nsGe
     SetAttr(aName, aValue, aTriggeringPrincipal, aError);
   }
   void UnsetHTMLAttr(nsAtom* aName, mozilla::ErrorResult& aError) {
     UnsetAttr(aName, aError);
   }
   void SetHTMLBoolAttr(nsAtom* aName, bool aValue,
                        mozilla::ErrorResult& aError) {
     if (aValue) {
-      SetHTMLAttr(aName, EmptyString(), aError);
+      SetHTMLAttr(aName, u""_ns, aError);
     } else {
       UnsetHTMLAttr(aName, aError);
     }
   }
   template <typename T>
   void SetHTMLIntAttr(nsAtom* aName, T aValue, mozilla::ErrorResult& aError) {
     nsAutoString value;
     value.AppendInt(aValue);
--- a/dom/html/nsGenericHTMLFrameElement.cpp
+++ b/dom/html/nsGenericHTMLFrameElement.cpp
@@ -274,34 +274,29 @@ nsresult nsGenericHTMLFrameElement::OnAt
 }
 
 void nsGenericHTMLFrameElement::AfterMaybeChangeAttr(
     int32_t aNamespaceID, nsAtom* aName, const nsAttrValueOrString* aValue,
     nsIPrincipal* aMaybeScriptedPrincipal, bool aNotify) {
   if (aNamespaceID == kNameSpaceID_None) {
     if (aName == nsGkAtoms::src) {
       mSrcTriggeringPrincipal = nsContentUtils::GetAttrTriggeringPrincipal(
-          this, aValue ? aValue->String() : EmptyString(),
-          aMaybeScriptedPrincipal);
+          this, aValue ? aValue->String() : u""_ns, aMaybeScriptedPrincipal);
       if (!IsHTMLElement(nsGkAtoms::iframe) ||
           !HasAttr(kNameSpaceID_None, nsGkAtoms::srcdoc)) {
         // Don't propagate error here. The attribute was successfully
         // set or removed; that's what we should reflect.
         LoadSrc();
       }
     } else if (aName == nsGkAtoms::name) {
       // Propagate "name" to the browsing context per HTML5.
       RefPtr<BrowsingContext> bc =
           mFrameLoader ? mFrameLoader->GetExtantBrowsingContext() : nullptr;
       if (bc) {
-        if (aValue) {
-          MOZ_ALWAYS_SUCCEEDS(bc->SetName(aValue->String()));
-        } else {
-          MOZ_ALWAYS_SUCCEEDS(bc->SetName(EmptyString()));
-        }
+        MOZ_ALWAYS_SUCCEEDS(bc->SetName(aValue ? aValue->String() : u""_ns));
       }
     }
   }
 }
 
 void nsGenericHTMLFrameElement::DestroyContent() {
   if (mFrameLoader) {
     mFrameLoader->Destroy();
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -218,17 +218,17 @@ void nsHTMLDocument::TryUserForcedCharse
     auto encoding = nsDocShell::Cast(aDocShell)->GetForcedCharset();
 
     if (encoding) {
       if (!IsAsciiCompatible(encoding)) {
         return;
       }
       aEncoding = WrapNotNull(encoding);
       aCharsetSource = kCharsetFromUserForced;
-      aDocShell->SetCharset(EmptyCString());
+      aDocShell->SetCharset(""_ns);
     }
   }
 }
 
 void nsHTMLDocument::TryCacheCharset(nsICachingChannel* aCachingChannel,
                                      int32_t& aCharsetSource,
                                      NotNull<const Encoding*>& aEncoding) {
   nsresult rv;
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -662,17 +662,17 @@ nsresult SetDefaultPragmas(mozIStorageCo
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
 #ifndef IDB_MOBILE
   if (kSQLiteGrowthIncrement) {
     // This is just an optimization so ignore the failure if the disk is
     // currently too full.
-    rv = aConnection.SetGrowthIncrement(kSQLiteGrowthIncrement, EmptyCString());
+    rv = aConnection.SetGrowthIncrement(kSQLiteGrowthIncrement, ""_ns);
     if (rv != NS_ERROR_FILE_TOO_BIG && NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
 #endif  // IDB_MOBILE
 
   return NS_OK;
 }
@@ -5745,18 +5745,18 @@ SerializeStructuredCloneFiles(PBackgroun
             if (!actor) {
               IDB_REPORT_INTERNAL_ERR();
               return Err(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
             }
 
             // Transfer ownership to IPDL.
             actor->SetActorAlive();
 
-            if (!aDatabase->SendPBackgroundMutableFileConstructor(
-                    actor, EmptyString(), EmptyString())) {
+            if (!aDatabase->SendPBackgroundMutableFileConstructor(actor, u""_ns,
+                                                                  u""_ns)) {
               // This can only fail if the child has crashed.
               IDB_REPORT_INTERNAL_ERR();
               return Err(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
             }
 
             return SerializedStructuredCloneFile{
                 actor.get(), StructuredCloneFileBase::eMutableFile};
           }
@@ -13366,17 +13366,17 @@ nsresult QuotaClient::GetUsageForOriginI
         }
 
         continue;
       }
 
       if (obsoleteFilenames.Contains(subdirNameBase)) {
         rv = RemoveDatabaseFilesAndDirectory(*directory, subdirNameBase,
                                              nullptr, aPersistenceType, aGroup,
-                                             aOrigin, EmptyString());
+                                             aOrigin, u""_ns);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           // If we somehow running into here, it probably means we are in a
           // serious situation. e.g. Filesystem corruption.
           // Will handle this in bug 1521541.
           REPORT_TELEMETRY_INIT_ERR(kQuotaExternalError, IDB_RemoveDBFiles);
           return NS_ERROR_UNEXPECTED;
         }
 
--- a/dom/indexedDB/SchemaUpgrades.cpp
+++ b/dom/indexedDB/SchemaUpgrades.cpp
@@ -2851,19 +2851,18 @@ nsresult DeserializeUpgradeValueToFileId
       new DeserializeUpgradeValueHelper(aCloneReadInfo);
   return helper->DispatchAndWait(aFileIds);
 }
 
 nsresult UpgradeFileIdsFunction::Init(nsIFile* aFMDirectory,
                                       mozIStorageConnection& aConnection) {
   // This file manager doesn't need real origin info, etc. The only purpose is
   // to store file ids without adding more complexity or code duplication.
-  auto fileManager =
-      MakeSafeRefPtr<FileManager>(PERSISTENCE_TYPE_INVALID, EmptyCString(),
-                                  EmptyCString(), EmptyString(), false);
+  auto fileManager = MakeSafeRefPtr<FileManager>(PERSISTENCE_TYPE_INVALID,
+                                                 ""_ns, ""_ns, u""_ns, false);
 
   nsresult rv = fileManager->Init(aFMDirectory, aConnection);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   mFileManager = std::move(fileManager);
   return NS_OK;
--- a/dom/indexedDB/ScriptErrorHelper.cpp
+++ b/dom/indexedDB/ScriptErrorHelper.cpp
@@ -103,23 +103,23 @@ class ScriptErrorRunnable final : public
     // down.
     if (!scriptError) {
       return;
     }
 
     if (aInnerWindowID) {
       MOZ_ALWAYS_SUCCEEDS(scriptError->InitWithWindowID(
           aMessage, aFilename,
-          /* aSourceLine */ EmptyString(), aLineNumber, aColumnNumber,
-          aSeverityFlag, category, aInnerWindowID));
+          /* aSourceLine */ u""_ns, aLineNumber, aColumnNumber, aSeverityFlag,
+          category, aInnerWindowID));
     } else {
       MOZ_ALWAYS_SUCCEEDS(scriptError->Init(
           aMessage, aFilename,
-          /* aSourceLine */ EmptyString(), aLineNumber, aColumnNumber,
-          aSeverityFlag, category.get(),
+          /* aSourceLine */ u""_ns, aLineNumber, aColumnNumber, aSeverityFlag,
+          category.get(),
           /* IDB doesn't run on Private browsing mode */ false,
           /* from chrome context */ aIsChrome));
     }
 
     // We may not be able to obtain the console service when we're shutting
     // down.
     if (consoleService) {
       MOZ_ALWAYS_SUCCEEDS(consoleService->LogMessage(scriptError));
--- a/dom/ipc/BrowserChild.cpp
+++ b/dom/ipc/BrowserChild.cpp
@@ -3710,19 +3710,18 @@ NS_IMETHODIMP BrowserChild::OnLocationCh
       MOZ_TRY(loadGroup->GetRequestContextID(&requestContextID));
       locationChangeData->requestContextID() = Some(requestContextID);
     }
 
 #ifdef MOZ_CRASHREPORTER
     if (CrashReporter::GetEnabled()) {
       nsCOMPtr<nsIURI> annotationURI;
 
-      nsresult rv = NS_MutateURI(aLocation)
-                        .SetUserPass(EmptyCString())
-                        .Finalize(annotationURI);
+      nsresult rv =
+          NS_MutateURI(aLocation).SetUserPass(""_ns).Finalize(annotationURI);
 
       if (NS_FAILED(rv)) {
         // Ignore failures on about: URIs.
         annotationURI = aLocation;
       }
 
       CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL,
                                          annotationURI->GetSpecOrDefault());
--- a/dom/ipc/BrowserParent.cpp
+++ b/dom/ipc/BrowserParent.cpp
@@ -465,17 +465,17 @@ ParentShowInfo BrowserParent::GetShowInf
     mFrameElement->GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
     bool isTransparent =
         nsContentUtils::IsChromeDoc(mFrameElement->OwnerDoc()) &&
         mFrameElement->HasAttr(kNameSpaceID_None, nsGkAtoms::transparent);
     return ParentShowInfo(name, false, isTransparent, mDPI, mRounding,
                           mDefaultScale.scale);
   }
 
-  return ParentShowInfo(EmptyString(), false, false, mDPI, mRounding,
+  return ParentShowInfo(u""_ns, false, false, mDPI, mRounding,
                         mDefaultScale.scale);
 }
 
 already_AddRefed<nsIPrincipal> BrowserParent::GetContentPrincipal() const {
   nsCOMPtr<nsIBrowser> browser =
       mFrameElement ? mFrameElement->AsBrowser() : nullptr;
   NS_ENSURE_TRUE(browser, nullptr);
 
@@ -3884,17 +3884,17 @@ mozilla::ipc::IPCResult BrowserParent::R
   nsCOMPtr<nsIAuthPrompt2> authPrompt;
   GetAuthPrompt(nsIAuthPromptProvider::PROMPT_NORMAL,
                 NS_GET_IID(nsIAuthPrompt2), getter_AddRefs(authPrompt));
   RefPtr<FakeChannel> channel =
       new FakeChannel(aUri, aCallbackId, mFrameElement);
   uint32_t promptFlags = nsIAuthInformation::AUTH_HOST;
 
   RefPtr<nsAuthInformationHolder> holder =
-      new nsAuthInformationHolder(promptFlags, aRealm, EmptyCString());
+      new nsAuthInformationHolder(promptFlags, aRealm, ""_ns);
 
   uint32_t level = nsIAuthPrompt2::LEVEL_NONE;
   nsCOMPtr<nsICancelable> dummy;
   nsresult rv = authPrompt->AsyncPromptAuth(channel, channel, nullptr, level,
                                             holder, getter_AddRefs(dummy));
 
   if (NS_FAILED(rv)) {
     return IPC_FAIL_NO_REASON(this);
--- a/dom/ipc/ClonedErrorHolder.cpp
+++ b/dom/ipc/ClonedErrorHolder.cpp
@@ -280,17 +280,17 @@ bool ClonedErrorHolder::ToErrorValue(JSC
     JS::Rooted<JSString*> filename(aCx);
     JS::Rooted<JSString*> message(aCx);
 
     // For some unknown reason, we can end up with a void string in mFilename,
     // which will cause filename to be null, which causes JS::CreateError() to
     // crash. Make this code against robust against this by treating void
     // strings as the empty string.
     if (mFilename.IsVoid()) {
-      mFilename.Assign(EmptyCString());
+      mFilename.Assign(""_ns);
     }
 
     if (!ToJSString(aCx, mFilename, &filename) ||
         !ToJSString(aCx, mMessage, &message)) {
       return false;
     }
     if (!JS::CreateError(aCx, mExnType, stack, filename, mLineNumber, mColumn,
                          nullptr, message, aResult)) {
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -914,17 +914,17 @@ nsresult ContentChild::ProvideWindowComm
                                &fullZoom, getter_AddRefs(referrerInfo),
                                getter_AddRefs(triggeringPrincipal),
                                getter_AddRefs(csp));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     if (name.LowerCaseEqualsLiteral("_blank")) {
-      name = EmptyString();
+      name.Truncate();
     }
 
     MOZ_DIAGNOSTIC_ASSERT(!nsContentUtils::IsSpecialName(name));
 
     Unused << SendCreateWindowInDifferentProcess(
         aTabOpener, parent, aChromeFlags, aCalledFromJS, aWidthSpecified, aURI,
         features, fullZoom, name, triggeringPrincipal, csp, referrerInfo,
         aOpenWindowInfo->GetOriginAttributes());
@@ -1056,17 +1056,17 @@ nsresult ContentChild::ProvideWindowComm
 
     // If the BrowserChild has been torn down, we don't need to do this anymore.
     if (NS_WARN_IF(!newChild->IPCOpen() || newChild->IsDestroyed())) {
       rv = NS_ERROR_ABORT;
       return;
     }
 
     ParentShowInfo showInfo(
-        EmptyString(), /* fakeShowInfo = */ true, /* isTransparent = */ false,
+        u""_ns, /* fakeShowInfo = */ true, /* isTransparent = */ false,
         aTabOpener->WebWidget()->GetDPI(),
         aTabOpener->WebWidget()->RoundsWidgetCoordinatesTo(),
         aTabOpener->WebWidget()->GetDefaultScale().scale);
 
     newChild->SetMaxTouchPoints(maxTouchPoints);
     newChild->SetHasSiblings(hasSiblings);
 
     if (aForceNoOpener || !parent) {
@@ -4119,17 +4119,17 @@ mozilla::ipc::IPCResult ContentChild::Re
     bc->NotifyNavigationFinished();
   }
 
 #ifdef MOZ_CRASHREPORTER
   if (CrashReporter::GetEnabled()) {
     nsCOMPtr<nsIURI> annotationURI;
 
     nsresult rv = NS_MutateURI(aLoadState->URI())
-                      .SetUserPass(EmptyCString())
+                      .SetUserPass(""_ns)
                       .Finalize(annotationURI);
 
     if (NS_FAILED(rv)) {
       // Ignore failures on about: URIs.
       annotationURI = aLoadState->URI();
     }
 
     CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL,
@@ -4159,17 +4159,17 @@ mozilla::ipc::IPCResult ContentChild::Re
     }
   }
 
 #ifdef MOZ_CRASHREPORTER
   if (CrashReporter::GetEnabled()) {
     nsCOMPtr<nsIURI> annotationURI;
 
     nsresult rv = NS_MutateURI(aLoadState->URI())
-                      .SetUserPass(EmptyCString())
+                      .SetUserPass(""_ns)
                       .Finalize(annotationURI);
 
     if (NS_FAILED(rv)) {
       // Ignore failures on about: URIs.
       annotationURI = aLoadState->URI();
     }
 
     CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL,
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -477,18 +477,18 @@ ContentParentsMemoryReporter::CollectRep
         static_cast<nsIObserver*>(cp), refcnt);
 
     constexpr auto desc =
         "The number of unset IPC messages held in this ContentParent's "
         "channel.  A large value here might indicate that we're leaking "
         "messages.  Similarly, a ContentParent object for a process that's no "
         "longer running could indicate that we're leaking ContentParents."_ns;
 
-    aHandleReport->Callback(/* process */ EmptyCString(), path, KIND_OTHER,
-                            UNITS_COUNT, numQueuedMessages, desc, aData);
+    aHandleReport->Callback(/* process */ ""_ns, path, KIND_OTHER, UNITS_COUNT,
+                            numQueuedMessages, desc, aData);
   }
 
   return NS_OK;
 }
 
 // A hashtable (by type) of processes/ContentParents.  This includes
 // processes that are in the Preallocator cache (which would be type
 // 'prealloc'), and recycled processes ('web' and in the future
@@ -1527,17 +1527,17 @@ void ContentParent::Init() {
 #endif  // #ifdef ACCESSIBILITY
 
 #ifdef MOZ_GECKO_PROFILER
   Unused << SendInitProfiler(ProfilerParent::CreateForProcess(OtherPid()));
 #endif
 
   // Ensure that the default set of permissions are avaliable in the content
   // process before we try to load any URIs in it.
-  EnsurePermissionsByKey(EmptyCString(), EmptyCString());
+  EnsurePermissionsByKey(""_ns, ""_ns);
 
   RefPtr<GeckoMediaPluginServiceParent> gmps(
       GeckoMediaPluginServiceParent::GetSingleton());
   gmps->UpdateContentProcessGMPCapabilities();
 }
 
 void ContentParent::MaybeAsyncSendShutDownMessage() {
   MOZ_LOG(ContentParent::GetLog(), LogLevel::Verbose,
@@ -3249,19 +3249,19 @@ static void InitClients() {
                        "profileBeforeChange shutdown blocker");
   }
 }
 
 void ContentParent::AddShutdownBlockers() {
   InitClients();
 
   sXPCOMShutdownClient->AddBlocker(
-      this, NS_LITERAL_STRING_FROM_CSTRING(__FILE__), __LINE__, EmptyString());
+      this, NS_LITERAL_STRING_FROM_CSTRING(__FILE__), __LINE__, u""_ns);
   sProfileBeforeChangeClient->AddBlocker(
-      this, NS_LITERAL_STRING_FROM_CSTRING(__FILE__), __LINE__, EmptyString());
+      this, NS_LITERAL_STRING_FROM_CSTRING(__FILE__), __LINE__, u""_ns);
 }
 
 void ContentParent::RemoveShutdownBlockers() {
   Unused << sXPCOMShutdownClient->RemoveBlocker(this);
   Unused << sProfileBeforeChangeClient->RemoveBlocker(this);
 }
 
 NS_IMETHODIMP
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -758,18 +758,17 @@ class ContentParent final
       const nsCString& aFeatures, const float& aFullZoom,
       BrowserParent* aNextRemoteBrowser, const nsString& aName,
       nsresult& aResult, nsCOMPtr<nsIRemoteTab>& aNewRemoteTab,
       bool* aWindowIsNew, int32_t& aOpenLocation,
       nsIPrincipal* aTriggeringPrincipal, nsIReferrerInfo* aReferrerInfo,
       bool aLoadUri, nsIContentSecurityPolicy* aCsp,
       const OriginAttributes& aOriginAttributes);
 
-  explicit ContentParent(int32_t aPluginID)
-      : ContentParent(EmptyCString(), aPluginID) {}
+  explicit ContentParent(int32_t aPluginID) : ContentParent(""_ns, aPluginID) {}
   explicit ContentParent(const nsACString& aRemoteType)
       : ContentParent(aRemoteType, nsFakePluginTag::NOT_JSPLUGIN) {}
 
   ContentParent(const nsACString& aRemoteType, int32_t aPluginID);
 
   // Launch the subprocess and associated initialization.
   // Returns false if the process fails to start.
   // Deprecated in favor of LaunchSubprocessAsync.
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -125,18 +125,18 @@ class ProcessPriorityManagerImpl final :
    */
   void SetProcessPriority(ContentParent* aContentParent,
                           ProcessPriority aPriority);
 
   /**
    * If a magic testing-only pref is set, notify the observer service on the
    * given topic with the given data.  This is used for testing
    */
-  void FireTestOnlyObserverNotification(
-      const char* aTopic, const nsACString& aData = EmptyCString());
+  void FireTestOnlyObserverNotification(const char* aTopic,
+                                        const nsACString& aData = ""_ns);
 
   /**
    * This must be called by a ParticularProcessPriorityManager when it changes
    * its priority.
    */
   void NotifyProcessPriorityChanged(
       ParticularProcessPriorityManager* aParticularManager,
       hal::ProcessPriority aOldPriority);
@@ -257,18 +257,18 @@ class ParticularProcessPriorityManager f
   void ShutDown();
 
   NS_IMETHOD GetName(nsACString& aName) override {
     aName.AssignLiteral("ParticularProcessPriorityManager");
     return NS_OK;
   }
 
  private:
-  void FireTestOnlyObserverNotification(
-      const char* aTopic, const nsACString& aData = EmptyCString());
+  void FireTestOnlyObserverNotification(const char* aTopic,
+                                        const nsACString& aData = ""_ns);
 
   void FireTestOnlyObserverNotification(const char* aTopic,
                                         const char* aData = nullptr);
 
   bool IsHoldingWakeLock(const nsAString& aTopic);
 
   ContentParent* mContentParent;
   uint64_t mChildID;
@@ -819,17 +819,17 @@ void ParticularProcessPriorityManager::S
     mResetPriorityTimer->Cancel();
     mResetPriorityTimer = nullptr;
   }
 
   mContentParent = nullptr;
 }
 
 void ProcessPriorityManagerImpl::FireTestOnlyObserverNotification(
-    const char* aTopic, const nsACString& aData /* = EmptyCString() */) {
+    const char* aTopic, const nsACString& aData /* = ""_ns */) {
   if (!TestMode()) {
     return;
   }
 
   nsCOMPtr<nsIObserverService> os = services::GetObserverService();
   NS_ENSURE_TRUE_VOID(os);
 
   nsPrintfCString topic("process-priority-manager:TEST-ONLY:%s", aTopic);
@@ -849,17 +849,17 @@ void ParticularProcessPriorityManager::F
   if (aData) {
     data.AppendASCII(aData);
   }
 
   FireTestOnlyObserverNotification(aTopic, data);
 }
 
 void ParticularProcessPriorityManager::FireTestOnlyObserverNotification(
-    const char* aTopic, const nsACString& aData /* = EmptyCString() */) {
+    const char* aTopic, const nsACString& aData /* = ""_ns */) {
   if (!ProcessPriorityManagerImpl::TestMode()) {
     return;
   }
 
   nsAutoCString data(nsPrintfCString("%" PRIu64, ChildID()));
   if (!aData.IsEmpty()) {
     data.Append(':');
     data.Append(aData);
--- a/dom/ipc/SharedMap.h
+++ b/dom/ipc/SharedMap.h
@@ -120,17 +120,17 @@ class SharedMap : public DOMEventTargetH
 
  protected:
   ~SharedMap() override = default;
 
   class Entry {
    public:
     Entry(Entry&&) = delete;
 
-    explicit Entry(SharedMap& aMap, const nsACString& aName = EmptyCString())
+    explicit Entry(SharedMap& aMap, const nsACString& aName = ""_ns)
         : mMap(aMap), mName(aName), mData(AsVariant(uint32_t(0))) {}
 
     ~Entry() = default;
 
     /**
      * Encodes or decodes this entry into or from the given OutputBuffer or
      * InputBuffer.
      */
--- a/dom/jsurl/nsJSProtocolHandler.cpp
+++ b/dom/jsurl/nsJSProtocolHandler.cpp
@@ -130,20 +130,20 @@ static nsIScriptGlobalObject* GetGlobalO
 static bool AllowedByCSP(nsIContentSecurityPolicy* aCSP,
                          const nsAString& aContentOfPseudoScript) {
   if (!aCSP) {
     return true;
   }
 
   bool allowsInlineScript = true;
   nsresult rv = aCSP->GetAllowsInline(nsIContentPolicy::TYPE_SCRIPT,
-                                      EmptyString(),  // aNonce
-                                      true,           // aParserCreated
-                                      nullptr,        // aElement,
-                                      nullptr,        // nsICSPEventListener
+                                      u""_ns,   // aNonce
+                                      true,     // aParserCreated
+                                      nullptr,  // aElement,
+                                      nullptr,  // nsICSPEventListener
                                       aContentOfPseudoScript,  // aContent
                                       0,                       // aLineNumber
                                       0,                       // aColumnNumber
                                       &allowsInlineScript);
 
   return (NS_SUCCEEDED(rv) && allowsInlineScript);
 }
 
@@ -434,18 +434,18 @@ nsresult nsJSChannel::Init(nsIURI* aURI,
   mIOThunk = new nsJSThunk();
 
   // Create a stock input stream channel...
   // Remember, until AsyncOpen is called, the script will not be evaluated
   // and the underlying Input Stream will not be created...
   nsCOMPtr<nsIChannel> channel;
   RefPtr<nsJSThunk> thunk = mIOThunk;
   rv = NS_NewInputStreamChannelInternal(getter_AddRefs(channel), aURI,
-                                        thunk.forget(), "text/html"_ns,
-                                        EmptyCString(), aLoadInfo);
+                                        thunk.forget(), "text/html"_ns, ""_ns,
+                                        aLoadInfo);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = mIOThunk->Init(aURI);
   if (NS_SUCCEEDED(rv)) {
     mStreamChannel = channel;
     mPropertyBag = do_QueryInterface(channel);
     nsCOMPtr<nsIWritablePropertyBag2> writableBag = do_QueryInterface(channel);
     if (writableBag && jsURI->GetBaseURI()) {
--- a/dom/l10n/tests/gtest/TestL10nOverlays.cpp
+++ b/dom/l10n/tests/gtest/TestL10nOverlays.cpp
@@ -16,19 +16,19 @@ using namespace mozilla::dom;
 
 static already_AddRefed<Document> SetUpDocument() {
   nsCOMPtr<nsIURI> uri;
   NS_NewURI(getter_AddRefs(uri), "about:blank");
   nsCOMPtr<nsIPrincipal> principal =
       NullPrincipal::CreateWithoutOriginAttributes();
   nsCOMPtr<Document> document;
   nsresult rv = NS_NewDOMDocument(getter_AddRefs(document),
-                                  EmptyString(),  // aNamespaceURI
-                                  EmptyString(),  // aQualifiedName
-                                  nullptr,        // aDoctype
+                                  u""_ns,   // aNamespaceURI
+                                  u""_ns,   // aQualifiedName
+                                  nullptr,  // aDoctype
                                   uri, uri, principal,
                                   false,    // aLoadedAsData
                                   nullptr,  // aEventObject
                                   DocumentFlavorHTML);
 
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return nullptr;
   }
--- a/dom/localstorage/ActorsParent.cpp
+++ b/dom/localstorage/ActorsParent.cpp
@@ -404,18 +404,17 @@ nsresult SetDefaultPragmas(mozIStorageCo
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
 #ifndef LS_MOBILE
   if (kSQLiteGrowthIncrement) {
     // This is just an optimization so ignore the failure if the disk is
     // currently too full.
-    rv =
-        aConnection->SetGrowthIncrement(kSQLiteGrowthIncrement, EmptyCString());
+    rv = aConnection->SetGrowthIncrement(kSQLiteGrowthIncrement, ""_ns);
     if (rv != NS_ERROR_FILE_TOO_BIG && NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
 #endif  // LS_MOBILE
 
   return NS_OK;
 }
@@ -8588,17 +8587,17 @@ void ArchivedOriginScope::GetBindingClau
       *mBindingClause = " WHERE originKey = :originKey"_ns;
     }
 
     void operator()(const Pattern& aPattern) {
       *mBindingClause = nsLiteralCString(
           " WHERE originAttributes MATCH :originAttributesPattern");
     }
 
-    void operator()(const Null& aNull) { *mBindingClause = EmptyCString(); }
+    void operator()(const Null& aNull) { mBindingClause->Truncate(); }
   };
 
   mData.match(Matcher(&aBindingClause));
 }
 
 nsresult ArchivedOriginScope::BindToStatement(
     mozIStorageStatement* aStmt) const {
   MOZ_ASSERT(IsOnIOThread() || IsOnConnectionThread());
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1281,18 +1281,17 @@ MediaMemoryTracker::CollectReports(nsIHa
 
   nsCOMPtr<nsIHandleReportCallback> handleReport = aHandleReport;
   nsCOMPtr<nsISupports> data = aData;
 
   resourceSizes->Promise()->Then(
       AbstractThread::MainThread(), __func__,
       [handleReport, data](size_t size) {
         handleReport->Callback(
-            EmptyCString(), "explicit/media/resources"_ns, KIND_HEAP,
-            UNITS_BYTES, size,
+            ""_ns, "explicit/media/resources"_ns, KIND_HEAP, UNITS_BYTES, size,
             nsLiteralCString("Memory used by media resources including "
                              "streaming buffers, caches, etc."),
             data);
 
         nsCOMPtr<nsIMemoryReporterManager> imgr =
             do_GetService("@mozilla.org/memory-reporter-manager;1");
 
         if (imgr) {
--- a/dom/media/MediaInfo.h
+++ b/dom/media/MediaInfo.h
@@ -140,18 +140,17 @@ class VideoInfo : public TrackInfo {
     kDegree_270 = 270,
   };
   VideoInfo() : VideoInfo(-1, -1) {}
 
   explicit VideoInfo(int32_t aWidth, int32_t aHeight)
       : VideoInfo(gfx::IntSize(aWidth, aHeight)) {}
 
   explicit VideoInfo(const gfx::IntSize& aSize)
-      : TrackInfo(kVideoTrack, u"2"_ns, u"main"_ns, EmptyString(),
-                  EmptyString(), true, 2),
+      : TrackInfo(kVideoTrack, u"2"_ns, u"main"_ns, u""_ns, u""_ns, true, 2),
         mDisplay(aSize),
         mStereoMode(StereoMode::MONO),
         mImage(aSize),
         mCodecSpecificConfig(new MediaByteBuffer),
         mExtraData(new MediaByteBuffer),
         mRotation(kDegree_0),
         mImageRect(gfx::IntRect(gfx::IntPoint(), aSize)) {}
 
@@ -263,18 +262,17 @@ class VideoInfo : public TrackInfo {
   bool mAlphaPresent = false;
 
   Maybe<int32_t> mFrameRate;
 };
 
 class AudioInfo : public TrackInfo {
  public:
   AudioInfo()
-      : TrackInfo(kAudioTrack, u"1"_ns, u"main"_ns, EmptyString(),
-                  EmptyString(), true, 1),
+      : TrackInfo(kAudioTrack, u"1"_ns, u"main"_ns, u""_ns, u""_ns, true, 1),
         mRate(0),
         mChannels(0),
         mChannelMap(AudioConfig::ChannelLayout::UNKNOWN_MAP),
         mBitDepth(0),
         mProfile(0),
         mExtendedProfile(0),
         mCodecSpecificConfig(new MediaByteBuffer),
         mExtraData(new MediaByteBuffer) {}
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -1553,18 +1553,18 @@ class GetUserMediaTask : public Runnable
         mManager(MediaManager::GetInstance()) {}
 
   ~GetUserMediaTask() {
     if (!mHolder.IsEmpty()) {
       Fail(MediaMgrError::Name::NotAllowedError);
     }
   }
 
-  void Fail(MediaMgrError::Name aName, const nsString& aMessage = EmptyString(),
-            const nsString& aConstraint = EmptyString()) {
+  void Fail(MediaMgrError::Name aName, const nsString& aMessage = u""_ns,
+            const nsString& aConstraint = u""_ns) {
     NS_DispatchToMainThread(NS_NewRunnableFunction(
         "GetUserMediaTask::Fail",
         [aName, aMessage, aConstraint, holder = std::move(mHolder)]() mutable {
           holder.Reject(MakeRefPtr<MediaMgrError>(aName, aMessage, aConstraint),
                         __func__);
         }));
     // Do after the above runs, as it checks active window list
     NS_DispatchToMainThread(NewRunnableMethod<RefPtr<SourceListener>>(
@@ -1653,17 +1653,17 @@ class GetUserMediaTask : public Runnable
     NS_DispatchToMainThread(do_AddRef(new GetUserMediaStreamRunnable(
         std::move(mHolder), mWindowID, mWindowListener, mSourceListener,
         mPrincipalInfo, mConstraints, mAudioDevice, mVideoDevice, peerIdentity,
         mIsChrome)));
     return NS_OK;
   }
 
   nsresult Denied(MediaMgrError::Name aName,
-                  const nsString& aMessage = EmptyString()) {
+                  const nsString& aMessage = u""_ns) {
     // We add a disabled listener to the StreamListeners array until accepted
     // If this was the only active MediaStream, remove the window from the list.
     if (NS_IsMainThread()) {
       mHolder.Reject(MakeRefPtr<MediaMgrError>(aName, aMessage), __func__);
       // Should happen *after* error runs for consistency, but may not matter
       mWindowListener->Remove(mSourceListener);
     } else {
       // This will re-check the window being alive on main-thread
--- a/dom/media/MediaRecorder.cpp
+++ b/dom/media/MediaRecorder.cpp
@@ -109,19 +109,19 @@ class MediaRecorderReporter final : publ
                 return;
               }
 
               size_t sum = 0;
               for (const size_t& size : sizes) {
                 sum += size;
               }
 
-              handleReport->Callback(
-                  EmptyCString(), "explicit/media/recorder"_ns, KIND_HEAP,
-                  UNITS_BYTES, sum, "Memory used by media recorder."_ns, data);
+              handleReport->Callback(""_ns, "explicit/media/recorder"_ns,
+                                     KIND_HEAP, UNITS_BYTES, sum,
+                                     "Memory used by media recorder."_ns, data);
 
               manager->EndReport();
             },
             [](size_t) { MOZ_CRASH("Unexpected reject"); });
 
     return NS_OK;
   }
 
--- a/dom/media/MediaStreamError.h
+++ b/dom/media/MediaStreamError.h
@@ -56,34 +56,34 @@ class BaseMediaMgrError {
   nsString mNameString;
   nsString mMessage;
   const nsString mConstraint;
   const Name mName;
 };
 
 class MediaMgrError final : public nsISupports, public BaseMediaMgrError {
  public:
-  explicit MediaMgrError(Name aName, const nsAString& aMessage = EmptyString(),
-                         const nsAString& aConstraint = EmptyString())
+  explicit MediaMgrError(Name aName, const nsAString& aMessage = u""_ns,
+                         const nsAString& aConstraint = u""_ns)
       : BaseMediaMgrError(aName, aMessage, aConstraint) {}
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
  private:
   ~MediaMgrError() = default;
 };
 
 namespace dom {
 class MediaStreamError final : public nsISupports,
                                public BaseMediaMgrError,
                                public nsWrapperCache {
  public:
   MediaStreamError(nsPIDOMWindowInner* aParent, Name aName,
-                   const nsAString& aMessage = EmptyString(),
-                   const nsAString& aConstraint = EmptyString());
+                   const nsAString& aMessage = u""_ns,
+                   const nsAString& aConstraint = u""_ns);
 
   MediaStreamError(nsPIDOMWindowInner* aParent, const BaseMediaMgrError& aOther)
       : BaseMediaMgrError(aOther.mName, aOther.mMessage, aOther.mConstraint),
         mParent(aParent) {}
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamError)
   NS_DECLARE_STATIC_IID_ACCESSOR(
--- a/dom/media/MediaTrackGraph.cpp
+++ b/dom/media/MediaTrackGraph.cpp
@@ -3336,18 +3336,18 @@ void MediaTrackGraphImpl::FinishCollectR
   MOZ_ASSERT(NS_IsMainThread());
 
   nsCOMPtr<nsIMemoryReporterManager> manager =
       do_GetService("@mozilla.org/memory-reporter-manager;1");
 
   if (!manager) return;
 
 #define REPORT(_path, _amount, _desc)                                    \
-  aHandleReport->Callback(EmptyCString(), _path, KIND_HEAP, UNITS_BYTES, \
-                          _amount, nsLiteralCString(_desc), aData);
+  aHandleReport->Callback(""_ns, _path, KIND_HEAP, UNITS_BYTES, _amount, \
+                          nsLiteralCString(_desc), aData);
 
   for (size_t i = 0; i < aAudioTrackSizes.Length(); i++) {
     const AudioNodeSizes& usage = aAudioTrackSizes[i];
     const char* const nodeType =
         usage.mNodeType ? usage.mNodeType : "<unknown>";
 
     nsPrintfCString enginePath("explicit/webaudio/audio-node/%s/engine-objects",
                                nodeType);
--- a/dom/media/eme/EMEUtils.cpp
+++ b/dom/media/eme/EMEUtils.cpp
@@ -62,12 +62,12 @@ bool IsWidevineKeySystem(const nsAString
 nsString KeySystemToGMPName(const nsAString& aKeySystem) {
   if (IsClearkeyKeySystem(aKeySystem)) {
     return u"gmp-clearkey"_ns;
   }
   if (IsWidevineKeySystem(aKeySystem)) {
     return u"gmp-widevinecdm"_ns;
   }
   MOZ_ASSERT(false, "We should only call this for known GMPs");
-  return EmptyString();
+  return u""_ns;
 }
 
 }  // namespace mozilla
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -170,17 +170,17 @@ EMECodecString ToEMEAPICodecString(const
     return EME_CODEC_H264;
   }
   if (IsVP8CodecString(aCodec)) {
     return EME_CODEC_VP8;
   }
   if (IsVP9CodecString(aCodec)) {
     return EME_CODEC_VP9;
   }
-  return EmptyCString();
+  return ""_ns;
 }
 
 // A codec can be decrypted-and-decoded by the CDM, or only decrypted
 // by the CDM and decoded by Gecko. Not both.
 struct KeySystemContainerSupport {
   bool IsSupported() const {
     return !mCodecsDecoded.IsEmpty() || !mCodecsDecrypted.IsEmpty();
   }
--- a/dom/media/gmp/CDMStorageIdProvider.cpp
+++ b/dom/media/gmp/CDMStorageIdProvider.cpp
@@ -13,66 +13,66 @@
 #  include "rlz/lib/machine_id.h"
 #endif
 
 namespace mozilla {
 
 /*static*/
 nsCString CDMStorageIdProvider::ComputeStorageId(const nsCString& aOriginSalt) {
 #ifndef SUPPORT_STORAGE_ID
-  return EmptyCString();
+  return ""_ns;
 #else
   GMP_LOG_DEBUG("CDMStorageIdProvider::ComputeStorageId");
 
   std::string machineId;
   if (!rlz_lib::GetMachineId(&machineId)) {
     GMP_LOG_DEBUG(
         "CDMStorageIdProvider::ComputeStorageId: get machineId failed.");
-    return EmptyCString();
+    return ""_ns;
   }
 
   std::string originSalt(aOriginSalt.BeginReading(), aOriginSalt.Length());
   std::string input =
       machineId + originSalt + CDMStorageIdProvider::kBrowserIdentifier;
   nsresult rv;
   nsCOMPtr<nsICryptoHash> hasher =
       do_CreateInstance("@mozilla.org/security/hash;1", &rv);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     GMP_LOG_DEBUG(
         "CDMStorageIdProvider::ComputeStorageId: no crypto hash(0x%08" PRIx32
         ")",
         static_cast<uint32_t>(rv));
-    return EmptyCString();
+    return ""_ns;
   }
 
   rv = hasher->Init(nsICryptoHash::SHA256);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     GMP_LOG_DEBUG(
         "CDMStorageIdProvider::ComputeStorageId: failed to initialize "
         "hash(0x%08" PRIx32 ")",
         static_cast<uint32_t>(rv));
-    return EmptyCString();
+    return ""_ns;
   }
 
   rv = hasher->Update(reinterpret_cast<const uint8_t*>(input.c_str()),
                       input.size());
   if (NS_WARN_IF(NS_FAILED(rv))) {
     GMP_LOG_DEBUG(
         "CDMStorageIdProvider::ComputeStorageId: failed to update "
         "hash(0x%08" PRIx32 ")",
         static_cast<uint32_t>(rv));
-    return EmptyCString();
+    return ""_ns;
   }
 
   nsCString storageId;
   rv = hasher->Finish(false, storageId);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     GMP_LOG_DEBUG(
         "CDMStorageIdProvider::ComputeStorageId: failed to get the final hash "
         "result(0x%08" PRIx32 ")",
         static_cast<uint32_t>(rv));
-    return EmptyCString();
+    return ""_ns;
   }
   return storageId;
 #endif
 }
 
 }  // namespace mozilla
\ No newline at end of file
--- a/dom/media/gmp/GMPServiceChild.cpp
+++ b/dom/media/gmp/GMPServiceChild.cpp
@@ -71,17 +71,17 @@ GeckoMediaPluginServiceChild::GetContent
 
         nsTArray<base::ProcessId> alreadyBridgedTo;
         child->GetAlreadyBridgedTo(alreadyBridgedTo);
 
         base::ProcessId otherProcess;
         nsCString displayName;
         uint32_t pluginId = 0;
         ipc::Endpoint<PGMPContentParent> endpoint;
-        nsCString errorDescription = ""_ns;
+        nsCString errorDescription;
 
         bool ok = child->SendLaunchGMP(
             nodeIdString, api, tags, alreadyBridgedTo, &pluginId, &otherProcess,
             &displayName, &endpoint, &rv, &errorDescription);
         if (helper && pluginId) {
           // Note: Even if the launch failed, we need to connect the crash
           // helper so that if the launch failed due to the plugin crashing,
           // we can report the crash via the crash reporter. The crash
@@ -147,17 +147,17 @@ GeckoMediaPluginServiceChild::GetContent
 
         nsTArray<base::ProcessId> alreadyBridgedTo;
         child->GetAlreadyBridgedTo(alreadyBridgedTo);
 
         base::ProcessId otherProcess;
         nsCString displayName;
         uint32_t pluginId = 0;
         ipc::Endpoint<PGMPContentParent> endpoint;
-        nsCString errorDescription = ""_ns;
+        nsCString errorDescription;
 
         bool ok = child->SendLaunchGMPForNodeId(
             nodeId, api, tags, alreadyBridgedTo, &pluginId, &otherProcess,
             &displayName, &endpoint, &rv, &errorDescription);
 
         if (helper && pluginId) {
           // Note: Even if the launch failed, we need to connect the crash
           // helper so that if the launch failed due to the plugin crashing,
@@ -326,25 +326,25 @@ GeckoMediaPluginServiceChild::GetNodeId(
   nsString topLevelOrigin(aTopLevelOrigin);
   nsString gmpName(aGMPName);
   GetServiceChild()->Then(
       thread, __func__,
       [rawCallback, origin, topLevelOrigin, gmpName](GMPServiceChild* child) {
         UniquePtr<GetNodeIdCallback> callback(rawCallback);
         nsCString outId;
         if (!child->SendGetGMPNodeId(origin, topLevelOrigin, gmpName, &outId)) {
-          callback->Done(NS_ERROR_FAILURE, EmptyCString());
+          callback->Done(NS_ERROR_FAILURE, ""_ns);
           return;
         }
 
         callback->Done(NS_OK, outId);
       },
       [rawCallback](nsresult rv) {
         UniquePtr<GetNodeIdCallback> callback(rawCallback);
-        callback->Done(NS_ERROR_FAILURE, EmptyCString());
+        callback->Done(NS_ERROR_FAILURE, ""_ns);
       });
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 GeckoMediaPluginServiceChild::Observe(nsISupports* aSubject, const char* aTopic,
                                       const char16_t* aSomeData) {
--- a/dom/media/gmp/GMPServiceParent.cpp
+++ b/dom/media/gmp/GMPServiceParent.cpp
@@ -503,18 +503,17 @@ RefPtr<GenericPromise> GeckoMediaPluginS
           []() { return GenericPromise::CreateAndResolve(true, __func__); },
           []() {
             return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
           });
 }
 
 class NotifyObserversTask final : public mozilla::Runnable {
  public:
-  explicit NotifyObserversTask(const char* aTopic,
-                               nsString aData = EmptyString())
+  explicit NotifyObserversTask(const char* aTopic, nsString aData = u""_ns)
       : Runnable(aTopic), mTopic(aTopic), mData(aData) {}
   NS_IMETHOD Run() override {
     MOZ_ASSERT(NS_IsMainThread());
     nsCOMPtr<nsIObserverService> obsService =
         mozilla::services::GetObserverService();
     MOZ_ASSERT(obsService);
     if (obsService) {
       obsService->NotifyObservers(nullptr, mTopic, mData.get());
--- a/dom/media/gmp/GMPUtils.cpp
+++ b/dom/media/gmp/GMPUtils.cpp
@@ -166,17 +166,17 @@ bool GMPInfoFileParser::Contains(const n
 nsCString GMPInfoFileParser::Get(const nsCString& aKey) const {
   MOZ_ASSERT(Contains(aKey));
   nsCString key(aKey);
   ToLowerCase(key);
   nsCString* p = nullptr;
   if (mValues.Get(key, &p)) {
     return nsCString(*p);
   }
-  return EmptyCString();
+  return ""_ns;
 }
 
 bool HaveGMPFor(const nsCString& aAPI, nsTArray<nsCString>&& aTags) {
   nsCOMPtr<mozIGeckoMediaPluginService> mps =
       do_GetService("@mozilla.org/gecko-media-plugin-service;1");
   if (NS_WARN_IF(!mps)) {
     return false;
   }
--- a/dom/media/gtest/TestCDMStorage.cpp
+++ b/dom/media/gtest/TestCDMStorage.cpp
@@ -901,17 +901,17 @@ class CDMStorageTest {
         std::move(aContinuation), mNodeId));
     SchedulerGroup::Dispatch(TaskCategory::Other, task.forget());
   }
 
   void Shutdown() {
     if (mCDM) {
       mCDM->Shutdown();
       mCDM = nullptr;
-      mNodeId = EmptyCString();
+      mNodeId.Truncate();
     }
   }
 
   void Dummy() {}
 
   void SetFinished() {
     mFinished = true;
     Shutdown();
--- a/dom/media/gtest/TestGMPRemoveAndDelete.cpp
+++ b/dom/media/gtest/TestGMPRemoveAndDelete.cpp
@@ -38,17 +38,17 @@ class GMPRemoveTest : public nsIObserver
   NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
                      const char16_t* aData) override;
 
   // Create a new GMP plugin directory that we can trash and add it to the GMP
   // service. Remove the original plugin directory. Original plugin directory
   // gets re-added at destruction.
   void Setup();
 
-  bool CreateVideoDecoder(nsCString aNodeId = EmptyCString());
+  bool CreateVideoDecoder(nsCString aNodeId = ""_ns);
   void CloseVideoDecoder();
 
   void DeletePluginDirectory(bool aCanDefer);
 
   // Decode a dummy frame.
   GMPErr Decode();
 
   // Wait until TestMonitor has been signaled.
--- a/dom/media/mediacontrol/MediaControlUtils.h
+++ b/dom/media/mediacontrol/MediaControlUtils.h
@@ -168,17 +168,17 @@ inline nsresult GetEncodedImageBuffer(im
   MOZ_ASSERT(aImage);
 
   nsCOMPtr<imgITools> imgTools = do_GetService("@mozilla.org/image/tools;1");
   if (!imgTools) {
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIInputStream> inputStream;
-  nsresult rv = imgTools->EncodeImage(aImage, aMimeType, EmptyString(),
+  nsresult rv = imgTools->EncodeImage(aImage, aMimeType, u""_ns,
                                       getter_AddRefs(inputStream));
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   if (!inputStream) {
     return NS_ERROR_FAILURE;
   }
--- a/dom/media/mediacontrol/MediaStatusManager.cpp
+++ b/dom/media/mediacontrol/MediaStatusManager.cpp
@@ -234,28 +234,28 @@ nsString MediaStatusManager::GetDefaultF
                           nsLiteralCString(FAVICON_DEFAULT_URL));
   NS_ENSURE_SUCCESS(rv, u""_ns);
 
   // Convert URI from `chrome://XXX` to `file://XXX` because we would like to
   // let OS related frameworks, such as SMTC and MPRIS, handle this URL in order
   // to show the icon on virtual controller interface.
   nsCOMPtr<nsIChromeRegistry> regService = services::GetChromeRegistry();
   if (!regService) {
-    return EmptyString();
+    return u""_ns;
   }
   nsCOMPtr<nsIURI> processedURI;
   regService->ConvertChromeURL(faviconURI, getter_AddRefs(processedURI));
 
   nsAutoCString spec;
   if (NS_FAILED(processedURI->GetSpec(spec))) {
-    return EmptyString();
+    return u""_ns;
   }
   return NS_ConvertUTF8toUTF16(spec);
 #endif
-  return EmptyString();
+  return u""_ns;
 }
 
 void MediaStatusManager::SetDeclaredPlaybackState(
     uint64_t aBrowsingContextId, MediaSessionPlaybackState aState) {
   if (!mMediaSessionInfoMap.Contains(aBrowsingContextId)) {
     return;
   }
   MediaSessionInfo* info = mMediaSessionInfoMap.GetValue(aBrowsingContextId);
--- a/dom/media/ogg/OggDemuxer.cpp
+++ b/dom/media/ogg/OggDemuxer.cpp
@@ -125,30 +125,30 @@ const nsString OggDemuxer::GetKind(const
     return u"commentary"_ns;
   } else if (aRole.Find("video/sign") != -1) {
     return u"sign"_ns;
   } else if (aRole.Find("video/captioned") != -1) {
     return u"captions"_ns;
   } else if (aRole.Find("video/subtitled") != -1) {
     return u"subtitles"_ns;
   }
-  return EmptyString();
+  return u""_ns;
 }
 
 void OggDemuxer::InitTrack(MessageField* aMsgInfo, TrackInfo* aInfo,
                            bool aEnable) {
   MOZ_ASSERT(aMsgInfo);
   MOZ_ASSERT(aInfo);
 
   nsCString* sName = aMsgInfo->mValuesStore.Get(eName);
   nsCString* sRole = aMsgInfo->mValuesStore.Get(eRole);
   nsCString* sTitle = aMsgInfo->mValuesStore.Get(eTitle);
   nsCString* sLanguage = aMsgInfo->mValuesStore.Get(eLanguage);
   aInfo->Init(sName ? NS_ConvertUTF8toUTF16(*sName) : EmptyString(),
-              sRole ? GetKind(*sRole) : EmptyString(),
+              sRole ? GetKind(*sRole) : u""_ns,
               sTitle ? NS_ConvertUTF8toUTF16(*sTitle) : EmptyString(),
               sLanguage ? NS_ConvertUTF8toUTF16(*sLanguage) : EmptyString(),
               aEnable);
 }
 
 OggDemuxer::OggDemuxer(MediaResource* aResource)
     : mSandbox(CreateSandbox()),
       mTheoraState(nullptr),
--- a/dom/media/platforms/android/AndroidDataEncoder.cpp
+++ b/dom/media/platforms/android/AndroidDataEncoder.cpp
@@ -128,17 +128,17 @@ RefPtr<MediaDataEncoder::InitPromise> An
         MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                     "cannot create Java callback object"),
         __func__);
   }
   JavaCallbacksSupport::AttachNative(
       mJavaCallbacks, mozilla::MakeUnique<CallbacksSupport>(this));
 
   mJavaEncoder = java::CodecProxy::Create(true /* encoder */, mFormat, nullptr,
-                                          mJavaCallbacks, EmptyString());
+                                          mJavaCallbacks, u""_ns);
   if (!mJavaEncoder) {
     return InitPromise::CreateAndReject(
         MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                     "cannot create Java encoder object"),
         __func__);
   }
 
   mIsHardwareAccelerated = mJavaEncoder->IsHardwareAccelerated();
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -1264,18 +1264,18 @@ AudioContext::CollectReports(nsIHandleRe
                              nsISupports* aData, bool aAnonymize) {
   const nsLiteralCString nodeDescription(
       "Memory used by AudioNode DOM objects (Web Audio).");
   for (auto iter = mAllNodes.ConstIter(); !iter.Done(); iter.Next()) {
     AudioNode* node = iter.Get()->GetKey();
     int64_t amount = node->SizeOfIncludingThis(MallocSizeOf);
     nsPrintfCString domNodePath("explicit/webaudio/audio-node/%s/dom-nodes",
                                 node->NodeType());
-    aHandleReport->Callback(EmptyCString(), domNodePath, KIND_HEAP, UNITS_BYTES,
-                            amount, nodeDescription, aData);
+    aHandleReport->Callback(""_ns, domNodePath, KIND_HEAP, UNITS_BYTES, amount,
+                            nodeDescription, aData);
   }
 
   int64_t amount = SizeOfIncludingThis(MallocSizeOf);
   MOZ_COLLECT_REPORT("explicit/webaudio/audiocontext", KIND_HEAP, UNITS_BYTES,
                      amount,
                      "Memory used by AudioContext objects (Web Audio).");
 
   return NS_OK;
--- a/dom/media/webaudio/WebAudioUtils.cpp
+++ b/dom/media/webaudio/WebAudioUtils.cpp
@@ -131,16 +131,16 @@ void WebAudioUtils::LogToDeveloperConsol
   rv = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES, aKey,
                                           result);
 
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to log message to console.");
     return;
   }
 
-  errorObject->InitWithWindowID(result, spec, EmptyString(), aLineNumber,
+  errorObject->InitWithWindowID(result, spec, u""_ns, aLineNumber,
                                 aColumnNumber, nsIScriptError::warningFlag,
                                 "Web Audio", aWindowID);
   console->LogMessage(errorObject);
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/media/webrtc/common/browser_logging/WebRtcLog.cpp
+++ b/dom/media/webrtc/common/browser_logging/WebRtcLog.cpp
@@ -123,17 +123,17 @@ void StopWebRtcLog() {
     rtc::LogMessage::RemoveLogToStream(sSink);
     sSink = nullptr;
   }
 }
 
 nsCString ConfigAecLog() {
   nsCString aecLogDir;
   if (rtc::LogMessage::aec_debug()) {
-    return EmptyCString();
+    return ""_ns;
   }
 #if defined(ANDROID)
   aecLogDir.Assign(default_tmp_dir);
 #else
   nsCOMPtr<nsIFile> tempDir;
   nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tempDir));
   if (NS_SUCCEEDED(rv)) {
 #  ifdef XP_WIN
@@ -149,17 +149,17 @@ nsCString ConfigAecLog() {
   rtc::LogMessage::set_aec_debug_filename(aecLogDir.get());
 
   return aecLogDir;
 }
 
 nsCString StartAecLog() {
   nsCString aecLogDir;
   if (rtc::LogMessage::aec_debug()) {
-    return EmptyCString();
+    return ""_ns;
   }
 
   GetWebRtcLogPrefs();
   CheckOverrides();
   aecLogDir = ConfigAecLog();
 
   rtc::LogMessage::set_aec_debug(true);
 
--- a/dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp
+++ b/dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp
@@ -617,17 +617,17 @@ void WebrtcGlobalInformation::SetAecDebu
 }
 
 bool WebrtcGlobalInformation::AecDebug(const GlobalObject& aGlobal) {
   return sLastAECDebug;
 }
 
 void WebrtcGlobalInformation::GetAecDebugLogDir(const GlobalObject& aGlobal,
                                                 nsAString& aDir) {
-  aDir = NS_ConvertASCIItoUTF16(sAecDebugLogDir.valueOr(EmptyCString()));
+  aDir = NS_ConvertASCIItoUTF16(sAecDebugLogDir.valueOr(""_ns));
 }
 
 mozilla::ipc::IPCResult WebrtcGlobalParent::RecvGetStatsResult(
     const int& aRequestId, nsTArray<RTCStatsReportInternal>&& Stats) {
   MOZ_ASSERT(NS_IsMainThread());
 
   StatsRequest* request = StatsRequest::Get(aRequestId);
 
--- a/dom/media/webrtc/libwebrtcglue/WebrtcMediaCodecVP8VideoCodec.cpp
+++ b/dom/media/webrtc/libwebrtcglue/WebrtcMediaCodecVP8VideoCodec.cpp
@@ -1068,18 +1068,18 @@ int32_t WebrtcMediaCodecVP8VideoRemoteEn
     }
 
     res = format->SetInteger(nsCString("bitrate"), 300 * 1000);
     res = format->SetInteger(nsCString("bitrate-mode"), 2);
     res = format->SetInteger(nsCString("color-format"), 21);
     res = format->SetInteger(nsCString("frame-rate"), 30);
     res = format->SetInteger(nsCString("i-frame-interval"), 100);
 
-    mJavaEncoder = java::CodecProxy::Create(true, format, nullptr,
-                                            mJavaCallbacks, EmptyString());
+    mJavaEncoder =
+        java::CodecProxy::Create(true, format, nullptr, mJavaCallbacks, u""_ns);
 
     if (mJavaEncoder == nullptr) {
       return WEBRTC_VIDEO_CODEC_ERROR;
     }
   }
 
   rtc::scoped_refptr<webrtc::I420BufferInterface> inputBuffer =
       inputImage.video_frame_buffer()->GetI420();
--- a/dom/media/webspeech/synth/SpeechSynthesisUtterance.cpp
+++ b/dom/media/webspeech/synth/SpeechSynthesisUtterance.cpp
@@ -44,17 +44,17 @@ JSObject* SpeechSynthesisUtterance::Wrap
 }
 
 nsISupports* SpeechSynthesisUtterance::GetParentObject() const {
   return GetOwner();
 }
 
 already_AddRefed<SpeechSynthesisUtterance>
 SpeechSynthesisUtterance::Constructor(GlobalObject& aGlobal, ErrorResult& aRv) {
-  return Constructor(aGlobal, EmptyString(), aRv);
+  return Constructor(aGlobal, u""_ns, aRv);
 }
 
 already_AddRefed<SpeechSynthesisUtterance>
 SpeechSynthesisUtterance::Constructor(GlobalObject& aGlobal,
                                       const nsAString& aText,
                                       ErrorResult& aRv) {
   nsCOMPtr<nsPIDOMWindowInner> win = do_QueryInterface(aGlobal.GetAsSupports());
 
--- a/dom/media/webspeech/synth/nsSpeechTask.cpp
+++ b/dom/media/webspeech/synth/nsSpeechTask.cpp
@@ -95,18 +95,17 @@ nsresult nsSpeechTask::DispatchStartImpl
   if (NS_WARN_IF(mState != STATE_PENDING)) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   CreateAudioChannelAgent();
 
   mState = STATE_SPEAKING;
   mUtterance->mChosenVoiceURI = aUri;
-  mUtterance->DispatchSpeechSynthesisEvent(u"start"_ns, 0, nullptr, 0,
-                                           EmptyString());
+  mUtterance->DispatchSpeechSynthesisEvent(u"start"_ns, 0, nullptr, 0, u""_ns);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSpeechTask::DispatchEnd(float aElapsedTime, uint32_t aCharIndex) {
   // After we end, no callback functions should go through.
   mCallback = nullptr;
@@ -132,17 +131,17 @@ nsresult nsSpeechTask::DispatchEndImpl(f
   RefPtr<SpeechSynthesisUtterance> utterance = mUtterance;
 
   if (mSpeechSynthesis) {
     mSpeechSynthesis->OnEnd(this);
   }
 
   mState = STATE_ENDED;
   utterance->DispatchSpeechSynthesisEvent(u"end"_ns, aCharIndex, nullptr,
-                                          aElapsedTime, EmptyString());
+                                          aElapsedTime, u""_ns);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSpeechTask::DispatchPause(float aElapsedTime, uint32_t aCharIndex) {
   return DispatchPauseImpl(aElapsedTime, aCharIndex);
 }
@@ -156,17 +155,17 @@ nsresult nsSpeechTask::DispatchPauseImpl
   }
   if (NS_WARN_IF(mState == STATE_ENDED)) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   mUtterance->mPaused = true;
   if (mState == STATE_SPEAKING) {
     mUtterance->DispatchSpeechSynthesisEvent(u"pause"_ns, aCharIndex, nullptr,
-                                             aElapsedTime, EmptyString());
+                                             aElapsedTime, u""_ns);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSpeechTask::DispatchResume(float aElapsedTime, uint32_t aCharIndex) {
   return DispatchResumeImpl(aElapsedTime, aCharIndex);
@@ -181,17 +180,17 @@ nsresult nsSpeechTask::DispatchResumeImp
   }
   if (NS_WARN_IF(mState == STATE_ENDED)) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   mUtterance->mPaused = false;
   if (mState == STATE_SPEAKING) {
     mUtterance->DispatchSpeechSynthesisEvent(u"resume"_ns, aCharIndex, nullptr,
-                                             aElapsedTime, EmptyString());
+                                             aElapsedTime, u""_ns);
   }
 
   return NS_OK;
 }
 
 void nsSpeechTask::ForceError(float aElapsedTime, uint32_t aCharIndex) {
   DispatchError(aElapsedTime, aCharIndex);
 }
@@ -217,17 +216,17 @@ nsresult nsSpeechTask::DispatchErrorImpl
   }
 
   if (mSpeechSynthesis) {
     mSpeechSynthesis->OnEnd(this);
   }
 
   mState = STATE_ENDED;
   mUtterance->DispatchSpeechSynthesisEvent(u"error"_ns, aCharIndex, nullptr,
-                                           aElapsedTime, EmptyString());
+                                           aElapsedTime, u""_ns);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSpeechTask::DispatchBoundary(const nsAString& aName, float aElapsedTime,
                                uint32_t aCharIndex, uint32_t aCharLength,
                                uint8_t argc) {
   return DispatchBoundaryImpl(aName, aElapsedTime, aCharIndex, aCharLength,
--- a/dom/messagechannel/MessagePort.cpp
+++ b/dom/messagechannel/MessagePort.cpp
@@ -152,18 +152,18 @@ class PostMessageRunnable final : public
 
     Sequence<OwningNonNull<MessagePort>> ports;
     if (!mData->TakeTransferredPortsAsSequence(ports)) {
       mPort->DispatchError();
       return;
     }
 
     event->InitMessageEvent(nullptr, u"message"_ns, CanBubble::eNo,
-                            Cancelable::eNo, value, EmptyString(),
-                            EmptyString(), nullptr, ports);
+                            Cancelable::eNo, value, u""_ns, u""_ns, nullptr,
+                            ports);
     event->SetTrusted(true);
 
     mPort->DispatchEvent(*event);
   }
 
  private:
   ~PostMessageRunnable() = default;
 
--- a/dom/network/TCPSocket.cpp
+++ b/dom/network/TCPSocket.cpp
@@ -826,26 +826,26 @@ TCPSocketBinaryType TCPSocket::BinaryTyp
     return TCPSocketBinaryType::String;
   }
 }
 
 already_AddRefed<TCPSocket> TCPSocket::CreateAcceptedSocket(
     nsIGlobalObject* aGlobal, nsISocketTransport* aTransport,
     bool aUseArrayBuffers) {
   RefPtr<TCPSocket> socket =
-      new TCPSocket(aGlobal, EmptyString(), 0, false, aUseArrayBuffers);
+      new TCPSocket(aGlobal, u""_ns, 0, false, aUseArrayBuffers);
   nsresult rv = socket->InitWithTransport(aTransport);
   NS_ENSURE_SUCCESS(rv, nullptr);
   return socket.forget();
 }
 
 already_AddRefed<TCPSocket> TCPSocket::CreateAcceptedSocket(
     nsIGlobalObject* aGlobal, TCPSocketChild* aBridge, bool aUseArrayBuffers) {
   RefPtr<TCPSocket> socket =
-      new TCPSocket(aGlobal, EmptyString(), 0, false, aUseArrayBuffers);
+      new TCPSocket(aGlobal, u""_ns, 0, false, aUseArrayBuffers);
   socket->InitWithSocketChild(aBridge);
   return socket.forget();
 }
 
 already_AddRefed<TCPSocket> TCPSocket::Constructor(
     const GlobalObject& aGlobal, const nsAString& aHost, uint16_t aPort,
     const SocketOptions& aOptions, mozilla::ErrorResult& aRv) {
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
--- a/dom/network/UDPSocket.cpp
+++ b/dom/network/UDPSocket.cpp
@@ -214,25 +214,25 @@ void UDPSocket::JoinMulticastGroup(const
 
   MOZ_ASSERT(mSocket || mSocketChild);
 
   NS_ConvertUTF16toUTF8 address(aMulticastGroupAddress);
 
   if (mSocket) {
     MOZ_ASSERT(!mSocketChild);
 
-    aRv = mSocket->JoinMulticast(address, EmptyCString());
+    aRv = mSocket->JoinMulticast(address, ""_ns);
     NS_WARNING_ASSERTION(!aRv.Failed(), "JoinMulticast failed");
 
     return;
   }
 
   MOZ_ASSERT(mSocketChild);
 
-  mSocketChild->JoinMulticast(address, EmptyCString());
+  mSocketChild->JoinMulticast(address, ""_ns);
 }
 
 void UDPSocket::LeaveMulticastGroup(const nsAString& aMulticastGroupAddress,
                                     ErrorResult& aRv) {
   if (mReadyState == SocketReadyState::Closed) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return;
   }
@@ -245,24 +245,24 @@ void UDPSocket::LeaveMulticastGroup(cons
   }
 
   MOZ_ASSERT(mSocket || mSocketChild);
 
   nsCString address = NS_ConvertUTF16toUTF8(aMulticastGroupAddress);
   if (mSocket) {
     MOZ_ASSERT(!mSocketChild);
 
-    aRv = mSocket->LeaveMulticast(address, EmptyCString());
+    aRv = mSocket->LeaveMulticast(address, ""_ns);
     NS_WARNING_ASSERTION(!aRv.Failed(), "mSocket->LeaveMulticast failed");
     return;
   }
 
   MOZ_ASSERT(mSocketChild);
 
-  mSocketChild->LeaveMulticast(address, EmptyCString());
+  mSocketChild->LeaveMulticast(address, ""_ns);
 }
 
 nsresult UDPSocket::DoPendingMcastCommand() {
   MOZ_ASSERT(mReadyState == SocketReadyState::Open,
              "Multicast command can only be executed after socket opened");
 
   for (uint32_t i = 0; i < mPendingMcastCommands.Length(); ++i) {
     MulticastCommand& command = mPendingMcastCommands[i];
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -767,18 +767,18 @@ already_AddRefed<Notification> Notificat
   if (scope) {
     aRv.ThrowTypeError(
         "Notification constructor cannot be used in ServiceWorkerGlobalScope. "
         "Use registration.showNotification() instead.");
     return nullptr;
   }
 
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
-  RefPtr<Notification> notification = CreateAndShow(
-      aGlobal.Context(), global, aTitle, aOptions, EmptyString(), aRv);
+  RefPtr<Notification> notification =
+      CreateAndShow(aGlobal.Context(), global, aTitle, aOptions, u""_ns, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
   // This is be ok since we are on the worker thread where this function will
   // run to completion before the Notification has a chance to go away.
   return notification.forget();
 }
@@ -1652,17 +1652,17 @@ already_AddRefed<Promise> Notification::
 already_AddRefed<Promise> Notification::Get(
     const GlobalObject& aGlobal, const GetNotificationOptions& aFilter,
     ErrorResult& aRv) {
   AssertIsOnMainThread();
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
   MOZ_ASSERT(global);
   nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(global);
 
-  return Get(window, aFilter, EmptyString(), aRv);
+  return Get(window, aFilter, u""_ns, aRv);
 }
 
 class WorkerGetResultRunnable final : public NotificationWorkerRunnable {
   RefPtr<PromiseWorkerProxy> mPromiseProxy;
   const nsTArray<NotificationStrings> mStrings;
 
  public:
   WorkerGetResultRunnable(WorkerPrivate* aWorkerPrivate,
@@ -2183,17 +2183,17 @@ already_AddRefed<Promise> Notification::
 /* static */
 already_AddRefed<Notification> Notification::CreateAndShow(
     JSContext* aCx, nsIGlobalObject* aGlobal, const nsAString& aTitle,
     const NotificationOptions& aOptions, const nsAString& aScope,
     ErrorResult& aRv) {
   MOZ_ASSERT(aGlobal);
 
   RefPtr<Notification> notification =
-      CreateInternal(aGlobal, EmptyString(), aTitle, aOptions);
+      CreateInternal(aGlobal, u""_ns, aTitle, aOptions);
 
   // Make a structured clone of the aOptions.mData object
   JS::Rooted<JS::Value> data(aCx, aOptions.mData);
   notification->InitFromJSVal(aCx, data, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
--- a/dom/payments/PaymentActionResponse.cpp
+++ b/dom/payments/PaymentActionResponse.cpp
@@ -139,17 +139,17 @@ BasicCardResponseData::InitData(const ns
   return NS_OK;
 }
 
 /* PaymentActionResponse */
 
 NS_IMPL_ISUPPORTS(PaymentActionResponse, nsIPaymentActionResponse)
 
 PaymentActionResponse::PaymentActionResponse()
-    : mRequestId(EmptyString()), mType(nsIPaymentActionResponse::NO_TYPE) {}
+    : mRequestId(u""_ns), mType(nsIPaymentActionResponse::NO_TYPE) {}
 
 NS_IMETHODIMP
 PaymentActionResponse::GetRequestId(nsAString& aRequestId) {
   aRequestId = mRequestId;
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/dom/payments/PaymentRequest.cpp
+++ b/dom/payments/PaymentRequest.cpp
@@ -868,18 +868,18 @@ void PaymentRequest::RespondAbortPayment
   //   => Reject |mAcceptPromise| and reset |mUpdateError| to complete
   //      the action, regardless of |aSuccess|.
   //
   // - Otherwise, we are handling |Abort| method call from merchant.
   //   => Resolve/Reject |mAbortPromise| based on |aSuccess|.
   if (mUpdateError.Failed()) {
     // Respond show with mUpdateError, set mUpdating to false.
     mUpdating = false;
-    RespondShowPayment(EmptyString(), ResponseData(), EmptyString(),
-                       EmptyString(), EmptyString(), std::move(mUpdateError));
+    RespondShowPayment(u""_ns, ResponseData(), u""_ns, u""_ns, u""_ns,
+                       std::move(mUpdateError));
     return;
   }
 
   MOZ_ASSERT(mAbortPromise);
   MOZ_ASSERT(mState == eInteractive);
 
   if (aSuccess) {
     mAbortPromise->MaybeResolve(JS::UndefinedHandleValue);
@@ -1004,17 +1004,17 @@ nsresult PaymentRequest::DispatchUpdateE
 
 nsresult PaymentRequest::DispatchMerchantValidationEvent(
     const nsAString& aType) {
   MOZ_ASSERT(ReadyForUpdate());
 
   MerchantValidationEventInit init;
   init.mBubbles = false;
   init.mCancelable = false;
-  init.mValidationURL = EmptyString();
+  init.mValidationURL.Truncate();
 
   ErrorResult rv;
   RefPtr<MerchantValidationEvent> event =
       MerchantValidationEvent::Constructor(this, aType, init, rv);
   if (rv.Failed()) {
     return rv.StealNSResult();
   }
   event->SetTrusted(true);
@@ -1051,20 +1051,19 @@ already_AddRefed<PaymentAddress> Payment
 nsresult PaymentRequest::UpdateShippingAddress(
     const nsAString& aCountry, const nsTArray<nsString>& aAddressLine,
     const nsAString& aRegion, const nsAString& aRegionCode,
     const nsAString& aCity, const nsAString& aDependentLocality,
     const nsAString& aPostalCode, const nsAString& aSortingCode,
     const nsAString& aOrganization, const nsAString& aRecipient,
     const nsAString& aPhone) {
   nsTArray<nsString> emptyArray;
-  mShippingAddress =
-      new PaymentAddress(GetOwner(), aCountry, emptyArray, aRegion, aRegionCode,
-                         aCity, aDependentLocality, aPostalCode, aSortingCode,
-                         EmptyString(), EmptyString(), EmptyString());
+  mShippingAddress = new PaymentAddress(
+      GetOwner(), aCountry, emptyArray, aRegion, aRegionCode, aCity,
+      aDependentLocality, aPostalCode, aSortingCode, u""_ns, u""_ns, u""_ns);
   mFullShippingAddress =
       new PaymentAddress(GetOwner(), aCountry, aAddressLine, aRegion,
                          aRegionCode, aCity, aDependentLocality, aPostalCode,
                          aSortingCode, aOrganization, aRecipient, aPhone);
   // Fire shippingaddresschange event
   return DispatchUpdateEvent(u"shippingaddresschange"_ns);
 }
 
--- a/dom/payments/PaymentRequestManager.cpp
+++ b/dom/payments/PaymentRequestManager.cpp
@@ -147,20 +147,20 @@ void ConvertDetailsInit(JSContext* aCx, 
   }
 
   // Convert required |total|
   IPCPaymentItem total;
   ConvertItem(aDetails.mTotal, total);
 
   aIPCDetails =
       IPCPaymentDetails(id, total, displayItems, shippingOptions, modifiers,
-                        EmptyString(),   // error message
-                        EmptyString(),   // shippingAddressErrors
-                        EmptyString(),   // payerErrors
-                        EmptyString());  // paymentMethodErrors
+                        u""_ns,   // error message
+                        u""_ns,   // shippingAddressErrors
+                        u""_ns,   // payerErrors
+                        u""_ns);  // paymentMethodErrors
 }
 
 void ConvertDetailsUpdate(JSContext* aCx, const PaymentDetailsUpdate& aDetails,
                           IPCPaymentDetails& aIPCDetails, bool aRequestShipping,
                           ErrorResult& aRv) {
   MOZ_ASSERT(aCx);
   // Convert PaymentDetailsBase members
   nsTArray<IPCPaymentItem> displayItems;
@@ -206,17 +206,17 @@ void ConvertDetailsUpdate(JSContext* aCx
     JS::RootedObject object(aCx, aDetails.mPaymentMethodErrors.Value());
     if (NS_WARN_IF(NS_FAILED(
             SerializeFromJSObject(aCx, object, paymentMethodErrors)))) {
       aRv.ThrowTypeError("The PaymentMethodErrors can not be serialized");
       return;
     }
   }
 
-  aIPCDetails = IPCPaymentDetails(EmptyString(),  // id
+  aIPCDetails = IPCPaymentDetails(u""_ns,  // id
                                   total, displayItems, shippingOptions,
                                   modifiers, error, shippingAddressErrors,
                                   payerErrors, paymentMethodErrors);
 }
 
 void ConvertOptions(const PaymentOptions& aOptions,
                     IPCPaymentOptions& aIPCOption) {
   NS_ConvertASCIItoUTF16 shippingType(
--- a/dom/payments/PaymentRequestService.cpp
+++ b/dom/payments/PaymentRequestService.cpp
@@ -297,17 +297,17 @@ nsresult PaymentRequestService::RequestP
         return rv;
       }
       nsAutoString completeStatus;
       rv = request->GetCompleteStatus(completeStatus);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
       if (completeStatus.Equals(u"initial"_ns)) {
-        request->SetCompleteStatus(EmptyString());
+        request->SetCompleteStatus(u""_ns);
       }
       MOZ_ASSERT(mShowingRequest && mShowingRequest == request);
       rv = LaunchUIAction(aRequestId, type);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
       break;
     }
@@ -552,18 +552,18 @@ nsresult PaymentRequestService::ShowPaym
     if (mShowingRequest) {
       responseStatus = nsIPaymentActionResponse::PAYMENT_REJECTED;
     } else {
       responseStatus = nsIPaymentActionResponse::PAYMENT_NOTSUPPORTED;
     }
     nsCOMPtr<nsIPaymentShowActionResponse> showResponse =
         do_CreateInstance(NS_PAYMENT_SHOW_ACTION_RESPONSE_CONTRACT_ID);
     MOZ_ASSERT(showResponse);
-    rv = showResponse->Init(aRequestId, responseStatus, EmptyString(), nullptr,
-                            EmptyString(), EmptyString(), EmptyString());
+    rv = showResponse->Init(aRequestId, responseStatus, u""_ns, nullptr, u""_ns,
+                            u""_ns, u""_ns);
     rv = RespondPayment(showResponse.get());
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   } else {
     mShowingRequest = request;
     rv = LaunchUIAction(aRequestId,
                         IPCPaymentActionRequest::TIPCPaymentShowActionRequest);
--- a/dom/payments/ipc/PaymentRequestParent.cpp
+++ b/dom/payments/ipc/PaymentRequestParent.cpp
@@ -13,17 +13,17 @@
 #include "PaymentRequestData.h"
 #include "PaymentRequestParent.h"
 #include "PaymentRequestService.h"
 
 namespace mozilla {
 namespace dom {
 
 PaymentRequestParent::PaymentRequestParent()
-    : mActorAlive(true), mRequestId(EmptyString()) {}
+    : mActorAlive(true), mRequestId(u""_ns) {}
 
 mozilla::ipc::IPCResult PaymentRequestParent::RecvRequestPayment(
     const IPCPaymentActionRequest& aRequest) {
   if (!mActorAlive) {
     return IPC_FAIL_NO_REASON(this);
   }
   switch (aRequest.type()) {
     case IPCPaymentActionRequest::TIPCPaymentCreateActionRequest: {
@@ -330,17 +330,17 @@ mozilla::ipc::IPCResult PaymentRequestPa
   return IPC_OK();
 }
 
 void PaymentRequestParent::ActorDestroy(ActorDestroyReason aWhy) {
   mActorAlive = false;
   nsCOMPtr<nsIPaymentRequestService> service =
       do_GetService(NS_PAYMENT_REQUEST_SERVICE_CONTRACT_ID);
   MOZ_ASSERT(service);
-  if (!mRequestId.Equals(EmptyString())) {
+  if (!mRequestId.Equals(u""_ns)) {
     nsCOMPtr<nsIPaymentRequest> request;
     nsresult rv =
         service->GetPaymentRequestById(mRequestId, getter_AddRefs(request));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return;
     }
     if (!request) {
       return;
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -1793,17 +1793,17 @@ void nsPluginHost::UpdatePluginBlocklist
   nsCOMPtr<nsIBlocklistService> blocklist =
       do_GetService("@mozilla.org/extensions/blocklist;1");
   MOZ_ASSERT(blocklist, "Should be able to access the blocklist");
   if (!blocklist) {
     return;
   }
   // Asynchronously get the blocklist state.
   RefPtr<Promise> promise;
-  blocklist->GetPluginBlocklistState(aPluginTag, EmptyString(), EmptyString(),
+  blocklist->GetPluginBlocklistState(aPluginTag, u""_ns, u""_ns,
                                      getter_AddRefs(promise));
   MOZ_ASSERT(promise,
              "Should always get a promise for plugin blocklist state.");
   if (promise) {
     promise->AppendNativeHandler(new mozilla::plugins::BlocklistPromiseHandler(
         aPluginTag, aShouldSoftblock));
   }
 }
@@ -2316,17 +2316,17 @@ nsresult nsPluginHost::NewPluginURLStrea
       nsCOMPtr<nsISeekableStream> postDataSeekable(
           do_QueryInterface(aPostStream));
       if (postDataSeekable)
         postDataSeekable->Seek(nsISeekableStream::NS_SEEK_SET, 0);
 
       nsCOMPtr<nsIUploadChannel> uploadChannel(do_QueryInterface(httpChannel));
       NS_ASSERTION(uploadChannel, "http must support nsIUploadChannel");
 
-      uploadChannel->SetUploadStream(aPostStream, EmptyCString(), -1);
+      uploadChannel->SetUploadStream(aPostStream, ""_ns, -1);
     }
 
     if (aHeadersData) {
       rv = AddHeadersToChannel(aHeadersData, aHeadersDataLen, httpChannel);
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
   rv = channel->AsyncOpen(listenerPeer);
--- a/dom/plugins/ipc/PluginHangUIParent.cpp
+++ b/dom/plugins/ipc/PluginHangUIParent.cpp
@@ -313,17 +313,17 @@ bool PluginHangUIParent::RecvUserRespons
   mResponseTicks = ::GetTickCount();
   mIsShowing = false;
   // responseCode: 1 = Stop, 2 = Continue, 3 = Cancel
   int responseCode;
   if (aResponse & HANGUI_USER_RESPONSE_STOP) {
     // User clicked Stop
     mModule->TerminateChildProcess(mMainThreadMessageLoop,
                                    mozilla::ipc::kInvalidProcessId,
-                                   "ModalHangUI"_ns, EmptyString());
+                                   "ModalHangUI"_ns, u""_ns);
     responseCode = 1;
   } else if (aResponse & HANGUI_USER_RESPONSE_CONTINUE) {
     mModule->OnHangUIContinue();
     // User clicked Continue
     responseCode = 2;
   } else {
     // Dialog was cancelled
     responseCode = 3;
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -972,17 +972,17 @@ bool PluginModuleChromeParent::ShouldCon
     return true;
   }
   // If LaunchHangUI returned false then we should proceed with the
   // original plugin hang behaviour and kill the plugin container.
   FinishHangUI();
 #endif  // XP_WIN
 
   TerminateChildProcess(MessageLoop::current(), mozilla::ipc::kInvalidProcessId,
-                        "ModalHangUI"_ns, EmptyString());
+                        "ModalHangUI"_ns, u""_ns);
   GetIPCChannel()->CloseWithTimeout();
   return false;
 }
 
 bool PluginModuleContentParent::ShouldContinueFromReplyTimeout() {
   RefPtr<ProcessHangMonitor> monitor = ProcessHangMonitor::Get();
   if (!monitor) {
     return true;
@@ -1072,17 +1072,17 @@ void PluginModuleChromeParent::TakeFullM
 void PluginModuleChromeParent::TerminateChildProcess(
     MessageLoop* aMsgLoop, base::ProcessId aContentPid,
     const nsCString& aMonitorDescription, const nsAString& aDumpId) {
   // Start by taking a full minidump if necessary, this is done early
   // because it also needs to lock the mCrashReporterMutex and Mutex doesn't
   // support recursive locking.
   nsAutoString dumpId;
   if (aDumpId.IsEmpty()) {
-    TakeFullMinidump(aContentPid, EmptyString(), dumpId);
+    TakeFullMinidump(aContentPid, u""_ns, dumpId);
   }
 
   mozilla::MutexAutoLock lock(mCrashReporterMutex);
   if (!mCrashReporter) {
     // If mCrashReporter is null then the hang has ended, the plugin module
     // is shutting down. There's nothing to do here.
     return;
   }
--- a/dom/presentation/PresentationConnection.cpp
+++ b/dom/presentation/PresentationConnection.cpp
@@ -139,26 +139,26 @@ void PresentationConnection::DisconnectF
 /* virtual */
 JSObject* PresentationConnection::WrapObject(
     JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   return PresentationConnection_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 void PresentationConnection::GetId(nsAString& aId) const {
   if (nsContentUtils::ShouldResistFingerprinting()) {
-    aId = EmptyString();
+    aId.Truncate();
     return;
   }
 
   aId = mId;
 }
 
 void PresentationConnection::GetUrl(nsAString& aUrl) const {
   if (nsContentUtils::ShouldResistFingerprinting()) {
-    aUrl = EmptyString();
+    aUrl.Truncate();
     return;
   }
 
   aUrl = mUrl;
 }
 
 PresentationConnectionState PresentationConnection::State() const {
   if (nsContentUtils::ShouldResistFingerprinting()) {
@@ -505,17 +505,17 @@ nsresult PresentationConnection::DoRecei
   }
   JSContext* cx = jsapi.cx();
   JS::Rooted<JS::Value> jsData(cx);
 
   nsresult rv;
   if (aIsBinary) {
     if (mBinaryType == PresentationConnectionBinaryType::Blob) {
       RefPtr<Blob> blob =
-          Blob::CreateStringBlob(GetOwnerGlobal(), aData, EmptyString());
+          Blob::CreateStringBlob(GetOwnerGlobal(), aData, u""_ns);
       if (NS_WARN_IF(!blob)) {
         return NS_ERROR_FAILURE;
       }
 
       if (!ToJSValue(cx, blob, &jsData)) {
         return NS_ERROR_FAILURE;
       }
     } else if (mBinaryType == PresentationConnectionBinaryType::Arraybuffer) {
@@ -582,17 +582,17 @@ nsresult PresentationConnection::Dispatc
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   RefPtr<MessageEvent> messageEvent = new MessageEvent(this, nullptr, nullptr);
 
   messageEvent->InitMessageEvent(
       nullptr, u"message"_ns, CanBubble::eNo, Cancelable::eNo, aData, origin,
-      EmptyString(), nullptr, Sequence<OwningNonNull<MessagePort>>());
+      u""_ns, nullptr, Sequence<OwningNonNull<MessagePort>>());
   messageEvent->SetTrusted(true);
 
   RefPtr<AsyncEventDispatcher> asyncDispatcher =
       new AsyncEventDispatcher(this, messageEvent);
   return asyncDispatcher->PostDOMEvent();
 }
 
 nsresult PresentationConnection::ProcessConnectionWentAway() {
--- a/dom/presentation/provider/MulticastDNSDeviceProvider.cpp
+++ b/dom/presentation/provider/MulticastDNSDeviceProvider.cpp
@@ -461,42 +461,42 @@ nsresult MulticastDNSDeviceProvider::Rem
   return NS_OK;
 }
 
 bool MulticastDNSDeviceProvider::FindDeviceById(const nsACString& aId,
                                                 uint32_t& aIndex) {
   MOZ_ASSERT(NS_IsMainThread());
 
   RefPtr<Device> device = new Device(aId,
-                                     /* aName = */ EmptyCString(),
-                                     /* aType = */ EmptyCString(),
-                                     /* aHost = */ EmptyCString(),
+                                     /* aName = */ ""_ns,
+                                     /* aType = */ ""_ns,
+                                     /* aHost = */ ""_ns,
                                      /* aPort = */ 0,
-                                     /* aCertFingerprint */ EmptyCString(),
+                                     /* aCertFingerprint */ ""_ns,
                                      /* aState = */ DeviceState::eUnknown,
                                      /* aProvider = */ nullptr);
   size_t index = mDevices.IndexOf(device, 0, DeviceIdComparator());
 
   if (index == mDevices.NoIndex) {
     return false;
   }
 
   aIndex = index;
   return true;
 }
 
 bool MulticastDNSDeviceProvider::FindDeviceByAddress(const nsACString& aAddress,
                                                      uint32_t& aIndex) {
   MOZ_ASSERT(NS_IsMainThread());
 
-  RefPtr<Device> device = new Device(/* aId = */ EmptyCString(),
-                                     /* aName = */ EmptyCString(),
-                                     /* aType = */ EmptyCString(), aAddress,
+  RefPtr<Device> device = new Device(/* aId = */ ""_ns,
+                                     /* aName = */ ""_ns,
+                                     /* aType = */ ""_ns, aAddress,
                                      /* aPort = */ 0,
-                                     /* aCertFingerprint */ EmptyCString(),
+                                     /* aCertFingerprint */ ""_ns,
                                      /* aState = */ DeviceState::eUnknown,
                                      /* aProvider = */ nullptr);
   size_t index = mDevices.IndexOf(device, 0, DeviceAddressComparator());
 
   if (index == mDevices.NoIndex) {
     return false;
   }
 
@@ -914,22 +914,21 @@ MulticastDNSDeviceProvider::GetOrCreateD
     // Create a one-time device object for non-discoverable controller.
     // This device will not be in the list of available devices and cannot
     // be used for requesting session.
     nsAutoCString id;
     Unused << aDeviceInfo->GetId(id);
     uint16_t port;
     Unused << aDeviceInfo->GetPort(&port);
 
-    device =
-        new Device(id,
-                   /* aName = */ id,
-                   /* aType = */ EmptyCString(), address, port,
-                   /* aCertFingerprint */ EmptyCString(), DeviceState::eActive,
-                   /* aProvider = */ nullptr);
+    device = new Device(id,
+                        /* aName = */ id,
+                        /* aType = */ ""_ns, address, port,
+                        /* aCertFingerprint */ ""_ns, DeviceState::eActive,
+                        /* aProvider = */ nullptr);
   }
 
   return device.forget();
 }
 
 NS_IMETHODIMP
 MulticastDNSDeviceProvider::OnSessionRequest(
     nsITCPDeviceInfo* aDeviceInfo, const nsAString& aUrl,
--- a/dom/prototype/PrototypeDocumentContentSink.cpp
+++ b/dom/prototype/PrototypeDocumentContentSink.cpp
@@ -800,17 +800,17 @@ PrototypeDocumentContentSink::OnStreamCo
     nsCOMPtr<nsIURI> uri = mCurrentScriptProto->mSrcURI;
 
     // XXX should also check nsIHttpChannel::requestSucceeded
 
     MOZ_ASSERT(!mOffThreadCompiling && (mOffThreadCompileStringLength == 0 &&
                                         !mOffThreadCompileStringBuf),
                "PrototypeDocument can't load multiple scripts at once");
 
-    rv = ScriptLoader::ConvertToUTF16(channel, string, stringLen, EmptyString(),
+    rv = ScriptLoader::ConvertToUTF16(channel, string, stringLen, u""_ns,
                                       mDocument, mOffThreadCompileStringBuf,
                                       mOffThreadCompileStringLength);
     if (NS_SUCCEEDED(rv)) {
       // Pass ownership of the buffer, carefully emptying the existing
       // fields in the process.  Note that the |Compile| function called
       // below always takes ownership of the buffer.
       char16_t* units = nullptr;
       size_t unitsLength = 0;
--- a/dom/push/PushNotifier.cpp
+++ b/dom/push/PushNotifier.cpp
@@ -429,28 +429,28 @@ nsresult PushErrorDispatcher::NotifyObse
 
 nsresult PushErrorDispatcher::NotifyWorkers() {
   if (!ShouldNotifyWorkers() &&
       (!mPrincipal || mPrincipal->IsSystemPrincipal())) {
     // For system subscriptions, log the error directly to the browser console.
     return nsContentUtils::ReportToConsoleNonLocalized(
         mMessage, mFlags, "Push"_ns, nullptr, /* aDocument */
         nullptr,                              /* aURI */
-        EmptyString(),                        /* aLine */
+        u""_ns,                               /* aLine */
         0,                                    /* aLineNumber */
         0,                                    /* aColumnNumber */
         nsContentUtils::eOMIT_LOCATION);
   }
 
   // For service worker subscriptions, report the error to all clients.
   RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
   if (swm) {
     swm->ReportToAllClients(mScope, mMessage,
                             NS_ConvertUTF8toUTF16(mScope), /* aFilename */
-                            EmptyString(),                 /* aLine */
+                            u""_ns,                        /* aLine */
                             0,                             /* aLineNumber */
                             0,                             /* aColumnNumber */
                             mFlags);
   }
   return NS_OK;
 }
 
 bool PushErrorDispatcher::SendToParent(ContentChild* aContentActor) {
@@ -468,16 +468,16 @@ nsresult PushErrorDispatcher::HandleNoCh
   nsCOMPtr<nsIURI> scopeURI;
   nsresult rv = NS_NewURI(getter_AddRefs(scopeURI), mScope);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
   return nsContentUtils::ReportToConsoleNonLocalized(
       mMessage, mFlags, "Push"_ns, nullptr, /* aDocument */
       scopeURI,                             /* aURI */
-      EmptyString(),                        /* aLine */
+      u""_ns,                               /* aLine */
       0,                                    /* aLineNumber */
       0,                                    /* aColumnNumber */
       nsContentUtils::eOMIT_LOCATION);
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -6620,17 +6620,17 @@ already_AddRefed<DirectoryLock> QuotaMan
 already_AddRefed<DirectoryLock> QuotaManager::OpenDirectoryInternal(
     const Nullable<PersistenceType>& aPersistenceType,
     const OriginScope& aOriginScope, const Nullable<Client::Type>& aClientType,
     bool aExclusive, OpenDirectoryListener* aOpenListener) {
   AssertIsOnOwningThread();
 
   bool blocked;
   RefPtr<DirectoryLockImpl> lock =
-      CreateDirectoryLock(aPersistenceType, EmptyCString(), aOriginScope,
+      CreateDirectoryLock(aPersistenceType, ""_ns, aOriginScope,
                           Nullable<Client::Type>(aClientType), aExclusive, true,
                           aOpenListener, blocked);
   MOZ_ASSERT(lock);
 
   if (!aExclusive) {
     return blocked ? lock.forget() : nullptr;
   }
 
@@ -7309,17 +7309,17 @@ nsresult QuotaManager::GetInfoFromWindow
 
   return NS_OK;
 }
 
 // static
 void QuotaManager::GetInfoForChrome(nsACString* aSuffix, nsACString* aGroup,
                                     nsACString* aOrigin) {
   if (aSuffix) {
-    aSuffix->Assign(EmptyCString());
+    aSuffix->Assign(""_ns);
   }
   if (aGroup) {
     ChromeOrigin(*aGroup);
   }
   if (aOrigin) {
     ChromeOrigin(*aOrigin);
   }
 }
@@ -10959,17 +10959,17 @@ void OriginParser::HandleToken(const nsD
 
       return;
     }
 
     case eExpectingEmptyTokenOrDriveLetterOrPathnameComponent: {
       MOZ_ASSERT(mSchemeType == eFile);
 
       if (aToken.IsEmpty()) {
-        mPathnameComponents.AppendElement(EmptyCString());
+        mPathnameComponents.AppendElement(""_ns);
 
         mState = mTokenizer.hasMoreTokens()
                      ? eExpectingEmptyTokenOrPathnameComponent
                      : eComplete;
 
         return;
       }
 
@@ -10997,17 +10997,17 @@ void OriginParser::HandleToken(const nsD
         if (mMaybeDriveLetter) {
           MOZ_ASSERT(mPathnameComponents.Length() == 1);
 
           nsCString& pathnameComponent = mPathnameComponents[0];
           pathnameComponent.Append(':');
 
           mMaybeDriveLetter = false;
         } else {
-          mPathnameComponents.AppendElement(EmptyCString());
+          mPathnameComponents.AppendElement(""_ns);
         }
 
         mState = mTokenizer.hasMoreTokens()
                      ? eExpectingEmptyTokenOrPathnameComponent
                      : eComplete;
 
         return;
       }
@@ -11051,17 +11051,17 @@ void OriginParser::HandleToken(const nsD
       MOZ_CRASH("Should never get here!");
   }
 }
 
 void OriginParser::HandleTrailingSeparator() {
   MOZ_ASSERT(mState == eComplete);
   MOZ_ASSERT(mSchemeType == eFile);
 
-  mPathnameComponents.AppendElement(EmptyCString());
+  mPathnameComponents.AppendElement(""_ns);
 
   mState = eHandledTrailingSeparator;
 }
 
 nsresult RepositoryOperationBase::ProcessRepository() {
   AssertIsOnIOThread();
 
   QM_DEBUG_TRY_VAR(const bool exists, MOZ_TO_RESULT_INVOKE(mDirectory, Exists));
@@ -11249,17 +11249,17 @@ nsresult CreateOrUpgradeDirectoryMetadat
            file) {
       nsString leafName;
       rv = file->GetLeafName(leafName);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
 
       if (!leafName.Equals(idbDirectoryName)) {
-        rv = file->MoveTo(idbDirectory, EmptyString());
+        rv = file->MoveTo(idbDirectory, u""_ns);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return rv;
         }
       }
     }
 
     rv = metadataFile->Create(nsIFile::NORMAL_FILE_TYPE, 0644);
     if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -11362,18 +11362,17 @@ nsresult CreateOrUpgradeDirectoryMetadat
       }
 
       if (exists) {
         QM_WARNING("Found %s in storage/persistent and storage/permanent !",
                    NS_ConvertUTF16toUTF8(leafName).get());
 
         rv = aOriginProps.mDirectory->Remove(/* recursive */ true);
       } else {
-        rv = aOriginProps.mDirectory->MoveTo(mPermanentStorageDir,
-                                             EmptyString());
+        rv = aOriginProps.mDirectory->MoveTo(mPermanentStorageDir, u""_ns);
       }
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
     }
   } else if (aOriginProps.mNeedsRestore) {
     rv = CreateDirectoryMetadata(*aOriginProps.mDirectory,
                                  aOriginProps.mTimestamp, aOriginProps.mSuffix,
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -1411,26 +1411,26 @@ nsresult ScriptLoader::StartLoad(ScriptL
       // Bug 1436400: no bytecode cache support for modules yet.
       !aRequest->IsModuleRequest()) {
     if (!aRequest->IsLoadingSource()) {
       // Inform the HTTP cache that we prefer to have information coming from
       // the bytecode cache instead of the sources, if such entry is already
       // registered.
       LOG(("ScriptLoadRequest (%p): Maybe request bytecode", aRequest));
       cic->PreferAlternativeDataType(nsContentUtils::JSBytecodeMimeType(),
-                                     EmptyCString(), true);
+                                     ""_ns, true);
     } else {
       // If we are explicitly loading from the sources, such as after a
       // restarted request, we might still want to save the bytecode after.
       //
       // The following tell the cache to look for an alternative data type which
       // does not exist, such that we can later save the bytecode with a
       // different alternative data type.
       LOG(("ScriptLoadRequest (%p): Request saving bytecode later", aRequest));
-      cic->PreferAlternativeDataType(kNullMimeType, EmptyCString(), true);
+      cic->PreferAlternativeDataType(kNullMimeType, ""_ns, true);
     }
   }
 
   LOG(("ScriptLoadRequest (%p): mode=%u tracking=%d", aRequest,
        unsigned(aRequest->mScriptMode), aRequest->IsTracking()));
 
   if (aRequest->IsLinkPreloadScript()) {
     // This is <link rel="preload" as="script"> initiated speculative load,
@@ -1583,17 +1583,17 @@ static bool CSPAllowsInlineScript(nsIScr
   }
 
   bool parserCreated =
       aElement->GetParserCreated() != mozilla::dom::NOT_FROM_PARSER;
 
   bool allowInlineScript = false;
   rv = csp->GetAllowsInline(nsIContentPolicy::TYPE_SCRIPT, nonce, parserCreated,
                             scriptContent, nullptr /* nsICSPEventListener */,
-                            EmptyString(), aElement->GetScriptLineNumber(),
+                            u""_ns, aElement->GetScriptLineNumber(),
                             aElement->GetScriptColumnNumber(),
                             &allowInlineScript);
   return NS_SUCCEEDED(rv) && allowInlineScript;
 }
 
 ScriptLoadRequest* ScriptLoader::CreateLoadRequest(
     ScriptKind aKind, nsIURI* aURI, nsIScriptElement* aElement,
     nsIPrincipal* aTriggeringPrincipal, CORSMode aCORSMode,
@@ -3611,20 +3611,20 @@ void ScriptLoader::ReportErrorToConsole(
 
   AutoTArray<nsString, 1> params;
   CopyUTF8toUTF16(aRequest->mURI->GetSpecOrDefault(), *params.AppendElement());
 
   nsIScriptElement* element = aRequest->GetScriptElement();
   uint32_t lineNo = element ? element->GetScriptLineNumber() : 0;
   uint32_t columnNo = element ? element->GetScriptColumnNumber() : 0;
 
-  nsContentUtils::ReportToConsole(
-      nsIScriptError::warningFlag, "Script Loader"_ns, mDocument,
-      nsContentUtils::eDOM_PROPERTIES, message, params, nullptr, EmptyString(),
-      lineNo, columnNo);
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "Script Loader"_ns, mDocument,
+                                  nsContentUtils::eDOM_PROPERTIES, message,
+                                  params, nullptr, u""_ns, lineNo, columnNo);
 }
 
 void ScriptLoader::ReportPreloadErrorsToConsole(ScriptLoadRequest* aRequest) {
   if (NS_FAILED(aRequest->mUnreportedPreloadError)) {
     ReportErrorToConsole(aRequest, aRequest->mUnreportedPreloadError);
     aRequest->mUnreportedPreloadError = NS_OK;
   }
 
--- a/dom/security/CSPEvalChecker.cpp
+++ b/dom/security/CSPEvalChecker.cpp
@@ -56,18 +56,17 @@ nsresult CheckInternal(nsIContentSecurit
     *aAllowed = false;
     return rv;
   }
 
   if (reportViolation) {
     aCSP->LogViolationDetails(nsIContentSecurityPolicy::VIOLATION_TYPE_EVAL,
                               nullptr,  // triggering element
                               aCSPEventListener, aFileNameString, aExpression,
-                              aLineNum, aColumnNum, EmptyString(),
-                              EmptyString());
+                              aLineNum, aColumnNum, u""_ns, u""_ns);
   }
 
   return NS_OK;
 }
 
 class WorkerCSPCheckRunnable final : public WorkerMainThreadRunnable {
  public:
   WorkerCSPCheckRunnable(WorkerPrivate* aWorkerPrivate,
--- a/dom/security/FramingChecker.cpp
+++ b/dom/security/FramingChecker.cpp
@@ -145,20 +145,20 @@ static bool ShouldIgnoreFrameOptions(nsI
 
   // log warning to console that xfo is ignored because of CSP
   nsCOMPtr<nsILoadInfo> loadInfo = aChannel->LoadInfo();
   uint64_t innerWindowID = loadInfo->GetInnerWindowID();
   bool privateWindow = !!loadInfo->GetOriginAttributes().mPrivateBrowsingId;
   AutoTArray<nsString, 2> params = {u"x-frame-options"_ns,
                                     u"frame-ancestors"_ns};
   CSP_LogLocalizedStr("IgnoringSrcBecauseOfDirective", params,
-                      EmptyString(),  // no sourcefile
-                      EmptyString(),  // no scriptsample
-                      0,              // no linenumber
-                      0,              // no columnnumber
+                      u""_ns,  // no sourcefile
+                      u""_ns,  // no scriptsample
+                      0,       // no linenumber
+                      0,       // no columnnumber
                       nsIScriptError::warningFlag,
                       "IgnoringSrcBecauseOfDirective"_ns, innerWindowID,
                       privateWindow);
 
   return true;
 }
 
 // Check if X-Frame-Options permits this document to be loaded as a
--- a/dom/security/ReferrerInfo.cpp
+++ b/dom/security/ReferrerInfo.cpp
@@ -934,17 +934,17 @@ HashNumber ReferrerInfo::Hash() const {
   if (mOriginalReferrer) {
     Unused << mOriginalReferrer->GetSpec(originalReferrerSpec);
   }
 
   return mozilla::AddToHash(
       static_cast<uint32_t>(mPolicy), mSendReferrer, mOverridePolicyByDefault,
       mozilla::HashString(originalReferrerSpec),
       mozilla::HashString(mComputedReferrer.isSome() ? mComputedReferrer.value()
-                                                     : EmptyCString()));
+                                                     : ""_ns));
 }
 
 NS_IMETHODIMP
 ReferrerInfo::Init(nsIReferrerInfo::ReferrerPolicyIDL aReferrerPolicy,
                    bool aSendReferrer, nsIURI* aOriginalReferrer,
                    JSContext* aCx) {
   MOZ_ASSERT(!mInitialized);
   if (mInitialized) {
@@ -1158,17 +1158,17 @@ nsresult ReferrerInfo::ComputeReferrer(n
     }
   }
 
   mComputedReferrer.reset();
   // Emplace mComputedReferrer with an empty string, which means we have
   // computed the referrer and the result referrer value is empty (not send
   // referrer). So any early return later than this line will use that empty
   // referrer.
-  mComputedReferrer.emplace(EmptyCString());
+  mComputedReferrer.emplace(""_ns);
 
   if (!mSendReferrer || !mOriginalReferrer ||
       mPolicy == ReferrerPolicy::No_referrer) {
     return NS_OK;
   }
 
   if (mPolicy == ReferrerPolicy::_empty) {
     nsCOMPtr<nsILoadInfo> loadInfo = aChannel->LoadInfo();
--- a/dom/security/featurepolicy/test/gtest/TestFeaturePolicyParser.cpp
+++ b/dom/security/featurepolicy/test/gtest/TestFeaturePolicyParser.cpp
@@ -39,17 +39,17 @@ TEST(FeaturePolicyParser, Basic)
   nsCOMPtr<nsIPrincipal> exampleComPrincipal =
       mozilla::BasePrincipal::CreateContentPrincipal(URL_EXAMPLE_COM);
   nsCOMPtr<nsIPrincipal> exampleNetPrincipal =
       mozilla::BasePrincipal::CreateContentPrincipal(URL_EXAMPLE_NET);
 
   nsTArray<Feature> parsedFeatures;
 
   // Empty string is a valid policy.
-  CheckParser(EmptyString(), true, 0, parsedFeatures);
+  CheckParser(u""_ns, true, 0, parsedFeatures);
 
   // Empty string with spaces is still valid.
   CheckParser(u"   "_ns, true, 0, parsedFeatures);
 
   // Non-Existing features with no allowed values
   CheckParser(u"non-existing-feature"_ns, true, 0, parsedFeatures);
   CheckParser(u"non-existing-feature;another-feature"_ns, true, 0,
               parsedFeatures);
--- a/dom/security/fuzztest/csp_fuzzer.cpp
+++ b/dom/security/fuzztest/csp_fuzzer.cpp
@@ -19,18 +19,18 @@ static int LLVMFuzzerTestOneInput(const 
   nsCOMPtr<nsIPrincipal> selfURIPrincipal =
       mozilla::BasePrincipal::CreateContentPrincipal(selfURI, attrs);
   if (!selfURIPrincipal) return 0;
 
   nsCOMPtr<nsIContentSecurityPolicy> csp =
       do_CreateInstance(NS_CSPCONTEXT_CONTRACTID, &ret);
   if (ret != NS_OK) return 0;
 
-  ret = csp->SetRequestContextWithPrincipal(selfURIPrincipal, selfURI,
-                                            EmptyString(), 0);
+  ret =
+      csp->SetRequestContextWithPrincipal(selfURIPrincipal, selfURI, u""_ns, 0);
   if (ret != NS_OK) return 0;
 
   NS_ConvertASCIItoUTF16 policy(reinterpret_cast<const char*>(data), size);
   if (!policy.get()) return 0;
   csp->AppendPolicy(policy, false, false);
 
   return 0;
 }
--- a/dom/security/nsCSPContext.cpp
+++ b/dom/security/nsCSPContext.cpp
@@ -214,19 +214,19 @@ bool nsCSPContext::permitsInternal(
         AsyncReportViolation(
             aTriggeringElement, aCSPEventListener,
             (aSendContentLocationInViolationReports ? aContentLocation
                                                     : nullptr),
             BlockedContentSource::eUnknown, /* a BlockedContentSource */
             aOriginalURIIfRedirect, /* in case of redirect originalURI is not
                                        null */
             violatedDirective, p,   /* policy index        */
-            EmptyString(),          /* no observer subject */
+            u""_ns,                 /* no observer subject */
             spec,                   /* source file      */
-            EmptyString(),          /* no script sample    */
+            u""_ns,                 /* no script sample    */
             lineNumber,             /* line number      */
             columnNumber);          /*  column number    */
       }
     }
   }
 
   return permits;
 }
@@ -444,17 +444,17 @@ NS_IMETHODIMP
 nsCSPContext::GetAllowsEval(bool* outShouldReportViolation,
                             bool* outAllowsEval) {
   EnsureIPCPoliciesRead();
   *outShouldReportViolation = false;
   *outAllowsEval = true;
 
   for (uint32_t i = 0; i < mPolicies.Length(); i++) {
     if (!mPolicies[i]->allows(nsIContentPolicy::TYPE_SCRIPT, CSP_UNSAFE_EVAL,
-                              EmptyString(), false)) {
+                              u""_ns, false)) {
       // policy is violated: must report the violation and allow the inline
       // script if the policy is report-only.
       *outShouldReportViolation = true;
       if (!mPolicies[i]->getReportOnlyFlag()) {
         *outAllowsEval = false;
       }
     }
   }
@@ -533,22 +533,22 @@ nsCSPContext::GetAllowsInline(nsContentP
 
   if (aContentType != nsIContentPolicy::TYPE_SCRIPT &&
       aContentType != nsIContentPolicy::TYPE_STYLESHEET) {
     MOZ_ASSERT(false, "can only allow inline for script or style");
     return NS_OK;
   }
 
   EnsureIPCPoliciesRead();
-  nsAutoString content(EmptyString());
+  nsAutoString content(u""_ns);
 
   // always iterate all policies, otherwise we might not send out all reports
   for (uint32_t i = 0; i < mPolicies.Length(); i++) {
     bool allowed =
-        mPolicies[i]->allows(aContentType, CSP_UNSAFE_INLINE, EmptyString(),
+        mPolicies[i]->allows(aContentType, CSP_UNSAFE_INLINE, u""_ns,
                              aParserCreated) ||
         mPolicies[i]->allows(aContentType, CSP_NONCE, aNonce, aParserCreated);
 
     // If the inlined script or style is allowed by either unsafe-inline or the
     // nonce, go ahead and shortcut this loop so we can avoid allocating
     // unecessary strings
     if (allowed) {
       continue;
@@ -656,19 +656,19 @@ nsCSPContext::GetAllowsNavigateTo(nsIURI
       nsresult rv = AsyncReportViolation(
           nullptr,                                    // aTriggeringElement
           nullptr,                                    // aCSPEventListener
           blockedURIForReporting,                     // aBlockedURI
           nsCSPContext::BlockedContentSource::eSelf,  // aBlockedSource
           nullptr,                                    // aOriginalURI
           u"navigate-to"_ns,                          // aViolatedDirective
           i,                                          // aViolatedPolicyIndex
-          EmptyString(),                              // aObserverSubject
+          u""_ns,                                     // aObserverSubject
           NS_ConvertUTF8toUTF16(spec),                // aSourceFile
-          EmptyString(),                              // aScriptSample
+          u""_ns,                                     // aScriptSample
           lineNumber,                                 // aLineNum
           columnNumber);                              // aColumnNum
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
 
   *outAllowsNavigateTo = !atLeastOneBlock;
   return NS_OK;
@@ -710,21 +710,21 @@ nsCSPContext::GetAllowsNavigateTo(nsIURI
     PR_BEGIN_MACRO                                                             \
     if (!mPolicies[p]->allows(nsIContentPolicy::TYPE_##contentPolicyType,      \
                               keyword, nonceOrHash, false)) {                  \
       nsAutoString violatedDirective;                                          \
       bool reportSample = false;                                               \
       mPolicies[p]->getDirectiveStringAndReportSampleForContentType(           \
           nsIContentPolicy::TYPE_##contentPolicyType, violatedDirective,       \
           &reportSample);                                                      \
-      AsyncReportViolation(                                                    \
-          aTriggeringElement, aCSPEventListener, nullptr,                      \
-          blockedContentSource, nullptr, violatedDirective, p,                 \
-          NS_LITERAL_STRING_FROM_CSTRING(observerTopic), aSourceFile,          \
-          reportSample ? aScriptSample : EmptyString(), aLineNum, aColumnNum); \
+      AsyncReportViolation(aTriggeringElement, aCSPEventListener, nullptr,     \
+                           blockedContentSource, nullptr, violatedDirective,   \
+                           p, NS_LITERAL_STRING_FROM_CSTRING(observerTopic),   \
+                           aSourceFile, reportSample ? aScriptSample : u""_ns, \
+                           aLineNum, aColumnNum);                              \
     }                                                                          \
     PR_END_MACRO;                                                              \
     break
 
 /**
  * For each policy, log any violation on the Error Console and send a report
  * if a report-uri is present in the policy
  *
@@ -1565,18 +1565,18 @@ nsCSPContext::PermitsAncestry(nsILoadInf
       currentURI = windowOuter->GetDocumentURI();
     }
 
     if (currentURI) {
       nsAutoCString spec;
       currentURI->GetSpec(spec);
       // delete the userpass from the URI.
       rv = NS_MutateURI(currentURI)
-               .SetRef(EmptyCString())
-               .SetUserPass(EmptyCString())
+               .SetRef(""_ns)
+               .SetUserPass(""_ns)
                .Finalize(uriClone);
 
       // If setUserPass fails for some reason, just return a clone of the
       // current URI
       if (NS_FAILED(rv)) {
         rv = NS_GetURIWithoutRef(currentURI, getter_AddRefs(uriClone));
         NS_ENSURE_SUCCESS(rv, rv);
       }
@@ -1602,21 +1602,21 @@ nsCSPContext::PermitsAncestry(nsILoadInf
     bool okToSendAncestor =
         NS_SecurityCompareURIs(ancestorsArray[a], mSelfURI, true);
 
     bool permits =
         permitsInternal(nsIContentSecurityPolicy::FRAME_ANCESTORS_DIRECTIVE,
                         nullptr,  // triggering element
                         nullptr,  // nsICSPEventListener
                         ancestorsArray[a],
-                        nullptr,        // no redirect here.
-                        EmptyString(),  // no nonce
-                        false,          // not a preload.
-                        true,           // specific, do not use default-src
-                        true,           // send violation reports
+                        nullptr,  // no redirect here.
+                        u""_ns,   // no nonce
+                        false,    // not a preload.
+                        true,     // specific, do not use default-src
+                        true,     // send violation reports
                         okToSendAncestor,
                         false);  // not parser created
     if (!permits) {
       *outPermitsAncestry = false;
     }
   }
   return NS_OK;
 }
@@ -1639,19 +1639,19 @@ nsCSPContext::Permits(Element* aTriggeri
     if (StringBeginsWith(uriSpec, "resource://pdf.js/"_ns)) {
       *outPermits = true;
       return NS_OK;
     }
   }
 
   *outPermits =
       permitsInternal(aDir, aTriggeringElement, aCSPEventListener, aURI,
-                      nullptr,        // no original (pre-redirect) URI
-                      EmptyString(),  // no nonce
-                      false,          // not a preload.
+                      nullptr,  // no original (pre-redirect) URI
+                      u""_ns,   // no nonce
+                      false,    // not a preload.
                       aSpecific,
                       true,    // send violation reports
                       true,    // send blocked URI in violation reports
                       false);  // not parser created
 
   if (CSPCONTEXTLOGENABLED()) {
     CSPCONTEXTLOG(("nsCSPContext::Permits, aUri: %s, aDir: %d, isAllowed: %s",
                    aURI->GetSpecOrDefault().get(), aDir,
@@ -1711,18 +1711,18 @@ nsCSPContext::GetCSPSandboxFlags(uint32_
       mPolicies[i]->toString(policy);
 
       CSPCONTEXTLOG(
           ("nsCSPContext::GetCSPSandboxFlags, report only policy, ignoring "
            "sandbox in: %s",
            NS_ConvertUTF16toUTF8(policy).get()));
 
       AutoTArray<nsString, 1> params = {policy};
-      logToConsole("ignoringReportOnlyDirective", params, EmptyString(),
-                   EmptyString(), 0, 0, nsIScriptError::warningFlag);
+      logToConsole("ignoringReportOnlyDirective", params, u""_ns, u""_ns, 0, 0,
+                   nsIScriptError::warningFlag);
     }
   }
 
   return NS_OK;
 }
 
 /* ========== CSPViolationReportListener implementation ========== */
 
--- a/dom/security/nsCSPParser.cpp
+++ b/dom/security/nsCSPParser.cpp
@@ -177,18 +177,18 @@ bool nsCSPParser::atValidPathChar() {
 
 void nsCSPParser::logWarningErrorToConsole(uint32_t aSeverityFlag,
                                            const char* aProperty,
                                            const nsTArray<nsString>& aParams) {
   CSPPARSERLOG(("nsCSPParser::logWarningErrorToConsole: %s", aProperty));
   // send console messages off to the context and let the context
   // deal with it (potentially messages need to be queued up)
   mCSPContext->logToConsole(aProperty, aParams,
-                            EmptyString(),   // aSourceName
-                            EmptyString(),   // aSourceLine
+                            u""_ns,          // aSourceName
+                            u""_ns,          // aSourceLine
                             0,               // aLineNumber
                             0,               // aColumnNumber
                             aSeverityFlag);  // aFlags
 }
 
 bool nsCSPParser::hostChar() {
   if (atEnd()) {
     return false;
--- a/dom/security/nsCSPService.cpp
+++ b/dom/security/nsCSPService.cpp
@@ -353,21 +353,21 @@ nsresult CSPService::ConsultCSPForRedire
   // 1) Apply speculative CSP for preloads
   if (isPreload) {
     nsCOMPtr<nsIContentSecurityPolicy> preloadCsp = aLoadInfo->GetPreloadCsp();
     if (preloadCsp) {
       // Pass  originalURI to indicate the redirect
       preloadCsp->ShouldLoad(
           policyType,  // load type per nsIContentPolicy (uint32_t)
           cspEventListener,
-          aNewURI,         // nsIURI
-          EmptyCString(),  // ACString - MIME guess
-          aOriginalURI,    // Original nsIURI
-          true,            // aSendViolationReports
-          cspNonce,        // nonce
+          aNewURI,       // nsIURI
+          ""_ns,         // ACString - MIME guess
+          aOriginalURI,  // Original nsIURI
+          true,          // aSendViolationReports
+          cspNonce,      // nonce
           parserCreatedScript, &decision);
 
       // if the preload policy already denied the load, then there
       // is no point in checking the real policy
       if (NS_CP_REJECTED(decision)) {
         aCancelCode = Some(NS_ERROR_DOM_BAD_URI);
         return NS_BINDING_FAILED;
       }
@@ -375,21 +375,21 @@ nsresult CSPService::ConsultCSPForRedire
   }
 
   // 2) Apply actual CSP to all loads
   nsCOMPtr<nsIContentSecurityPolicy> csp = aLoadInfo->GetCsp();
   if (csp) {
     // Pass  originalURI to indicate the redirect
     csp->ShouldLoad(policyType,  // load type per nsIContentPolicy (uint32_t)
                     cspEventListener,
-                    aNewURI,         // nsIURI
-                    EmptyCString(),  // ACString - MIME guess
-                    aOriginalURI,    // Original nsIURI
-                    true,            // aSendViolationReports
-                    cspNonce,        // nonce
+                    aNewURI,       // nsIURI
+                    ""_ns,         // ACString - MIME guess
+                    aOriginalURI,  // Original nsIURI
+                    true,          // aSendViolationReports
+                    cspNonce,      // nonce
                     parserCreatedScript, &decision);
     if (NS_CP_REJECTED(decision)) {
       aCancelCode = Some(NS_ERROR_DOM_BAD_URI);
       return NS_BINDING_FAILED;
     }
   }
 
   return NS_OK;
--- a/dom/security/nsCSPUtils.cpp
+++ b/dom/security/nsCSPUtils.cpp
@@ -1361,18 +1361,17 @@ nsCSPPolicy::~nsCSPPolicy() {
   for (uint32_t i = 0; i < mDirectives.Length(); i++) {
     delete mDirectives[i];
   }
 }
 
 bool nsCSPPolicy::permits(CSPDirective aDir, nsIURI* aUri,
                           bool aSpecific) const {
   nsString outp;
-  return this->permits(aDir, aUri, EmptyString(), false, aSpecific, false,
-                       outp);
+  return this->permits(aDir, aUri, u""_ns, false, aSpecific, false, outp);
 }
 
 bool nsCSPPolicy::permits(CSPDirective aDir, nsIURI* aUri,
                           const nsAString& aNonce, bool aWasRedirected,
                           bool aSpecific, bool aParserCreated,
                           nsAString& outViolatedDirective) const {
   if (CSPUTILSLOGENABLED()) {
     CSPUTILSLOG(("nsCSPPolicy::permits, aUri: %s, aDir: %d, aSpecific: %s",
@@ -1502,23 +1501,22 @@ bool nsCSPPolicy::allowsNavigateTo(nsIUR
   bool allowsNavigateTo = true;
 
   for (unsigned long i = 0; i < mDirectives.Length(); i++) {
     if (mDirectives[i]->equals(
             nsIContentSecurityPolicy::NAVIGATE_TO_DIRECTIVE)) {
       // Early return if we can skip the allowlist AND 'unsafe-allow-redirects'
       // is present.
       if (!aEnforceAllowlist &&
-          mDirectives[i]->allows(CSP_UNSAFE_ALLOW_REDIRECTS, EmptyString(),
-                                 false)) {
+          mDirectives[i]->allows(CSP_UNSAFE_ALLOW_REDIRECTS, u""_ns, false)) {
         return true;
       }
       // Otherwise, check against the allowlist.
-      if (!mDirectives[i]->permits(aURI, EmptyString(), aWasRedirected, false,
-                                   false, false)) {
+      if (!mDirectives[i]->permits(aURI, u""_ns, aWasRedirected, false, false,
+                                   false)) {
         allowsNavigateTo = false;
       }
     }
   }
 
   return allowsNavigateTo;
 }
 
--- a/dom/security/nsContentSecurityManager.cpp
+++ b/dom/security/nsContentSecurityManager.cpp
@@ -387,57 +387,57 @@ static nsresult DoContentSecurityChecks(
   nsCString mimeTypeGuess;
 
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_GetFinalChannelURI(aChannel, getter_AddRefs(uri));
   NS_ENSURE_SUCCESS(rv, rv);
 
   switch (contentPolicyType) {
     case nsIContentPolicy::TYPE_OTHER: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_SCRIPT: {
       mimeTypeGuess = "application/javascript"_ns;
       break;
     }
 
     case nsIContentPolicy::TYPE_IMAGE: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_STYLESHEET: {
       mimeTypeGuess = "text/css"_ns;
       break;
     }
 
     case nsIContentPolicy::TYPE_OBJECT: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_DOCUMENT: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_SUBDOCUMENT: {
       mimeTypeGuess = "text/html"_ns;
       break;
     }
 
     case nsIContentPolicy::TYPE_REFRESH: {
       MOZ_ASSERT(false, "contentPolicyType not supported yet");
       break;
     }
 
     case nsIContentPolicy::TYPE_PING: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_XMLHTTPREQUEST: {
       // alias nsIContentPolicy::TYPE_DATAREQUEST:
 #ifdef DEBUG
       {
         nsCOMPtr<nsINode> node = aLoadInfo->LoadingNode();
@@ -445,61 +445,61 @@ static nsresult DoContentSecurityChecks(
                    "type_xml requires requestingContext of type Document");
       }
 #endif
       // We're checking for the external TYPE_XMLHTTPREQUEST here in case
       // an addon creates a request with that type.
       if (internalContentPolicyType ==
               nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST ||
           internalContentPolicyType == nsIContentPolicy::TYPE_XMLHTTPREQUEST) {
-        mimeTypeGuess = EmptyCString();
+        mimeTypeGuess.Truncate();
       } else {
         MOZ_ASSERT(internalContentPolicyType ==
                        nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE,
                    "can not set mime type guess for unexpected internal type");
         mimeTypeGuess = nsLiteralCString(TEXT_EVENT_STREAM);
       }
       break;
     }
 
     case nsIContentPolicy::TYPE_OBJECT_SUBREQUEST: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
 #ifdef DEBUG
       {
         nsCOMPtr<nsINode> node = aLoadInfo->LoadingNode();
         MOZ_ASSERT(
             !node || node->NodeType() == nsINode::ELEMENT_NODE,
             "type_subrequest requires requestingContext of type Element");
       }
 #endif
       break;
     }
 
     case nsIContentPolicy::TYPE_DTD: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
 #ifdef DEBUG
       {
         nsCOMPtr<nsINode> node = aLoadInfo->LoadingNode();
         MOZ_ASSERT(!node || node->NodeType() == nsINode::DOCUMENT_NODE,
                    "type_dtd requires requestingContext of type Document");
       }
 #endif
       break;
     }
 
     case nsIContentPolicy::TYPE_FONT: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_MEDIA: {
       if (internalContentPolicyType == nsIContentPolicy::TYPE_INTERNAL_TRACK) {
         mimeTypeGuess = "text/vtt"_ns;
       } else {
-        mimeTypeGuess = EmptyCString();
+        mimeTypeGuess.Truncate();
       }
 #ifdef DEBUG
       {
         nsCOMPtr<nsINode> node = aLoadInfo->LoadingNode();
         MOZ_ASSERT(!node || node->NodeType() == nsINode::ELEMENT_NODE,
                    "type_media requires requestingContext of type Element");
       }
 #endif
@@ -511,71 +511,71 @@ static nsresult DoContentSecurityChecks(
       // ws:// instead of http:// for CSP checks
       nsCOMPtr<nsIHttpChannelInternal> httpChannelInternal =
           do_QueryInterface(aChannel);
       MOZ_ASSERT(httpChannelInternal);
       if (httpChannelInternal) {
         rv = httpChannelInternal->GetProxyURI(getter_AddRefs(uri));
         MOZ_ASSERT(NS_SUCCEEDED(rv));
       }
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_CSP_REPORT: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_XSLT: {
       mimeTypeGuess = "application/xml"_ns;
 #ifdef DEBUG
       {
         nsCOMPtr<nsINode> node = aLoadInfo->LoadingNode();
         MOZ_ASSERT(!node || node->NodeType() == nsINode::DOCUMENT_NODE,
                    "type_xslt requires requestingContext of type Document");
       }
 #endif
       break;
     }
 
     case nsIContentPolicy::TYPE_BEACON: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
 #ifdef DEBUG
       {
         nsCOMPtr<nsINode> node = aLoadInfo->LoadingNode();
         MOZ_ASSERT(!node || node->NodeType() == nsINode::DOCUMENT_NODE,
                    "type_beacon requires requestingContext of type Document");
       }
 #endif
       break;
     }
 
     case nsIContentPolicy::TYPE_FETCH: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_IMAGESET: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_WEB_MANIFEST: {
       mimeTypeGuess = "application/manifest+json"_ns;
       break;
     }
 
     case nsIContentPolicy::TYPE_SAVEAS_DOWNLOAD: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     case nsIContentPolicy::TYPE_SPECULATIVE: {
-      mimeTypeGuess = EmptyCString();
+      mimeTypeGuess.Truncate();
       break;
     }
 
     default:
       // nsIContentPolicy::TYPE_INVALID
       MOZ_ASSERT(false,
                  "can not perform security check without a valid contentType");
   }
--- a/dom/security/nsContentSecurityUtils.cpp
+++ b/dom/security/nsContentSecurityUtils.cpp
@@ -612,17 +612,17 @@ void nsContentSecurityUtils::NotifyEvalU
   nsAutoString message;
   AutoTArray<nsString, 1> formatStrings = {aFileNameA};
   nsresult rv = bundle->FormatStringFromName("RestrictBrowserEvalUsage",
                                              formatStrings, message);
   if (NS_FAILED(rv)) {
     return;
   }
 
-  rv = error->InitWithWindowID(message, aFileNameA, EmptyString(), aLineNumber,
+  rv = error->InitWithWindowID(message, aFileNameA, u""_ns, aLineNumber,
                                aColumnNumber, nsIScriptError::errorFlag,
                                "BrowserEvalUsage", aWindowID,
                                true /* From chrome context */);
   if (NS_FAILED(rv)) {
     return;
   }
   console->LogMessage(error);
 }
--- a/dom/security/nsMixedContentBlocker.cpp
+++ b/dom/security/nsMixedContentBlocker.cpp
@@ -72,17 +72,17 @@ enum MixedContentHSTSState {
 nsMixedContentBlocker::~nsMixedContentBlocker() = default;
 
 NS_IMPL_ISUPPORTS(nsMixedContentBlocker, nsIContentPolicy, nsIChannelEventSink)
 
 static void LogMixedContentMessage(
     MixedContentTypes aClassification, nsIURI* aContentLocation,
     uint64_t aInnerWindowID, nsMixedContentBlockerMessageType aMessageType,
     nsIURI* aRequestingLocation,
-    const nsACString& aOverruleMessageLookUpKeyWithThis = EmptyCString()) {
+    const nsACString& aOverruleMessageLookUpKeyWithThis = ""_ns) {
   nsAutoCString messageCategory;
   uint32_t severityFlag;
   nsAutoCString messageLookupKey;
 
   if (aMessageType == eBlocked) {
     severityFlag = nsIScriptError::errorFlag;
     messageCategory.AssignLiteral("Mixed Content Blocker");
     if (aClassification == eMixedDisplay) {
@@ -179,17 +179,17 @@ nsMixedContentBlocker::AsyncOnChannelRed
     // early if it is
     if (requestingPrincipal->IsSystemPrincipal()) {
       return NS_OK;
     }
   }
 
   int16_t decision = REJECT_REQUEST;
   rv = ShouldLoad(newUri, loadInfo,
-                  EmptyCString(),  // aMimeGuess
+                  ""_ns,  // aMimeGuess
                   &decision);
   if (NS_FAILED(rv)) {
     autoCallback.DontCallback();
     aOldChannel->Cancel(NS_ERROR_DOM_BAD_URI);
     return NS_BINDING_FAILED;
   }
 
   // If the channel is about to load mixed content, abort the channel
@@ -750,20 +750,20 @@ nsresult nsMixedContentBlocker::ShouldLo
     nsAutoCString spec;
     nsresult rv = aContentLocation->GetSpec(spec);
     NS_ENSURE_SUCCESS(rv, rv);
 
     AutoTArray<nsString, 1> params;
     CopyUTF8toUTF16(spec, *params.AppendElement());
 
     CSP_LogLocalizedStr("blockAllMixedContent", params,
-                        EmptyString(),  // aSourceFile
-                        EmptyString(),  // aScriptSample
-                        0,              // aLineNumber
-                        0,              // aColumnNumber
+                        u""_ns,  // aSourceFile
+                        u""_ns,  // aScriptSample
+                        0,       // aLineNumber
+                        0,       // aColumnNumber
                         nsIScriptError::errorFlag, "blockAllMixedContent"_ns,
                         requestingWindow->Id(),
                         !!aLoadInfo->GetOriginAttributes().mPrivateBrowsingId);
     *aDecision = REJECT_REQUEST;
     MOZ_LOG(
         sMCBLog, LogLevel::Verbose,
         ("  -> decision: Request will be rejected because the CSP directive "
          "'block-all-mixed-content' was set while trying to load data from "
--- a/dom/security/sanitizer/Sanitizer.cpp
+++ b/dom/security/sanitizer/Sanitizer.cpp
@@ -133,17 +133,17 @@ already_AddRefed<DocumentFragment> Sanit
 
   treeSanitizer.Sanitize(fragment);
   return fragment.forget();
 }
 
 void Sanitizer::SanitizeToString(
     const Optional<StringOrDocumentFragmentOrDocument>& aInput,
     nsAString& outSanitized, ErrorResult& aRv) {
-  outSanitized = EmptyString();
+  outSanitized.Truncate();
   if (!aInput.WasPassed()) {
     AutoTArray<nsString, 1> params = {};
     LogLocalizedString("SanitizerRcvdNoInput", params,
                        nsIScriptError::warningFlag);
     return;
   }
   ErrorResult error;
   RefPtr<DocumentFragment> fragment =
--- a/dom/security/test/gtest/TestCSPParser.cpp
+++ b/dom/security/test/gtest/TestCSPParser.cpp
@@ -84,18 +84,18 @@ nsresult runTest(
 
   // create a CSP object
   nsCOMPtr<nsIContentSecurityPolicy> csp =
       do_CreateInstance(NS_CSPCONTEXT_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // for testing the parser we only need to set a principal which is needed
   // to translate the keyword 'self' into an actual URI.
-  rv = csp->SetRequestContextWithPrincipal(selfURIPrincipal, selfURI,
-                                           EmptyString(), 0);
+  rv =
+      csp->SetRequestContextWithPrincipal(selfURIPrincipal, selfURI, u""_ns, 0);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // append a policy
   nsString policyStr;
   policyStr.AssignASCII(aPolicy);
   rv = csp->AppendPolicy(policyStr, false, false);
   NS_ENSURE_SUCCESS(rv, rv);
 
--- a/dom/serviceworkers/FetchEventOpChild.cpp
+++ b/dom/serviceworkers/FetchEventOpChild.cpp
@@ -65,17 +65,17 @@ bool CSPPermitsResponse(nsILoadInfo* aLo
 
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), url, nullptr, nullptr);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
   }
 
   int16_t decision = nsIContentPolicy::ACCEPT;
-  rv = NS_CheckContentLoadPolicy(uri, aLoadInfo, EmptyCString(), &decision);
+  rv = NS_CheckContentLoadPolicy(uri, aLoadInfo, ""_ns, &decision);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
   }
 
   return decision == nsIContentPolicy::ACCEPT;
 }
 
 void AsyncLog(nsIInterceptedChannel* aChannel, const nsACString& aScriptSpec,
@@ -343,17 +343,17 @@ nsresult FetchEventOpChild::StartSynthes
   for (auto& entry : entries) {
     mInterceptedChannel->SynthesizeHeader(entry.mName, entry.mValue);
   }
 
   auto castLoadInfo = static_cast<mozilla::net::LoadInfo*>(loadInfo.get());
   castLoadInfo->SynthesizeServiceWorkerTainting(response->GetTainting());
 
   // Get the preferred alternative data type of the outer channel
-  nsAutoCString preferredAltDataType(EmptyCString());
+  nsAutoCString preferredAltDataType(""_ns);
   nsCOMPtr<nsICacheInfoChannel> outerChannel =
       do_QueryInterface(underlyingChannel);
   if (outerChannel &&
       !outerChannel->PreferredAlternativeDataTypes().IsEmpty()) {
     preferredAltDataType.Assign(
         outerChannel->PreferredAlternativeDataTypes()[0].type());
   }
 
--- a/dom/serviceworkers/ServiceWorkerEvents.cpp
+++ b/dom/serviceworkers/ServiceWorkerEvents.cpp
@@ -310,17 +310,17 @@ class StartResponse final : public Runna
       mChannel->SynthesizeHeader(entries[i].mName, entries[i].mValue);
     }
 
     auto castLoadInfo = static_cast<mozilla::net::LoadInfo*>(loadInfo.get());
     castLoadInfo->SynthesizeServiceWorkerTainting(
         mInternalResponse->GetTainting());
 
     // Get the preferred alternative data type of outter channel
-    nsAutoCString preferredAltDataType(EmptyCString());
+    nsAutoCString preferredAltDataType(""_ns);
     nsCOMPtr<nsICacheInfoChannel> outerChannel =
         do_QueryInterface(underlyingChannel);
     if (outerChannel &&
         !outerChannel->PreferredAlternativeDataTypes().IsEmpty()) {
       // TODO: handle multiple types properly.
       preferredAltDataType.Assign(
           outerChannel->PreferredAlternativeDataTypes()[0].type());
     }
@@ -372,17 +372,17 @@ class StartResponse final : public Runna
     nsCString url = mInternalResponse->GetUnfilteredURL();
     if (url.IsEmpty()) {
       // Synthetic response. The buck stops at the worker script.
       url = mScriptSpec;
     }
     rv = NS_NewURI(getter_AddRefs(uri), url);
     NS_ENSURE_SUCCESS(rv, false);
     int16_t decision = nsIContentPolicy::ACCEPT;
-    rv = NS_CheckContentLoadPolicy(uri, aLoadInfo, EmptyCString(), &decision);
+    rv = NS_CheckContentLoadPolicy(uri, aLoadInfo, ""_ns, &decision);
     NS_ENSURE_SUCCESS(rv, false);
     return decision == nsIContentPolicy::ACCEPT;
   }
 };
 
 class RespondWithHandler final : public PromiseNativeHandler {
   nsMainThreadPtrHandle<nsIInterceptedChannel> mInterceptedChannel;
   nsMainThreadPtrHandle<ServiceWorkerRegistrationInfo> mRegistration;
@@ -923,17 +923,17 @@ class WaitUntilHandler final : public Pr
 
     // Note, there is a corner case where this won't report to the window
     // that triggered the error.  Consider a navigation fetch event that
     // rejects waitUntil() without holding respondWith() open.  In this case
     // there is no controlling document yet, the window did call .register()
     // because there is no documeny yet, and the navigation is no longer
     // being intercepted.
 
-    swm->ReportToAllClients(mScope, message, mSourceSpec, EmptyString(), mLine,
+    swm->ReportToAllClients(mScope, message, mSourceSpec, u""_ns, mLine,
                             mColumn, nsIScriptError::errorFlag);
   }
 };
 
 NS_IMPL_ISUPPORTS0(WaitUntilHandler)
 
 }  // anonymous namespace
 
@@ -1098,18 +1098,18 @@ void PushMessageData::ArrayBuffer(JSCont
   if (data) {
     BodyUtil::ConsumeArrayBuffer(cx, aRetval, mBytes.Length(), data, aRv);
   }
 }
 
 already_AddRefed<mozilla::dom::Blob> PushMessageData::Blob(ErrorResult& aRv) {
   uint8_t* data = GetContentsCopy();
   if (data) {
-    RefPtr<mozilla::dom::Blob> blob = BodyUtil::ConsumeBlob(
-        mOwner, EmptyString(), mBytes.Length(), data, aRv);
+    RefPtr<mozilla::dom::Blob> blob =
+        BodyUtil::ConsumeBlob(mOwner, u""_ns, mBytes.Length(), data, aRv);
     if (blob) {
       return blob.forget();
     }
   }
   return nullptr;
 }
 
 nsresult PushMessageData::EnsureDecodedText() {
--- a/dom/serviceworkers/ServiceWorkerManager.cpp
+++ b/dom/serviceworkers/ServiceWorkerManager.cpp
@@ -1234,21 +1234,21 @@ ServiceWorkerManager::SendPushEvent(cons
   if (optional_argc == 1) {
     // This does one copy here (while constructing the Maybe) and another when
     // we end up copying into the SendPushEventRunnable.  We could fix that to
     // only do one copy by making things between here and there take
     // Maybe<nsTArray<uint8_t>>&&, but then we'd need to copy before we know
     // whether we really need to in PushMessageDispatcher::NotifyWorkers.  Since
     // in practice this only affects JS callers that pass data, and we don't
     // have any right now, let's not worry about it.
-    return SendPushEvent(aOriginAttributes, aScope, EmptyString(),
+    return SendPushEvent(aOriginAttributes, aScope, u""_ns,
                          Some(aDataBytes.Clone()));
   }
   MOZ_ASSERT(optional_argc == 0);
-  return SendPushEvent(aOriginAttributes, aScope, EmptyString(), Nothing());
+  return SendPushEvent(aOriginAttributes, aScope, u""_ns, Nothing());
 }
 
 nsresult ServiceWorkerManager::SendPushEvent(
     const nsACString& aOriginAttributes, const nsACString& aScope,
     const nsAString& aMessageId, const Maybe<nsTArray<uint8_t>>& aData) {
   OriginAttributes attrs;
   if (!attrs.PopulateFromSuffix(aOriginAttributes)) {
     return NS_ERROR_INVALID_ARG;
@@ -2624,19 +2624,18 @@ void ServiceWorkerManager::Update(
 
   RefPtr<GenericPromise::Private> promise =
       new GenericPromise::Private(__func__);
 
   RefPtr<CancelableRunnable> successRunnable =
       new UpdateRunnable(aPrincipal, aScope, std::move(aNewestWorkerScriptUrl),
                          aCallback, UpdateRunnable::eSuccess, promise);