Bug 450495 - Make foreignObject a mandatory part of SVG. r+sr=roc
authorRobert Longson <longsonr@gmail.com>
Sun, 17 Aug 2008 12:18:21 +0100
changeset 16967 e582feebd7f10fae9c68cd10d2291dc96eb32f93
parent 16966 3148d9d6c55a5ecf806a34ae58e971448c323303
child 16968 4d825567db88475d661fecc69627c47be2f7fc96
push id1301
push userlongsonr@gmail.com
push dateSun, 17 Aug 2008 11:20:51 +0000
treeherdermozilla-central@e582feebd7f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs450495
milestone1.9.1a2pre
Bug 450495 - Make foreignObject a mandatory part of SVG. r+sr=roc
config/autoconf.mk.in
configure.in
content/base/src/nsGkAtomList.h
content/svg/content/src/Makefile.in
content/svg/content/src/nsSVGElementFactory.cpp
content/svg/content/src/nsSVGElementList.h
dom/public/nsDOMClassInfoID.h
dom/src/base/nsDOMClassInfo.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsLayoutUtils.cpp
layout/svg/base/src/Makefile.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -232,17 +232,16 @@ MOZ_NATIVE_PNG	= @SYSTEM_PNG@
 MOZ_TREE_CAIRO = @MOZ_TREE_CAIRO@
 
 MOZ_UPDATE_XTERM = @MOZ_UPDATE_XTERM@
 MOZ_MATHML = @MOZ_MATHML@
 MOZ_PERMISSIONS = @MOZ_PERMISSIONS@
 MOZ_XTF = @MOZ_XTF@
 MOZ_NO_INSPECTOR_APIS = @MOZ_NO_INSPECTOR_APIS@
 MOZ_SVG = @MOZ_SVG@
-MOZ_SVG_FOREIGNOBJECT = @MOZ_SVG_FOREIGNOBJECT@
 MOZ_LIBART_CFLAGS = @MOZ_LIBART_CFLAGS@
 MOZ_ENABLE_CANVAS = @MOZ_ENABLE_CANVAS@
 MOZ_CAIRO_CFLAGS = @MOZ_CAIRO_CFLAGS@
 MOZ_XSLT_STANDALONE = @MOZ_XSLT_STANDALONE@
 
 MOZ_PREF_EXTENSIONS = @MOZ_PREF_EXTENSIONS@
 
 MOZ_CAIRO_LIBS = @MOZ_CAIRO_LIBS@
--- a/configure.in
+++ b/configure.in
@@ -5811,33 +5811,16 @@ dnl ====================================
 MOZ_ARG_DISABLE_BOOL(svg,
 [  --disable-svg            Disable SVG support],
     MOZ_SVG=,
     MOZ_SVG=1 )
 if test -n "$MOZ_SVG"; then
   AC_DEFINE(MOZ_SVG)
 fi
 
-MOZ_SVG_FOREIGNOBJECT=1
-dnl ========================================================
-dnl SVG <foreignObject>
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(svg-foreignobject,
-   [  --disable-svg-foreignobject
-                        Disable SVG <foreignObject> support],
-   MOZ_SVG_FOREIGNOBJECT=,
-   MOZ_SVG_FOREIGNOBJECT=1 )
-if test "$MOZ_SVG_FOREIGNOBJECT"; then
-  if test "$MOZ_SVG"; then
-    AC_DEFINE(MOZ_SVG_FOREIGNOBJECT)
-  else
-    MOZ_SVG_FOREIGNOBEJCT=
-  fi
-fi
-
 dnl ========================================================
 dnl Installer
 dnl ========================================================
 case "$target_os" in
     aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
         MOZ_INSTALLER=1
         ;;
 esac
@@ -7953,17 +7936,16 @@ AC_SUBST(NS_HILDON)
 AC_SUBST(NS_OSSO)
 AC_SUBST(MOZ_AUTH_EXTENSION)
 AC_SUBST(MOZ_MATHML)
 AC_SUBST(MOZ_PERMISSIONS)
 AC_SUBST(MOZ_XTF)
 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
 AC_SUBST(MOZ_PREF_EXTENSIONS)
 AC_SUBST(MOZ_SVG)
