Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
authorSylvestre Ledru <sledru@mozilla.com>
Wed, 04 Nov 2020 17:04:01 +0000
changeset 555890 8a260892acc935e4f0911b38029e69e8178c06c3
parent 555889 b76268bfeb60d78738df3dec94a285aace5a4dda
child 555891 6137e9da86b783871df15cea6ad61597adb1f6ef
push id37922
push usercbrindusan@mozilla.com
push dateThu, 05 Nov 2020 04:52:47 +0000
treeherdermozilla-central@ffeebb5c7d51 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssg, andi
bugs1674637
milestone84.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 1674637 - Use nested namespaces in dom/ r=sg,andi Also add some missing namespace qualifications Done with: ./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/ ./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}') Differential Revision: https://phabricator.services.mozilla.com/D95456
dom/abort/AbortController.cpp
dom/abort/AbortSignal.cpp
dom/animation/Animation.cpp
dom/animation/AnimationEffect.cpp
dom/animation/AnimationTimeline.cpp
dom/animation/CSSAnimation.cpp
dom/animation/CSSPseudoElement.cpp
dom/animation/CSSTransition.cpp
dom/animation/DocumentTimeline.cpp
dom/audiochannel/AudioChannelService.cpp
dom/base/AbstractRange.cpp
dom/base/AnonymousContent.cpp
dom/base/Attr.cpp
dom/base/BarProps.cpp
dom/base/BindContext.cpp
dom/base/BodyConsumer.cpp
dom/base/BodyStream.cpp
dom/base/BodyUtil.cpp
dom/base/BorrowedAttrInfo.cpp
dom/base/CCGCScheduler.h
dom/base/CharacterData.cpp
dom/base/ChildIterator.cpp
dom/base/ChromeMessageBroadcaster.cpp
dom/base/ChromeMessageSender.cpp
dom/base/ChromeUtils.cpp
dom/base/Comment.cpp
dom/base/Crypto.cpp
dom/base/CustomElementRegistry.cpp
dom/base/DOMException.cpp
dom/base/DOMImplementation.cpp
dom/base/DOMIntersectionObserver.cpp
dom/base/DOMMatrix.cpp
dom/base/DOMStringList.cpp
dom/base/DocGroup.cpp
dom/base/Document.cpp
dom/base/DocumentFragment.cpp
dom/base/DocumentOrShadowRoot.cpp
dom/base/DocumentType.cpp
dom/base/Element.cpp
dom/base/EventSource.cpp
dom/base/EventSourceEventService.cpp
dom/base/GeneratedImageContent.cpp
dom/base/IDTracker.cpp
dom/base/IdleDeadline.cpp
dom/base/IdleRequest.cpp
dom/base/ImageEncoder.cpp
dom/base/ImageTracker.cpp
dom/base/IntlUtils.cpp
dom/base/Link.cpp
dom/base/LinkStyle.cpp
dom/base/Location.cpp
dom/base/LocationBase.cpp
dom/base/MaybeCrossOriginObject.cpp
dom/base/MessageBroadcaster.cpp
dom/base/MessageListenerManager.cpp
dom/base/MessageManagerGlobal.cpp
dom/base/MessageSender.cpp
dom/base/MozQueryInterface.cpp
dom/base/Navigator.cpp
dom/base/NodeIterator.cpp
dom/base/ParentProcessMessageManager.cpp
dom/base/PlacesEvent.cpp
dom/base/PlacesObservers.cpp
dom/base/PlacesWeakCallbackWrapper.cpp
dom/base/PopupBlocker.cpp
dom/base/Pose.cpp
dom/base/PostMessageEvent.cpp
dom/base/ProcessMessageManager.cpp
dom/base/RemoteOuterWindowProxy.cpp
dom/base/ResizeObserver.cpp
dom/base/ResizeObserverController.cpp
dom/base/ResponsiveImageSelector.cpp
dom/base/ScreenLuminance.cpp
dom/base/SerializedStackHolder.cpp
dom/base/StaticRange.cpp
dom/base/StorageAccessPermissionRequest.cpp
dom/base/StructuredCloneBlob.cpp
dom/base/StructuredCloneHolder.cpp
dom/base/StyleSheetList.cpp
dom/base/SubtleCrypto.cpp
dom/base/Text.cpp
dom/base/Timeout.cpp
dom/base/TimeoutBudgetManager.cpp
dom/base/TimeoutExecutor.cpp
dom/base/TimeoutHandler.cpp
dom/base/TreeWalker.cpp
dom/base/UIDirectionManager.cpp
dom/base/UserActivation.cpp
dom/base/WindowNamedPropertiesHandler.cpp
dom/base/nsContentPermissionHelper.cpp
dom/base/nsTextFragment.cpp
dom/bindings/CallbackInterface.cpp
dom/bindings/CallbackObject.cpp
dom/bindings/DOMJSProxyHandler.cpp
dom/bindings/Exceptions.cpp
dom/bindings/IterableIterator.cpp
dom/bindings/RemoteObjectProxy.cpp
dom/bindings/SimpleGlobalObject.cpp
dom/bindings/ToJSValue.cpp
dom/bindings/WebIDLGlobalNameHash.cpp
dom/bindings/test/TestFunctions.cpp
dom/bindings/test/TestInterfaceIterableDouble.cpp
dom/bindings/test/TestInterfaceIterableDoubleUnion.cpp
dom/bindings/test/TestInterfaceIterableSingle.cpp
dom/bindings/test/TestInterfaceMaplike.cpp
dom/bindings/test/TestInterfaceMaplikeObject.cpp
dom/bindings/test/TestInterfaceSetlike.cpp
dom/bindings/test/TestInterfaceSetlikeNode.cpp
dom/bindings/test/WrapperCachedNonISupportsTestInterface.cpp
dom/cache/Action.cpp
dom/cache/ActorChild.cpp
dom/cache/AutoUtils.cpp
dom/cache/Cache.cpp
dom/cache/CacheChild.cpp
dom/cache/CacheOpChild.cpp
dom/cache/CacheOpParent.cpp
dom/cache/CacheParent.cpp
dom/cache/CacheStorage.cpp
dom/cache/CacheStorageChild.cpp
dom/cache/CacheStorageParent.cpp
dom/cache/CacheStreamControlChild.cpp
dom/cache/CacheStreamControlParent.cpp
dom/cache/CacheWorkerRef.cpp
dom/cache/Connection.cpp
dom/cache/Context.cpp
dom/cache/DBAction.cpp
dom/cache/DBSchema.cpp
dom/cache/FileUtils.cpp
dom/cache/Manager.cpp
dom/cache/ManagerId.cpp
dom/cache/PrincipalVerifier.cpp
dom/cache/QuotaClient.cpp
dom/cache/ReadStream.cpp
dom/cache/StreamControl.cpp
dom/cache/StreamList.cpp
dom/cache/TypeUtils.cpp
dom/canvas/CanvasRenderingContext2D.cpp
dom/canvas/CanvasRenderingContextHelper.cpp
dom/canvas/CanvasUtils.cpp
dom/canvas/ImageBitmap.cpp
dom/canvas/ImageBitmapRenderingContext.cpp
dom/canvas/ImageData.cpp
dom/canvas/OffscreenCanvas.cpp
dom/canvas/Queue.cpp
dom/canvas/WebGLChild.cpp
dom/canvas/WebGLFormats.cpp
dom/canvas/WebGLParent.cpp
dom/canvas/XRWebGLLayer.cpp
dom/clients/api/Client.cpp
dom/clients/api/Clients.cpp
dom/clients/manager/ClientChannelHelper.cpp
dom/clients/manager/ClientHandle.cpp
dom/clients/manager/ClientHandleChild.cpp
dom/clients/manager/ClientHandleOpChild.cpp
dom/clients/manager/ClientHandleOpParent.cpp
dom/clients/manager/ClientHandleParent.cpp
dom/clients/manager/ClientInfo.cpp
dom/clients/manager/ClientManager.cpp
dom/clients/manager/ClientManagerActors.cpp
dom/clients/manager/ClientManagerChild.cpp
dom/clients/manager/ClientManagerOpChild.cpp
dom/clients/manager/ClientManagerOpParent.cpp
dom/clients/manager/ClientManagerParent.cpp
dom/clients/manager/ClientManagerService.cpp
dom/clients/manager/ClientNavigateOpChild.cpp
dom/clients/manager/ClientNavigateOpParent.cpp
dom/clients/manager/ClientOpenWindowUtils.cpp
dom/clients/manager/ClientPrincipalUtils.cpp
dom/clients/manager/ClientSource.cpp
dom/clients/manager/ClientSourceChild.cpp
dom/clients/manager/ClientSourceOpChild.cpp
dom/clients/manager/ClientSourceOpParent.cpp
dom/clients/manager/ClientSourceParent.cpp
dom/clients/manager/ClientState.cpp
dom/clients/manager/ClientValidation.cpp
dom/console/Console.cpp
dom/console/ConsoleInstance.cpp
dom/console/ConsoleUtils.cpp
dom/credentialmanagement/Credential.cpp
dom/credentialmanagement/CredentialsContainer.cpp
dom/crypto/CryptoBuffer.cpp
dom/crypto/CryptoKey.cpp
dom/crypto/KeyAlgorithmProxy.cpp
dom/crypto/WebCryptoTask.cpp
dom/debugger/CallbackDebuggerNotification.cpp
dom/debugger/DebuggerNotification.cpp
dom/debugger/DebuggerNotificationManager.cpp
dom/debugger/DebuggerNotificationObserver.cpp
dom/debugger/EventCallbackDebuggerNotification.cpp
dom/encoding/TextDecoder.cpp
dom/encoding/TextEncoder.cpp
dom/events/AnimationEvent.cpp
dom/events/BeforeUnloadEvent.cpp
dom/events/Clipboard.cpp
dom/events/ClipboardEvent.cpp
dom/events/CommandEvent.cpp
dom/events/CompositionEvent.cpp
dom/events/ConstructibleEventTarget.cpp
dom/events/DataTransfer.cpp
dom/events/DataTransferItem.cpp
dom/events/DataTransferItemList.cpp
dom/events/DeviceMotionEvent.cpp
dom/events/DragEvent.cpp
dom/events/Event.cpp
dom/events/EventTarget.cpp
dom/events/FocusEvent.cpp
dom/events/ImageCaptureError.cpp
dom/events/InputEvent.cpp
dom/events/KeyboardEvent.cpp
dom/events/MessageEvent.cpp
dom/events/MouseEvent.cpp
dom/events/MouseScrollEvent.cpp
dom/events/MutationEvent.cpp
dom/events/NotifyPaintEvent.cpp
dom/events/PaintRequest.cpp
dom/events/PointerEvent.cpp
dom/events/RemoteDragStartData.cpp
dom/events/ScrollAreaEvent.cpp
dom/events/SimpleGestureEvent.cpp
dom/events/SpeechRecognitionError.cpp
dom/events/StorageEvent.cpp
dom/events/TextClause.cpp
dom/events/Touch.cpp
dom/events/TouchEvent.cpp
dom/events/TransitionEvent.cpp
dom/events/UIEvent.cpp
dom/events/WheelEvent.cpp
dom/events/XULCommandEvent.cpp
dom/fetch/BodyExtractor.cpp
dom/fetch/EmptyBody.cpp
dom/fetch/Fetch.cpp
dom/fetch/FetchDriver.cpp
dom/fetch/FetchObserver.cpp
dom/fetch/FetchStreamReader.cpp
dom/fetch/FetchUtil.cpp
dom/fetch/Headers.cpp
dom/fetch/InternalHeaders.cpp
dom/fetch/InternalRequest.cpp
dom/fetch/InternalResponse.cpp
dom/fetch/Request.cpp
dom/fetch/Response.cpp
dom/file/BaseBlobImpl.cpp
dom/file/Blob.cpp
dom/file/BlobImpl.cpp
dom/file/BlobSet.cpp
dom/file/EmptyBlobImpl.cpp
dom/file/File.cpp
dom/file/FileBlobImpl.cpp
dom/file/FileCreatorHelper.cpp
dom/file/FileList.cpp
dom/file/FileReader.cpp
dom/file/MemoryBlobImpl.cpp
dom/file/MutableBlobStorage.cpp
dom/file/MutableBlobStreamListener.cpp
dom/file/StreamBlobImpl.cpp
dom/file/StringBlobImpl.cpp
dom/file/TemporaryFileBlobImpl.cpp
dom/file/ipc/FileCreatorChild.cpp
dom/file/ipc/FileCreatorParent.cpp
dom/file/ipc/IPCBlobUtils.cpp
dom/file/ipc/TemporaryIPCBlobChild.cpp
dom/file/ipc/TemporaryIPCBlobParent.cpp
dom/file/uri/BlobURLInputStream.cpp
dom/file/uri/BlobURLProtocolHandler.cpp
dom/filehandle/ActorsParent.cpp
dom/filesystem/Directory.cpp
dom/filesystem/FileSystemBase.cpp
dom/filesystem/FileSystemRequestParent.cpp
dom/filesystem/FileSystemSecurity.cpp
dom/filesystem/FileSystemTaskBase.cpp
dom/filesystem/FileSystemUtils.cpp
dom/filesystem/GetDirectoryListingTask.cpp
dom/filesystem/GetFileOrDirectoryTask.cpp
dom/filesystem/GetFilesHelper.cpp
dom/filesystem/GetFilesTask.cpp
dom/filesystem/OSFileSystem.cpp
dom/filesystem/compat/CallbackRunnables.cpp
dom/filesystem/compat/FileSystem.cpp
dom/filesystem/compat/FileSystemDirectoryEntry.cpp
dom/filesystem/compat/FileSystemDirectoryReader.cpp
dom/filesystem/compat/FileSystemEntry.cpp
dom/filesystem/compat/FileSystemFileEntry.cpp
dom/filesystem/compat/FileSystemRootDirectoryEntry.cpp
dom/filesystem/compat/FileSystemRootDirectoryReader.cpp
dom/flex/Flex.cpp
dom/flex/FlexItemValues.cpp
dom/flex/FlexLineValues.cpp
dom/gamepad/Gamepad.cpp
dom/gamepad/GamepadButton.cpp
dom/gamepad/GamepadHapticActuator.cpp
dom/gamepad/GamepadLightIndicator.cpp
dom/gamepad/GamepadManager.cpp
dom/gamepad/GamepadPlatformService.cpp
dom/gamepad/GamepadPose.cpp
dom/gamepad/GamepadRemapping.cpp
dom/gamepad/GamepadServiceTest.cpp
dom/gamepad/GamepadTouch.cpp
dom/gamepad/ipc/GamepadEventChannelChild.cpp
dom/gamepad/ipc/GamepadEventChannelParent.cpp
dom/gamepad/ipc/GamepadTestChannelChild.cpp
dom/gamepad/ipc/GamepadTestChannelParent.cpp
dom/gamepad/linux/LinuxGamepad.cpp
dom/grid/Grid.cpp
dom/grid/GridArea.cpp
dom/grid/GridDimension.cpp
dom/grid/GridLine.cpp
dom/grid/GridLines.cpp
dom/grid/GridTrack.cpp
dom/grid/GridTracks.cpp
dom/html/ElementInternals.cpp
dom/html/HTMLAllCollection.cpp
dom/html/HTMLAnchorElement.cpp
dom/html/HTMLAreaElement.cpp
dom/html/HTMLAudioElement.cpp
dom/html/HTMLBRElement.cpp
dom/html/HTMLBodyElement.cpp
dom/html/HTMLButtonElement.cpp
dom/html/HTMLCanvasElement.cpp
dom/html/HTMLDataElement.cpp
dom/html/HTMLDataListElement.cpp
dom/html/HTMLDetailsElement.cpp
dom/html/HTMLDialogElement.cpp
dom/html/HTMLDivElement.cpp
dom/html/HTMLElement.cpp
dom/html/HTMLEmbedElement.cpp
dom/html/HTMLFieldSetElement.cpp
dom/html/HTMLFontElement.cpp
dom/html/HTMLFormControlsCollection.cpp
dom/html/HTMLFormElement.cpp
dom/html/HTMLFormSubmission.cpp
dom/html/HTMLFrameElement.cpp
dom/html/HTMLFrameSetElement.cpp
dom/html/HTMLHRElement.cpp
dom/html/HTMLHeadingElement.cpp
dom/html/HTMLIFrameElement.cpp
dom/html/HTMLImageElement.cpp
dom/html/HTMLInputElement.cpp
dom/html/HTMLLIElement.cpp
dom/html/HTMLLabelElement.cpp
dom/html/HTMLLegendElement.cpp
dom/html/HTMLLinkElement.cpp
dom/html/HTMLMapElement.cpp
dom/html/HTMLMarqueeElement.cpp
dom/html/HTMLMediaElement.cpp
dom/html/HTMLMenuElement.cpp
dom/html/HTMLMenuItemElement.cpp
dom/html/HTMLMetaElement.cpp
dom/html/HTMLMeterElement.cpp
dom/html/HTMLModElement.cpp
dom/html/HTMLObjectElement.cpp
dom/html/HTMLOptGroupElement.cpp
dom/html/HTMLOptionElement.cpp
dom/html/HTMLOptionsCollection.cpp
dom/html/HTMLOutputElement.cpp
dom/html/HTMLParagraphElement.cpp
dom/html/HTMLPictureElement.cpp
dom/html/HTMLPreElement.cpp
dom/html/HTMLProgressElement.cpp
dom/html/HTMLScriptElement.cpp
dom/html/HTMLSelectElement.cpp
dom/html/HTMLSharedElement.cpp
dom/html/HTMLSharedListElement.cpp
dom/html/HTMLSlotElement.cpp
dom/html/HTMLSourceElement.cpp
dom/html/HTMLSpanElement.cpp
dom/html/HTMLStyleElement.cpp
dom/html/HTMLSummaryElement.cpp
dom/html/HTMLTableCaptionElement.cpp
dom/html/HTMLTableCellElement.cpp
dom/html/HTMLTableColElement.cpp
dom/html/HTMLTableElement.cpp
dom/html/HTMLTableRowElement.cpp
dom/html/HTMLTableSectionElement.cpp
dom/html/HTMLTemplateElement.cpp
dom/html/HTMLTextAreaElement.cpp
dom/html/HTMLTimeElement.cpp
dom/html/HTMLTitleElement.cpp
dom/html/HTMLTrackElement.cpp
dom/html/HTMLUnknownElement.cpp
dom/html/HTMLVideoElement.cpp
dom/html/ImageDocument.cpp
dom/html/MediaDocument.cpp
dom/html/MediaError.cpp
dom/html/PlayPromise.cpp
dom/html/RadioNodeList.cpp
dom/html/TextTrackManager.cpp
dom/html/TimeRanges.cpp
dom/html/ValidityState.cpp
dom/html/VideoDocument.cpp
dom/html/input/DateTimeInputTypes.cpp
dom/indexedDB/ActorsChild.cpp
dom/indexedDB/FileInfo.cpp
dom/indexedDB/IDBCursor.cpp
dom/indexedDB/IDBCursorType.cpp
dom/indexedDB/IDBDatabase.cpp
dom/indexedDB/IDBEvents.cpp
dom/indexedDB/IDBFactory.cpp
dom/indexedDB/IDBFileHandle.cpp
dom/indexedDB/IDBFileRequest.cpp
dom/indexedDB/IDBIndex.cpp
dom/indexedDB/IDBKeyRange.cpp
dom/indexedDB/IDBMutableFile.cpp
dom/indexedDB/IDBObjectStore.cpp
dom/indexedDB/IDBRequest.cpp
dom/indexedDB/IDBTransaction.cpp
dom/indexedDB/IndexedDatabaseManager.cpp
dom/indexedDB/KeyPath.cpp
dom/indexedDB/PermissionRequestBase.cpp
dom/indexedDB/ProfilerHelpers.cpp
dom/indexedDB/ReportInternalError.cpp
dom/indexedDB/ScriptErrorHelper.cpp
dom/ipc/BrowserBridgeChild.cpp
dom/ipc/BrowserBridgeHost.cpp
dom/ipc/BrowserBridgeParent.cpp
dom/ipc/BrowserHost.cpp
dom/ipc/BrowserParent.cpp
dom/ipc/ContentProcess.cpp
dom/ipc/ContentProcessManager.cpp
dom/ipc/DocShellMessageUtils.cpp
dom/ipc/InProcessImpl.cpp
dom/ipc/MMPrinter.cpp
dom/ipc/MemMapSnapshot.cpp
dom/ipc/MemoryReportRequest.cpp
dom/ipc/PermissionMessageUtils.cpp
dom/ipc/ProcessActor.cpp
dom/ipc/PropertyBagUtils.cpp
dom/ipc/RefMessageBodyService.cpp
dom/ipc/RemoteBrowser.cpp
dom/ipc/RemoteWebProgress.cpp
dom/ipc/RemoteWebProgressRequest.cpp
dom/ipc/SharedMap.cpp
dom/ipc/SharedStringMap.cpp
dom/ipc/StructuredCloneData.cpp
dom/ipc/TabContext.cpp
dom/ipc/TabMessageUtils.cpp
dom/ipc/WindowGlobalActor.cpp
dom/ipc/WindowGlobalChild.cpp
dom/ipc/WindowGlobalParent.cpp
dom/ipc/jsactor/JSActor.cpp
dom/ipc/jsactor/JSActorManager.cpp
dom/ipc/jsactor/JSActorService.cpp
dom/ipc/jsactor/JSProcessActorChild.cpp
dom/ipc/jsactor/JSProcessActorParent.cpp
dom/ipc/jsactor/JSProcessActorProtocol.cpp
dom/ipc/jsactor/JSWindowActorChild.cpp
dom/ipc/jsactor/JSWindowActorParent.cpp
dom/ipc/jsactor/JSWindowActorProtocol.cpp
dom/localstorage/ActorsChild.cpp
dom/localstorage/ActorsParent.cpp
dom/localstorage/LSDatabase.cpp
dom/localstorage/LSObject.cpp
dom/localstorage/LSObserver.cpp
dom/localstorage/LSSnapshot.cpp
dom/localstorage/LSValue.cpp
dom/localstorage/LSWriteOptimizer.cpp
dom/localstorage/LocalStorageCommon.cpp
dom/localstorage/LocalStorageManager2.cpp
dom/localstorage/ReportInternalError.cpp
dom/localstorage/SnappyUtils.cpp
dom/media/AudioStreamTrack.cpp
dom/media/AudioTrack.cpp
dom/media/AudioTrackList.cpp
dom/media/AutoplayPolicy.cpp
dom/media/CanvasCaptureMediaStream.cpp
dom/media/GVAutoplayPermissionRequest.cpp
dom/media/GetUserMediaRequest.cpp
dom/media/MediaDeviceInfo.cpp
dom/media/MediaDevices.cpp
dom/media/MediaPlaybackDelayPolicy.cpp
dom/media/MediaRecorder.cpp
dom/media/MediaStreamTrack.cpp
dom/media/MediaTrack.cpp
dom/media/MediaTrackList.cpp
dom/media/TextTrack.cpp
dom/media/TextTrackCue.cpp
dom/media/TextTrackCueList.cpp
dom/media/TextTrackList.cpp
dom/media/TextTrackRegion.cpp
dom/media/VideoPlaybackQuality.cpp
dom/media/VideoStreamTrack.cpp
dom/media/VideoTrack.cpp
dom/media/VideoTrackList.cpp
dom/media/WebVTTListener.cpp
dom/media/eme/DetailedPromise.cpp
dom/media/eme/MediaEncryptedEvent.cpp
dom/media/eme/MediaKeyError.cpp
dom/media/eme/MediaKeyMessageEvent.cpp
dom/media/eme/MediaKeySession.cpp
dom/media/eme/MediaKeyStatusMap.cpp
dom/media/eme/MediaKeySystemAccess.cpp
dom/media/eme/MediaKeySystemAccessManager.cpp
dom/media/eme/MediaKeySystemAccessPermissionRequest.cpp
dom/media/eme/MediaKeys.cpp
dom/media/gmp/ChromiumCDMChild.cpp
dom/media/gmp/ChromiumCDMParent.cpp
dom/media/gmp/GMPContentChild.cpp
dom/media/gmp/GMPContentParent.cpp
dom/media/gmp/GMPDiskStorage.cpp
dom/media/gmp/GMPLoader.cpp
dom/media/gmp/GMPMemoryStorage.cpp
dom/media/gmp/GMPParent.cpp
dom/media/gmp/GMPPlatform.cpp
dom/media/gmp/GMPProcessChild.cpp
dom/media/gmp/GMPProcessParent.cpp
dom/media/gmp/GMPServiceChild.cpp
dom/media/gmp/GMPServiceParent.cpp
dom/media/gmp/GMPSharedMemManager.cpp
dom/media/gmp/GMPStorageChild.cpp
dom/media/gmp/GMPTimerChild.cpp
dom/media/gmp/GMPVideoDecoderChild.cpp
dom/media/gmp/GMPVideoDecoderParent.cpp
dom/media/gmp/GMPVideoEncodedFrameImpl.cpp
dom/media/gmp/GMPVideoEncoderChild.cpp
dom/media/gmp/GMPVideoEncoderParent.cpp
dom/media/gmp/GMPVideoHost.cpp
dom/media/gmp/GMPVideoPlaneImpl.cpp
dom/media/gmp/GMPVideoi420FrameImpl.cpp
dom/media/gtest/TestMuxer.cpp
dom/media/gtest/TestVideoSegment.cpp
dom/media/mediacapabilities/MediaCapabilities.cpp
dom/media/mediacontrol/AudioFocusManager.cpp
dom/media/mediacontrol/ContentMediaController.cpp
dom/media/mediacontrol/ContentPlaybackController.cpp
dom/media/mediacontrol/FetchImageHelper.cpp
dom/media/mediacontrol/MediaControlKeyManager.cpp
dom/media/mediacontrol/MediaControlKeySource.cpp
dom/media/mediacontrol/MediaControlService.cpp
dom/media/mediacontrol/MediaControlUtils.cpp
dom/media/mediacontrol/MediaController.cpp
dom/media/mediacontrol/MediaPlaybackStatus.cpp
dom/media/mediacontrol/MediaStatusManager.cpp
dom/media/mediasession/MediaMetadata.cpp
dom/media/mediasession/MediaSession.cpp
dom/media/mediasource/SourceBufferList.cpp
dom/media/systemservices/CamerasChild.cpp
dom/media/systemservices/MediaChild.cpp
dom/media/systemservices/MediaParent.cpp
dom/media/systemservices/MediaSystemResourceManagerChild.cpp
dom/media/systemservices/MediaSystemResourceManagerParent.cpp
dom/media/systemservices/MediaUtils.cpp
dom/media/systemservices/VideoEngine.cpp
dom/media/webaudio/AudioBuffer.cpp
dom/media/webaudio/AudioBufferSourceNode.cpp
dom/media/webaudio/AudioContext.cpp
dom/media/webaudio/AudioDestinationNode.cpp
dom/media/webaudio/AudioEventTimeline.cpp
dom/media/webaudio/AudioListener.cpp
dom/media/webaudio/AudioNode.cpp
dom/media/webaudio/AudioParam.cpp
dom/media/webaudio/AudioParamMap.cpp
dom/media/webaudio/AudioProcessingEvent.cpp
dom/media/webaudio/AudioScheduledSourceNode.cpp
dom/media/webaudio/AudioWorkletGlobalScope.cpp
dom/media/webaudio/AudioWorkletNode.cpp
dom/media/webaudio/AudioWorkletProcessor.cpp
dom/media/webaudio/BiquadFilterNode.cpp
dom/media/webaudio/ChannelMergerNode.cpp
dom/media/webaudio/ChannelSplitterNode.cpp
dom/media/webaudio/ConstantSourceNode.cpp
dom/media/webaudio/ConvolverNode.cpp
dom/media/webaudio/DelayNode.cpp
dom/media/webaudio/DynamicsCompressorNode.cpp
dom/media/webaudio/GainNode.cpp
dom/media/webaudio/IIRFilterNode.cpp
dom/media/webaudio/MediaElementAudioSourceNode.cpp
dom/media/webaudio/MediaStreamAudioDestinationNode.cpp
dom/media/webaudio/MediaStreamAudioSourceNode.cpp
dom/media/webaudio/MediaStreamTrackAudioSourceNode.cpp
dom/media/webaudio/OscillatorNode.cpp
dom/media/webaudio/PannerNode.cpp
dom/media/webaudio/PeriodicWave.cpp
dom/media/webaudio/ScriptProcessorNode.cpp
dom/media/webaudio/StereoPannerNode.cpp
dom/media/webaudio/ThreeDPoint.cpp
dom/media/webaudio/WaveShaperNode.cpp
dom/media/webrtc/RTCCertificate.cpp
dom/media/webrtc/RTCIdentityProviderRegistrar.cpp
dom/media/webrtc/jsapi/RTCDTMFSender.cpp
dom/media/webrtc/jsapi/RTCDtlsTransport.cpp
dom/media/webrtc/jsapi/RTCRtpReceiver.cpp
dom/media/webrtc/jsapi/RTCStatsReport.cpp
dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp
dom/media/webrtc/transport/ipc/StunAddrsRequestChild.cpp
dom/media/webrtc/transport/ipc/StunAddrsRequestParent.cpp
dom/media/webrtc/transport/ipc/WebrtcTCPSocket.cpp
dom/media/webrtc/transport/ipc/WebrtcTCPSocketChild.cpp
dom/media/webrtc/transport/ipc/WebrtcTCPSocketLog.cpp
dom/media/webrtc/transport/ipc/WebrtcTCPSocketParent.cpp
dom/media/webspeech/recognition/SpeechGrammar.cpp
dom/media/webspeech/recognition/SpeechGrammarList.cpp
dom/media/webspeech/recognition/SpeechRecognition.cpp
dom/media/webspeech/recognition/SpeechRecognitionAlternative.cpp
dom/media/webspeech/recognition/SpeechRecognitionResult.cpp
dom/media/webspeech/recognition/SpeechRecognitionResultList.cpp
dom/media/webspeech/recognition/SpeechTrackListener.cpp
dom/media/webspeech/synth/SpeechSynthesis.cpp
dom/media/webspeech/synth/SpeechSynthesisUtterance.cpp
dom/media/webspeech/synth/SpeechSynthesisVoice.cpp
dom/media/webspeech/synth/ipc/SpeechSynthesisChild.cpp
dom/media/webspeech/synth/ipc/SpeechSynthesisParent.cpp
dom/media/webspeech/synth/nsSpeechTask.cpp
dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp
dom/media/webspeech/synth/test/nsFakeSynthServices.cpp
dom/messagechannel/MessageChannel.cpp
dom/messagechannel/MessagePort.cpp
dom/messagechannel/MessagePortChild.cpp
dom/messagechannel/MessagePortParent.cpp
dom/messagechannel/MessagePortService.cpp
dom/midi/MIDIAccess.cpp
dom/midi/MIDIAccessManager.cpp
dom/midi/MIDIInput.cpp
dom/midi/MIDIInputMap.cpp
dom/midi/MIDIManagerParent.cpp
dom/midi/MIDIMessageEvent.cpp
dom/midi/MIDIMessageQueue.cpp
dom/midi/MIDIOutputMap.cpp
dom/midi/MIDIPlatformRunnables.cpp
dom/midi/MIDIPort.cpp
dom/midi/MIDIPortParent.cpp
dom/midi/MIDIUtils.cpp
dom/network/Connection.cpp
dom/network/ConnectionMainThread.cpp
dom/network/ConnectionWorker.cpp
dom/network/TCPServerSocketChild.cpp
dom/network/TCPServerSocketParent.cpp
dom/network/TCPSocketChild.cpp
dom/network/UDPSocket.cpp
dom/network/UDPSocketChild.cpp
dom/notification/Notification.cpp
dom/payments/BasicCardPayment.cpp
dom/payments/MerchantValidationEvent.cpp
dom/payments/PaymentActionResponse.cpp
dom/payments/PaymentAddress.cpp
dom/payments/PaymentMethodChangeEvent.cpp
dom/payments/PaymentRequest.cpp
dom/payments/PaymentRequestData.cpp
dom/payments/PaymentRequestManager.cpp
dom/payments/PaymentRequestService.cpp
dom/payments/PaymentRequestUpdateEvent.cpp
dom/payments/PaymentRequestUtils.cpp
dom/payments/PaymentResponse.cpp
dom/payments/ipc/PaymentRequestChild.cpp
dom/payments/ipc/PaymentRequestParent.cpp
dom/performance/Performance.cpp
dom/performance/PerformanceMainThread.cpp
dom/performance/PerformanceNavigation.cpp
dom/performance/PerformanceServerTiming.cpp
dom/performance/PerformanceService.cpp
dom/performance/PerformanceStorageWorker.cpp
dom/performance/PerformanceTiming.cpp
dom/performance/PerformanceWorker.cpp
dom/permission/PermissionObserver.cpp
dom/permission/PermissionStatus.cpp
dom/permission/PermissionUtils.cpp
dom/permission/Permissions.cpp
dom/plugins/base/nsJSNPRuntime.cpp
dom/plugins/ipc/BrowserStreamChild.cpp
dom/plugins/ipc/BrowserStreamParent.cpp
dom/plugins/ipc/ChildTimer.cpp
dom/plugins/ipc/FunctionBroker.cpp
dom/plugins/ipc/FunctionBrokerChild.cpp
dom/plugins/ipc/FunctionBrokerParent.cpp
dom/plugins/ipc/FunctionHook.cpp
dom/plugins/ipc/PluginMessageUtils.cpp
dom/plugins/ipc/PluginModuleChild.cpp
dom/plugins/ipc/PluginProcessChild.cpp
dom/plugins/ipc/PluginQuirks.cpp
dom/power/PowerManagerService.cpp
dom/power/WakeLock.cpp
dom/quota/ActorsChild.cpp
dom/quota/ActorsParent.cpp
dom/quota/Client.cpp
dom/quota/MemoryOutputStream.cpp
dom/quota/PersistenceType.cpp
dom/quota/QuotaCommon.cpp
dom/quota/QuotaManagerService.cpp
dom/quota/QuotaRequests.cpp
dom/quota/QuotaResults.cpp
dom/quota/StorageManager.cpp
dom/simpledb/ActorsChild.cpp
dom/simpledb/ActorsParent.cpp
dom/simpledb/SDBConnection.cpp
dom/simpledb/SDBRequest.cpp
dom/simpledb/SDBResults.cpp
dom/simpledb/SimpleDBCommon.cpp
--- a/dom/abort/AbortController.cpp
+++ b/dom/abort/AbortController.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "AbortController.h"
 #include "AbortSignal.h"
 #include "mozilla/dom/AbortControllerBinding.h"
 #include "mozilla/dom/WorkerPrivate.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AbortController, mGlobal, mSignal)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(AbortController)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(AbortController)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AbortController)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -60,10 +59,9 @@ void AbortController::Abort() {
 
   mAborted = true;
 
   if (mSignal) {
     mSignal->SignalAbort();
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/abort/AbortSignal.cpp
+++ b/dom/abort/AbortSignal.cpp
@@ -5,18 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "AbortSignal.h"
 
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/AbortSignalBinding.h"
 #include "mozilla/RefPtr.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 // AbortSignalImpl
 // ----------------------------------------------------------------------------
 
 AbortSignalImpl::AbortSignalImpl(bool aAborted) : mAborted(aAborted) {}
 
 bool AbortSignalImpl::Aborted() const { return mAborted; }
 
@@ -136,10 +135,9 @@ void AbortFollower::Unfollow() {
 bool AbortFollower::IsFollowing() const { return !!mFollowingSignal; }
 
 /* static */ void AbortFollower::Traverse(
     AbortFollower* aFollower, nsCycleCollectionTraversalCallback& cb) {
   ImplCycleCollectionTraverse(cb, aFollower->mFollowingSignal,
                               "mFollowingSignal", 0);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -23,18 +23,17 @@
 #include "nsAnimationManager.h"  // For CSSAnimation
 #include "nsComputedDOMStyle.h"
 #include "nsDOMMutationObserver.h"    // For nsAutoAnimationMutationBatch
 #include "nsDOMCSSAttrDeclaration.h"  // For nsDOMCSSAttributeDeclaration
 #include "nsThreadUtils.h"  // For nsRunnableMethod and nsRevocableEventPtr
 #include "nsTransitionManager.h"      // For CSSTransition
 #include "PendingAnimationTracker.h"  // For PendingAnimationTracker
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 // Static members
 uint64_t Animation::sNextAnimationIndex = 0;
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(Animation, DOMEventTargetHelper, mTimeline,
                                    mEffect, mReady, mFinished)
 
 NS_IMPL_ADDREF_INHERITED(Animation, DOMEventTargetHelper)
@@ -1852,10 +1851,9 @@ void Animation::QueuePlaybackEvent(const
       aName, std::move(event), std::move(aScheduledEventTime), this));
 }
 
 bool Animation::IsRunningOnCompositor() const {
   return mEffect && mEffect->AsKeyframeEffect() &&
          mEffect->AsKeyframeEffect()->IsRunningOnCompositor();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/animation/AnimationEffect.cpp
+++ b/dom/animation/AnimationEffect.cpp
@@ -9,18 +9,17 @@
 
 #include "mozilla/dom/Animation.h"
 #include "mozilla/dom/KeyframeEffect.h"
 #include "mozilla/dom/MutationObservers.h"
 #include "mozilla/AnimationUtils.h"
 #include "mozilla/FloatingPoint.h"
 #include "nsDOMMutationObserver.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(AnimationEffect)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AnimationEffect)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocument, mAnimation)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AnimationEffect)
@@ -335,10 +334,9 @@ Nullable<TimeDuration> AnimationEffect::
   // time is equal to the parent time.
   Nullable<TimeDuration> result;
   if (mAnimation) {
     result = mAnimation->GetCurrentTimeAsDuration();
   }
   return result;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/animation/AnimationTimeline.cpp
+++ b/dom/animation/AnimationTimeline.cpp
@@ -3,18 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "AnimationTimeline.h"
 #include "mozilla/AnimationComparator.h"
 #include "mozilla/dom/Animation.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 AnimationTimeline::~AnimationTimeline() { mAnimationOrder.clear(); }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(AnimationTimeline)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AnimationTimeline)
   tmp->mAnimationOrder.clear();
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindow, mAnimations)
@@ -47,10 +46,9 @@ void AnimationTimeline::NotifyAnimationU
 void AnimationTimeline::RemoveAnimation(Animation* aAnimation) {
   MOZ_ASSERT(!aAnimation->GetTimeline() || aAnimation->GetTimeline() == this);
   if (static_cast<LinkedListElement<Animation>*>(aAnimation)->isInList()) {
     static_cast<LinkedListElement<Animation>*>(aAnimation)->remove();
   }
   mAnimations.RemoveEntry(aAnimation);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/animation/CSSAnimation.cpp
+++ b/dom/animation/CSSAnimation.cpp
@@ -7,18 +7,17 @@
 #include "CSSAnimation.h"
 
 #include "mozilla/AnimationEventDispatcher.h"
 #include "mozilla/dom/CSSAnimationBinding.h"
 #include "mozilla/dom/KeyframeEffectBinding.h"
 #include "mozilla/TimeStamp.h"
 #include "nsPresContext.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 using AnimationPhase = ComputedTiming::AnimationPhase;
 
 JSObject* CSSAnimation::WrapObject(JSContext* aCx,
                                    JS::Handle<JSObject*> aGivenProto) {
   return dom::CSSAnimation_Binding::Wrap(aCx, this, aGivenProto);
 }
 
@@ -358,10 +357,9 @@ void CSSAnimationKeyframeEffect::MaybeFl
   }
 
   if (dom::Document* doc = GetRenderedDocument()) {
     doc->FlushPendingNotifications(
         ChangesToFlush(FlushType::Style, false /* flush animations */));
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/animation/CSSPseudoElement.cpp
+++ b/dom/animation/CSSPseudoElement.cpp
@@ -5,18 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/CSSPseudoElement.h"
 #include "mozilla/dom/CSSPseudoElementBinding.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/KeyframeEffectBinding.h"
 #include "mozilla/AnimationComparator.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CSSPseudoElement, mOriginatingElement)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(CSSPseudoElement, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(CSSPseudoElement, Release)
 
 CSSPseudoElement::CSSPseudoElement(dom::Element* aElement,
                                    PseudoStyleType aType)
@@ -88,10 +87,9 @@ nsAtom* CSSPseudoElement::GetCSSPseudoEl
     default:
       MOZ_ASSERT_UNREACHABLE(
           "Should not try to get CSSPseudoElement "
           "other than ::before, ::after or ::marker");
       return nullptr;
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/animation/CSSTransition.cpp
+++ b/dom/animation/CSSTransition.cpp
@@ -8,18 +8,17 @@
 
 #include "mozilla/AnimationEventDispatcher.h"
 #include "mozilla/dom/CSSTransitionBinding.h"
 #include "mozilla/dom/KeyframeEffectBinding.h"
 #include "mozilla/dom/KeyframeEffect.h"
 #include "mozilla/TimeStamp.h"
 #include "nsPresContext.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 JSObject* CSSTransition::WrapObject(JSContext* aCx,
                                     JS::Handle<JSObject*> aGivenProto) {
   return dom::CSSTransition_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 void CSSTransition::GetTransitionProperty(nsString& aRetVal) const {
   MOZ_ASSERT(eCSSProperty_UNKNOWN != mTransitionProperty,
@@ -329,10 +328,9 @@ void CSSTransition::SetEffectFromStyle(d
                  keyframeEffect->Properties()[0].mSegments.Length() == 1)) {
     mTransitionProperty = keyframeEffect->Properties()[0].mProperty;
     mTransitionToValue = keyframeEffect->Properties()[0].mSegments[0].mToValue;
   } else {
     MOZ_ASSERT_UNREACHABLE("Transition effect has unexpected shape");
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/animation/DocumentTimeline.cpp
+++ b/dom/animation/DocumentTimeline.cpp
@@ -10,18 +10,17 @@
 #include "mozilla/dom/DocumentTimelineBinding.h"
 #include "AnimationUtils.h"
 #include "nsContentUtils.h"
 #include "nsDOMMutationObserver.h"
 #include "nsDOMNavigationTiming.h"
 #include "nsPresContext.h"
 #include "nsRefreshDriver.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(DocumentTimeline)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(DocumentTimeline,
                                                 AnimationTimeline)
   tmp->UnregisterFromRefreshDriver();
   if (tmp->isInList()) {
     tmp->remove();
   }
@@ -283,10 +282,9 @@ void DocumentTimeline::UnregisterFromRef
 
   nsRefreshDriver* refreshDriver = GetRefreshDriver();
   if (!refreshDriver) {
     return;
   }
   DisconnectRefreshDriver(refreshDriver);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/audiochannel/AudioChannelService.cpp
+++ b/dom/audiochannel/AudioChannelService.cpp
@@ -77,18 +77,17 @@ class AudioPlaybackRunnable final : publ
 
   nsCOMPtr<nsPIDOMWindowOuter> mWindow;
   bool mActive;
   AudioChannelService::AudibleChangedReasons mReason;
 };
 
 }  // anonymous namespace
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 const char* SuspendTypeToStr(const nsSuspendedTypes& aSuspend) {
   MOZ_ASSERT(aSuspend == nsISuspendedTypes::NONE_SUSPENDED ||
              aSuspend == nsISuspendedTypes::SUSPENDED_BLOCK);
 
   switch (aSuspend) {
     case nsISuspendedTypes::NONE_SUSPENDED:
       return "none";
@@ -618,10 +617,9 @@ void AudioChannelService::AudioChannelWi
           }
 
           observerService->NotifyObservers(ToSupports(window), "audio-playback",
                                            u"activeMediaBlockStart");
         }));
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/AbstractRange.cpp
+++ b/dom/base/AbstractRange.cpp
@@ -13,18 +13,17 @@
 #include "mozilla/dom/StaticRange.h"
 #include "nsContentUtils.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsGkAtoms.h"
 #include "nsINode.h"
 #include "nsRange.h"
 #include "nsTArray.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 template nsresult AbstractRange::SetStartAndEndInternal(
     const RangeBoundary& aStartBoundary, const RangeBoundary& aEndBoundary,
     nsRange* aRange);
 template nsresult AbstractRange::SetStartAndEndInternal(
     const RangeBoundary& aStartBoundary, const RawRangeBoundary& aEndBoundary,
     nsRange* aRange);
 template nsresult AbstractRange::SetStartAndEndInternal(
@@ -203,10 +202,9 @@ nsresult AbstractRange::SetStartAndEndIn
   return NS_OK;
 }
 
 JSObject* AbstractRange::WrapObject(JSContext* aCx,
                                     JS::Handle<JSObject*> aGivenProto) {
   MOZ_CRASH("Must be overridden");
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/AnonymousContent.cpp
+++ b/dom/base/AnonymousContent.cpp
@@ -11,18 +11,17 @@
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/AnonymousContentBinding.h"
 #include "nsComputedDOMStyle.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIFrame.h"
 #include "nsStyledElement.h"
 #include "HTMLCanvasElement.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 // Ref counting and cycle collection
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AnonymousContent, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AnonymousContent, Release)
 NS_IMPL_CYCLE_COLLECTION(AnonymousContent, mContentNode)
 
 AnonymousContent::AnonymousContent(already_AddRefed<Element> aContentNode)
     : mContentNode(aContentNode) {
@@ -214,10 +213,9 @@ void AnonymousContent::SetStyle(const ns
     return;
   }
 
   nsGenericHTMLElement* element = nsGenericHTMLElement::FromNode(mContentNode);
   nsCOMPtr<nsICSSDeclaration> declaration = element->Style();
   declaration->SetProperty(aProperty, aValue, u""_ns, IgnoreErrors());
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/Attr.cpp
+++ b/dom/base/Attr.cpp
@@ -22,18 +22,17 @@
 #include "nsGkAtoms.h"
 #include "nsCOMArray.h"
 #include "nsNameSpaceManager.h"
 #include "nsTextNode.h"
 #include "mozAutoDocUpdate.h"
 #include "nsWrapperCacheInlines.h"
 #include "NodeUbiReporting.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 //----------------------------------------------------------------------
 bool Attr::sInitialized;
 
 Attr::Attr(nsDOMAttributeMap* aAttrMap,
            already_AddRefed<dom::NodeInfo>&& aNodeInfo, const nsAString& aValue)
     : nsINode(std::move(aNodeInfo)), mAttrMap(aAttrMap), mValue(aValue) {
   MOZ_ASSERT(mNodeInfo, "We must get a nodeinfo here!");
@@ -217,10 +216,9 @@ void Attr::Shutdown() { sInitialized = f
 JSObject* Attr::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   return Attr_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 void Attr::ConstructUbiNode(void* storage) {
   JS::ubi::Concrete<Attr>::construct(storage, this);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/BarProps.cpp
+++ b/dom/base/BarProps.cpp
@@ -6,18 +6,17 @@
 
 #include "mozilla/dom/BarProps.h"
 #include "mozilla/dom/BarPropBinding.h"
 #include "nsContentUtils.h"
 #include "nsDocShell.h"
 #include "nsGlobalWindow.h"
 #include "nsIWebBrowserChrome.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 //
 //  Basic (virtual) BarProp class implementation
 //
 BarProp::BarProp(nsGlobalWindowInner* aWindow) : mDOMWindow(aWindow) {}
 
 BarProp::~BarProp() = default;
 
@@ -200,10 +199,9 @@ bool ScrollbarsProp::GetVisible(CallerTy
   ScrollbarPreference pref = nsDocShell::Cast(ds)->ScrollbarPreference();
   return pref != ScrollbarPreference::Never;
 }
 
 void ScrollbarsProp::SetVisible(bool aVisible, CallerType, ErrorResult&) {
   /* Do nothing */
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/BindContext.cpp
+++ b/dom/base/BindContext.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/BindContext.h"
 #include "mozilla/dom/BrowsingContext.h"
 
 #include "mozilla/StaticPrefs_browser.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 bool BindContext::AllowsAutoFocus() const {
   if (!StaticPrefs::browser_autofocus()) {
     return false;
   }
   if (!InUncomposedDoc()) {
     return false;
   }
@@ -40,10 +39,9 @@ bool BindContext::IsSameOriginAsTop() co
   Document* topLevelDocument = topWindow->GetExtantDoc();
   if (!topLevelDocument) {
     return false;
   }
 
   return NS_SUCCEEDED(nsContentUtils::CheckSameOrigin(topLevelDocument, &mDoc));
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/BodyConsumer.cpp
+++ b/dom/base/BodyConsumer.cpp
@@ -26,18 +26,17 @@
 #include "nsProxyRelease.h"
 
 // Undefine the macro of CreateFile to avoid FileCreatorHelper#CreateFile being
 // replaced by FileCreatorHelper#CreateFileW.
 #ifdef CreateFile
 #  undef CreateFile
 #endif
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 namespace {
 
 class BeginConsumeBodyRunnable final : public Runnable {
  public:
   BeginConsumeBodyRunnable(BodyConsumer* aConsumer,
                            ThreadSafeWorkerRef* aWorkerRef)
       : Runnable("BeginConsumeBodyRunnable"),
@@ -806,10 +805,9 @@ NS_IMETHODIMP BodyConsumer::Observe(nsIS
 void BodyConsumer::RunAbortAlgorithm() {
   AssertIsOnTargetThread();
   ShutDownMainThreadConsuming();
   ContinueConsumeBody(NS_ERROR_DOM_ABORT_ERR, 0, nullptr);
 }
 
 NS_IMPL_ISUPPORTS(BodyConsumer, nsIObserver, nsISupportsWeakReference)
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/BodyStream.cpp
+++ b/dom/base/BodyStream.cpp
@@ -13,18 +13,17 @@
 #include "mozilla/dom/WorkerRunnable.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/Unused.h"
 #include "nsProxyRelease.h"
 #include "nsStreamUtils.h"
 
 static NS_DEFINE_CID(kStreamTransportServiceCID, NS_STREAMTRANSPORTSERVICE_CID);
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 // BodyStreamHolder
 // ---------------------------------------------------------------------------
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(BodyStreamHolder)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(BodyStreamHolder)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
@@ -568,10 +567,9 @@ BodyStream::Observe(nsISupports* aSubjec
   nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(mGlobal);
   if (SameCOMIdentity(aSubject, window)) {
     Close();
   }
 
   return NS_OK;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/BodyUtil.cpp
+++ b/dom/base/BodyUtil.cpp
@@ -24,18 +24,17 @@
 #include "mozilla/dom/Exceptions.h"
 #include "mozilla/dom/FetchUtil.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/FormData.h"
 #include "mozilla/dom/Headers.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/URLSearchParams.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 namespace {
 
 // Reads over a CRLF and positions start after it.
 static bool PushOverLine(nsACString::const_iterator& aStart,
                          const nsACString::const_iterator& aEnd) {
   if (*aStart == nsCRT::CR && (aEnd - aStart > 1) && *(++aStart) == nsCRT::LF) {
     ++aStart;  // advance to after CRLF
@@ -494,10 +493,9 @@ void BodyUtil::ConsumeJson(JSContext* aC
     JS_ClearPendingException(aCx);
     aRv.ThrowJSException(aCx, exn);
     return;
   }
 
   aValue.set(json);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/BorrowedAttrInfo.cpp
+++ b/dom/base/BorrowedAttrInfo.cpp
@@ -1,24 +1,22 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/BorrowedAttrInfo.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 BorrowedAttrInfo::BorrowedAttrInfo(const nsAttrName* aName,
                                    const nsAttrValue* aValue)
     : mName(aName), mValue(aValue) {
   MOZ_ASSERT_IF(mName, mValue);
 }
 
 BorrowedAttrInfo::BorrowedAttrInfo(const BorrowedAttrInfo& aOther)
     : mName(aOther.mName), mValue(aOther.mValue) {
   MOZ_ASSERT_IF(mName, mValue);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/CCGCScheduler.h
+++ b/dom/base/CCGCScheduler.h
@@ -2,57 +2,62 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "js/SliceBudget.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/MainThreadIdlePeriod.h"
 #include "nsCycleCollector.h"
 
-static const TimeDuration kOneMinute = TimeDuration::FromSeconds(60.0f);
+static const mozilla::TimeDuration kOneMinute =
+    mozilla::TimeDuration::FromSeconds(60.0f);
 
 // The amount of time we wait between a request to CC (after GC ran)
 // and doing the actual CC.
-static const TimeDuration kCCDelay = TimeDuration::FromSeconds(6);
+static const mozilla::TimeDuration kCCDelay =
+    mozilla::TimeDuration::FromSeconds(6);
 
-static const TimeDuration kCCSkippableDelay =
-    TimeDuration::FromMilliseconds(250);
+static const mozilla::TimeDuration kCCSkippableDelay =
+    mozilla::TimeDuration::FromMilliseconds(250);
 
 // In case the cycle collector isn't run at all, we don't want forget skippables
 // to run too often. So limit the forget skippable cycle to start at earliest 2
 // seconds after the end of the previous cycle.
-static const TimeDuration kTimeBetweenForgetSkippableCycles =
-    TimeDuration::FromSeconds(2);
+static const mozilla::TimeDuration kTimeBetweenForgetSkippableCycles =
+    mozilla::TimeDuration::FromSeconds(2);
 
 // ForgetSkippable is usually fast, so we can use small budgets.
 // This isn't a real budget but a hint to IdleTaskRunner whether there
 // is enough time to call ForgetSkippable.
-static const TimeDuration kForgetSkippableSliceDuration =
-    TimeDuration::FromMilliseconds(2);
+static const mozilla::TimeDuration kForgetSkippableSliceDuration =
+    mozilla::TimeDuration::FromMilliseconds(2);
 
 // Maximum amount of time that should elapse between incremental CC slices
-static const TimeDuration kICCIntersliceDelay =
-    TimeDuration::FromMilliseconds(64);
+static const mozilla::TimeDuration kICCIntersliceDelay =
+    mozilla::TimeDuration::FromMilliseconds(64);
 
 // Time budget for an incremental CC slice when using timer to run it.
-static const TimeDuration kICCSliceBudget = TimeDuration::FromMilliseconds(3);
+static const mozilla::TimeDuration kICCSliceBudget =
+    mozilla::TimeDuration::FromMilliseconds(3);
 // Minimum budget for an incremental CC slice when using idle time to run it.
-static const TimeDuration kIdleICCSliceBudget =
-    TimeDuration::FromMilliseconds(2);
+static const mozilla::TimeDuration kIdleICCSliceBudget =
+    mozilla::TimeDuration::FromMilliseconds(2);
 
 // Maximum total duration for an ICC
-static const TimeDuration kMaxICCDuration = TimeDuration::FromSeconds(2);
+static const mozilla::TimeDuration kMaxICCDuration =
+    mozilla::TimeDuration::FromSeconds(2);
 
 // Force a CC after this long if there's more than NS_CC_FORCED_PURPLE_LIMIT
 // objects in the purple buffer.
-static const TimeDuration kCCForced = kOneMinute * 2;
+static const mozilla::TimeDuration kCCForced = kOneMinute * 2;
 static const uint32_t kCCForcedPurpleLimit = 10;
 
 // Don't allow an incremental GC to lock out the CC for too long.
-static const TimeDuration kMaxCCLockedoutTime = TimeDuration::FromSeconds(30);
+static const mozilla::TimeDuration kMaxCCLockedoutTime =
+    mozilla::TimeDuration::FromSeconds(30);
 
 // Trigger a CC if the purple buffer exceeds this size when we check it.
 static const uint32_t kCCPurpleLimit = 200;
 
 // if you add statics here, add them to the list in StartupJSEnvironment
 
 namespace mozilla {
 
--- a/dom/base/CharacterData.cpp
+++ b/dom/base/CharacterData.cpp
@@ -36,18 +36,17 @@
 #include "mozilla/Sprintf.h"
 #include "nsWindowSizes.h"
 #include "nsWrapperCacheInlines.h"
 
 #if defined(ACCESSIBILITY) && defined(DEBUG)
 #  include "nsAccessibilityService.h"
 #endif
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 CharacterData::CharacterData(already_AddRefed<dom::NodeInfo>&& aNodeInfo)
     : nsIContent(std::move(aNodeInfo)) {
   MOZ_ASSERT(mNodeInfo->NodeType() == TEXT_NODE ||
                  mNodeInfo->NodeType() == CDATA_SECTION_NODE ||
                  mNodeInfo->NodeType() == COMMENT_NODE ||
                  mNodeInfo->NodeType() == PROCESSING_INSTRUCTION_NODE ||
                  mNodeInfo->NodeType() == DOCUMENT_TYPE_NODE,
@@ -581,10 +580,9 @@ already_AddRefed<nsAtom> CharacterData::
 }
 
 void CharacterData::AddSizeOfExcludingThis(nsWindowSizes& aSizes,
                                            size_t* aNodeSize) const {
   nsIContent::AddSizeOfExcludingThis(aSizes, aNodeSize);
   *aNodeSize += mText.SizeOfExcludingThis(aSizes.mState.mMallocSizeOf);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ChildIterator.cpp
+++ b/dom/base/ChildIterator.cpp
@@ -9,18 +9,17 @@
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/HTMLSlotElement.h"
 #include "mozilla/dom/ShadowRoot.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsIFrame.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsLayoutUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 ExplicitChildIterator::ExplicitChildIterator(const nsIContent* aParent,
                                              bool aStartAtBeginning)
     : mParent(aParent),
       mChild(nullptr),
       mDefaultChild(nullptr),
       mIsFirst(aStartAtBeginning),
       mIndexInInserted(0) {
@@ -366,10 +365,9 @@ nsIContent* AllChildrenIterator::GetPrev
       return markerContent;
     }
   }
 
   mPhase = eAtBegin;
   return nullptr;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ChromeMessageBroadcaster.cpp
+++ b/dom/base/ChromeMessageBroadcaster.cpp
@@ -4,20 +4,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/ChromeMessageBroadcaster.h"
 #include "AccessCheck.h"
 #include "mozilla/HoldDropJSObjects.h"
 #include "mozilla/dom/MessageManagerBinding.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 JSObject* ChromeMessageBroadcaster::WrapObject(
     JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   MOZ_ASSERT(nsContentUtils::IsSystemCaller(aCx));
 
   return ChromeMessageBroadcaster_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ChromeMessageSender.cpp
+++ b/dom/base/ChromeMessageSender.cpp
@@ -2,20 +2,18 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/ChromeMessageSender.h"
 #include "mozilla/dom/MessageManagerBinding.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 JSObject* ChromeMessageSender::WrapObject(JSContext* aCx,
                                           JS::Handle<JSObject*> aGivenProto) {
   MOZ_ASSERT(nsContentUtils::IsSystemCaller(aCx));
 
   return ChromeMessageSender_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ChromeUtils.cpp
+++ b/dom/base/ChromeUtils.cpp
@@ -51,18 +51,17 @@
 #include "nsThreadUtils.h"
 #include "mozJSComponentLoader.h"
 #include "GeckoProfiler.h"
 #ifdef MOZ_GECKO_PROFILER
 #  include "ProfilerMarkerPayload.h"
 #endif
 #include "nsIException.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 /* static */
 void ChromeUtils::NondeterministicGetWeakMapKeys(
     GlobalObject& aGlobal, JS::Handle<JS::Value> aMap,
     JS::MutableHandle<JS::Value> aRetval, ErrorResult& aRv) {
   if (!aMap.isObject()) {
     aRetval.setUndefined();
   } else {
@@ -1359,10 +1358,9 @@ void ChromeUtils::GetAllDOMProcesses(
   aParents.AppendElement(InProcessParent::Singleton());
 
   // Before adding nsIDOMProcessParent for all the content processes
   for (auto* cp : ContentParent::AllProcesses(ContentParent::eLive)) {
     aParents.AppendElement(cp);
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/Comment.cpp
+++ b/dom/base/Comment.cpp
@@ -11,18 +11,17 @@
 #include "nsCOMPtr.h"
 #include "mozilla/dom/Comment.h"
 #include "mozilla/dom/CommentBinding.h"
 #include "mozilla/IntegerPrintfMacros.h"
 
 using namespace mozilla;
 using namespace dom;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 Comment::~Comment() = default;
 
 already_AddRefed<CharacterData> Comment::CloneDataNode(
     mozilla::dom::NodeInfo* aNodeInfo, bool aCloneText) const {
   RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfo;
   auto* nim = ni->NodeInfoManager();
   RefPtr<Comment> it = new (nim) Comment(ni.forget());
@@ -62,10 +61,9 @@ already_AddRefed<Comment> Comment::Const
 
   return window->GetDoc()->CreateComment(aData);
 }
 
 JSObject* Comment::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   return Comment_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/Crypto.cpp
+++ b/dom/base/Crypto.cpp
@@ -12,18 +12,17 @@
 #include "nsXULAppAPI.h"
 
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/CryptoBinding.h"
 #include "nsServiceManagerUtils.h"
 
 using mozilla::dom::ContentChild;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Crypto)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Crypto)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(Crypto)
@@ -95,10 +94,9 @@ void Crypto::GetRandomValues(JSContext* 
 
 SubtleCrypto* Crypto::Subtle() {
   if (!mSubtle) {
     mSubtle = new SubtleCrypto(GetParentObject());
   }
   return mSubtle;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -21,18 +21,17 @@
 #include "mozilla/dom/ShadowRoot.h"
 #include "mozilla/AutoRestore.h"
 #include "nsHTMLTags.h"
 #include "jsapi.h"
 #include "js/ForOfIterator.h"  // JS::ForOfIterator
 #include "xpcprivate.h"
 #include "nsGlobalWindow.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 //-----------------------------------------------------
 // CustomElementUpgradeReaction
 
 class CustomElementUpgradeReaction final : public CustomElementReaction {
  public:
   explicit CustomElementUpgradeReaction(CustomElementDefinition* aDefinition)
       : mDefinition(aDefinition) {
@@ -1500,10 +1499,9 @@ CustomElementDefinition::CustomElementDe
       mNamespaceID(aNamespaceID),
       mConstructor(aConstructor),
       mObservedAttributes(std::move(aObservedAttributes)),
       mCallbacks(std::move(aCallbacks)),
       mFormAssociated(aFormAssociated),
       mDisableInternals(aDisableInternals),
       mDisableShadow(aDisableShadow) {}
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/DOMException.cpp
+++ b/dom/base/DOMException.cpp
@@ -132,18 +132,17 @@ nsresult NS_GetNameAndMessageForDOMNSRes
       *aCode = code;
     }
     return NS_OK;
   }
 
   return NS_ERROR_NOT_AVAILABLE;
 }
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Exception)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(Exception)
   NS_INTERFACE_MAP_ENTRY(nsIException)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
@@ -401,10 +400,9 @@ already_AddRefed<DOMException> DOMExcept
   nsCString name;
   nsCString message;
   uint16_t code;
   NSResultToNameAndMessage(aRv, name, message, &code);
   RefPtr<DOMException> inst = new DOMException(aRv, aMessage, name, code);
   return inst.forget();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/DOMImplementation.cpp
+++ b/dom/base/DOMImplementation.cpp
@@ -8,18 +8,17 @@
 
 #include "mozilla/ContentEvents.h"
 #include "mozilla/dom/DOMImplementationBinding.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/DocumentType.h"
 #include "nsTextNode.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 // QueryInterface implementation for DOMImplementation
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMImplementation)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DOMImplementation, mOwner)
@@ -182,10 +181,9 @@ nsresult DOMImplementation::CreateHTMLDo
 already_AddRefed<Document> DOMImplementation::CreateHTMLDocument(
     const Optional<nsAString>& aTitle, ErrorResult& aRv) {
   nsCOMPtr<Document> document;
   aRv = CreateHTMLDocument(aTitle.WasPassed() ? aTitle.Value() : VoidString(),
                            getter_AddRefs(document));
   return document.forget();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/DOMIntersectionObserver.cpp
+++ b/dom/base/DOMIntersectionObserver.cpp
@@ -16,18 +16,17 @@
 #include "mozilla/ServoBindings.h"
 #include "mozilla/StaticPrefs_dom.h"
 #include "mozilla/dom/BrowserChild.h"
 #include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/dom/DocumentInlines.h"
 #include "mozilla/dom/HTMLImageElement.h"
 #include "Units.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMIntersectionObserverEntry)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMIntersectionObserverEntry)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMIntersectionObserverEntry)
@@ -733,10 +732,9 @@ void DOMIntersectionObserver::Notify() {
     RefPtr<dom::IntersectionCallback> callback(
         mCallback.as<RefPtr<dom::IntersectionCallback>>());
     callback->Call(this, entries, *this);
   } else {
     mCallback.as<NativeCallback>()(entries);
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/DOMMatrix.cpp
+++ b/dom/base/DOMMatrix.cpp
@@ -17,18 +17,17 @@
 #include "nsStyleTransformMatrix.h"
 #include "nsGlobalWindowInner.h"
 
 #include <math.h>
 
 #include "js/Conversions.h"  // JS::NumberToString
 #include "js/Equality.h"     // JS::SameValueZero
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 template <typename T>
 static void SetDataInMatrix(DOMMatrixReadOnly* aMatrix, const T* aData,
                             int aLength, ErrorResult& aRv);
 
 static const double radPerDegree = 2.0 * M_PI / 360.0;
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DOMMatrixReadOnly, mParent)
@@ -1016,10 +1015,9 @@ DOMMatrix* DOMMatrix::SetMatrixValue(con
   return this;
 }
 
 JSObject* DOMMatrix::WrapObject(JSContext* aCx,
                                 JS::Handle<JSObject*> aGivenProto) {
   return DOMMatrix_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/DOMStringList.cpp
+++ b/dom/base/DOMStringList.cpp
@@ -3,18 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/DOMStringList.h"
 #include "mozilla/dom/DOMStringListBinding.h"
 #include "nsContentUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(DOMStringList)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMStringList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMStringList)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMStringList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
@@ -22,10 +21,9 @@ NS_INTERFACE_MAP_END
 
 DOMStringList::~DOMStringList() = default;
 
 JSObject* DOMStringList::WrapObject(JSContext* aCx,
                                     JS::Handle<JSObject*> aGivenProto) {
   return DOMStringList_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/DocGroup.cpp
+++ b/dom/base/DocGroup.cpp
@@ -113,18 +113,17 @@ NS_IMETHODIMP LabellingEventTarget::Drai
 
 NS_IMETHODIMP LabellingEventTarget::HaveDirectTasks(bool* aValue) {
   return mMainThread->HaveDirectTasks(aValue);
 }
 
 NS_IMPL_ISUPPORTS(LabellingEventTarget, nsIEventTarget, nsISerialEventTarget,
                   nsIDirectTaskDispatcher)
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 AutoTArray<RefPtr<DocGroup>, 2>* DocGroup::sPendingDocGroups = nullptr;
 
 /* static */
 already_AddRefed<DocGroup> DocGroup::Create(
     BrowsingContextGroup* aBrowsingContextGroup, const nsACString& aKey) {
   RefPtr<DocGroup> docGroup = new DocGroup(aBrowsingContextGroup, aKey);
   docGroup->mEventTarget = new LabellingEventTarget(docGroup);
@@ -395,10 +394,9 @@ bool DocGroup::IsActive() const {
     if (doc->IsCurrentActiveDocument()) {
       return true;
     }
   }
 
   return false;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -9472,18 +9472,17 @@ void nsDOMAttributeMap::BlastSubtreeToPi
 
   while (aNode->HasChildren()) {
     nsIContent* node = aNode->GetFirstChild();
     BlastSubtreeToPieces(node);
     aNode->RemoveChildNode(node, false);
   }
 }
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 nsINode* Document::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv) {
   nsINode* adoptedNode = &aAdoptedNode;
 
   // Scope firing mutation events so that we don't carry any state that
   // might be stale
   {
     nsINode* parent = adoptedNode->GetParentNode();
@@ -17107,10 +17106,9 @@ void Document::EnableChildElementInPictu
   MOZ_ASSERT(mPictureInPictureChildElementCount >= 0);
 }
 
 void Document::DisableChildElementInPictureInPictureMode() {
   mPictureInPictureChildElementCount--;
   MOZ_ASSERT(mPictureInPictureChildElementCount >= 0);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/DocumentFragment.cpp
+++ b/dom/base/DocumentFragment.cpp
@@ -16,18 +16,17 @@
 #include "nsGkAtoms.h"
 #include "nsDOMString.h"
 #include "nsContentUtils.h"  // for NS_INTERFACE_MAP_ENTRY_TEAROFF
 #include "mozilla/dom/DocumentFragmentBinding.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/IntegerPrintfMacros.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 JSObject* DocumentFragment::WrapNode(JSContext* aCx,
                                      JS::Handle<JSObject*> aGivenProto) {
   return DocumentFragment_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 bool DocumentFragment::IsNodeOfType(uint32_t aFlags) const { return false; }
 
@@ -117,10 +116,9 @@ NS_INTERFACE_MAP_BEGIN(DocumentFragment)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContent)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF_INHERITED(DocumentFragment, FragmentOrElement)
 NS_IMPL_RELEASE_INHERITED(DocumentFragment, FragmentOrElement)
 
 NS_IMPL_ELEMENT_CLONE(DocumentFragment)
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/DocumentOrShadowRoot.cpp
+++ b/dom/base/DocumentOrShadowRoot.cpp
@@ -16,18 +16,17 @@
 #include "mozilla/dom/StyleSheetList.h"
 #include "nsTHashtable.h"
 #include "nsFocusManager.h"
 #include "nsIRadioVisitor.h"
 #include "nsIFormControl.h"
 #include "nsLayoutUtils.h"
 #include "nsWindowSizes.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 DocumentOrShadowRoot::DocumentOrShadowRoot(ShadowRoot* aShadowRoot)
     : mAsNode(aShadowRoot), mKind(Kind::ShadowRoot) {
   MOZ_ASSERT(mAsNode);
 }
 
 DocumentOrShadowRoot::DocumentOrShadowRoot(Document* aDoc)
     : mAsNode(aDoc), mKind(Kind::Document) {
@@ -843,10 +842,9 @@ void DocumentOrShadowRoot::Unlink(Docume
     aSheet.RemoveAdopter(*tmp);
     tmp->RemoveSheetFromStylesIfApplicable(aSheet);
   });
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mAdoptedStyleSheets);
   tmp->mIdentifierMap.Clear();
   tmp->mRadioGroups.Clear();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/DocumentType.cpp
+++ b/dom/base/DocumentType.cpp
@@ -28,18 +28,17 @@ already_AddRefed<mozilla::dom::DocumentT
       nsINode::DOCUMENT_TYPE_NODE, aName);
 
   RefPtr<mozilla::dom::DocumentType> docType =
       new (aNodeInfoManager) mozilla::dom::DocumentType(
           ni.forget(), aPublicId, aSystemId, aInternalSubset);
   return docType.forget();
 }
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 JSObject* DocumentType::WrapNode(JSContext* cx,
                                  JS::Handle<JSObject*> aGivenProto) {
   return DocumentType_Binding::Wrap(cx, this, aGivenProto);
 }
 
 DocumentType::DocumentType(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
                            const nsAString& aPublicId,
@@ -75,10 +74,9 @@ void DocumentType::GetInternalSubset(nsA
 }
 
 already_AddRefed<CharacterData> DocumentType::CloneDataNode(
     mozilla::dom::NodeInfo* aNodeInfo, bool aCloneText) const {
   return do_AddRef(new (aNodeInfo->NodeInfoManager()) DocumentType(
       do_AddRef(aNodeInfo), mPublicId, mSystemId, mInternalSubset));
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -163,18 +163,17 @@
 #include "DOMMatrix.h"
 
 #ifdef ACCESSIBILITY
 #  include "nsAccessibilityService.h"
 #endif
 
 using mozilla::gfx::Matrix4x4;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 // Verify sizes of nodes. We use a template rather than a direct static
 // assert so that the error message actually displays the sizes.
 // On 32 bit systems the actual allocated size varies a bit between
 // OSes/compilers.
 //
 // We need different numbers on certain build types to deal with the owning
 // thread pointer that comes with the non-threadsafe refcount on
@@ -204,18 +203,17 @@ ASSERT_NODE_SIZE(HTMLParagraphElement, 1
 ASSERT_NODE_SIZE(HTMLPreElement, 128, 80);
 ASSERT_NODE_SIZE(HTMLSpanElement, 128, 80);
 ASSERT_NODE_SIZE(HTMLTableCellElement, 128, 80);
 ASSERT_NODE_SIZE(Text, 120, 64);
 
 #undef ASSERT_NODE_SIZE
 #undef EXTRA_DOM_NODE_BYTES
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
 
 nsAtom* nsIContent::DoGetID() const {
   MOZ_ASSERT(HasID(), "Unexpected call");
   MOZ_ASSERT(IsElement(), "Only elements can have IDs");
 
   return AsElement()->GetParsedAttr(nsGkAtoms::id)->GetAtomValue();
 }
 
@@ -228,18 +226,17 @@ nsIFrame* nsIContent::GetPrimaryFrame(mo
   // Cause a flush, so we get up-to-date frame information.
   if (aType != mozilla::FlushType::None) {
     doc->FlushPendingNotifications(aType);
   }
 
   return GetPrimaryFrame();
 }
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 const nsAttrValue* Element::GetSVGAnimatedClass() const {
   MOZ_ASSERT(MayHaveClass() && IsSVGElement(), "Unexpected call");
   return static_cast<const SVGElement*>(this)->GetAnimatedClassName();
 }
 
 NS_IMETHODIMP
 Element::QueryInterface(REFNSIID aIID, void** aInstancePtr) {
@@ -288,18 +285,17 @@ void Element::UpdateState(bool aNotify) 
       if (doc) {
         nsAutoScriptBlocker scriptBlocker;
         doc->ContentStateChanged(this, changedStates);
       }
     }
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
 
 void nsIContent::UpdateEditableState(bool aNotify) {
   if (IsInNativeAnonymousSubtree()) {
     // Don't propagate the editable flag into native anonymous subtrees.
     if (IsRootOfNativeAnonymousSubtree()) {
       return;
     }
 
@@ -314,18 +310,17 @@ void nsIContent::UpdateEditableState(boo
       return;
     }
   }
 
   nsIContent* parent = GetParent();
   SetEditableFlag(parent && parent->HasFlag(NODE_IS_EDITABLE));
 }
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 void Element::UpdateEditableState(bool aNotify) {
   nsIContent::UpdateEditableState(aNotify);
   if (aNotify) {
     UpdateState(aNotify);
   } else {
     // Avoid calling UpdateState in this very common case, because
     // this gets called for pretty much every single element on
@@ -4353,10 +4348,9 @@ nsAtom* Element::GetEventNameForAttr(nsA
     return nsGkAtoms::onwebkitAnimationStart;
   }
   if (aAttr == nsGkAtoms::onwebkittransitionend) {
     return nsGkAtoms::onwebkitTransitionEnd;
   }
   return aAttr;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/EventSource.cpp
+++ b/dom/base/EventSource.cpp
@@ -44,18 +44,17 @@
 #include "mozilla/Preferences.h"
 #include "xpcpublic.h"
 #include "nsWrapperCacheInlines.h"
 #include "mozilla/Attributes.h"
 #include "nsError.h"
 #include "mozilla/Encoding.h"
 #include "ReferrerInfo.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 static LazyLogModule gEventSourceLog("EventSource");
 
 #define SPACE_CHAR (char16_t)0x0020
 #define CR_CHAR (char16_t)0x000D
 #define LF_CHAR (char16_t)0x000A
 #define COLON_CHAR (char16_t)0x003A
 
@@ -2045,10 +2044,9 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 bool EventSource::IsCertainlyAliveForCC() const { return mKeepingAlive; }
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(EventSource)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(EventSource, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(EventSource, DOMEventTargetHelper)
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/EventSourceEventService.cpp
+++ b/dom/base/EventSourceEventService.cpp
@@ -8,18 +8,17 @@
 #include "mozilla/StaticPtr.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIObserverService.h"
 #include "nsXULAppAPI.h"
 #include "nsSocketTransportService2.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Services.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 namespace {
 
 StaticRefPtr<EventSourceEventService> gEventSourceEventService;
 
 }  // anonymous namespace
 
 class EventSourceBaseRunnable : public Runnable {
@@ -309,10 +308,9 @@ void EventSourceEventService::GetListene
   WindowListener* listener = mWindows.Get(aInnerWindowID);
   if (!listener) {
     return;
   }
 
   aListeners.AppendElements(listener->mListeners);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/GeneratedImageContent.cpp
+++ b/dom/base/GeneratedImageContent.cpp
@@ -8,18 +8,17 @@
 
 #include "nsContentCreatorFunctions.h"
 #include "nsGkAtoms.h"
 #include "mozilla/dom/Document.h"
 #include "nsNodeInfoManager.h"
 #include "mozilla/dom/HTMLElementBinding.h"
 #include "mozilla/dom/NameSpaceConstants.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_ELEMENT_CLONE(GeneratedImageContent);
 
 already_AddRefed<GeneratedImageContent> GeneratedImageContent::Create(
     Document& aDocument, uint32_t aContentIndex) {
   RefPtr<dom::NodeInfo> nodeInfo = aDocument.NodeInfoManager()->GetNodeInfo(
       nsGkAtoms::mozgeneratedcontentimage, nullptr, kNameSpaceID_XHTML,
       nsINode::ELEMENT_NODE);
@@ -31,10 +30,9 @@ already_AddRefed<GeneratedImageContent> 
   return image.forget();
 }
 
 JSObject* GeneratedImageContent::WrapNode(JSContext* aCx,
                                           JS::Handle<JSObject*> aGivenProto) {
   return dom::HTMLElement_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/IDTracker.cpp
+++ b/dom/base/IDTracker.cpp
@@ -11,18 +11,17 @@
 #include "nsAtom.h"
 #include "nsContentUtils.h"
 #include "nsIURI.h"
 #include "nsIReferrerInfo.h"
 #include "nsEscape.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsStringFwd.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 static Element* LookupElement(DocumentOrShadowRoot& aDocOrShadow,
                               const nsAString& aRef, bool aReferenceImage) {
   if (aReferenceImage) {
     return aDocOrShadow.LookupImageElement(aRef);
   }
   return aDocOrShadow.GetElementById(aRef);
 }
@@ -219,10 +218,9 @@ IDTracker::DocumentLoadNotification::Obs
     // If we got here, that means we had Reset*() called with
     // aWatch == true.  So keep watching if IsPersistent().
     mTarget->HaveNewDocumentOrShadowRoot(doc, mTarget->IsPersistent(), mRef);
     mTarget->ElementChanged(nullptr, mTarget->mElement);
   }
   return NS_OK;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/IdleDeadline.cpp
+++ b/dom/base/IdleDeadline.cpp
@@ -9,18 +9,17 @@
 #include "mozilla/dom/IdleDeadline.h"
 #include "mozilla/dom/IdleDeadlineBinding.h"
 #include "mozilla/dom/Performance.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDOMNavigationTiming.h"
 #include "nsPIDOMWindow.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(IdleDeadline, mWindow, mGlobal)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(IdleDeadline)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(IdleDeadline)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IdleDeadline)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
@@ -65,10 +64,9 @@ DOMHighResTimeStamp IdleDeadline::TimeRe
   // If there's no window, we're in a system scope, and can just use
   // a high-resolution TimeStamp::Now();
   auto timestamp = TimeStamp::Now() - TimeStamp::ProcessCreation();
   return std::max(mDeadline - timestamp.ToMilliseconds(), 0.0);
 }
 
 bool IdleDeadline::DidTimeout() const { return mDidTimeout; }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/IdleRequest.cpp
+++ b/dom/base/IdleRequest.cpp
@@ -10,18 +10,17 @@
 #include "mozilla/dom/IdleDeadline.h"
 #include "mozilla/dom/PerformanceTiming.h"
 #include "mozilla/dom/TimeoutManager.h"
 #include "mozilla/dom/WindowBinding.h"
 #include "nsComponentManagerUtils.h"
 #include "nsGlobalWindow.h"
 #include "nsPIDOMWindow.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 IdleRequest::IdleRequest(IdleRequestCallback* aCallback, uint32_t aHandle)
     : mCallback(aCallback), mHandle(aHandle), mTimeoutHandle(Nothing()) {
   MOZ_DIAGNOSTIC_ASSERT(mCallback);
 }
 
 IdleRequest::~IdleRequest() = default;
 
@@ -57,10 +56,9 @@ void IdleRequest::IdleRun(nsPIDOMWindowI
 
   RefPtr<IdleDeadline> deadline =
       new IdleDeadline(aWindow, aDidTimeout, aDeadline);
   RefPtr<IdleRequestCallback> callback(std::move(mCallback));
   MOZ_ASSERT(!mCallback);
   callback->Call(*deadline, "requestIdleCallback handler");
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ImageEncoder.cpp
+++ b/dom/base/ImageEncoder.cpp
@@ -18,18 +18,17 @@
 #include "gfxUtils.h"
 #include "nsThreadUtils.h"
 #include "nsNetUtil.h"
 #include "nsXPCOMCIDInternal.h"
 #include "YCbCrUtils.h"
 
 using namespace mozilla::gfx;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 // This class should be placed inside GetBRGADataSourceSurfaceSync(). However,
 // due to B2G ICS uses old complier (C++98/03) which forbids local class as
 // template parameter, we need to move this class outside.
 class SurfaceHelper : public Runnable {
  public:
   explicit SurfaceHelper(already_AddRefed<layers::Image> aImage)
       : Runnable("SurfaceHelper"), mImage(aImage) {}
@@ -439,10 +438,9 @@ already_AddRefed<imgIEncoder> ImageEncod
     aType.AssignLiteral("image/png");
     nsCString PNGEncoderCID("@mozilla.org/image/encoder;2?type=image/png");
     encoder = do_CreateInstance(PNGEncoderCID.get());
   }
 
   return encoder.forget();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ImageTracker.cpp
+++ b/dom/base/ImageTracker.cpp
@@ -9,18 +9,17 @@
 
 #include "ImageTracker.h"
 
 #include "imgIContainer.h"
 #include "imgIRequest.h"
 #include "mozilla/Preferences.h"
 #include "nsXULAppAPI.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 ImageTracker::ImageTracker() : mLocking(false), mAnimating(true) {}
 
 ImageTracker::~ImageTracker() { SetLockingState(false); }
 
 nsresult ImageTracker::Add(imgIRequest* aImage) {
   MOZ_ASSERT(aImage);
 
@@ -160,10 +159,9 @@ void ImageTracker::MediaFeatureValuesCha
     }
     images.AppendElement(image->Unwrap());
   }
   for (imgIContainer* image : images) {
     image->MediaFeatureValuesChangedAllDocuments(aChange);
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/IntlUtils.cpp
+++ b/dom/base/IntlUtils.cpp
@@ -5,18 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "IntlUtils.h"
 
 #include "mozilla/dom/ToJSValue.h"
 #include "mozIMozIntl.h"
 #include "nsContentUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(IntlUtils, mWindow)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(IntlUtils)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(IntlUtils)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IntlUtils)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
@@ -125,10 +124,9 @@ void IntlUtils::GetLocaleInfo(const Sequ
   }
 
   // Return the result as LocaleInfo.
   if (!aResult.Init(cx, retVal)) {
     aError.Throw(NS_ERROR_FAILURE);
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/Link.cpp
+++ b/dom/base/Link.cpp
@@ -21,18 +21,17 @@
 #include "nsHTMLDNSPrefetch.h"
 #include "nsString.h"
 #include "mozAutoDocUpdate.h"
 
 #include "mozilla/Services.h"
 #include "nsAttrValueInlines.h"
 #include "HTMLLinkElement.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 Link::Link(Element* aElement)
     : mElement(aElement),
       mLinkState(eLinkState_NotLink),
       mNeedsRegistration(false),
       mRegistered(false),
       mHasPendingLinkUpdate(false),
       mInDNSPrefetch(false),
@@ -582,10 +581,9 @@ size_t Link::SizeOfExcludingThis(mozilla
   }
 
   // The following members don't need to be measured:
   // - mElement, because it is a pointer-to-self used to avoid QIs
 
   return n;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/LinkStyle.cpp
+++ b/dom/base/LinkStyle.cpp
@@ -26,18 +26,17 @@
 #include "nsUnicharUtils.h"
 #include "nsCRT.h"
 #include "nsXPCOMCIDInternal.h"
 #include "nsUnicharInputStream.h"
 #include "nsContentUtils.h"
 #include "nsStyleUtil.h"
 #include "nsQueryObject.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 LinkStyle::SheetInfo::SheetInfo(
     const Document& aDocument, nsIContent* aContent,
     already_AddRefed<nsIURI> aURI,
     already_AddRefed<nsIPrincipal> aTriggeringPrincipal,
     already_AddRefed<nsIReferrerInfo> aReferrerInfo,
     mozilla::CORSMode aCORSMode, const nsAString& aTitle,
     const nsAString& aMedia, const nsAString& aIntegrity,
@@ -316,10 +315,9 @@ Result<LinkStyle::Update, nsresult> Link
     // Don't propagate LoadStyleLink() errors further than this, since some
     // consumers (e.g. nsXMLContentSink) will completely abort on innocuous
     // things like a stylesheet load being blocked by the security system.
     return Update{};
   }
   return resultOrError;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/Location.cpp
+++ b/dom/base/Location.cpp
@@ -29,18 +29,17 @@
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/Unused.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/DocumentInlines.h"
 #include "mozilla/dom/LocationBinding.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "ReferrerInfo.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 Location::Location(nsPIDOMWindowInner* aWindow,
                    BrowsingContext* aBrowsingContext)
     : mInnerWindow(aWindow) {
   // aBrowsingContext can be null if it gets called after nsDocShell::Destory().
   if (aBrowsingContext) {
     mBrowsingContextId = aBrowsingContext->Id();
   }
@@ -630,10 +629,9 @@ bool Location::CallerSubsumes(nsIPrincip
   return subsumes;
 }
 
 JSObject* Location::WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) {
   return Location_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/LocationBase.cpp
+++ b/dom/base/LocationBase.cpp
@@ -13,18 +13,17 @@
 #include "nsCOMPtr.h"
 #include "nsError.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindow.h"
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/WindowContext.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 already_AddRefed<nsDocShellLoadState> LocationBase::CheckURL(
     nsIURI* aURI, nsIPrincipal& aSubjectPrincipal, ErrorResult& aRv) {
   RefPtr<BrowsingContext> bc(GetBrowsingContext());
   if (NS_WARN_IF(!bc)) {
     aRv.Throw(NS_ERROR_NOT_AVAILABLE);
     return nullptr;
   }
@@ -242,10 +241,9 @@ nsIURI* LocationBase::GetSourceBaseURL()
       if (docShellWin) {
         doc = docShellWin->GetDoc();
       }
     }
   }
   return doc ? doc->GetBaseURI() : nullptr;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/MaybeCrossOriginObject.cpp
+++ b/dom/base/MaybeCrossOriginObject.cpp
@@ -20,18 +20,17 @@
 #include "nsContentUtils.h"
 
 #ifdef DEBUG
 static bool IsLocation(JSObject* obj) {
   return strcmp(JS::GetClass(obj)->name, "Location") == 0;
 }
 #endif  // DEBUG
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 /* static */
 bool MaybeCrossOriginObjectMixins::IsPlatformObjectSameOrigin(JSContext* cx,
                                                               JSObject* obj) {
   MOZ_ASSERT(!js::IsCrossCompartmentWrapper(obj));
   // WindowProxy and Window must always be same-Realm, so we can do
   // our IsPlatformObjectSameOrigin check against either one.  But verify that
   // in case we have a WindowProxy the right things happen.
@@ -507,10 +506,9 @@ bool MaybeCrossOriginObject<Base>::hasIn
   // have a cross-compartment wrapper for `proxy`.
   return JS::InstanceofOperator(cx, proxyWrap, v, bp);
 }
 
 // Force instantiations of the out-of-line template methods we need.
 template class MaybeCrossOriginObject<js::Wrapper>;
 template class MaybeCrossOriginObject<DOMProxyHandler>;
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/MessageBroadcaster.cpp
+++ b/dom/base/MessageBroadcaster.cpp
@@ -2,18 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/MessageBroadcaster.h"
 #include "mozilla/dom/ContentParent.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 MessageBroadcaster::MessageBroadcaster(MessageBroadcaster* aParentManager,
                                        MessageManagerFlags aFlags)
     : MessageListenerManager(nullptr, aParentManager,
                              aFlags | MessageManagerFlags::MM_BROADCASTER) {
   if (aParentManager) {
     aParentManager->AddChildManager(this);
   }
@@ -31,10 +30,9 @@ void MessageBroadcaster::AddChildManager
 
   LoadPendingScripts(this, aManager);
 }
 
 void MessageBroadcaster::RemoveChildManager(MessageListenerManager* aManager) {
   mChildManagers.RemoveElement(aManager);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/MessageListenerManager.cpp
+++ b/dom/base/MessageListenerManager.cpp
@@ -2,18 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/MessageListenerManager.h"
 #include "mozilla/dom/MessageBroadcaster.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 MessageListenerManager::MessageListenerManager(
     ipc::MessageManagerCallback* aCallback, MessageBroadcaster* aParentManager,
     ipc::MessageManagerFlags aFlags)
     : nsFrameMessageManager(aCallback, aFlags),
       mParentManager(aParentManager) {}
 
 MessageListenerManager::~MessageListenerManager() = default;
@@ -41,10 +40,9 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 void MessageListenerManager::ClearParentManager(bool aRemove) {
   if (aRemove && mParentManager) {
     mParentManager->RemoveChildManager(this);
   }
   mParentManager = nullptr;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/MessageManagerGlobal.cpp
+++ b/dom/base/MessageManagerGlobal.cpp
@@ -11,18 +11,17 @@
 
 #ifdef ANDROID
 #  include <android/log.h>
 #endif
 #ifdef XP_WIN
 #  include <windows.h>
 #endif
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 void MessageManagerGlobal::Dump(const nsAString& aStr) {
   if (!nsJSUtils::DumpEnabled()) {
     return;
   }
 
 #ifdef ANDROID
   __android_log_print(ANDROID_LOG_INFO, "Gecko", "%s",
@@ -42,10 +41,9 @@ void MessageManagerGlobal::Atob(const ns
   aError = nsContentUtils::Atob(aAsciiString, aBase64Data);
 }
 
 void MessageManagerGlobal::Btoa(const nsAString& aBase64Data,
                                 nsAString& aAsciiString, ErrorResult& aError) {
   aError = nsContentUtils::Btoa(aBase64Data, aAsciiString);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/MessageSender.cpp
+++ b/dom/base/MessageSender.cpp
@@ -2,18 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/MessageSender.h"
 #include "mozilla/dom/MessageBroadcaster.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 void MessageSender::InitWithCallback(ipc::MessageManagerCallback* aCallback) {
   if (mCallback) {
     // Initialization should only happen once.
     return;
   }
 
   SetCallback(aCallback);
@@ -24,10 +23,9 @@ void MessageSender::InitWithCallback(ipc
   }
 
   for (uint32_t i = 0; i < mPendingScripts.Length(); ++i) {
     LoadScript(mPendingScripts[i], false, mPendingScriptsGlobalStates[i],
                IgnoreErrors());
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/MozQueryInterface.cpp
+++ b/dom/base/MozQueryInterface.cpp
@@ -9,18 +9,17 @@
 #include "xptinfo.h"
 
 #include <string.h>
 
 #include "jsapi.h"
 
 #include "xpcpublic.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 constexpr size_t IID_SIZE = sizeof(nsIID);
 
 static_assert(
     IID_SIZE == 16,
     "Size of nsID struct changed. Please ensure this code is still valid.");
 
 static int CompareIIDs(const nsIID& aA, const nsIID& aB) {
@@ -85,10 +84,9 @@ void MozQueryInterface::LegacyCall(JSCon
 }
 
 bool MozQueryInterface::WrapObject(JSContext* aCx,
                                    JS::Handle<JSObject*> aGivenProto,
                                    JS::MutableHandle<JSObject*> aReflector) {
   return MozQueryInterface_Binding::Wrap(aCx, this, aGivenProto, aReflector);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -107,18 +107,17 @@
 #include "mozilla/DetailedPromise.h"
 #include "mozilla/Unused.h"
 
 #include "mozilla/webgpu/Instance.h"
 #include "mozilla/dom/WindowGlobalChild.h"
 
 #include "mozilla/intl/LocaleService.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 static const nsLiteralCString kVibrationPermissionType = "vibration"_ns;
 
 Navigator::Navigator(nsPIDOMWindowInner* aWindow) : mWindow(aWindow) {}
 
 Navigator::~Navigator() { Invalidate(); }
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Navigator)
@@ -2157,10 +2156,9 @@ webgpu::Instance* Navigator::Gpu() {
   return mWebGpu;
 }
 
 /* static */
 bool Navigator::Webdriver() {
   return Preferences::GetBool("marionette.enabled", false);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/NodeIterator.cpp
+++ b/dom/base/NodeIterator.cpp
@@ -14,18 +14,17 @@
 
 #include "nsIContent.h"
 #include "mozilla/dom/Document.h"
 #include "nsContentUtils.h"
 #include "nsCOMPtr.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/NodeIteratorBinding.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 /*
  * NodePointer implementation
  */
 NodeIterator::NodePointer::NodePointer(nsINode* aNode, bool aBeforeNode)
     : mNode(aNode), mBeforeNode(aBeforeNode) {}
 
 bool NodeIterator::NodePointer::MoveToNext(nsINode* aRoot) {
@@ -205,10 +204,9 @@ void NodeIterator::ContentRemoved(nsICon
                                      aPreviousSibling);
 }
 
 bool NodeIterator::WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto,
                               JS::MutableHandle<JSObject*> aReflector) {
   return NodeIterator_Binding::Wrap(cx, this, aGivenProto, aReflector);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ParentProcessMessageManager.cpp
+++ b/dom/base/ParentProcessMessageManager.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/ParentProcessMessageManager.h"
 #include "AccessCheck.h"
 #include "mozilla/HoldDropJSObjects.h"
 #include "mozilla/dom/MessageManagerBinding.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 ParentProcessMessageManager::ParentProcessMessageManager()
     : MessageBroadcaster(nullptr, MessageManagerFlags::MM_CHROME |
                                       MessageManagerFlags::MM_PROCESSMANAGER) {
   mozilla::HoldJSObjects(this);
 }
 
 ParentProcessMessageManager::~ParentProcessMessageManager() {
@@ -24,10 +23,9 @@ ParentProcessMessageManager::~ParentProc
 
 JSObject* ParentProcessMessageManager::WrapObject(
     JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   MOZ_ASSERT(nsContentUtils::IsSystemCaller(aCx));
 
   return ParentProcessMessageManager_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/PlacesEvent.cpp
+++ b/dom/base/PlacesEvent.cpp
@@ -3,18 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/PlacesEvent.h"
 
 #include "mozilla/HoldDropJSObjects.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(PlacesEvent)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(PlacesEvent)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(PlacesEvent)
@@ -35,10 +34,9 @@ already_AddRefed<PlacesEvent> PlacesEven
 
 nsISupports* PlacesEvent::GetParentObject() const { return nullptr; }
 
 JSObject* PlacesEvent::WrapObject(JSContext* aCx,
                                   JS::Handle<JSObject*> aGivenProto) {
   return PlacesEvent_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/PlacesObservers.cpp
+++ b/dom/base/PlacesObservers.cpp
@@ -5,18 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "PlacesObservers.h"
 
 #include "PlacesWeakCallbackWrapper.h"
 #include "nsIWeakReferenceUtils.h"
 #include "mozilla/ClearOnShutdown.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 template <class T>
 struct Flagged {
   Flagged(uint32_t aFlags, T&& aValue)
       : flags(aFlags), value(std::forward<T>(aValue)) {}
   Flagged(Flagged&& aOther)
       : Flagged(std::move(aOther.flags), std::move(aOther.value)) {}
   Flagged(const Flagged& aOther) = default;
@@ -333,10 +332,9 @@ void PlacesObservers::NotifyListeners(
       RemoveListener(listener.flags, listener.value.get());
     }
   }
   nativeListenersToRemove.Clear();
 
   gCallingListeners = false;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/PlacesWeakCallbackWrapper.cpp
+++ b/dom/base/PlacesWeakCallbackWrapper.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/PlacesWeakCallbackWrapper.h"
 
 #include "mozilla/HoldDropJSObjects.h"
 #include "mozilla/dom/ContentProcessMessageManager.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WEAK_PTR(PlacesWeakCallbackWrapper,
                                                mParent, mCallback)
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(PlacesWeakCallbackWrapper, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(PlacesWeakCallbackWrapper, Release)
 
 PlacesWeakCallbackWrapper::PlacesWeakCallbackWrapper(
     nsISupports* aParent, PlacesEventCallback& aCallback)
@@ -37,10 +36,9 @@ nsISupports* PlacesWeakCallbackWrapper::
   return parent;
 }
 
 JSObject* PlacesWeakCallbackWrapper::WrapObject(
     JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   return PlacesWeakCallbackWrapper_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/PopupBlocker.cpp
+++ b/dom/base/PopupBlocker.cpp
@@ -10,18 +10,17 @@
 #include "mozilla/MouseEvents.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPrefs_dom.h"
 #include "mozilla/TextEvents.h"
 #include "mozilla/TimeStamp.h"
 #include "nsXULPopupManager.h"
 #include "nsIPermissionManager.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 namespace {
 
 static char* sPopupAllowedEvents;
 
 static PopupBlocker::PopupControlState sPopupControlState =
     PopupBlocker::openAbused;
 static uint32_t sPopupStatePusherCount = 0;
@@ -465,18 +464,17 @@ void PopupBlocker::RegisterOpenPopupSpam
 void PopupBlocker::UnregisterOpenPopupSpam() {
   MOZ_ASSERT(sOpenPopupSpamCount);
   sOpenPopupSpamCount--;
 }
 
 /* static */
 uint32_t PopupBlocker::GetOpenPopupSpamCount() { return sOpenPopupSpamCount; }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
 
 AutoPopupStatePusherInternal::AutoPopupStatePusherInternal(
     mozilla::dom::PopupBlocker::PopupControlState aState, bool aForce)
     : mOldState(
           mozilla::dom::PopupBlocker::PushPopupControlState(aState, aForce)) {
   mozilla::dom::PopupBlocker::PopupStatePusherCreated();
 }
 
--- a/dom/base/Pose.cpp
+++ b/dom/base/Pose.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "js/experimental/TypedData.h"  // JS_GetFloat32ArrayData
 #include "mozilla/HoldDropJSObjects.h"
 #include "mozilla/dom/TypedArray.h"
 #include "mozilla/dom/Pose.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(Pose)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Pose)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
   tmp->mPosition = nullptr;
   tmp->mLinearVelocity = nullptr;
@@ -80,10 +79,9 @@ void Pose::SetFloat32Array(JSContext* aJ
     if (data) {
       memcpy(data, aVal, aValLength * sizeof(float));
     }
   }
 
   aRetVal.set(aObj);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/PostMessageEvent.cpp
+++ b/dom/base/PostMessageEvent.cpp
@@ -28,18 +28,17 @@
 #include "nsGlobalWindow.h"
 #include "nsIConsoleService.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptError.h"
 #include "nsNetUtil.h"
 #include "nsPresContext.h"
 #include "nsQueryObject.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 PostMessageEvent::PostMessageEvent(BrowsingContext* aSource,
                                    const nsAString& aCallerOrigin,
                                    nsGlobalWindowOuter* aTargetWindow,
                                    nsIPrincipal* aProvidedPrincipal,
                                    uint64_t aCallerWindowID, nsIURI* aCallerURI,
                                    const nsCString& aScriptLocation,
                                    bool aIsFromPrivateWindow,
@@ -303,10 +302,9 @@ void PostMessageEvent::DispatchToTargetT
         return;
       }
     }
   }
 
   aError = mTargetWindow->Dispatch(TaskCategory::Other, event.forget());
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ProcessMessageManager.cpp
+++ b/dom/base/ProcessMessageManager.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/ParentProcessMessageManager.h"
 #include "mozilla/dom/ProcessMessageManager.h"
 #include "mozilla/dom/MessageManagerBinding.h"
 #include "nsContentUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 ProcessMessageManager::ProcessMessageManager(
     ipc::MessageManagerCallback* aCallback,
     ParentProcessMessageManager* aParentManager, MessageManagerFlags aFlags)
     : MessageSender(aCallback, aParentManager,
                     aFlags | MessageManagerFlags::MM_CHROME |
                         MessageManagerFlags::MM_PROCESSMANAGER),
       mPid(-1),
@@ -35,10 +34,9 @@ ProcessMessageManager::ProcessMessageMan
 
 JSObject* ProcessMessageManager::WrapObject(JSContext* aCx,
                                             JS::Handle<JSObject*> aGivenProto) {
   MOZ_ASSERT(nsContentUtils::IsSystemCaller(aCx));
 
   return ProcessMessageManager_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/RemoteOuterWindowProxy.cpp
+++ b/dom/base/RemoteOuterWindowProxy.cpp
@@ -6,18 +6,17 @@
 
 #include "AccessCheck.h"
 #include "js/Proxy.h"
 #include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/dom/RemoteObjectProxy.h"
 #include "mozilla/dom/WindowBinding.h"
 #include "xpcprivate.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 /**
  * RemoteOuterWindowProxy is the proxy handler for the WindowProxy objects for
  * Window objects that live in a different process.
  *
  * RemoteOuterWindowProxy holds a BrowsingContext, which is cycle collected.
  * This reference is declared to the cycle collector via NoteChildren().
  */
@@ -159,10 +158,9 @@ bool RemoteOuterWindowProxy::ownProperty
 }
 
 bool RemoteOuterWindowProxy::getOwnEnumerablePropertyKeys(
     JSContext* aCx, JS::Handle<JSObject*> aProxy,
     JS::MutableHandleVector<jsid> aProps) const {
   return AppendIndexedPropertyNames(aCx, GetBrowsingContext(aProxy), aProps);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ResizeObserver.cpp
+++ b/dom/base/ResizeObserver.cpp
@@ -8,18 +8,17 @@
 
 #include "mozilla/dom/DOMRect.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/SVGUtils.h"
 #include "nsIContent.h"
 #include "nsIContentInlines.h"
 #include <limits>
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 /**
  * Returns the length of the parent-traversal path (in terms of the number of
  * nodes) to an unparented/root node from aNode. An unparented/root node is
  * considered to have a depth of 1, its children have a depth of 2, etc.
  * aNode is expected to be non-null.
  * Note: The shadow root is not part of the calculation because the caller,
  * ResizeObserver, doesn't observe the shadow root, and only needs relative
@@ -316,10 +315,9 @@ void ResizeObserverEntry::SetContentRect
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ResizeObserverSize, mOwner)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(ResizeObserverSize)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(ResizeObserverSize)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ResizeObserverSize)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ResizeObserverController.cpp
+++ b/dom/base/ResizeObserverController.cpp
@@ -10,18 +10,17 @@
 #include "mozilla/dom/ErrorEvent.h"
 #include "mozilla/dom/RootedDictionary.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/Unused.h"
 #include "nsPresContext.h"
 #include "nsRefreshDriver.h"
 #include <limits>
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 void ResizeObserverNotificationHelper::WillRefresh(TimeStamp aTime) {
   MOZ_DIAGNOSTIC_ASSERT(mOwner, "Should've de-registered on-time!");
   mOwner->Notify();
   // Note that mOwner may be null / dead here.
 }
 
 nsRefreshDriver* ResizeObserverNotificationHelper::GetRefreshDriver() const {
@@ -219,10 +218,9 @@ void ResizeObserverController::AddSizeOf
   MallocSizeOf mallocSizeOf = aSizes.mState.mMallocSizeOf;
   size_t size = mallocSizeOf(this);
   size += mResizeObservers.ShallowSizeOfExcludingThis(mallocSizeOf);
   // TODO(emilio): Measure the observers individually or something? They aren't
   // really owned by us.
   aSizes.mDOMResizeObserverControllerSize += size;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ResponsiveImageSelector.cpp
+++ b/dom/base/ResponsiveImageSelector.cpp
@@ -15,18 +15,17 @@
 #include "nsContentUtils.h"
 #include "nsPresContext.h"
 
 #include "nsCSSProps.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION(ResponsiveImageSelector, mOwnerNode)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(ResponsiveImageSelector, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(ResponsiveImageSelector, Release)
 
 static bool ParseInteger(const nsAString& aString, int32_t& aInt) {
   nsContentUtils::ParseHTMLIntegerResultFlags parseResult;
@@ -725,10 +724,9 @@ double ResponsiveImageCandidate::Density
     MOZ_ASSERT(density > 0.0);
     return density;
   }
 
   MOZ_ASSERT(false, "Unknown candidate type");
   return 1.0;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/ScreenLuminance.cpp
+++ b/dom/base/ScreenLuminance.cpp
@@ -2,22 +2,20 @@
 /* vim:set ts=2 sw=2 et tw=78: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ScreenLuminance.h"
 #include "nsScreen.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(ScreenLuminance, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(ScreenLuminance, Release)
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ScreenLuminance, mScreen)
 
 JSObject* ScreenLuminance::WrapObject(JSContext* aCx,
                                       JS::Handle<JSObject*> aGivenProto) {
   return ScreenLuminance_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/SerializedStackHolder.cpp
+++ b/dom/base/SerializedStackHolder.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SerializedStackHolder.h"
 
 #include "js/SavedFrameAPI.h"
 #include "mozilla/dom/WorkerPrivate.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 SerializedStackHolder::SerializedStackHolder()
     : mHolder(StructuredCloneHolder::CloningSupported,
               StructuredCloneHolder::TransferringNotSupported,
               StructuredCloneHolder::StructuredCloneScope::SameProcess) {}
 
 void SerializedStackHolder::WriteStack(JSContext* aCx,
                                        JS::HandleObject aStack) {
@@ -145,10 +144,9 @@ void NotifyNetworkMonitorAlternateStack(
   if (!obsService) {
     return;
   }
 
   obsService->NotifyObservers(aChannel, "network-monitor-alternate-stack",
                               PromiseFlatString(aStackJSON).get());
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/StaticRange.cpp
+++ b/dom/base/StaticRange.cpp
@@ -3,18 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/StaticRange.h"
 #include "mozilla/dom/StaticRangeBinding.h"
 #include "nsINode.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 template already_AddRefed<StaticRange> StaticRange::Create(
     const RangeBoundary& aStartBoundary, const RangeBoundary& aEndBoundary,
     ErrorResult& aRv);
 template already_AddRefed<StaticRange> StaticRange::Create(
     const RangeBoundary& aStartBoundary, const RawRangeBoundary& aEndBoundary,
     ErrorResult& aRv);
 template already_AddRefed<StaticRange> StaticRange::Create(
@@ -116,10 +115,9 @@ already_AddRefed<StaticRange> StaticRang
                 init.mEndOffset, aRv);
 }
 
 JSObject* StaticRange::WrapObject(JSContext* aCx,
                                   JS::Handle<JSObject*> aGivenProto) {
   return StaticRange_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/StorageAccessPermissionRequest.cpp
+++ b/dom/base/StorageAccessPermissionRequest.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "StorageAccessPermissionRequest.h"
 #include "nsGlobalWindowInner.h"
 #include "mozilla/StaticPrefs_dom.h"
 #include <cstdlib>
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(StorageAccessPermissionRequest,
                                    ContentPermissionRequestBase)
 
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(StorageAccessPermissionRequest,
                                                ContentPermissionRequestBase)
 
 StorageAccessPermissionRequest::StorageAccessPermissionRequest(
@@ -121,10 +120,9 @@ unsigned StorageAccessPermissionRequest:
 
   const unsigned kMin = 0;
   const unsigned kMax = 3000;
   const unsigned random = std::abs(std::rand());
 
   return kMin + random % (kMax - kMin);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/StructuredCloneBlob.cpp
+++ b/dom/base/StructuredCloneBlob.cpp
@@ -10,18 +10,17 @@
 #include "js/Utility.h"
 #include "js/Wrapper.h"
 #include "mozilla/dom/BlobImpl.h"
 #include "mozilla/dom/StructuredCloneTags.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/UniquePtr.h"
 #include "xpcpublic.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 StructuredCloneBlob::StructuredCloneBlob() {
   mHolder.emplace(Holder::CloningSupported, Holder::TransferringNotSupported,
                   Holder::StructuredCloneScope::DifferentProcess);
 }
 
 StructuredCloneBlob::~StructuredCloneBlob() {
   UnregisterWeakMemoryReporter(this);
@@ -213,10 +212,9 @@ StructuredCloneBlob::CollectReports(nsIH
                      UNITS_BYTES, size,
                      "Memory used by StructuredCloneHolder DOM objects.");
 
   return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS(StructuredCloneBlob, nsIMemoryReporter)
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/StructuredCloneHolder.cpp
+++ b/dom/base/StructuredCloneHolder.cpp
@@ -39,18 +39,17 @@
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/PBackgroundSharedTypes.h"
 #include "MultipartBlobImpl.h"
 #include "nsQueryObject.h"
 
 using namespace mozilla::ipc;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 namespace {
 
 JSObject* StructuredCloneCallbacksRead(
     JSContext* aCx, JSStructuredCloneReader* aReader,
     const JS::CloneDataPolicy& aCloneDataPolicy, uint32_t aTag, uint32_t aIndex,
     void* aClosure) {
   StructuredCloneHolderBase* holder =
@@ -1332,10 +1331,9 @@ void StructuredCloneHolder::SameProcessS
     bool* aSameProcessScopeRequired) {
   MOZ_ASSERT(aSameProcessScopeRequired);
   if (mStructuredCloneScope == StructuredCloneScope::UnknownDestination) {
     mStructuredCloneScope = StructuredCloneScope::SameProcess;
     *aSameProcessScopeRequired = true;
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/StyleSheetList.cpp
+++ b/dom/base/StyleSheetList.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/StyleSheetList.h"
 
 #include "mozilla/dom/StyleSheetListBinding.h"
 #include "nsINode.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(StyleSheetList)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StyleSheetList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
@@ -39,10 +38,9 @@ StyleSheetList::StyleSheetList(DocumentO
 }
 
 StyleSheetList::~StyleSheetList() {
   if (mDocumentOrShadowRoot) {
     mDocumentOrShadowRoot->AsNode().RemoveMutationObserver(this);
   }
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/SubtleCrypto.cpp
+++ b/dom/base/SubtleCrypto.cpp
@@ -5,18 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/SubtleCrypto.h"
 
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/SubtleCryptoBinding.h"
 #include "mozilla/dom/WebCryptoTask.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(SubtleCrypto, mParent)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(SubtleCrypto)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SubtleCrypto)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SubtleCrypto)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
@@ -118,10 +117,9 @@ already_AddRefed<Promise> SubtleCrypto::
     const ObjectOrString& unwrapAlgorithm,
     const ObjectOrString& unwrappedKeyAlgorithm, bool extractable,
     const Sequence<nsString>& keyUsages, ErrorResult& aRv) {
   SUBTLECRYPTO_METHOD_BODY(UnwrapKey, aRv, mParent, cx, format, wrappedKey,
                            unwrappingKey, unwrapAlgorithm,
                            unwrappedKeyAlgorithm, extractable, keyUsages)
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/Text.cpp
+++ b/dom/base/Text.cpp
@@ -3,18 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/Text.h"
 #include "nsTextNode.h"
 #include "mozAutoDocUpdate.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 already_AddRefed<Text> Text::SplitText(uint32_t aOffset, ErrorResult& aRv) {
   nsAutoString cutText;
   const uint32_t length = TextLength();
 
   if (aOffset > length) {
     aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return nullptr;
@@ -150,10 +149,9 @@ bool Text::HasTextForTranslation() {
         (ch >= 192 && ch <= 214) || (ch >= 216 && ch <= 246) || (ch >= 248)) {
       return true;
     }
   }
 
   return false;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/Timeout.cpp
+++ b/dom/base/Timeout.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Timeout.h"
 
 #include "mozilla/dom/TimeoutManager.h"
 #include "nsGlobalWindowInner.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 Timeout::Timeout()
     : mTimeoutId(0),
       mFiringId(TimeoutManager::InvalidFiringId),
 #ifdef DEBUG
       mFiringIndex(-1),
 #endif
       mPopupState(PopupBlocker::openAllowed),
@@ -84,10 +83,9 @@ const TimeStamp& Timeout::SubmitTime() c
 
 const TimeDuration& Timeout::TimeRemaining() const {
   MOZ_DIAGNOSTIC_ASSERT(mWhen.IsNull());
   // Note, mWindow->IsFrozen() can be false here.  The Thaw() method calls
   // TimeRemaining() to calculate the new When() value.
   return mTimeRemaining;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/TimeoutBudgetManager.cpp
+++ b/dom/base/TimeoutBudgetManager.cpp
@@ -3,18 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "TimeoutBudgetManager.h"
 
 #include "mozilla/dom/Timeout.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 /* static */ TimeoutBudgetManager& TimeoutBudgetManager::Get() {
   static TimeoutBudgetManager gTimeoutBudgetManager;
   return gTimeoutBudgetManager;
 }
 
 void TimeoutBudgetManager::StartRecording(const TimeStamp& aNow) {
   mStart = aNow;
@@ -28,10 +27,9 @@ TimeDuration TimeoutBudgetManager::Recor
     // If we've started a sync operation mStart might be null, in
     // which case we should not record this piece of execution.
     return TimeDuration();
   }
 
   return aNow - mStart;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/TimeoutExecutor.cpp
+++ b/dom/base/TimeoutExecutor.cpp
@@ -10,18 +10,17 @@
 #include "mozilla/dom/TimeoutManager.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIEventTarget.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 
 extern mozilla::LazyLogModule gTimeoutLog;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_ISUPPORTS(TimeoutExecutor, nsIRunnable, nsITimerCallback, nsINamed)
 
 TimeoutExecutor::~TimeoutExecutor() {
   // The TimeoutManager should keep the Executor alive until its destroyed,
   // and then call Shutdown() explicitly.
   MOZ_DIAGNOSTIC_ASSERT(mMode == Mode::Shutdown);
   MOZ_DIAGNOSTIC_ASSERT(!mOwner);
@@ -249,10 +248,9 @@ TimeoutExecutor::Notify(nsITimer* aTimer
 }
 
 NS_IMETHODIMP
 TimeoutExecutor::GetName(nsACString& aNameOut) {
   aNameOut.AssignLiteral("TimeoutExecutor Runnable");
   return NS_OK;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/TimeoutHandler.cpp
+++ b/dom/base/TimeoutHandler.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "TimeoutHandler.h"
 
 #include "mozilla/Assertions.h"
 #include "nsJSUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 //-----------------------------------------------------------------------------
 // TimeoutHandler
 //-----------------------------------------------------------------------------
 
 TimeoutHandler::TimeoutHandler(JSContext* aCx) : TimeoutHandler() {
   nsJSUtils::GetCallingLocation(aCx, mFileName, &mLineNo, &mColumn);
 }
@@ -170,10 +169,9 @@ bool CallbackTimeoutHandler::Call(const 
 }
 
 void CallbackTimeoutHandler::MarkForCC() { mFunction->MarkForCC(); }
 
 void CallbackTimeoutHandler::GetDescription(nsACString& aOutString) {
   mFunction->GetDescription(aOutString);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/TreeWalker.cpp
+++ b/dom/base/TreeWalker.cpp
@@ -12,18 +12,17 @@
 
 #include "nsIContent.h"
 #include "nsError.h"
 #include "nsINode.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/TreeWalkerBinding.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 /*
  * Factories, constructors and destructors
  */
 
 TreeWalker::TreeWalker(nsINode* aRoot, uint32_t aWhatToShow,
                        NodeFilter* aFilter)
     : nsTraversal(aRoot, aWhatToShow, aFilter), mCurrentNode(aRoot) {}
@@ -322,10 +321,9 @@ already_AddRefed<nsINode> TreeWalker::Ne
   }
 }
 
 bool TreeWalker::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto,
                             JS::MutableHandle<JSObject*> aReflector) {
   return TreeWalker_Binding::Wrap(aCx, this, aGivenProto, aReflector);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/UIDirectionManager.cpp
+++ b/dom/base/UIDirectionManager.cpp
@@ -6,18 +6,17 @@
 
 #include "mozilla/dom/UIDirectionManager.h"
 #include "mozilla/Preferences.h"
 #include "nsIWindowMediator.h"
 #include "nsDocShell.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/SimpleEnumerator.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 /* static */
 void OnPrefChange(const char* aPrefName, void*) {
   // Iterate over all of the windows and notify them of the direction change.
   nsCOMPtr<nsIWindowMediator> windowMediator =
       do_GetService(NS_WINDOWMEDIATOR_CONTRACTID);
   NS_ENSURE_TRUE_VOID(windowMediator);
 
@@ -56,10 +55,9 @@ void UIDirectionManager::Initialize() {
 }
 
 /* static */
 void UIDirectionManager::Shutdown() {
   Preferences::UnregisterCallback(OnPrefChange, "intl.uidirection");
   Preferences::UnregisterCallback(OnPrefChange, "intl.l10n.pseudo");
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/UserActivation.cpp
+++ b/dom/base/UserActivation.cpp
@@ -3,18 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/UserActivation.h"
 
 #include "mozilla/TextEvents.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 namespace {
 
 // The current depth of user and keyboard inputs. sUserInputEventDepth
 // is the number of any user input events, page load events and mouse over
 // events.  sUserKeyboardEventDepth is the number of keyboard input events.
 // Incremented whenever we start handling a user input, decremented when we
 // have finished handling a user input. This depth is *not* reset in case
@@ -121,10 +120,9 @@ AutoHandlingUserInputStatePusher::AutoHa
 
 AutoHandlingUserInputStatePusher::~AutoHandlingUserInputStatePusher() {
   if (!mIsHandlingUserInput) {
     return;
   }
   UserActivation::StopHandlingUserInput(mMessage);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/WindowNamedPropertiesHandler.cpp
+++ b/dom/base/WindowNamedPropertiesHandler.cpp
@@ -9,18 +9,17 @@
 #include "mozilla/dom/WindowBinding.h"
 #include "mozilla/dom/WindowProxyHolder.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindow.h"
 #include "nsHTMLDocument.h"
 #include "nsJSUtils.h"
 #include "xpcprivate.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 static bool ShouldExposeChildWindow(const nsString& aNameBeingResolved,
                                     BrowsingContext* aChild) {
   Element* e = aChild->GetEmbedderElement();
   if (e && e->IsInShadowTree()) {
     return false;
   }
 
@@ -268,10 +267,9 @@ JSObject* WindowNamedPropertiesHandler::
   }
   MOZ_ASSERT(succeeded,
              "errors making the [[Prototype]] of the named properties object "
              "immutable should have been JSAPI failures, not !succeeded");
 
   return gsp;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -108,18 +108,17 @@ void VisibilityChangeListener::SetCallba
 }
 
 already_AddRefed<nsIContentPermissionRequestCallback>
 VisibilityChangeListener::GetCallback() {
   nsCOMPtr<nsIContentPermissionRequestCallback> callback = mCallback;
   return callback.forget();
 }
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 class ContentPermissionRequestParent : public PContentPermissionRequestParent {
  public:
   ContentPermissionRequestParent(const nsTArray<PermissionRequest>& aRequests,
                                  Element* aElement, nsIPrincipal* aPrincipal,
                                  nsIPrincipal* aTopLevelPrincipal,
                                  const bool aIsHandlingUserInput,
                                  const bool aMaybeUnsafePermissionDelegate);
@@ -781,18 +780,17 @@ nsresult TranslateChoices(
   } else {
     MOZ_ASSERT(false, "SelectedChoices should be undefined or an JS object");
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
 
 NS_IMPL_ISUPPORTS(
     nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy,
     nsIContentPermissionRequester)
 
 NS_IMETHODIMP
 nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy ::
     GetVisibility(nsIContentPermissionRequestCallback* aCallback) {
--- a/dom/base/nsTextFragment.cpp
+++ b/dom/base/nsTextFragment.cpp
@@ -155,21 +155,19 @@ static inline int32_t FirstNon8BitUnvect
   for (; i < len; i++) {
     if (str[i] > 255) return i;
   }
 
   return -1;
 }
 
 #ifdef MOZILLA_MAY_SUPPORT_SSE2
-namespace mozilla {
-namespace SSE2 {
+namespace mozilla::SSE2 {
 int32_t FirstNon8Bit(const char16_t* str, const char16_t* end);
-}  // namespace SSE2
-}  // namespace mozilla
+}  // namespace mozilla::SSE2
 #endif
 
 #ifdef __powerpc__
 namespace mozilla {
 namespace VMX {
 int32_t FirstNon8Bit(const char16_t* str, const char16_t* end);
 }  // namespace VMX
 }  // namespace mozilla
--- a/dom/bindings/CallbackInterface.cpp
+++ b/dom/bindings/CallbackInterface.cpp
@@ -5,18 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/CallbackInterface.h"
 #include "jsapi.h"
 #include "js/CharacterEncoding.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "nsPrintfCString.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 bool CallbackInterface::GetCallableProperty(
     BindingCallContext& cx, JS::Handle<jsid> aPropId,
     JS::MutableHandle<JS::Value> aCallable) {
   JS::Rooted<JSObject*> obj(cx, CallbackKnownNotGray());
   if (!JS_GetPropertyById(cx, obj, aPropId, aCallable)) {
     return false;
   }
@@ -26,10 +25,9 @@ bool CallbackInterface::GetCallablePrope
     nsPrintfCString description("Property '%s'", propName.get());
     cx.ThrowErrorMessage<MSG_NOT_CALLABLE>(description.get());
     return false;
   }
 
   return true;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/CallbackObject.cpp
+++ b/dom/bindings/CallbackObject.cpp
@@ -16,18 +16,17 @@
 #include "WorkerPrivate.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindow.h"
 #include "WorkerScope.h"
 #include "jsapi.h"
 #include "js/ContextOptions.h"
 #include "nsJSPrincipals.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CallbackObject)
   NS_INTERFACE_MAP_ENTRY(mozilla::dom::CallbackObject)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(CallbackObject)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(CallbackObject)
@@ -426,10 +425,9 @@ already_AddRefed<nsISupports> CallbackOb
   rv = wrappedJS->QueryInterface(aIID, getter_AddRefs(retval));
   if (NS_FAILED(rv)) {
     return nullptr;
   }
 
   return retval.forget();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/DOMJSProxyHandler.cpp
+++ b/dom/bindings/DOMJSProxyHandler.cpp
@@ -13,18 +13,17 @@
 #include "mozilla/dom/BindingUtils.h"
 
 #include "jsapi.h"
 #include "js/friend/DOMProxy.h"  // JS::DOMProxyShadowsResult, JS::ExpandoAndGeneration, JS::SetDOMProxyInformation
 #include "js/Object.h"           // JS::GetCompartment
 
 using namespace JS;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 jsid s_length_id = JSID_VOID;
 
 bool DefineStaticJSVals(JSContext* cx) {
   return AtomizeAndPinJSString(cx, s_length_id, "length");
 }
 
 const char DOMProxyHandler::family = 0;
@@ -322,10 +321,9 @@ void ShadowingDOMProxyHandler::trace(JST
   MOZ_ASSERT(!v.isUndefined());
 
   auto* expandoAndGeneration =
       static_cast<JS::ExpandoAndGeneration*>(v.toPrivate());
   JS::TraceEdge(trc, &expandoAndGeneration->expando,
                 "Shadowing DOM proxy expando");
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/Exceptions.cpp
+++ b/dom/bindings/Exceptions.cpp
@@ -17,18 +17,17 @@
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsPIDOMWindow.h"
 #include "nsServiceManagerUtils.h"
 #include "nsThreadUtils.h"
 #include "XPCWrapper.h"
 #include "WorkerPrivate.h"
 #include "nsContentUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 // Throw the given exception value if it's safe.  If it's not safe, then
 // synthesize and throw a new exception value for NS_ERROR_UNEXPECTED.  The
 // incoming value must be in the compartment of aCx.  This function guarantees
 // that an exception is pending on aCx when it returns.
 static void ThrowExceptionValueIfSafe(JSContext* aCx,
                                       JS::Handle<JS::Value> exnVal,
                                       Exception* aOriginalException) {
@@ -749,10 +748,9 @@ already_AddRefed<nsIStackFrame> CreateSt
                                             JS::Handle<JSObject*> aStack) {
   if (aStack) {
     return MakeAndAddRef<JSStackFrame>(aStack);
   }
   return nullptr;
 }
 
 }  // namespace exceptions
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/IterableIterator.cpp
+++ b/dom/bindings/IterableIterator.cpp
@@ -1,18 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/IterableIterator.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 // Due to IterableIterator being a templated class, we implement the necessary
 // CC bits in a superclass that IterableIterator then inherits from. This allows
 // us to put the macros outside of the header. The base class has pure virtual
 // functions for Traverse/Unlink that the templated subclasses will override.
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(IterableIteratorBase)
 
@@ -26,10 +25,9 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(IterableIteratorBase)
   tmp->UnlinkHelper();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IterableIteratorBase)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/RemoteObjectProxy.cpp
+++ b/dom/bindings/RemoteObjectProxy.cpp
@@ -5,18 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "RemoteObjectProxy.h"
 #include "AccessCheck.h"
 #include "jsfriendapi.h"
 #include "js/Object.h"  // JS::GetClass
 #include "xpcprivate.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 bool RemoteObjectProxyBase::getOwnPropertyDescriptor(
     JSContext* aCx, JS::Handle<JSObject*> aProxy, JS::Handle<jsid> aId,
     JS::MutableHandle<JS::PropertyDescriptor> aDesc) const {
   bool ok = CrossOriginGetOwnPropertyHelper(aCx, aProxy, aId, aDesc);
   if (!ok || aDesc.object()) {
     return ok;
   }
@@ -175,10 +174,9 @@ void RemoteObjectProxyBase::GetOrCreateP
     return;
   }
 
   aProxy.set(obj);
 }
 
 const char RemoteObjectProxyBase::sCrossOriginProxyFamily = 0;
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/SimpleGlobalObject.cpp
+++ b/dom/bindings/SimpleGlobalObject.cpp
@@ -14,18 +14,17 @@
 #include "nsThreadUtils.h"
 #include "nsContentUtils.h"
 
 #include "xpcprivate.h"
 
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/NullPrincipal.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(SimpleGlobalObject)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(SimpleGlobalObject)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
   tmp->UnlinkObjectsInGlobal();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
@@ -162,10 +161,9 @@ SimpleGlobalObject::GlobalType SimpleGlo
   if (JS::GetClass(obj) != &SimpleGlobalClass) {
     return SimpleGlobalObject::GlobalType::NotSimpleGlobal;
   }
 
   auto* globalObject = static_cast<SimpleGlobalObject*>(JS::GetPrivate(obj));
   return globalObject->Type();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/ToJSValue.cpp
+++ b/dom/bindings/ToJSValue.cpp
@@ -9,18 +9,17 @@
 #include "mozilla/dom/Exceptions.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/WindowProxyHolder.h"
 #include "nsAString.h"
 #include "nsContentUtils.h"
 #include "nsStringBuffer.h"
 #include "xpcpublic.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 bool ToJSValue(JSContext* aCx, const nsAString& aArgument,
                JS::MutableHandle<JS::Value> aValue) {
   // Make sure we're called in a compartment
   MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));
 
   // XXXkhuey I'd love to use xpc::NonVoidStringToJsval here, but it requires
   // a non-const nsAString for silly reasons.
@@ -111,10 +110,9 @@ static_assert(
     std::is_same_v<ScriptableInterfaceType<SingleScriptableInterface>,
                    nsIObserver>,
     "Concrete type with one scriptable interface picks the correct interface");
 class MultiScriptableInterface : public nsIObserver, public nsIRunnable {};
 static_assert(std::is_same_v<ScriptableInterfaceType<MultiScriptableInterface>,
                              nsISupports>,
               "Concrete type with multiple scriptable interfaces falls back");
 }  // namespace binding_detail
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/WebIDLGlobalNameHash.cpp
+++ b/dom/bindings/WebIDLGlobalNameHash.cpp
@@ -20,18 +20,17 @@
 #include "mozilla/dom/DOMJSProxyHandler.h"
 #include "mozilla/dom/JSSlots.h"
 #include "mozilla/dom/PrototypeList.h"
 #include "mozilla/dom/RegisterBindings.h"
 #include "nsGlobalWindow.h"
 #include "nsTHashtable.h"
 #include "WrapperFactory.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 static JSObject* FindNamedConstructorForXray(
     JSContext* aCx, JS::Handle<jsid> aId, const WebIDLNameTableEntry* aEntry) {
   JSObject* interfaceObject =
       GetPerInterfaceObjectHandle(aCx, aEntry->mConstructorId, aEntry->mCreate,
                                   /* aDefineOnGlobal = */ false);
   if (!interfaceObject) {
     return nullptr;
@@ -264,10 +263,9 @@ bool WebIDLGlobalNameHash::NewEnumerateS
       if (!str || !aProperties.append(JS::PropertyKey::fromNonIntAtom(str))) {
         return false;
       }
     }
   }
   return true;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/test/TestFunctions.cpp
+++ b/dom/bindings/test/TestFunctions.cpp
@@ -9,18 +9,17 @@
 #include "mozilla/dom/TestFunctionsBinding.h"
 #include "mozilla/dom/WindowBinding.h"
 #include "mozilla/dom/WrapperCachedNonISupportsTestInterface.h"
 #include "nsStringBuffer.h"
 #include "mozITestInterfaceJS.h"
 #include "nsComponentManagerUtils.h"
 #include "nsGlobalWindowInner.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 /* static */
 TestFunctions* TestFunctions::Constructor(GlobalObject& aGlobal) {
   return new TestFunctions;
 }
 
 /* static */
 void TestFunctions::ThrowUncatchableException(GlobalObject& aGlobal,
@@ -307,10 +306,9 @@ TestFunctions::WrapperCachedNonISupports
 }
 
 bool TestFunctions::WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto,
                                JS::MutableHandle<JSObject*> aWrapper) {
   return TestFunctions_Binding::Wrap(aCx, this, aGivenProto, aWrapper);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/test/TestInterfaceIterableDouble.cpp
+++ b/dom/bindings/test/TestInterfaceIterableDouble.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/TestInterfaceIterableDouble.h"
 #include "mozilla/dom/TestInterfaceJSMaplikeSetlikeIterableBinding.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/BindingUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TestInterfaceIterableDouble, mParent)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(TestInterfaceIterableDouble)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(TestInterfaceIterableDouble)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestInterfaceIterableDouble)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -64,10 +63,9 @@ nsAString& TestInterfaceIterableDouble::
   return mValues.ElementAt(aIndex).first;
 }
 
 nsAString& TestInterfaceIterableDouble::GetValueAtIndex(uint32_t aIndex) {
   MOZ_ASSERT(aIndex < mValues.Length());
   return mValues.ElementAt(aIndex).second;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/test/TestInterfaceIterableDoubleUnion.cpp
+++ b/dom/bindings/test/TestInterfaceIterableDoubleUnion.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/TestInterfaceIterableDoubleUnion.h"
 #include "mozilla/dom/TestInterfaceJSMaplikeSetlikeIterableBinding.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/BindingUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TestInterfaceIterableDoubleUnion, mParent)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(TestInterfaceIterableDoubleUnion)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(TestInterfaceIterableDoubleUnion)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestInterfaceIterableDoubleUnion)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -68,10 +67,9 @@ nsAString& TestInterfaceIterableDoubleUn
 }
 
 OwningStringOrLong& TestInterfaceIterableDoubleUnion::GetValueAtIndex(
     uint32_t aIndex) {
   MOZ_ASSERT(aIndex < mValues.Length());
   return mValues.ElementAt(aIndex).second;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/test/TestInterfaceIterableSingle.cpp
+++ b/dom/bindings/test/TestInterfaceIterableSingle.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/TestInterfaceIterableSingle.h"
 #include "mozilla/dom/TestInterfaceJSMaplikeSetlikeIterableBinding.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/BindingUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TestInterfaceIterableSingle, mParent)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(TestInterfaceIterableSingle)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(TestInterfaceIterableSingle)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestInterfaceIterableSingle)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -65,10 +64,9 @@ int32_t TestInterfaceIterableSingle::Ind
     aFound = false;
     return 0;
   }
 
   aFound = true;
   return mValues[aIndex];
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/test/TestInterfaceMaplike.cpp
+++ b/dom/bindings/test/TestInterfaceMaplike.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/TestInterfaceMaplike.h"
 #include "mozilla/dom/TestInterfaceJSMaplikeSetlikeIterableBinding.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/BindingUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TestInterfaceMaplike, mParent)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(TestInterfaceMaplike)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(TestInterfaceMaplike)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestInterfaceMaplike)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -63,10 +62,9 @@ bool TestInterfaceMaplike::DeleteInterna
   return TestInterfaceMaplike_Binding::MaplikeHelpers::Delete(this, aKey, rv);
 }
 
 bool TestInterfaceMaplike::HasInternal(const nsAString& aKey) {
   ErrorResult rv;
   return TestInterfaceMaplike_Binding::MaplikeHelpers::Has(this, aKey, rv);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/test/TestInterfaceMaplikeObject.cpp
+++ b/dom/bindings/test/TestInterfaceMaplikeObject.cpp
@@ -5,18 +5,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/TestInterfaceMaplikeObject.h"
 #include "mozilla/dom/TestInterfaceMaplike.h"
 #include "mozilla/dom/TestInterfaceJSMaplikeSetlikeIterableBinding.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/BindingUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TestInterfaceMaplikeObject, mParent)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(TestInterfaceMaplikeObject)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(TestInterfaceMaplikeObject)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestInterfaceMaplikeObject)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -69,10 +68,9 @@ bool TestInterfaceMaplikeObject::DeleteI
 }
 
 bool TestInterfaceMaplikeObject::HasInternal(const nsAString& aKey) {
   ErrorResult rv;
   return TestInterfaceMaplikeObject_Binding::MaplikeHelpers::Has(this, aKey,
                                                                  rv);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/test/TestInterfaceSetlike.cpp
+++ b/dom/bindings/test/TestInterfaceSetlike.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/TestInterfaceSetlike.h"
 #include "mozilla/dom/TestInterfaceJSMaplikeSetlikeIterableBinding.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/BindingUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TestInterfaceSetlike, mParent)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(TestInterfaceSetlike)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(TestInterfaceSetlike)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestInterfaceSetlike)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -44,10 +43,9 @@ JSObject* TestInterfaceSetlike::WrapObje
                                            JS::Handle<JSObject*> aGivenProto) {
   return TestInterfaceSetlike_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 nsPIDOMWindowInner* TestInterfaceSetlike::GetParentObject() const {
   return mParent;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/test/TestInterfaceSetlikeNode.cpp
+++ b/dom/bindings/test/TestInterfaceSetlikeNode.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/TestInterfaceSetlikeNode.h"
 #include "mozilla/dom/TestInterfaceJSMaplikeSetlikeIterableBinding.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/dom/BindingUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TestInterfaceSetlikeNode, mParent)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(TestInterfaceSetlikeNode)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(TestInterfaceSetlikeNode)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestInterfaceSetlikeNode)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -46,10 +45,9 @@ JSObject* TestInterfaceSetlikeNode::Wrap
     JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   return TestInterfaceSetlikeNode_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 nsPIDOMWindowInner* TestInterfaceSetlikeNode::GetParentObject() const {
   return mParent;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/bindings/test/WrapperCachedNonISupportsTestInterface.cpp
+++ b/dom/bindings/test/WrapperCachedNonISupportsTestInterface.cpp
@@ -2,18 +2,17 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/WrapperCachedNonISupportsTestInterface.h"
 #include "mozilla/dom/TestFunctionsBinding.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WrapperCachedNonISupportsTestInterface,
                                      AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WrapperCachedNonISupportsTestInterface,
                                        Release)
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WrapperCachedNonISupportsTestInterface)
 
@@ -26,10 +25,9 @@ JSObject* WrapperCachedNonISupportsTestI
 already_AddRefed<WrapperCachedNonISupportsTestInterface>
 WrapperCachedNonISupportsTestInterface::Constructor(
     const GlobalObject& aGlobalObject) {
   RefPtr<WrapperCachedNonISupportsTestInterface> result =
       new WrapperCachedNonISupportsTestInterface();
   return result.forget();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/cache/Action.cpp
+++ b/dom/cache/Action.cpp
@@ -1,29 +1,25 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/cache/Action.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 void Action::CancelOnInitiatingThread() {
   NS_ASSERT_OWNINGTHREAD(Action);
   // It is possible for cancellation to be duplicated.  For example, an
   // individual Cache could have its Actions canceled and then shutdown
   // could trigger a second action.
   mCanceled = true;
 }
 
 Action::Action() : mCanceled(false) {}
 
 Action::~Action() = default;
 
 bool Action::IsCanceled() const { return mCanceled; }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/ActorChild.cpp
+++ b/dom/cache/ActorChild.cpp
@@ -4,19 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/cache/ActorChild.h"
 
 #include "mozilla/dom/cache/CacheWorkerRef.h"
 #include "nsThreadUtils.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 void ActorChild::SetWorkerRef(SafeRefPtr<CacheWorkerRef> aWorkerRef) {
   // Some of the Cache actors can have multiple DOM objects associated with
   // them.  In this case the workerRef will be added multiple times.  This is
   // permitted, but the workerRef should be the same each time.
   if (mWorkerRef) {
     // XXX Here, we don't use aWorkerRef, so we unnecessarily add-refed... This
     // might be a case to show in the raw pointer guideline as a possible
@@ -47,11 +45,9 @@ const SafeRefPtr<CacheWorkerRef>& ActorC
 bool ActorChild::WorkerRefNotified() const {
   return mWorkerRef && mWorkerRef->Notified();
 }
 
 ActorChild::ActorChild() = default;
 
 ActorChild::~ActorChild() { MOZ_DIAGNOSTIC_ASSERT(!mWorkerRef); }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/AutoUtils.cpp
+++ b/dom/cache/AutoUtils.cpp
@@ -41,19 +41,17 @@ void CleanupChild(Maybe<CacheReadStream>
     return;
   }
 
   CleanupChild(aMaybeReadStream.ref(), aAction);
 }
 
 }  // namespace
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 // --------------------------------------------
 
 AutoChildOpArgs::AutoChildOpArgs(TypeUtils* aTypeUtils,
                                  const CacheOpArgs& aOpArgs,
                                  uint32_t aEntryCount)
     : mTypeUtils(aTypeUtils), mOpArgs(aOpArgs), mSent(false) {
   MOZ_DIAGNOSTIC_ASSERT(mTypeUtils);
@@ -506,11 +504,9 @@ void AutoParentOpResult::SerializeReadSt
 
   RefPtr<ReadStream> readStream =
       ReadStream::Create(mStreamControl, aId, stream);
   ErrorResult rv;
   readStream->Serialize(aReadStreamOut, mStreamCleanupList, rv);
   MOZ_DIAGNOSTIC_ASSERT(!rv.Failed());
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/Cache.cpp
+++ b/dom/cache/Cache.cpp
@@ -18,19 +18,17 @@
 #include "mozilla/dom/cache/CacheChild.h"
 #include "mozilla/dom/cache/CacheWorkerRef.h"
 #include "mozilla/dom/cache/ReadStream.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Unused.h"
 #include "nsIGlobalObject.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::ipc::PBackgroundChild;
 
 namespace {
 
 enum class PutStatusPolicy { Default, RequireOK };
 
 bool IsValidPutRequestURL(const nsAString& aUrl, ErrorResult& aRv) {
@@ -609,11 +607,9 @@ already_AddRefed<Promise> Cache::PutAll(
 
   return ExecuteOp(args, aRv);
 }
 
 OpenMode Cache::GetOpenMode() const {
   return mNamespace == CHROME_ONLY_NAMESPACE ? OpenMode::Eager : OpenMode::Lazy;
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/CacheChild.cpp
+++ b/dom/cache/CacheChild.cpp
@@ -7,19 +7,17 @@
 #include "mozilla/dom/cache/CacheChild.h"
 
 #include "mozilla/Unused.h"
 #include "mozilla/dom/cache/ActorUtils.h"
 #include "mozilla/dom/cache/Cache.h"
 #include "mozilla/dom/cache/CacheOpChild.h"
 #include "CacheWorkerRef.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 // Declared in ActorUtils.h
 PCacheChild* AllocPCacheChild() { return new CacheChild(); }
 
 // Declared in ActorUtils.h
 void DeallocPCacheChild(PCacheChild* aActor) { delete aActor; }
 
 CacheChild::CacheChild()
@@ -144,11 +142,9 @@ void CacheChild::Lock() {
 
 void CacheChild::Unlock() {
   NS_ASSERT_OWNINGTHREAD(CacheChild);
   MOZ_DIAGNOSTIC_ASSERT(mLocked);
   mLocked = false;
   MaybeFlushDelayedDestroy();
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/CacheOpChild.cpp
+++ b/dom/cache/CacheOpChild.cpp
@@ -9,18 +9,17 @@
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/Request.h"
 #include "mozilla/dom/Response.h"
 #include "mozilla/dom/cache/Cache.h"
 #include "mozilla/dom/cache/CacheChild.h"
 #include "mozilla/dom/cache/CacheStreamControlChild.h"
 #include "mozilla/dom/cache/CacheWorkerRef.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 // XXX Move this to ToJSValue.h
 template <typename T>
 MOZ_MUST_USE bool ToJSValue(JSContext* aCx, const SafeRefPtr<T>& aArgument,
                             JS::MutableHandle<JS::Value> aValue) {
   return ToJSValue(aCx, *aArgument.unsafeGetRawPtr(), aValue);
 }
 
 namespace cache {
@@ -226,10 +225,9 @@ void CacheOpChild::HandleRequestList(
     AddWorkerRefToStreamChild(aRequestList[i], GetWorkerRefPtr());
     requests.AppendElement(ToRequest(aRequestList[i]));
   }
 
   mPromise->MaybeResolve(requests);
 }
 
 }  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/cache/CacheOpParent.cpp
+++ b/dom/cache/CacheOpParent.cpp
@@ -11,19 +11,17 @@
 #include "mozilla/dom/cache/AutoUtils.h"
 #include "mozilla/dom/cache/ManagerId.h"
 #include "mozilla/dom/cache/ReadStream.h"
 #include "mozilla/dom/cache/SavedTypes.h"
 #include "mozilla/ipc/FileDescriptorSetParent.h"
 #include "mozilla/ipc/InputStreamUtils.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::ipc::FileDescriptorSetParent;
 using mozilla::ipc::PBackgroundParent;
 
 CacheOpParent::CacheOpParent(PBackgroundParent* aIpcManager, CacheId aCacheId,
                              const CacheOpArgs& aOpArgs)
     : mIpcManager(aIpcManager),
       mCacheId(aCacheId),
@@ -310,11 +308,9 @@ void CacheOpParent::ProcessCrossOriginRe
               contentPrincipalInfo.baseDomain())) {
         aRv.ThrowTypeError("Response is expected from same site.");
         return;
       }
     }
   }
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/CacheParent.cpp
+++ b/dom/cache/CacheParent.cpp
@@ -4,19 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/cache/CacheParent.h"
 
 #include "mozilla/dom/cache/CacheOpParent.h"
 #include "nsCOMPtr.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 // Declared in ActorUtils.h
 void DeallocPCacheParent(PCacheParent* aActor) { delete aActor; }
 
 CacheParent::CacheParent(SafeRefPtr<cache::Manager> aManager, CacheId aCacheId)
     : mManager(std::move(aManager)), mCacheId(aCacheId) {
   MOZ_COUNT_CTOR(cache::CacheParent);
   MOZ_DIAGNOSTIC_ASSERT(mManager);
@@ -61,11 +59,9 @@ mozilla::ipc::IPCResult CacheParent::Rec
 mozilla::ipc::IPCResult CacheParent::RecvTeardown() {
   if (!Send__delete__(this)) {
     // child process is gone, warn and allow actor to clean up normally
     NS_WARNING("Cache failed to send delete.");
   }
   return IPC_OK();
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/CacheStorage.cpp
+++ b/dom/cache/CacheStorage.cpp
@@ -30,19 +30,17 @@
 #include "mozilla/StaticPrefs_extensions.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/Document.h"
 #include "nsIGlobalObject.h"
 #include "nsMixedContentBlocker.h"
 #include "nsURLParsers.h"
 #include "js/Object.h"  // JS::GetClass
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::ErrorResult;
 using mozilla::Unused;
 using mozilla::dom::quota::QuotaManager;
 using mozilla::ipc::BackgroundChild;
 using mozilla::ipc::IProtocol;
 using mozilla::ipc::PBackgroundChild;
 using mozilla::ipc::PrincipalInfo;
@@ -586,11 +584,9 @@ bool CacheStorage::HasStorageAccess() co
     MOZ_ASSERT(workerPrivate);
 
     access = workerPrivate->StorageAccess();
   }
 
   return access > StorageAccess::ePrivateBrowsing;
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/CacheStorageChild.cpp
+++ b/dom/cache/CacheStorageChild.cpp
@@ -7,19 +7,17 @@
 #include "mozilla/dom/cache/CacheStorageChild.h"
 
 #include "mozilla/Unused.h"
 #include "mozilla/dom/cache/CacheChild.h"
 #include "mozilla/dom/cache/CacheOpChild.h"
 #include "mozilla/dom/cache/CacheStorage.h"
 #include "mozilla/dom/cache/CacheWorkerRef.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 // declared in ActorUtils.h
 void DeallocPCacheStorageChild(PCacheStorageChild* aActor) { delete aActor; }
 
 CacheStorageChild::CacheStorageChild(CacheStorage* aListener,
                                      SafeRefPtr<CacheWorkerRef> aWorkerRef)
     : mListener(aListener), mNumChildActors(0), mDelayedDestroy(false) {
   MOZ_COUNT_CTOR(cache::CacheStorageChild);
@@ -119,11 +117,9 @@ bool CacheStorageChild::DeallocPCacheOpC
 void CacheStorageChild::NoteDeletedActor() {
   MOZ_DIAGNOSTIC_ASSERT(mNumChildActors);
   mNumChildActors -= 1;
   if (!mNumChildActors && mDelayedDestroy) {
     StartDestroy();
   }
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/CacheStorageParent.cpp
+++ b/dom/cache/CacheStorageParent.cpp
@@ -8,19 +8,17 @@
 
 #include "mozilla/Unused.h"
 #include "mozilla/dom/cache/ActorUtils.h"
 #include "mozilla/dom/cache/CacheOpParent.h"
 #include "mozilla/dom/cache/ManagerId.h"
 #include "mozilla/dom/quota/QuotaManager.h"
 #include "mozilla/ipc/PBackgroundParent.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::dom::quota::QuotaManager;
 using mozilla::ipc::PBackgroundParent;
 using mozilla::ipc::PrincipalInfo;
 
 // declared in ActorUtils.h
 PCacheStorageParent* AllocPCacheStorageParent(
     PBackgroundParent* aManagingActor, Namespace aNamespace,
@@ -118,11 +116,9 @@ void CacheStorageParent::OnPrincipalVeri
     mVerifiedStatus = aRv;
   }
 
   mManagerId = aManagerId.clonePtr();
   mVerifier->RemoveListener(this);
   mVerifier = nullptr;
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/CacheStreamControlChild.cpp
+++ b/dom/cache/CacheStreamControlChild.cpp
@@ -12,19 +12,17 @@
 #include "mozilla/dom/cache/CacheWorkerRef.h"
 #include "mozilla/dom/cache/ReadStream.h"
 #include "mozilla/ipc/FileDescriptorSetChild.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/ipc/PFileDescriptorSetChild.h"
 #include "nsISupportsImpl.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::dom::OptionalFileDescriptorSet;
 using mozilla::ipc::AutoIPCStream;
 using mozilla::ipc::FileDescriptor;
 using mozilla::ipc::FileDescriptorSetChild;
 using mozilla::ipc::PFileDescriptorSetChild;
 
 // declared in ActorUtils.h
@@ -145,11 +143,9 @@ void CacheStreamControlChild::ActorDestr
 }
 
 mozilla::ipc::IPCResult CacheStreamControlChild::RecvCloseAll() {
   NS_ASSERT_OWNINGTHREAD(CacheStreamControlChild);
   CloseAllReadStreams();
   return IPC_OK();
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/CacheStreamControlParent.cpp
+++ b/dom/cache/CacheStreamControlParent.cpp
@@ -13,19 +13,17 @@
 #include "mozilla/dom/cache/StreamList.h"
 #include "mozilla/ipc/FileDescriptorSetParent.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/ipc/PBackgroundParent.h"
 #include "mozilla/ipc/PFileDescriptorSetParent.h"
 #include "nsISupportsImpl.h"
 #include "nsTArray.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::dom::OptionalFileDescriptorSet;
 using mozilla::ipc::AutoIPCStream;
 using mozilla::ipc::FileDescriptor;
 using mozilla::ipc::FileDescriptorSetParent;
 using mozilla::ipc::PFileDescriptorSetParent;
 
 // declared in ActorUtils.h
@@ -148,11 +146,9 @@ void CacheStreamControlParent::Shutdown(
   }
 }
 
 void CacheStreamControlParent::NotifyCloseAll() {
   NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent);
   CloseAllReadStreams();
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/CacheWorkerRef.cpp
+++ b/dom/cache/CacheWorkerRef.cpp
@@ -5,19 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/cache/CacheWorkerRef.h"
 
 #include "mozilla/dom/cache/ActorChild.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/dom/WorkerRef.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 namespace {
 // XXX Move this to mfbt, or do we already have something like this? Or remove
 // the need for that by changing StrongWorkerRef/IPCWorkerRef?
 
 template <class T>
 class FakeCopyable {
  public:
@@ -146,11 +144,9 @@ void CacheWorkerRef::Notify() {
 CacheWorkerRef::CacheWorkerRef(Behavior aBehavior, ConstructorGuard)
     : mBehavior(aBehavior), mNotified(false) {}
 
 CacheWorkerRef::~CacheWorkerRef() {
   NS_ASSERT_OWNINGTHREAD(CacheWorkerRef);
   MOZ_DIAGNOSTIC_ASSERT(mActorList.IsEmpty());
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/Connection.cpp
+++ b/dom/cache/Connection.cpp
@@ -4,19 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/cache/Connection.h"
 
 #include "mozilla/dom/cache/DBSchema.h"
 #include "mozStorageHelper.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::dom::quota::QuotaObject;
 
 NS_IMPL_ISUPPORTS(cache::Connection, mozIStorageAsyncConnection,
                   mozIStorageConnection);
 
 Connection::Connection(mozIStorageConnection* aBase)
     : mBase(aBase), mClosed(false) {
@@ -248,11 +246,9 @@ Connection::EnableModule(const nsACStrin
 }
 
 NS_IMETHODIMP
 Connection::GetQuotaObjects(QuotaObject** aDatabaseQuotaObject,
                             QuotaObject** aJournalQuotaObject) {
   return mBase->GetQuotaObjects(aDatabaseQuotaObject, aJournalQuotaObject);
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/Context.cpp
+++ b/dom/cache/Context.cpp
@@ -34,19 +34,17 @@ class NullAction final : public Action {
     // Resolve success immediately.  This Action does no actual work.
     MOZ_DIAGNOSTIC_ASSERT(aResolver);
     aResolver->Resolve(NS_OK);
   }
 };
 
 }  // namespace
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::dom::quota::AssertIsOnIOThread;
 using mozilla::dom::quota::OpenDirectoryListener;
 using mozilla::dom::quota::PERSISTENCE_TYPE_DEFAULT;
 using mozilla::dom::quota::PersistenceType;
 using mozilla::dom::quota::QuotaManager;
 
 class Context::Data final : public Action::Data {
@@ -1039,11 +1037,9 @@ void Context::DoomTargetData() {
   // roundtrip to the target thread and back to the owning thread.  The
   // ref to the Data object is cleared on the owning thread after creating
   // the ActionRunnable, but before dispatching it.
   DispatchAction(MakeSafeRefPtr<NullAction>(), true /* doomed data */);
 
   MOZ_DIAGNOSTIC_ASSERT(!mData);
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/DBAction.cpp
+++ b/dom/cache/DBAction.cpp
@@ -16,19 +16,17 @@
 #include "mozIStorageService.h"
 #include "mozStorageCID.h"
 #include "nsIFile.h"
 #include "nsIURI.h"
 #include "nsIURIMutator.h"
 #include "nsIFileURL.h"
 #include "nsThreadUtils.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::dom::quota::AssertIsOnIOThread;
 using mozilla::dom::quota::Client;
 using mozilla::dom::quota::PERSISTENCE_TYPE_DEFAULT;
 using mozilla::dom::quota::PersistenceType;
 
 namespace {
 
@@ -268,11 +266,9 @@ nsresult OpenDBConnection(const QuotaInf
     return rv;
   }
 
   conn.forget(aConnOut);
 
   return rv;
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -28,20 +28,17 @@
 #include "nsCRT.h"
 #include "nsHttp.h"
 #include "nsIContentPolicy.h"
 #include "nsICryptoHash.h"
 #include "nsNetCID.h"
 #include "nsPrintfCString.h"
 #include "nsTArray.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
-namespace db {
+namespace mozilla::dom::cache::db {
 const int32_t kFirstShippedSchemaVersion = 15;
 namespace {
 // ## Firefox 57 Cache API v25/v26/v27 Schema Hack Info
 // ### Overview
 // In Firefox 57 we introduced Cache API schema version 26 and Quota Manager
 // schema v3 to support tracking padding for opaque responses.  Unfortunately,
 // Firefox 57 is a big release that may potentially result in users downgrading
 // to Firefox 56 due to 57 retiring add-ons.  These schema changes have the
@@ -3533,12 +3530,9 @@ nsresult MigrateFrom26To27(mozIStorageCo
   nsresult rv = aConn.SetSchemaVersion(kHackyDowngradeSchemaVersion);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
   return rv;
 }
 
 }  // anonymous namespace
-}  // namespace db
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache::db
--- a/dom/cache/FileUtils.cpp
+++ b/dom/cache/FileUtils.cpp
@@ -18,19 +18,17 @@
 #include "nsIFile.h"
 #include "nsIUUIDGenerator.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::dom::quota::Client;
 using mozilla::dom::quota::FileInputStream;
 using mozilla::dom::quota::FileOutputStream;
 using mozilla::dom::quota::PERSISTENCE_TYPE_DEFAULT;
 using mozilla::dom::quota::QuotaManager;
 using mozilla::dom::quota::QuotaObject;
 
@@ -1024,11 +1022,9 @@ nsresult LockedDirectoryPaddingDeleteFil
     return NS_OK;
   }
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return rv;
 }
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/Manager.cpp
+++ b/dom/cache/Manager.cpp
@@ -25,19 +25,17 @@
 #include "nsIInputStream.h"
 #include "nsID.h"
 #include "nsIFile.h"
 #include "nsIThread.h"
 #include "nsThreadUtils.h"
 #include "nsTObserverArray.h"
 #include "QuotaClientImpl.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 namespace {
 
 /**
  * Note: The aCommitHook argument will be invoked while a lock is held. Callers
  * should be careful not to pass a hook that might lock on something else and
  * trigger a deadlock.
  */
@@ -2056,11 +2054,9 @@ void Manager::MaybeAllowContextToClose()
     // want to start any new operations once we allow the Context to close since
     // it may race with the underlying storage getting invalidated.
     NoteClosing();
 
     pinnedContext->AllowToClose();
   }
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/ManagerId.cpp
+++ b/dom/cache/ManagerId.cpp
@@ -9,19 +9,17 @@
 #include "CacheCommon.h"
 
 #include "mozilla/dom/quota/QuotaManager.h"
 #include "nsIPrincipal.h"
 #include "nsProxyRelease.h"
 #include "mozilla/RefPtr.h"
 #include "nsThreadUtils.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::dom::quota::QuotaManager;
 
 // static
 Result<SafeRefPtr<ManagerId>, nsresult> ManagerId::Create(
     nsIPrincipal* aPrincipal) {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -54,11 +52,9 @@ ManagerId::~ManagerId() {
 
   // Otherwise we need to proxy to main thread to do the release
 
   // The PBackground worker thread shouldn't be running after the main thread
   // is stopped.  So main thread is guaranteed to exist here.
   NS_ReleaseOnMainThread("ManagerId::mPrincipal", mPrincipal.forget());
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/PrincipalVerifier.cpp
+++ b/dom/cache/PrincipalVerifier.cpp
@@ -14,19 +14,17 @@
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/BasePrincipal.h"
 #include "CacheCommon.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsIPrincipal.h"
 #include "nsNetUtil.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::ipc::AssertIsOnBackgroundThread;
 using mozilla::ipc::BackgroundParent;
 using mozilla::ipc::PBackgroundParent;
 using mozilla::ipc::PrincipalInfo;
 using mozilla::ipc::PrincipalInfoToPrincipal;
 
 // static
@@ -185,11 +183,9 @@ void PrincipalVerifier::DispatchToInitia
   nsresult rv =
       mInitiatingEventTarget->Dispatch(this, nsIThread::DISPATCH_NORMAL);
   if (NS_FAILED(rv)) {
     NS_WARNING(
         "Cache unable to complete principal verification due to shutdown.");
   }
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/QuotaClient.cpp
+++ b/dom/cache/QuotaClient.cpp
@@ -192,19 +192,17 @@ static nsresult LockedGetPaddingSizeFrom
 
   *aPaddingSizeOut = paddingSize;
 
   return rv;
 }
 
 }  // namespace
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 const nsLiteralString kCachesSQLiteFilename = u"caches.sqlite"_ns;
 
 CacheQuotaClient::CacheQuotaClient()
     : mDirPaddingFileMutex("DOMCacheQuotaClient.mDirPaddingFileMutex") {
   AssertIsOnBackgroundThread();
   MOZ_DIAGNOSTIC_ASSERT(!sInstance);
   sInstance = this;
@@ -563,11 +561,9 @@ nsresult WipePaddingFile(const QuotaInfo
   RefPtr<CacheQuotaClient> cacheQuotaClient = CacheQuotaClient::Get();
   MOZ_DIAGNOSTIC_ASSERT(cacheQuotaClient);
 
   nsresult rv = cacheQuotaClient->WipePaddingFileInternal(aQuotaInfo, aBaseDir);
   Unused << NS_WARN_IF(NS_FAILED(rv));
 
   return rv;
 }
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/ReadStream.cpp
+++ b/dom/cache/ReadStream.cpp
@@ -11,19 +11,17 @@
 #include "mozilla/dom/cache/CacheStreamControlParent.h"
 #include "mozilla/dom/cache/CacheTypes.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/SnappyUncompressInputStream.h"
 #include "nsIAsyncInputStream.h"
 #include "nsStringStream.h"
 #include "nsTArray.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::Unused;
 using mozilla::ipc::AutoIPCStream;
 using mozilla::ipc::IPCStream;
 
 // ----------------------------------------------------------------------------
 
 // The inner stream class.  This is where all of the real work is done.  As
@@ -603,11 +601,9 @@ ReadStream::ReadSegments(nsWriteSegmentF
   return mInner->ReadSegments(aWriter, aClosure, aCount, aNumReadOut);
 }
 
 NS_IMETHODIMP
 ReadStream::IsNonBlocking(bool* aNonBlockingOut) {
   return mInner->IsNonBlocking(aNonBlockingOut);
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/StreamControl.cpp
+++ b/dom/cache/StreamControl.cpp
@@ -1,19 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/cache/StreamControl.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 void StreamControl::AddReadStream(
     SafeRefPtr<ReadStream::Controllable> aReadStream) {
   AssertOwningThread();
   MOZ_DIAGNOSTIC_ASSERT(aReadStream);
   MOZ_ASSERT(!mReadStreamList.Contains(aReadStream));
   mReadStreamList.AppendElement(std::move(aReadStream));
 }
@@ -62,11 +60,9 @@ void StreamControl::CloseAllReadStreamsW
 
 bool StreamControl::HasEverBeenRead() const {
   const auto range = mReadStreamList.NonObservingRange();
   return std::any_of(range.begin(), range.end(), [](const auto& stream) {
     return stream->HasEverBeenRead();
   });
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/StreamList.cpp
+++ b/dom/cache/StreamList.cpp
@@ -6,19 +6,17 @@
 
 #include "mozilla/dom/cache/StreamList.h"
 
 #include "mozilla/dom/cache/CacheStreamControlParent.h"
 #include "mozilla/dom/cache/Context.h"
 #include "mozilla/dom/cache/Manager.h"
 #include "nsIInputStream.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 StreamList::StreamList(SafeRefPtr<Manager> aManager,
                        SafeRefPtr<Context> aContext)
     : mManager(std::move(aManager)),
       mContext(std::move(aContext)),
       mCacheId(INVALID_CACHE_ID),
       mStreamControl(nullptr),
       mActivated(false) {
@@ -157,11 +155,9 @@ StreamList::~StreamList() {
     for (uint32_t i = 0; i < mList.Length(); ++i) {
       mManager->ReleaseBodyId(mList[i].mId);
     }
     mManager->ReleaseCacheId(mCacheId);
   }
   mContext->RemoveActivity(this);
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/cache/TypeUtils.cpp
+++ b/dom/cache/TypeUtils.cpp
@@ -26,19 +26,17 @@
 #include "nsHttp.h"
 #include "nsIIPCSerializableInputStream.h"
 #include "nsPromiseFlatString.h"
 #include "nsQueryObject.h"
 #include "nsStreamUtils.h"
 #include "nsString.h"
 #include "nsURLParsers.h"
 
-namespace mozilla {
-namespace dom {
-namespace cache {
+namespace mozilla::dom::cache {
 
 using mozilla::ipc::AutoIPCStream;
 using mozilla::ipc::BackgroundChild;
 using mozilla::ipc::FileDescriptor;
 using mozilla::ipc::PBackgroundChild;
 using mozilla::ipc::PFileDescriptorSetChild;
 
 namespace {
@@ -504,11 +502,9 @@ void TypeUtils::SerializeCacheStream(
   cacheStream.controlParent() = nullptr;
 
   UniquePtr<AutoIPCStream> autoStream(new AutoIPCStream(cacheStream.stream()));
   autoStream->Serialize(aStream, GetIPCManager());
 
   aStreamCleanupList.AppendElement(std::move(autoStream));
 }
 
-}  // namespace cache
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom::cache
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -135,18 +135,17 @@
 using namespace mozilla;
 using namespace mozilla::CanvasUtils;
 using namespace mozilla::css;
 using namespace mozilla::gfx;
 using namespace mozilla::image;
 using namespace mozilla::ipc;
 using namespace mozilla::layers;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 // Cap sigma to avoid overly large temp surfaces.
 const Float SIGMA_MAX = 100;
 
 const size_t MAX_STYLE_STACK_SIZE = 1024;
 
 /* Memory reporter stuff */
 static int64_t gCanvasAzureMemoryUsed = 0;
@@ -5725,10 +5724,9 @@ size_t BindingJSObjectMallocBytes(Canvas
   CheckedInt<uint32_t> bytes = CheckedInt<uint32_t>(width) * height * 4;
   if (!bytes.isValid()) {
     return 0;
   }
 
   return bytes.value();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/canvas/CanvasRenderingContextHelper.cpp
+++ b/dom/canvas/CanvasRenderingContextHelper.cpp
@@ -14,18 +14,17 @@
 #include "mozilla/webgpu/CanvasContext.h"
 #include "MozFramebuffer.h"
 #include "nsContentUtils.h"
 #include "nsDOMJSUtils.h"
 #include "nsIScriptContext.h"
 #include "nsJSUtils.h"
 #include "ClientWebGLContext.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 CanvasRenderingContextHelper::CanvasRenderingContextHelper()
     : mCurrentContextType(CanvasContextType::NoContext) {}
 
 void CanvasRenderingContextHelper::ToBlob(
     JSContext* aCx, nsIGlobalObject* aGlobal, BlobCallback& aCallback,
     const nsAString& aType, JS::Handle<JS::Value> aParams, bool aUsePlaceholder,
     ErrorResult& aRv) {
@@ -278,10 +277,9 @@ nsresult CanvasRenderingContextHelper::P
       outParams.Append(parseOptions);
       *outUsingCustomParseOptions = true;
     }
   }
 
   return NS_OK;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/canvas/CanvasUtils.cpp
+++ b/dom/canvas/CanvasUtils.cpp
@@ -37,18 +37,17 @@
 
 #define TOPIC_CANVAS_PERMISSIONS_PROMPT "canvas-permissions-prompt"
 #define TOPIC_CANVAS_PERMISSIONS_PROMPT_HIDE_DOORHANGER \
   "canvas-permissions-prompt-hide-doorhanger"
 #define PERMISSION_CANVAS_EXTRACT_DATA "canvas"_ns
 
 using namespace mozilla::gfx;
 
-namespace mozilla {
-namespace CanvasUtils {
+namespace mozilla::CanvasUtils {
 
 bool IsImageExtractionAllowed(dom::Document* aDocument, JSContext* aCx,
                               nsIPrincipal& aPrincipal) {
   // Do the rest of the checks only if privacy.resistFingerprinting is on.
   if (!nsContentUtils::ShouldResistFingerprinting(aDocument)) {
     return true;
   }
 
@@ -315,10 +314,9 @@ bool CheckWriteOnlySecurity(bool aCORSUs
     if (NS_WARN_IF(!principal) || !(principal->Subsumes(aPrincipal))) {
       return true;
     }
   }
 
   return false;
 }
 
-}  // namespace CanvasUtils
-}  // namespace mozilla
+}  // namespace mozilla::CanvasUtils
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -33,18 +33,17 @@
 #include "imgLoader.h"
 #include "imgTools.h"
 
 using namespace mozilla::gfx;
 using namespace mozilla::layers;
 using mozilla::dom::HTMLMediaElement_Binding::HAVE_METADATA;
 using mozilla::dom::HTMLMediaElement_Binding::NETWORK_EMPTY;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ImageBitmap, mParent)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(ImageBitmap)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(ImageBitmap)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ImageBitmap)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
@@ -1706,10 +1705,9 @@ void CreateImageBitmapFromBlob::WorkerSh
   MutexAutoLock lock(mMutex);
 
   // Let's release all the non-thread-safe objects now.
   mWorkerRef = nullptr;
   mPromise = nullptr;
   mGlobalObject = nullptr;
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/canvas/ImageBitmapRenderingContext.cpp
+++ b/dom/canvas/ImageBitmapRenderingContext.cpp
@@ -3,18 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ImageBitmapRenderingContext.h"
 #include "mozilla/dom/ImageBitmapRenderingContextBinding.h"
 #include "ImageContainer.h"
 #include "ImageLayers.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 ImageBitmapRenderingContext::ImageBitmapRenderingContext()
     : mWidth(0), mHeight(0), mIsCapturedFrameInvalid(false) {}
 
 ImageBitmapRenderingContext::~ImageBitmapRenderingContext() {
   RemovePostRefreshObserver();
 }
 
@@ -305,10 +304,9 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Im
                                       mCanvasElement, mOffscreenCanvas)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ImageBitmapRenderingContext)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/canvas/ImageData.cpp
+++ b/dom/canvas/ImageData.cpp
@@ -7,18 +7,17 @@
 #include "mozilla/dom/ImageData.h"
 
 #include "mozilla/CheckedInt.h"
 #include "mozilla/HoldDropJSObjects.h"
 #include "mozilla/dom/ImageDataBinding.h"
 
 #include "jsapi.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(ImageData)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(ImageData)
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(ImageData)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ImageData)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
@@ -124,10 +123,9 @@ bool ImageData::WriteStructuredClone(JSC
   if (!JS_WrapValue(aCx, &arrayValue)) {
     return false;
   }
 
   return JS_WriteUint32Pair(aWriter, Width(), Height()) &&
          JS_WriteTypedArray(aWriter, arrayValue);
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/canvas/OffscreenCanvas.cpp
+++ b/dom/canvas/OffscreenCanvas.cpp
@@ -14,18 +14,17 @@
 #include "mozilla/layers/ImageBridgeChild.h"
 #include "mozilla/Telemetry.h"
 #include "CanvasRenderingContext2D.h"
 #include "CanvasUtils.h"
 #include "GLContext.h"
 #include "GLScreenBuffer.h"
 #include "ImageBitmap.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 OffscreenCanvasCloneData::OffscreenCanvasCloneData(
     layers::CanvasRenderer* aRenderer, uint32_t aWidth, uint32_t aHeight,
     layers::LayersBackend aCompositorBackend, bool aNeutered, bool aIsWriteOnly)
     : mRenderer(aRenderer),
       mWidth(aWidth),
       mHeight(aHeight),
       mCompositorBackendType(aCompositorBackend),
@@ -316,10 +315,9 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(Offsc
 
 NS_IMPL_ADDREF_INHERITED(OffscreenCanvas, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(OffscreenCanvas, DOMEventTargetHelper)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(OffscreenCanvas)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/canvas/Queue.cpp
+++ b/dom/canvas/Queue.cpp
@@ -1,15 +1,13 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ProducerConsumerQueue.h"
 
-namespace mozilla {
-namespace webgl {
+namespace mozilla::webgl {
 
 mozilla::LazyLogModule gPCQLog("pcq");
 mozilla::LazyLogModule gIpdlQueueLog("ipdlqueue");
 
-}  // namespace webgl
-}  // namespace mozilla
+}  // namespace mozilla::webgl
--- a/dom/canvas/WebGLChild.cpp
+++ b/dom/canvas/WebGLChild.cpp
@@ -4,18 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WebGLChild.h"
 
 #include "ClientWebGLContext.h"
 #include "mozilla/StaticPrefs_webgl.h"
 #include "WebGLMethodDispatcher.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 WebGLChild::WebGLChild(ClientWebGLContext& context)
     : mContext(&context),
       mDefaultCmdsShmemSize(StaticPrefs::webgl_out_of_process_shmem_size()) {}
 
 WebGLChild::~WebGLChild() { (void)Send__delete__(this); }
 
 void WebGLChild::ActorDestroy(ActorDestroyReason why) {
@@ -84,10 +83,9 @@ mozilla::ipc::IPCResult WebGLChild::Recv
 
 mozilla::ipc::IPCResult WebGLChild::RecvOnContextLoss(
     const webgl::ContextLossReason reason) const {
   if (!mContext) return IPC_OK();
   mContext->OnContextLoss(reason);
   return IPC_OK();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/canvas/WebGLFormats.cpp
+++ b/dom/canvas/WebGLFormats.cpp
@@ -5,18 +5,17 @@
 
 #include "WebGLFormats.h"
 
 #include "GLContext.h"
 #include "GLDefs.h"
 #include "mozilla/gfx/Logging.h"
 #include "mozilla/StaticMutex.h"
 
-namespace mozilla {
-namespace webgl {
+namespace mozilla::webgl {
 
 const char* ToString(const ComponentType type) {
   switch (type) {
     case ComponentType::Int:
       return "Int";
     case ComponentType::UInt:
       return "UInt";
     case ComponentType::NormInt:
@@ -1229,10 +1228,9 @@ const FormatUsageInfo* FormatUsageAuthor
   auto itr = mUsageMap.find(format);
   if (itr == mUsageMap.end()) return nullptr;
 
   return &(itr->second);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
-}  // namespace webgl
-}  // namespace mozilla
+}  // namespace mozilla::webgl
--- a/dom/canvas/WebGLParent.cpp
+++ b/dom/canvas/WebGLParent.cpp
@@ -8,19 +8,17 @@
 #include "WebGLChild.h"
 #include "mozilla/dom/WebGLCrossProcessCommandQueue.h"
 #include "mozilla/layers/LayerTransactionParent.h"
 #include "mozilla/layers/TextureClientSharedSurface.h"
 #include "ImageContainer.h"
 #include "HostWebGLContext.h"
 #include "WebGLMethodDispatcher.h"
 
-namespace mozilla {
-
-namespace dom {
+namespace mozilla::dom {
 
 mozilla::ipc::IPCResult WebGLParent::RecvInitialize(
     const webgl::InitContextDesc& desc,
     UniquePtr<HostWebGLCommandSinkP>&& aSinkP,
     UniquePtr<HostWebGLCommandSinkI>&& aSinkI,
     webgl::InitContextResult* const out) {
   auto remotingData = Some(HostWebGLContext::RemotingData{
       *this, {},  // std::move(commandSink),
@@ -303,10 +301,9 @@ IPCResult WebGLParent::RecvOnMemoryPress
   return IPC_OK();
 }
 
 IPCResult WebGLParent::RecvValidateProgram(ObjectId id, bool* const ret) {
   *ret = mHost->ValidateProgram(id);
   return IPC_OK();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/canvas/XRWebGLLayer.cpp
+++ b/dom/canvas/XRWebGLLayer.cpp
@@ -16,18 +16,17 @@
 #include "ScopedGLHelpers.h"
 #include "MozFramebuffer.h"
 #include "VRDisplayClient.h"
 #include "ClientWebGLContext.h"
 #include "nsIScriptError.h"
 
 using namespace mozilla::gl;
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 static constexpr float XR_FRAMEBUFFER_MIN_SCALE = 0.2f;
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(XRWebGLLayer, mParent, mSession, mWebGL,
                                       mFramebuffer, mLeftViewport,
                                       mRightViewport)
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(XRWebGLLayer, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(XRWebGLLayer, Release)
@@ -270,10 +269,9 @@ void XRWebGLLayer::EndAnimationFrame() {
 }
 
 HTMLCanvasElement* XRWebGLLayer::GetCanvas() {
   return mWebGL->GetParentObject();
 }
 
 void XRWebGLLayer::SessionEnded() { DeleteFramebuffer(); }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/clients/api/Client.cpp
+++ b/dom/clients/api/Client.cpp
@@ -13,18 +13,17 @@
 #include "mozilla/dom/ClientState.h"
 #include "mozilla/dom/DOMMozPromiseRequestHolder.h"
 #include "mozilla/dom/MessagePortBinding.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/dom/WorkerScope.h"
 #include "nsIGlobalObject.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 using mozilla::dom::ipc::StructuredCloneData;
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(mozilla::dom::Client);
 NS_IMPL_CYCLE_COLLECTING_RELEASE(mozilla::dom::Client);
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(mozilla::dom::Client, mGlobal);
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(mozilla::dom::Client)
@@ -203,10 +202,9 @@ already_AddRefed<Promise> Client::Naviga
       [self, outerPromise](const CopyableErrorResult& aResult) {
         // MaybeReject needs a non-const-ref result, so make a copy.
         outerPromise->MaybeReject(CopyableErrorResult(aResult));
       });
 
   return outerPromise.forget();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/clients/api/Clients.cpp
+++ b/dom/clients/api/Clients.cpp
@@ -16,18 +16,17 @@
 #include "mozilla/dom/ServiceWorkerManager.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/SchedulerGroup.h"
 #include "mozilla/StorageAccess.h"
 #include "nsIGlobalObject.h"
 #include "nsString.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 using mozilla::ipc::CSPInfo;
 using mozilla::ipc::PrincipalInfo;
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Clients);
 NS_IMPL_CYCLE_COLLECTING_RELEASE(Clients);
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Clients, mGlobal);
 
@@ -280,10 +279,9 @@ already_AddRefed<Promise> Clients::Claim
       [outerPromise](const CopyableErrorResult& aResult) {
         // MaybeReject needs a non-const-ref result, so make a copy.
         outerPromise->MaybeReject(CopyableErrorResult(aResult));
       });
 
   return outerPromise.forget();
 }
 
-}  // namespace dom
-}  // namespace mozilla
+}  // namespace mozilla::dom
--- a/dom/clients/manager/ClientChannelHelper.cpp
+++ b/dom/clients/manager/ClientChannelHelper.cpp
@@ -14,18 +14,17 @@
 #include "nsContentUtils.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIChannel.h"
 #include "nsIChannelEventSink.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 
-namespace mozilla {
-namespace dom {
+namespace mozilla::dom {
 
 using mozilla::ipc::PrincipalInfoToPrincipal;
 
 namespace {
 
 // In the default mode, ClientChannelHelper runs in the content process and
 // handles all redirects. When we use DocumentChannel, redirects aren't exposed