Bug 288438. Turn off SVG <foreignobject> because it's pretty broken. r=benjamin,sr=dbaron,a=benjamin,patch by jwatt,tor and roc

This commit is contained in:
roc+%cs.cmu.edu 2005-06-29 03:51:44 +00:00
Родитель 3175a3f6e1
Коммит afe40e0ab9
11 изменённых файлов: 67 добавлений и 14 удалений

Просмотреть файл

@ -68,7 +68,9 @@ ac_add_options() {
# Avoid adding duplicates
case "$ac_options" in
*"$_opt"* ) ;;
# Note that all options in $ac_options are enclosed in quotes,
# so there will always be a last character to match [^-A-Za-z0-9_]
*"\"$_opt[^-A-Za-z0-9_]"* ) ;;
* ) mozconfig_ac_options="$mozconfig_ac_options $_opt" ;;
esac
done

Просмотреть файл

@ -186,6 +186,7 @@ MOZ_UPDATE_XTERM = @MOZ_UPDATE_XTERM@
MOZ_MATHML = @MOZ_MATHML@
MOZ_XTF = @MOZ_XTF@
MOZ_SVG = @MOZ_SVG@
MOZ_SVG_FOREIGNOBJECT = @MOZ_SVG_FOREIGNOBJECT@
MOZ_SVG_RENDERER_GDIPLUS = @MOZ_SVG_RENDERER_GDIPLUS@
MOZ_SVG_RENDERER_LIBART = @MOZ_SVG_RENDERER_LIBART@
MOZ_SVG_RENDERER_CAIRO = @MOZ_SVG_RENDERER_CAIRO@

Просмотреть файл

@ -4840,6 +4840,20 @@ if test -n "$MOZ_SVG"; then
esac
fi
dnl COMMENTED OUT because foreignobject support should
dnl not be tweakable by distributors!
dnl ========================================================
dnl SVG <foreignObject>
dnl ========================================================
dnl MOZ_ARG_ENABLE_BOOL(svg-foreignobject,
dnl [ --enable-svg-foreignobject
dnl Enable SVG <foreignObject> support],
dnl MOZ_SVG_FOREIGNOBJECT=1,
dnl MOZ_SVG_FOREIGNOBJECT= )
dnl if test -n "$MOZ_SVG_FOREIGNOBJECT"; then
dnl AC_DEFINE(MOZ_SVG_FOREIGNOBJECT)
dnl fi
dnl ========================================================
dnl Transformiix
dnl ========================================================
@ -6464,6 +6478,7 @@ AC_SUBST(MINIMO)
AC_SUBST(MOZ_MATHML)
AC_SUBST(MOZ_XTF)
AC_SUBST(MOZ_SVG)
AC_SUBST(MOZ_SVG_FOREIGNOBJECT)
AC_SUBST(MOZ_SVG_RENDERER_GDIPLUS)
AC_SUBST(MOZ_SVG_RENDERER_LIBART)
AC_SUBST(MOZ_SVG_RENDERER_CAIRO)

Просмотреть файл

@ -89,7 +89,6 @@ CPPSRCS = \
nsSVGEllipseElement.cpp \
nsSVGEnum.cpp \
nsSVGFeatures.cpp \
nsSVGForeignObjectElement.cpp \
nsSVGGElement.cpp \
nsSVGGenericStringValue.cpp \
nsSVGGradientElement.cpp \
@ -130,6 +129,10 @@ CPPSRCS = \
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.

Просмотреть файл

@ -60,7 +60,9 @@ SVG_ATOM(clipPath, "clipPath")
SVG_ATOM(defs, "defs")
SVG_ATOM(desc, "desc")
SVG_ATOM(ellipse, "ellipse")
#ifdef MOZ_SVG_FOREIGNOBJECT
SVG_ATOM(foreignObject, "foreignObject")
#endif
SVG_ATOM(g, "g")
SVG_ATOM(generic, "generic")
SVG_ATOM(image, "image")

Просмотреть файл

@ -60,8 +60,10 @@ 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
@ -161,8 +163,10 @@ NS_NewSVGElement(nsIContent** aResult, nsINodeInfo *aNodeInfo)
return NS_NewSVGSVGElement(aResult, aNodeInfo);
if (name == nsSVGAtoms::g)
return NS_NewSVGGElement(aResult, aNodeInfo);
#ifdef MOZ_SVG_FOREIGNOBJECT
if (name == nsSVGAtoms::foreignObject)
return NS_NewSVGForeignObjectElement(aResult, aNodeInfo);
#endif
if (name == nsSVGAtoms::path)
return NS_NewSVGPathElement(aResult, aNodeInfo);
if (name == nsSVGAtoms::text)

Просмотреть файл