-AC_SUBST(MOZ_SVG_FOREIGNOBJECT)
 AC_SUBST(MOZ_XSLT_STANDALONE)
 AC_SUBST(MOZ_JS_LIBS)
 AC_SUBST(MOZ_PSM)
 AC_SUBST(MOZ_DEBUG)
 AC_SUBST(MOZ_DEBUG_MODULES)
 AC_SUBST(MOZ_PROFILE_MODULES)
 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -1078,19 +1078,17 @@ GK_ATOM(font_face_name, "font-face-name"
 GK_ATOM(font_face_src, "font-face-src")
 GK_ATOM(font_face_uri, "font-face-uri")
 GK_ATOM(font_family, "font-family")
 GK_ATOM(font_size, "font-size")
 GK_ATOM(font_size_adjust, "font-size-adjust")
 GK_ATOM(font_stretch, "font-stretch")
 GK_ATOM(font_style, "font-style")
 GK_ATOM(font_variant, "font-variant")
-#ifdef MOZ_SVG_FOREIGNOBJECT
 GK_ATOM(foreignObject, "foreignObject")
-#endif
 GK_ATOM(fractalNoise, "fractalNoise")
 GK_ATOM(fx, "fx")
 GK_ATOM(fy, "fy")
 GK_ATOM(G, "G")
 GK_ATOM(g, "g")
 GK_ATOM(gamma, "gamma")
 GK_ATOM(generic, "generic")
 GK_ATOM(glyph, "glyph")
@@ -1517,19 +1515,17 @@ GK_ATOM(tableRowFrame, "TableRowFrame")
 GK_ATOM(textInputFrame,"TextInputFrame")
 GK_ATOM(textFrame, "TextFrame")
 GK_ATOM(viewportFrame, "ViewportFrame")
 #ifdef MOZ_SVG
 GK_ATOM(svgAFrame, "SVGAFrame")
 GK_ATOM(svgClipPathFrame, "SVGClipPathFrame")
 GK_ATOM(svgDefsFrame, "SVGDefsFrame")
 GK_ATOM(svgFilterFrame, "SVGFilterFrame")
-#ifdef MOZ_SVG_FOREIGNOBJECT
 GK_ATOM(svgForeignObjectFrame, "SVGForeignObjectFrame")
-#endif
 GK_ATOM(svgGenericContainerFrame, "SVGGenericContainerFrame")
 GK_ATOM(svgGFrame, "SVGGFrame")
 GK_ATOM(svgGlyphFrame, "SVGGlyphFrame")
 GK_ATOM(svgGradientFrame, "SVGGradientFrame")
 GK_ATOM(svgImageFrame, "SVGImageFrame")
 GK_ATOM(svgInnerSVGFrame, "SVGInnerSVGFrame")
 GK_ATOM(svgLinearGradientFrame, "SVGLinearGradientFrame")
 GK_ATOM(svgMarkerFrame, "SVGMarkerFrame")
--- a/content/svg/content/src/Makefile.in
+++ b/content/svg/content/src/Makefile.in
@@ -83,16 +83,17 @@ CPPSRCS		= \
 		nsSVGDescElement.cpp \
 		nsSVGElement.cpp \
 		nsSVGElementFactory.cpp \
 		nsSVGEllipseElement.cpp \
 		nsSVGEnum.cpp \
 		nsSVGFeatures.cpp \
 		nsSVGFilterElement.cpp \
 		nsSVGFilters.cpp \
+		nsSVGForeignObjectElement.cpp \
 		nsSVGGElement.cpp \
 		nsSVGGradientElement.cpp \
 		nsSVGGraphicElement.cpp \
 		nsSVGImageElement.cpp \
 		nsSVGInteger.cpp \
 		nsSVGLength.cpp \
 		nsSVGLength2.cpp \
 		nsSVGLengthList.cpp \
@@ -133,20 +134,16 @@ CPPSRCS		= \
 		nsSVGTitleElement.cpp \
 		nsSVGTransform.cpp \
 		nsSVGTransformList.cpp \
 		nsSVGTransformListParser.cpp \
 		nsSVGUseElement.cpp \
 		nsSVGValue.cpp \
 		$(NULL)
 
-ifdef MOZ_SVG_FOREIGNOBJECT
-CPPSRCS += nsSVGForeignObjectElement.cpp
-endif
-
 include $(topsrcdir)/config/config.mk
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 EXPORTS =  			\
 	nsIDOMSVGListener.h \
 	nsIDOMSVGZoomListener.h \
--- a/content/svg/content/src/nsSVGElementFactory.cpp
+++ b/content/svg/content/src/nsSVGElementFactory.cpp
@@ -59,20 +59,18 @@ NS_NewSVGEllipseElement(nsIContent **aRe
 nsresult
 NS_NewSVGLineElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
 nsresult
 NS_NewSVGRectElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
 nsresult
 NS_NewSVGGElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
 nsresult
 NS_NewSVGSVGElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
-#ifdef MOZ_SVG_FOREIGNOBJECT
 nsresult
 NS_NewSVGForeignObjectElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
-#endif
 nsresult
 NS_NewSVGPathElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
 nsresult
 NS_NewSVGTextElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
 nsresult
 NS_NewSVGTSpanElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
 nsresult
 NS_NewSVGImageElement(nsIContent **aResult, nsINodeInfo *aNodeInfo);
--- a/content/svg/content/src/nsSVGElementList.h
+++ b/content/svg/content/src/nsSVGElementList.h
@@ -109,19 +109,17 @@ SVG_ELEMENT(feTile, ATTRS_NONE)
 SVG_ELEMENT(feTurbulence, ATTRS_NONE)
 SVG_ELEMENT(filter, ATTRS_EXTERNAL)
 SVG_ELEMENT(font, ATTRS_EXTERNAL)
 SVG_ELEMENT(font_face, ATTRS_NONE)
 SVG_ELEMENT(font_face_format, ATTRS_NONE)
 SVG_ELEMENT(font_face_name, ATTRS_NONE)
 SVG_ELEMENT(font_face_src, ATTRS_NONE)
 SVG_ELEMENT(font_face_uri, ATTRS_NONE)
-#ifdef MOZ_SVG_FOREIGNOBJECT
 SVG_ELEMENT(foreignObject, ATTRS_ALL)
-#endif
 SVG_ELEMENT(g, ATTRS_ALL)
 SVG_ELEMENT(glyph, ATTRS_NONE)
 SVG_ELEMENT(glyphRef, ATTRS_NONE)
 SVG_ELEMENT(hkern, ATTRS_NONE)
 SVG_ELEMENT(image, ATTRS_ALL)
 SVG_ELEMENT(line, ATTRS_ALL)
 SVG_ELEMENT(linearGradient, ATTRS_EXTERNAL)
 SVG_ELEMENT(marker, ATTRS_NONE)
--- a/dom/public/nsDOMClassInfoID.h
+++ b/dom/public/nsDOMClassInfoID.h
@@ -395,17 +395,17 @@ enum nsDOMClassInfoID {
   eDOMClassInfo_ClientRect_id,
   eDOMClassInfo_ClientRectList_id,
 
   // We are now trying to preserve binary compat in classinfo.  No more
   // putting things in those categories up there.  New entries are to be
   // added here, which is the end of the things that are currently on by
   // default.
 
-#if defined(MOZ_SVG) && defined(MOZ_SVG_FOREIGNOBJECT)
+#ifdef MOZ_SVG
   eDOMClassInfo_SVGForeignObjectElement_id,
 #endif
 
   eDOMClassInfo_XULCommandEvent_id,
   eDOMClassInfo_CommandEvent_id,
   eDOMClassInfo_OfflineResourceList_id,
   eDOMClassInfo_LoadStatusList_id,
   eDOMClassInfo_LoadStatus_id,
--- a/dom/src/base/nsDOMClassInfo.cpp
+++ b/dom/src/base/nsDOMClassInfo.cpp
@@ -384,19 +384,17 @@
 #include "nsIDOMSVGDocument.h"
 #include "nsIDOMSVGElement.h"
 #include "nsIDOMSVGEllipseElement.h"
 #include "nsIDOMSVGEvent.h"
 #include "nsIDOMSVGException.h"
 #include "nsIDOMSVGFilterElement.h"
 #include "nsIDOMSVGFilters.h"
 #include "nsIDOMSVGFitToViewBox.h"
-#ifdef MOZ_SVG_FOREIGNOBJECT
 #include "nsIDOMSVGForeignObjectElem.h"
-#endif
 #include "nsIDOMSVGGElement.h"
 #include "nsIDOMSVGGradientElement.h"
 #include "nsIDOMSVGImageElement.h"
 #include "nsIDOMSVGLength.h"
 #include "nsIDOMSVGLengthList.h"
 #include "nsIDOMSVGLineElement.h"
 #include "nsIDOMSVGLocatable.h"
 #include "nsIDOMSVGMarkerElement.h"
@@ -1207,20 +1205,17 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA(XMLHttpRequest, nsEventTargetSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(ClientRect, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(ClientRectList, nsClientRectListSH,
                            ARRAY_SCRIPTABLE_FLAGS)
 
-  // Define MOZ_SVG_FOREIGNOBJECT here so that when it gets switched on,
-  // we preserve binary compatibility. New classes should be added
-  // at the end.
-#if defined(MOZ_SVG) && defined(MOZ_SVG_FOREIGNOBJECT)
+#ifdef MOZ_SVG
   NS_DEFINE_CLASSINFO_DATA(SVGForeignObjectElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
 #endif
 
   NS_DEFINE_CLASSINFO_DATA(XULCommandEvent, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(CommandEvent, nsDOMGenericSH,
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -169,20 +169,18 @@ NS_NewSVGOuterSVGFrame(nsIPresShell* aPr
 nsIFrame*
 NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
 nsIFrame*
 NS_NewSVGPathGeometryFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
 nsIFrame*
 NS_NewSVGGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
 nsIFrame*
 NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
-#ifdef MOZ_SVG_FOREIGNOBJECT
 nsIFrame*
 NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
-#endif
 nsIFrame*
 NS_NewSVGAFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
 nsIFrame*
 NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parent, nsStyleContext* aContext);
 nsIFrame*
 NS_NewSVGSwitchFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
 nsIFrame*
 NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
@@ -7068,25 +7066,22 @@ nsCSSFrameConstructor::ConstructSVGFrame
 
   PRBool parentIsSVG = PR_FALSE;
   if (aParentFrame && aParentFrame->GetContent()) {
     PRInt32 parentNSID;
     nsIAtom* parentTag =
       mDocument->BindingManager()->ResolveTag(aParentFrame->GetContent(),
                                               &parentNSID);
 
-    parentIsSVG = parentNSID == kNameSpaceID_SVG
-#ifdef MOZ_SVG_FOREIGNOBJECT
-                  // It's not clear whether the SVG spec intends to allow any SVG
-                  // content within svg:foreignObject at all (SVG 1.1, section
-                  // 23.2), but if it does, it better be svg:svg.  So given that
-                  // we're allowing it, treat it as a non-SVG parent.
-                  && parentTag != nsGkAtoms::foreignObject
-#endif
-                  ;
+    // It's not clear whether the SVG spec intends to allow any SVG
+    // content within svg:foreignObject at all (SVG 1.1, section
+    // 23.2), but if it does, it better be svg:svg.  So given that
+    // we're allowing it, treat it as a non-SVG parent.
+    parentIsSVG = parentNSID == kNameSpaceID_SVG &&
+                  parentTag != nsGkAtoms::foreignObject;
   }
 
   if ((aTag != nsGkAtoms::svg && !parentIsSVG) ||
       (aTag == nsGkAtoms::desc || aTag == nsGkAtoms::title)) {
     // Sections 5.1 and G.4 of SVG 1.1 say that SVG elements other than
     // svg:svg not contained within svg:svg are incorrect, although they
     // don't seem to specify error handling.  Ignore them, since many of
     // our frame classes can't deal.  It *may* be that the document
@@ -7144,21 +7139,19 @@ nsCSSFrameConstructor::ConstructSVGFrame
            aTag == nsGkAtoms::ellipse ||
            aTag == nsGkAtoms::line ||
            aTag == nsGkAtoms::rect ||
            aTag == nsGkAtoms::path)
     newFrame = NS_NewSVGPathGeometryFrame(mPresShell, aContent, aStyleContext);
   else if (aTag == nsGkAtoms::defs) {
     newFrame = NS_NewSVGContainerFrame(mPresShell, aContent, aStyleContext);
   }
-#ifdef MOZ_SVG_FOREIGNOBJECT
   else if (aTag == nsGkAtoms::foreignObject) {
     newFrame = NS_NewSVGForeignObjectFrame(mPresShell, aContent, aStyleContext);
   }
-#endif
   else if (aTag == nsGkAtoms::a) {
     newFrame = NS_NewSVGAFrame(mPresShell, aContent, aStyleContext);
   }
   else if (aTag == nsGkAtoms::text) {
     nsIFrame *ancestorFrame = SVG_GetFirstNonAAncestorFrame(aParentFrame);
     if (ancestorFrame) {
       nsISVGTextContentMetrics* metrics;
       CallQueryInterface(ancestorFrame, &metrics);
@@ -7267,17 +7260,16 @@ nsCSSFrameConstructor::ConstructSVGFrame
 
     rv = aState.AddChild(newFrame, aFrameItems, aContent, aStyleContext,
                          aParentFrame, isOuterSVGNode, isOuterSVGNode);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     nsFrameItems childItems;
-#ifdef MOZ_SVG_FOREIGNOBJECT
     if (aTag == nsGkAtoms::foreignObject) { 
       // Resolve pseudo style and create an inner block frame
       // XXX this breaks style inheritance
       nsRefPtr<nsStyleContext> innerPseudoStyle;
       innerPseudoStyle = mPresShell->StyleSet()->
         ResolvePseudoStyleFor(aContent,
                               nsCSSAnonBoxes::mozSVGForeignContent, aStyleContext);
     
@@ -7292,19 +7284,17 @@ nsCSSFrameConstructor::ConstructSVGFrame
       nsFrameConstructorSaveState saveState;
       aState.PushFloatContainingBlock(nsnull, saveState, PR_FALSE, PR_FALSE);
       rv = ConstructBlock(aState, innerPseudoStyle->GetStyleDisplay(), aContent,
                           newFrame, newFrame, innerPseudoStyle,
                           &blockFrame, childItems, PR_TRUE);
       // Give the blockFrame a view so that GetOffsetTo works for descendants
       // of blockFrame with views...
       nsHTMLContainerFrame::CreateViewForFrame(blockFrame, nsnull, PR_TRUE);
-    } else
-#endif  // MOZ_SVG_FOREIGNOBJECT
-    {
+    } else {
       // Process the child content if requested.
       if (!newFrame->IsLeaf()) {
         rv = ProcessChildren(aState, aContent, newFrame, PR_FALSE, childItems,
                              PR_FALSE);
       }
       CreateAnonymousFrames(aTag, aState, aContent, newFrame,
                             PR_FALSE, childItems);
     }
@@ -7503,20 +7493,18 @@ nsCSSFrameConstructor::ConstructFrameInt
   if (aContent->IsNodeOfType(nsINode::eTEXT)) 
     return ConstructTextFrame(aState, aContent, adjParentFrame, styleContext,
                               *frameItems, pseudoParent);
 
 #ifdef MOZ_SVG
   // Don't create frames for non-SVG children of SVG elements
   if (aNameSpaceID != kNameSpaceID_SVG &&
       aParentFrame &&
-      aParentFrame->IsFrameOfType(nsIFrame::eSVG)
-#ifdef MOZ_SVG_FOREIGNOBJECT
-      && !aParentFrame->IsFrameOfType(nsIFrame::eSVGForeignObject)
-#endif
+      aParentFrame->IsFrameOfType(nsIFrame::eSVG) &&
+      !aParentFrame->IsFrameOfType(nsIFrame::eSVGForeignObject)
       ) {
     return NS_OK;
   }
 #endif
 
   // Style resolution can normally happen lazily.  However, getting the
   // Visibility struct can cause |SetBidiEnabled| to be called on the
   // pres context, and this needs to happen before we start reflow, so
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -74,18 +74,16 @@
 #include "nsPIDOMWindow.h"
 #include "nsIBaseWindow.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIWidget.h"
 
 #ifdef MOZ_SVG
 #include "nsSVGUtils.h"
-#endif
-#ifdef MOZ_SVG_FOREIGNOBJECT
 #include "nsSVGForeignObjectFrame.h"
 #include "nsSVGOuterSVGFrame.h"
 #endif
 
 /**
  * A namespace class for static layout utilities.
  */
 
@@ -627,17 +625,17 @@ nsLayoutUtils::GetEventCoordinatesRelati
   const nsGUIEvent* GUIEvent = static_cast<const nsGUIEvent*>(aEvent);
   if (!GUIEvent->widget)
     return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
 
   // If it is, or is a descendant of, an SVG foreignobject frame,
   // then we need to do extra work
   nsIFrame* rootFrame = aFrame;
   for (nsIFrame* f = aFrame; f; f = GetCrossDocParentFrame(f)) {
-#ifdef MOZ_SVG_FOREIGNOBJECT
+#ifdef MOZ_SVG
     if (f->IsFrameOfType(nsIFrame::eSVGForeignObject) && f->GetFirstChild(nsnull)) {
       nsSVGForeignObjectFrame* fo = static_cast<nsSVGForeignObjectFrame*>(f);
       nsIFrame* outer = nsSVGUtils::GetOuterSVGFrame(fo);
       return fo->TransformPointFromOuter(
           GetEventCoordinatesRelativeTo(aEvent, outer)) -
         aFrame->GetOffsetTo(fo->GetFirstChild(nsnull));
     }
 #endif
--- a/layout/svg/base/src/Makefile.in
+++ b/layout/svg/base/src/Makefile.in
@@ -67,16 +67,17 @@ REQUIRES	= xpcom \
 
 CPPSRCS		= \
 		nsSVGAFrame.cpp \
 		nsSVGClipPathFrame.cpp \
 		nsSVGContainerFrame.cpp \
 		nsSVGEffects.cpp \
 		nsSVGFilterFrame.cpp \
 		nsSVGFilterInstance.cpp \
+		nsSVGForeignObjectFrame.cpp \
 		nsSVGGFrame.cpp \
 		nsSVGGenericContainerFrame.cpp \
 		nsSVGGeometryFrame.cpp \
 		nsSVGGlyphFrame.cpp \
 		nsSVGGradientFrame.cpp \
 		nsSVGImageFrame.cpp \
 		nsSVGInnerSVGFrame.cpp \
 		nsSVGLeafFrame.cpp \
@@ -91,29 +92,25 @@ CPPSRCS		= \
 		nsSVGTextContainerFrame.cpp \
 		nsSVGTextFrame.cpp \
 		nsSVGTextPathFrame.cpp \
 		nsSVGTSpanFrame.cpp \
 		nsSVGUseFrame.cpp \
 		nsSVGUtils.cpp \
 		$(NULL)
 
-ifdef MOZ_SVG_FOREIGNOBJECT
-CPPSRCS += nsSVGForeignObjectFrame.cpp
-endif
-
 include $(topsrcdir)/config/config.mk
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 EXPORTS = \
 	nsSVGUtils.h \
 	nsSVGFilterInstance.h \
-        nsSVGForeignObjectFrame.h \
+	nsSVGForeignObjectFrame.h \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES	= \
 		-I$(srcdir)/../../../base \
 		-I$(srcdir)/../../../generic \
 		-I$(srcdir)/../../../style \