Skip to content

Commit

Permalink
Bug 1648463 - Move SVGForeignObjectFrame SVGImageFrame and SVGUseFram…
Browse files Browse the repository at this point in the history
…e to mozilla namespace r=dholbert,jgilbert

stop exposing SVGImageListener as only SVGImageFrame uses it.

Differential Revision: https://phabricator.services.mozilla.com/D81087
  • Loading branch information
longsonr committed Jun 25, 2020
1 parent d335e07 commit ea44283
Show file tree
Hide file tree
Showing 31 changed files with 286 additions and 260 deletions.
16 changes: 8 additions & 8 deletions dom/base/nsImageLoadingContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -26,7 +24,6 @@
#include "nsThreadUtils.h"
#include "nsNetUtil.h"
#include "nsImageFrame.h"
#include "nsSVGImageFrame.h"

#include "nsIChannel.h"
#include "nsIStreamListener.h"
Expand All @@ -36,22 +33,25 @@
#include "nsContentUtils.h"
#include "nsLayoutUtils.h"
#include "nsIContentPolicy.h"
#include "SVGObserverUtils.h"

#include "mozAutoDocUpdate.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/AutoRestore.h"
#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.
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions dom/canvas/CanvasRenderingContext2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 12 additions & 12 deletions dom/canvas/CanvasRenderingContext2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
#ifndef CanvasRenderingContext2D_h
#define CanvasRenderingContext2D_h

#include "mozilla/Attributes.h"
#include <vector>
#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;
Expand Down
2 changes: 1 addition & 1 deletion dom/canvas/WebGLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dom/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions dom/svg/SVGForeignObjectElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
nsresult NS_NewSVGForeignObjectElement(
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& 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(
Expand Down
4 changes: 2 additions & 2 deletions dom/svg/SVGGeometryProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <type_traits>

namespace mozilla {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion dom/svg/SVGImageElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ bool SVGImageElement::GetGeometryBounds(

already_AddRefed<Path> 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");
Expand Down
6 changes: 3 additions & 3 deletions dom/svg/SVGImageElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
nsresult NS_NewSVGImageElement(
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);

class nsSVGImageFrame;

namespace mozilla {
class SVGImageFrame;

namespace dom {
class DOMSVGAnimatedPreserveAspectRatio;

typedef SVGGeometryElement SVGImageElementBase;

class SVGImageElement : public SVGImageElementBase,
public nsImageLoadingContent {
friend class ::nsSVGImageFrame;
friend class mozilla::SVGImageFrame;

protected:
explicit SVGImageElement(
Expand Down
16 changes: 8 additions & 8 deletions dom/svg/SVGUseElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -527,15 +527,15 @@ 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.
if (!frame || !frame->IsSVGUseFrame()) {
MOZ_ASSERT_IF(frame, frame->Type() == LayoutFrameType::None);
return nullptr;
}
return static_cast<nsSVGUseFrame*>(frame);
return static_cast<SVGUseFrame*>(frame);
}

//----------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions dom/svg/SVGUseElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "nsTArray.h"

class nsIContent;
class nsSVGUseFrame;

nsresult NS_NewSVGSVGElement(
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
Expand All @@ -27,6 +26,7 @@ nsresult NS_NewSVGUseElement(
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);

namespace mozilla {
class SVGUseFrame;
struct URLExtraData;

namespace dom {
Expand All @@ -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(
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions dom/svg/SVGViewportElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
16 changes: 8 additions & 8 deletions image/SurfaceCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion image/test/mochitest/test_svg_animatedGIF.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<pre id="test">
<script type="text/javascript">

/** Test for Bug 666446 nsSVGImageFrame/RasterImage**/
/** Test for Bug 666446 SVGImageFrame/RasterImage**/

const FAILURE_TIMEOUT = 120000; // Fail early after 120 seconds (2 minutes)

Expand Down
Loading

0 comments on commit ea44283

Please sign in to comment.