@ -198,8 +198,7 @@ enum nsDOMClassInfoID {
// 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 right before eDOMClassInfoIDCount (or, for now,
// before the MOZ_SVG ifdefs, since they're off by default).
// are to be added right before eDOMClassInfoIDCount.
// Rect object used by getComputedStyle
eDOMClassInfo_CSSRect_id,
@ -254,7 +253,6 @@ enum nsDOMClassInfoID {
eDOMClassInfo_SVGDefsElement_id,
eDOMClassInfo_SVGDescElement_id,
eDOMClassInfo_SVGEllipseElement_id,
eDOMClassInfo_SVGForeignObjectElement_id,
eDOMClassInfo_SVGGElement_id,
eDOMClassInfo_SVGGradientElement_id,
eDOMClassInfo_SVGImageElement_id,
@ -338,6 +336,12 @@ enum nsDOMClassInfoID {
// PageTransition Events
eDOMClassInfo_PageTransitionEvent_id,
// Define this near the end so that enabling/disabling foreignobject doesn't
// break binary compatibility
#if defined(MOZ_SVG) && defined(MOZ_SVG_FOREIGNOBJECT)
eDOMClassInfo_SVGForeignObjectElement_id,
#endif
// This one better be the last one in this list
eDOMClassInfoIDCount
};

Просмотреть файл

@ -336,7 +336,9 @@
#include "nsIDOMSVGEllipseElement.h"
#include "nsIDOMSVGException.h"
#include "nsIDOMSVGFitToViewBox.h"
#ifdef MOZ_SVG_FOREIGNOBJECT
#include "nsIDOMSVGForeignObjectElem.h"
#endif
#include "nsIDOMSVGGElement.h"
#include "nsIDOMSVGGradientElement.h"
#include "nsIDOMSVGImageElement.h"
@ -857,8 +859,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
ELEMENT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(SVGEllipseElement, nsElementSH,
ELEMENT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(SVGForeignObjectElement, nsElementSH,
ELEMENT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(SVGGElement, nsElementSH,
ELEMENT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(SVGGradientElement, nsElementSH,
@ -1008,6 +1008,14 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(PageTransitionEvent, nsDOMGenericSH,
DOM_DEFAULT_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)
NS_DEFINE_CLASSINFO_DATA(SVGForeignObjectElement, nsElementSH,
ELEMENT_SCRIPTABLE_FLAGS)
#endif
};
nsIXPConnect *nsDOMClassInfo::sXPConnect = nsnull;
@ -2385,11 +2393,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(SVGForeignObjectElement, nsIDOMSVGForeignObjectElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGForeignObjectElement)
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(SVGGElement, nsIDOMSVGGElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGGElement)
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
@ -2713,6 +2716,13 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_END
#endif // MOZ_ENABLE_CANVAS
#if defined(MOZ_SVG) && defined(MOZ_SVG_FOREIGNOBJECT)
DOM_CLASSINFO_MAP_BEGIN(SVGForeignObjectElement, nsIDOMSVGForeignObjectElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGForeignObjectElement)
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
#endif
#ifdef NS_DEBUG
{
PRUint32 i = sizeof(sClassInfoData) / sizeof(sClassInfoData[0]);

Просмотреть файл

@ -189,8 +189,10 @@ nsresult
NS_NewSVGGFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
#ifdef MOZ_SVG_FOREIGNOBJECT
nsresult
NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
#endif
nsresult
NS_NewSVGPathFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame** aNewFrame);
nsresult
@ -7293,10 +7295,12 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
rv = NS_NewSVGLineFrame(mPresShell, aContent, &newFrame);
else if (aTag == nsSVGAtoms::rect)
rv = NS_NewSVGRectFrame(mPresShell, aContent, &newFrame);
#ifdef MOZ_SVG_FOREIGNOBJECT
else if (aTag == nsSVGAtoms::foreignObject) {
processChildren = PR_TRUE;
rv = NS_NewSVGForeignObjectFrame(mPresShell, aContent, &newFrame);
}
#endif
else if (aTag == nsSVGAtoms::path)
rv = NS_NewSVGPathFrame(mPresShell, aContent, &newFrame);
else if (aTag == nsSVGAtoms::text) {
@ -7355,6 +7359,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
// If we succeeded in creating a frame then initialize it, process its
// children (if requested), and set the initial child list
if (NS_SUCCEEDED(rv) && newFrame != nsnull) {
#ifdef MOZ_SVG_FOREIGNOBJECT
if (aTag == nsSVGAtoms::foreignObject) {
// Claim to be relatively positioned so that we end up being the
// absolute containing block. Also, push "null" as the floater
@ -7365,7 +7370,9 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
rv = ConstructBlock(aState, disp, aContent,
geometricParent, aParentFrame, aStyleContext,
&newFrame, aFrameItems, PR_TRUE);
} else {
} else
#endif // MOZ_SVG_FOREIGNOBJECT
{
InitAndRestoreFrame(aState, aContent, geometricParent, aStyleContext,
nsnull, newFrame);

Просмотреть файл

@ -248,7 +248,9 @@ LAYOUT_ATOM(svgCircleFrame,"SVGCircleFrame")
LAYOUT_ATOM(svgClipPathFrame,"SVGClipPathFrame")
LAYOUT_ATOM(svgDefsFrame,"SVGDefsFrame")
LAYOUT_ATOM(svgEllipseFrame,"SVGEllipseFrame")
#ifdef MOZ_SVG_FOREIGNOBJECT
LAYOUT_ATOM(svgForeignObjectFrame,"SVGForeignObjectFrame")
#endif
LAYOUT_ATOM(svgGenericContainerFrame,"SVGGenericContainerFrame")
LAYOUT_ATOM(svgGFrame,"SVGGFrame")
LAYOUT_ATOM(svgGlyphFrame,"SVGGlyphFrame")

Просмотреть файл

@ -68,7 +68,6 @@ CPPSRCS = \
nsSVGClipPathFrame.cpp \
nsSVGDefsFrame.cpp \
nsSVGEllipseFrame.cpp \
nsSVGForeignObjectFrame.cpp \
nsSVGGFrame.cpp \
nsSVGGenericContainerFrame.cpp \
nsSVGGlyphFrame.cpp \
@ -90,6 +89,10 @@ CPPSRCS = \
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.