diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp index 23b1fd791c1f1..73731c4dee5b6 100644 --- a/dom/base/nsImageLoadingContent.cpp +++ b/dom/base/nsImageLoadingContent.cpp @@ -13,8 +13,6 @@ #include "nsImageLoadingContent.h" #include "nsError.h" #include "nsIContent.h" -#include "mozilla/dom/BindContext.h" -#include "mozilla/dom/Document.h" #include "nsIScriptGlobalObject.h" #include "nsServiceManagerUtils.h" #include "nsContentList.h" @@ -26,7 +24,6 @@ #include "nsThreadUtils.h" #include "nsNetUtil.h" #include "nsImageFrame.h" -#include "nsSVGImageFrame.h" #include "nsIChannel.h" #include "nsIStreamListener.h" @@ -36,7 +33,6 @@ #include "nsContentUtils.h" #include "nsLayoutUtils.h" #include "nsIContentPolicy.h" -#include "SVGObserverUtils.h" #include "mozAutoDocUpdate.h" #include "mozilla/AsyncEventDispatcher.h" @@ -44,14 +40,18 @@ #include "mozilla/CycleCollectedJSContext.h" #include "mozilla/EventStateManager.h" #include "mozilla/EventStates.h" +#include "mozilla/Preferences.h" +#include "mozilla/PresShell.h" +#include "mozilla/StaticPrefs_image.h" +#include "mozilla/SVGImageFrame.h" +#include "mozilla/SVGObserverUtils.h" +#include "mozilla/dom/BindContext.h" +#include "mozilla/dom/Document.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/HTMLImageElement.h" #include "mozilla/dom/ImageTracker.h" #include "mozilla/dom/ScriptSettings.h" #include "mozilla/net/UrlClassifierFeatureFactory.h" -#include "mozilla/Preferences.h" -#include "mozilla/PresShell.h" -#include "mozilla/StaticPrefs_image.h" #ifdef LoadImage // Undefine LoadImage to prevent naming conflict with Windows. @@ -524,7 +524,7 @@ void nsImageLoadingContent::MaybeForceSyncDecoding( bool aPrepareNextRequest, nsIFrame* aFrame /* = nullptr */) { nsIFrame* frame = aFrame ? aFrame : GetOurPrimaryFrame(); nsImageFrame* imageFrame = do_QueryFrame(frame); - nsSVGImageFrame* svgImageFrame = do_QueryFrame(frame); + SVGImageFrame* svgImageFrame = do_QueryFrame(frame); if (!imageFrame && !svgImageFrame) { return; } diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 5c5e53198535b..d9372b1e6a3c6 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -9,16 +9,16 @@ #include "nsXULElement.h" #include "nsMathUtils.h" -#include "SVGImageContext.h" #include "nsContentUtils.h" #include "mozilla/PresShell.h" #include "mozilla/PresShellInlines.h" +#include "mozilla/SVGImageContext.h" +#include "mozilla/SVGObserverUtils.h" #include "mozilla/dom/Document.h" #include "mozilla/dom/HTMLCanvasElement.h" #include "mozilla/dom/GeneratePlaceholderCanvasData.h" -#include "SVGObserverUtils.h" #include "nsPresContext.h" #include "nsIInterfaceRequestorUtils.h" diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h index 2f7776e440257..544f585a40b13 100644 --- a/dom/canvas/CanvasRenderingContext2D.h +++ b/dom/canvas/CanvasRenderingContext2D.h @@ -5,29 +5,29 @@ #ifndef CanvasRenderingContext2D_h #define CanvasRenderingContext2D_h -#include "mozilla/Attributes.h" #include -#include "nsICanvasRenderingContextInternal.h" -#include "mozilla/RefPtr.h" -#include "nsColor.h" -#include "mozilla/dom/HTMLCanvasElement.h" -#include "mozilla/dom/HTMLVideoElement.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BasicRenderingContext2D.h" #include "mozilla/dom/CanvasGradient.h" -#include "mozilla/dom/CanvasRenderingContext2DBinding.h" #include "mozilla/dom/CanvasPattern.h" +#include "mozilla/dom/CanvasRenderingContext2DBinding.h" +#include "mozilla/dom/HTMLCanvasElement.h" +#include "mozilla/dom/HTMLVideoElement.h" #include "mozilla/gfx/Rect.h" #include "mozilla/gfx/2D.h" +#include "mozilla/Attributes.h" +#include "mozilla/EnumeratedArray.h" +#include "mozilla/ErrorResult.h" #include "mozilla/PresShell.h" +#include "mozilla/RefPtr.h" +#include "mozilla/SVGObserverUtils.h" #include "mozilla/UniquePtr.h" -#include "gfx2DGlue.h" -#include "nsLayoutUtils.h" -#include "mozilla/EnumeratedArray.h" #include "FilterSupport.h" -#include "SVGObserverUtils.h" +#include "gfx2DGlue.h" #include "Layers.h" +#include "nsICanvasRenderingContextInternal.h" #include "nsBidi.h" +#include "nsColor.h" +#include "nsLayoutUtils.h" class gfxFontGroup; class nsGlobalWindowInner; diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index 16674492d7893..a2b42adc32dca 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -39,6 +39,7 @@ #include "mozilla/ScopeExit.h" #include "mozilla/Services.h" #include "mozilla/StaticPrefs_webgl.h" +#include "mozilla/SVGObserverUtils.h" #include "mozilla/Telemetry.h" #include "nsContentUtils.h" #include "nsDisplayList.h" @@ -48,7 +49,6 @@ #include "nsIWidget.h" #include "nsServiceManagerUtils.h" #include "SharedSurfaceGL.h" -#include "SVGObserverUtils.h" #include "prenv.h" #include "ScopedGLHelpers.h" #include "VRManagerChild.h" diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 69cccfd080725..309844f20224a 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -41,7 +41,6 @@ #include "MediaStreamWindowCapturer.h" #include "MediaTrack.h" #include "MediaTrackList.h" -#include "SVGObserverUtils.h" #include "TimeRanges.h" #include "VideoFrameContainer.h" #include "VideoOutput.h" @@ -59,6 +58,7 @@ #include "mozilla/PresShell.h" #include "mozilla/Sprintf.h" #include "mozilla/StaticPrefs_media.h" +#include "mozilla/SVGObserverUtils.h" #include "mozilla/Telemetry.h" #include "mozilla/dom/AudioTrack.h" #include "mozilla/dom/AudioTrackList.h" diff --git a/dom/svg/SVGForeignObjectElement.h b/dom/svg/SVGForeignObjectElement.h index 1e9d1428e6e8f..b5c37b3894ed9 100644 --- a/dom/svg/SVGForeignObjectElement.h +++ b/dom/svg/SVGForeignObjectElement.h @@ -14,13 +14,13 @@ nsresult NS_NewSVGForeignObjectElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); -class nsSVGForeignObjectFrame; - namespace mozilla { +class SVGForeignObjectFrame; + namespace dom { class SVGForeignObjectElement final : public SVGGraphicsElement { - friend class ::nsSVGForeignObjectFrame; + friend class mozilla::SVGForeignObjectFrame; protected: friend nsresult(::NS_NewSVGForeignObjectElement( diff --git a/dom/svg/SVGGeometryProperty.h b/dom/svg/SVGGeometryProperty.h index 4cbd1627fd65a..9a84473ff0e97 100644 --- a/dom/svg/SVGGeometryProperty.h +++ b/dom/svg/SVGGeometryProperty.h @@ -7,13 +7,13 @@ #ifndef mozilla_dom_SVGGeometryProperty_SVGGeometryProperty_h #define mozilla_dom_SVGGeometryProperty_SVGGeometryProperty_h +#include "mozilla/SVGImageFrame.h" #include "mozilla/dom/SVGElement.h" #include "ComputedStyle.h" #include "SVGAnimatedLength.h" #include "nsComputedDOMStyle.h" #include "nsGkAtoms.h" #include "nsIFrame.h" -#include "nsSVGImageFrame.h" #include namespace mozilla { @@ -126,7 +126,7 @@ float ResolveImpl(ComputedStyle const& aStyle, SVGElement* aElement, // specified in: // https://svgwg.org/svg2-draft/embedded.html#ImageElement - nsSVGImageFrame* imgf = do_QueryFrame(aElement->GetPrimaryFrame()); + SVGImageFrame* imgf = do_QueryFrame(aElement->GetPrimaryFrame()); MOZ_ASSERT(imgf); using Other = typename Tag::CounterPart; diff --git a/dom/svg/SVGImageElement.cpp b/dom/svg/SVGImageElement.cpp index b63a3f1ac1d8c..2536f283586e2 100644 --- a/dom/svg/SVGImageElement.cpp +++ b/dom/svg/SVGImageElement.cpp @@ -265,7 +265,7 @@ bool SVGImageElement::GetGeometryBounds( already_AddRefed SVGImageElement::BuildPath(PathBuilder* aBuilder) { // To get bound, the faster method GetGeometryBounds() should already return - // success. For render and hittest, nsSVGImageFrame should have its own + // success. For render and hittest, SVGImageFrame should have its own // implementation that doesn't need to build path for an image. MOZ_ASSERT_UNREACHABLE( "There is no reason to call BuildPath for SVGImageElement"); diff --git a/dom/svg/SVGImageElement.h b/dom/svg/SVGImageElement.h index e9506a2b8b624..9b8d383ba932c 100644 --- a/dom/svg/SVGImageElement.h +++ b/dom/svg/SVGImageElement.h @@ -16,9 +16,9 @@ nsresult NS_NewSVGImageElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); -class nsSVGImageFrame; - namespace mozilla { +class SVGImageFrame; + namespace dom { class DOMSVGAnimatedPreserveAspectRatio; @@ -26,7 +26,7 @@ typedef SVGGeometryElement SVGImageElementBase; class SVGImageElement : public SVGImageElementBase, public nsImageLoadingContent { - friend class ::nsSVGImageFrame; + friend class mozilla::SVGImageFrame; protected: explicit SVGImageElement( diff --git a/dom/svg/SVGUseElement.cpp b/dom/svg/SVGUseElement.cpp index 9c2cc7fd06dbb..dfc06428b5a74 100644 --- a/dom/svg/SVGUseElement.cpp +++ b/dom/svg/SVGUseElement.cpp @@ -8,17 +8,17 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/ErrorResult.h" +#include "mozilla/SVGObserverUtils.h" +#include "mozilla/SVGUseFrame.h" +#include "mozilla/URLExtraData.h" +#include "mozilla/dom/Document.h" +#include "mozilla/dom/Element.h" #include "mozilla/dom/SVGLengthBinding.h" +#include "mozilla/dom/SVGSVGElement.h" #include "mozilla/dom/SVGUseElementBinding.h" #include "nsGkAtoms.h" -#include "mozilla/dom/SVGSVGElement.h" -#include "mozilla/dom/Document.h" -#include "mozilla/dom/Element.h" #include "nsContentUtils.h" #include "nsIURI.h" -#include "mozilla/URLExtraData.h" -#include "SVGObserverUtils.h" -#include "nsSVGUseFrame.h" NS_IMPL_NS_NEW_SVG_ELEMENT(Use) @@ -527,7 +527,7 @@ SVGElement::StringAttributesInfo SVGUseElement::GetStringInfo() { ArrayLength(sStringInfo)); } -nsSVGUseFrame* SVGUseElement::GetFrame() const { +SVGUseFrame* SVGUseElement::GetFrame() const { nsIFrame* frame = GetPrimaryFrame(); // We might be a plain nsSVGContainerFrame if we didn't pass the conditional // processing checks. @@ -535,7 +535,7 @@ nsSVGUseFrame* SVGUseElement::GetFrame() const { MOZ_ASSERT_IF(frame, frame->Type() == LayoutFrameType::None); return nullptr; } - return static_cast(frame); + return static_cast(frame); } //---------------------------------------------------------------------- diff --git a/dom/svg/SVGUseElement.h b/dom/svg/SVGUseElement.h index 3aede8b30d416..fbdcd4616818f 100644 --- a/dom/svg/SVGUseElement.h +++ b/dom/svg/SVGUseElement.h @@ -18,7 +18,6 @@ #include "nsTArray.h" class nsIContent; -class nsSVGUseFrame; nsresult NS_NewSVGSVGElement( nsIContent** aResult, already_AddRefed&& aNodeInfo, @@ -27,6 +26,7 @@ nsresult NS_NewSVGUseElement( nsIContent** aResult, already_AddRefed&& aNodeInfo); namespace mozilla { +class SVGUseFrame; struct URLExtraData; namespace dom { @@ -35,7 +35,7 @@ typedef SVGGraphicsElement SVGUseElementBase; class SVGUseElement final : public SVGUseElementBase, public nsStubMutationObserver { - friend class ::nsSVGUseFrame; + friend class mozilla::SVGUseFrame; protected: friend nsresult(::NS_NewSVGUseElement( @@ -88,7 +88,7 @@ class SVGUseElement final : public SVGUseElementBase, // referenced element. void UpdateShadowTree(); - // Shared code between AfterSetAttr and nsSVGUseFrame::AttributeChanged. + // Shared code between AfterSetAttr and SVGUseFrame::AttributeChanged. // // This is needed because SMIL doesn't go through AfterSetAttr unfortunately. void ProcessAttributeChange(int32_t aNamespaceID, nsAtom* aAttribute); @@ -137,7 +137,7 @@ class SVGUseElement final : public SVGUseElementBase, SVGUseElement* mOwningUseElement; }; - nsSVGUseFrame* GetFrame() const; + SVGUseFrame* GetFrame() const; virtual LengthAttributesInfo GetLengthInfo() override; virtual StringAttributesInfo GetStringInfo() override; diff --git a/dom/svg/SVGViewportElement.h b/dom/svg/SVGViewportElement.h index fb57943c166a9..e41bf64bae4cf 100644 --- a/dom/svg/SVGViewportElement.h +++ b/dom/svg/SVGViewportElement.h @@ -8,15 +8,15 @@ #define mozilla_dom_SVGViewportElement_h #include "mozilla/Attributes.h" -#include "mozilla/dom/FromParser.h" +#include "mozilla/SVGImageContext.h" #include "mozilla/UniquePtr.h" +#include "mozilla/dom/FromParser.h" #include "nsIContentInlines.h" #include "SVGAnimatedEnumeration.h" #include "SVGAnimatedLength.h" #include "SVGAnimatedPreserveAspectRatio.h" #include "SVGAnimatedViewBox.h" #include "SVGGraphicsElement.h" -#include "SVGImageContext.h" #include "nsISVGPoint.h" #include "SVGPreserveAspectRatio.h" diff --git a/image/SurfaceCache.h b/image/SurfaceCache.h index d10b12e8b85fc..7ac9f19961f70 100644 --- a/image/SurfaceCache.h +++ b/image/SurfaceCache.h @@ -11,18 +11,18 @@ #ifndef mozilla_image_SurfaceCache_h #define mozilla_image_SurfaceCache_h -#include "mozilla/Maybe.h" // for Maybe -#include "mozilla/NotNull.h" -#include "mozilla/MemoryReporting.h" // for MallocSizeOf #include "mozilla/HashFunctions.h" // for HashGeneric and AddToHash +#include "mozilla/Maybe.h" // for Maybe +#include "mozilla/MemoryReporting.h" // for MallocSizeOf +#include "mozilla/NotNull.h" +#include "mozilla/SVGImageContext.h" // for SVGImageContext +#include "mozilla/gfx/2D.h" // for SourceSurface +#include "mozilla/gfx/Point.h" // for mozilla::gfx::IntSize #include "gfx2DGlue.h" -#include "gfxPoint.h" // for gfxSize -#include "nsCOMPtr.h" // for already_AddRefed -#include "mozilla/gfx/Point.h" // for mozilla::gfx::IntSize -#include "mozilla/gfx/2D.h" // for SourceSurface +#include "gfxPoint.h" // for gfxSize +#include "nsCOMPtr.h" // for already_AddRefed #include "PlaybackType.h" #include "SurfaceFlags.h" -#include "SVGImageContext.h" // for SVGImageContext namespace mozilla { namespace image { diff --git a/image/test/mochitest/test_svg_animatedGIF.html b/image/test/mochitest/test_svg_animatedGIF.html index 7009e352f0890..04077676b71ef 100644 --- a/image/test/mochitest/test_svg_animatedGIF.html +++ b/image/test/mochitest/test_svg_animatedGIF.html @@ -35,7 +35,7 @@