From 34c91fa45e69cb1f5ae67ada4cc6e2664a288aed Mon Sep 17 00:00:00 2001 From: "hwaara%chello.se" Date: Tue, 16 Apr 2002 18:13:13 +0000 Subject: [PATCH] #137382, cleanup handling of SVG namespace, and remove old bogus namespace. r=afri (not part of default build) --- content/shared/public/nsSVGAtoms.h | 2 +- content/shared/src/nsSVGAtoms.cpp | 4 ---- content/svg/content/src/nsSVGAtoms.cpp | 4 ---- content/svg/content/src/nsSVGAtoms.h | 2 +- layout/base/nsCSSFrameConstructor.cpp | 15 ++++----------- layout/base/public/nsIFrameManager.h | 8 ++++---- layout/html/style/src/nsCSSFrameConstructor.cpp | 15 ++++----------- 7 files changed, 14 insertions(+), 36 deletions(-) diff --git a/content/shared/public/nsSVGAtoms.h b/content/shared/public/nsSVGAtoms.h index a6f4bde3afd0..63900a1c3056 100644 --- a/content/shared/public/nsSVGAtoms.h +++ b/content/shared/public/nsSVGAtoms.h @@ -43,7 +43,6 @@ public: // SVG namespace ID, good for the life of the nsSVGAtoms object static PRInt32 nameSpaceID; - static PRInt32 nameSpaceDeprecatedID; /* Declare all atoms @@ -59,3 +58,4 @@ public: }; #endif /* nsSVGAtoms_h___ */ + diff --git a/content/shared/src/nsSVGAtoms.cpp b/content/shared/src/nsSVGAtoms.cpp index 890c41fbeb04..1305ce77166a 100644 --- a/content/shared/src/nsSVGAtoms.cpp +++ b/content/shared/src/nsSVGAtoms.cpp @@ -28,10 +28,8 @@ #include "nsLayoutCID.h" static const char kSVGNameSpace[] = "http://www.w3.org/2000/svg"; -static const char kSVGDeprecatedNameSpace[] = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.svg"; PRInt32 nsSVGAtoms::nameSpaceID; -PRInt32 nsSVGAtoms::nameSpaceDeprecatedID; // define storage for all atoms #define SVG_ATOM(_name, _value) nsIAtom* nsSVGAtoms::_name; @@ -56,8 +54,6 @@ void nsSVGAtoms::AddRefAtoms() { if (nsmgr) { nsmgr->RegisterNameSpace(NS_ConvertASCIItoUCS2(kSVGNameSpace), nameSpaceID); - nsmgr->RegisterNameSpace(NS_ConvertASCIItoUCS2(kSVGDeprecatedNameSpace), - nameSpaceDeprecatedID); gNameSpaceManager = nsmgr; NS_ADDREF(gNameSpaceManager); diff --git a/content/svg/content/src/nsSVGAtoms.cpp b/content/svg/content/src/nsSVGAtoms.cpp index 890c41fbeb04..1305ce77166a 100644 --- a/content/svg/content/src/nsSVGAtoms.cpp +++ b/content/svg/content/src/nsSVGAtoms.cpp @@ -28,10 +28,8 @@ #include "nsLayoutCID.h" static const char kSVGNameSpace[] = "http://www.w3.org/2000/svg"; -static const char kSVGDeprecatedNameSpace[] = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.svg"; PRInt32 nsSVGAtoms::nameSpaceID; -PRInt32 nsSVGAtoms::nameSpaceDeprecatedID; // define storage for all atoms #define SVG_ATOM(_name, _value) nsIAtom* nsSVGAtoms::_name; @@ -56,8 +54,6 @@ void nsSVGAtoms::AddRefAtoms() { if (nsmgr) { nsmgr->RegisterNameSpace(NS_ConvertASCIItoUCS2(kSVGNameSpace), nameSpaceID); - nsmgr->RegisterNameSpace(NS_ConvertASCIItoUCS2(kSVGDeprecatedNameSpace), - nameSpaceDeprecatedID); gNameSpaceManager = nsmgr; NS_ADDREF(gNameSpaceManager); diff --git a/content/svg/content/src/nsSVGAtoms.h b/content/svg/content/src/nsSVGAtoms.h index a6f4bde3afd0..63900a1c3056 100644 --- a/content/svg/content/src/nsSVGAtoms.h +++ b/content/svg/content/src/nsSVGAtoms.h @@ -43,7 +43,6 @@ public: // SVG namespace ID, good for the life of the nsSVGAtoms object static PRInt32 nameSpaceID; - static PRInt32 nameSpaceDeprecatedID; /* Declare all atoms @@ -59,3 +58,4 @@ public: }; #endif /* nsSVGAtoms_h___ */ + diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index d2435f0924f6..43337070a632 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -3375,8 +3375,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell, #endif #ifdef MOZ_SVG if (NS_SUCCEEDED(aDocElement->GetNameSpaceID(nameSpaceID)) && - (nameSpaceID == nsSVGAtoms::nameSpaceID || - nameSpaceID == nsSVGAtoms::nameSpaceDeprecatedID)) { + (nameSpaceID == nsSVGAtoms::nameSpaceID)) { rv = NS_NewSVGOuterSVGFrame(aPresShell, aDocElement, &contentFrame); if (NS_FAILED(rv)) { return rv; @@ -6934,9 +6933,8 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsIPresShell* aPresShell, nsIStyleContext* aStyleContext, nsFrameItems& aFrameItems) { - // Make sure that we remain confined in the SVG world - if (aNameSpaceID != nsSVGAtoms::nameSpaceID) - return NS_OK; + NS_ASSERTION(NS_SUCCEEDED(aContent->GetNameSpaceID(aNameSpaceID)) && + (aNameSpaceID == nsSVGAtoms::nameSpaceID), "SVG frame constructed in wrong namespace"); nsresult rv = NS_OK; PRBool isAbsolutelyPositioned = PR_FALSE; @@ -6949,10 +6947,6 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsIPresShell* aPresShell, if (aTag == nsnull) return NS_OK; - // Make sure that we remain confined in the SVG world - if (aNameSpaceID != nsSVGAtoms::nameSpaceID) - return NS_OK; - // Initialize the new frame nsIFrame* newFrame = nsnull; //nsSVGTableCreator svgTableCreator(aPresShell); // Used to make table views. @@ -7297,8 +7291,7 @@ nsCSSFrameConstructor::ConstructFrameInternal( nsIPresShell* aPresShe if (NS_SUCCEEDED(rv) && ((nsnull == aFrameItems.childList) || (lastChild == aFrameItems.lastChild)) && - (aNameSpaceID == nsSVGAtoms::nameSpaceID || - aNameSpaceID == nsSVGAtoms::nameSpaceDeprecatedID)) { + (aNameSpaceID == nsSVGAtoms::nameSpaceID)) { rv = ConstructSVGFrame(aPresShell, aPresContext, aState, aContent, aParentFrame, aTag, aNameSpaceID, styleContext, aFrameItems); } diff --git a/layout/base/public/nsIFrameManager.h b/layout/base/public/nsIFrameManager.h index 257deeacbf15..caee02f56520 100644 --- a/layout/base/public/nsIFrameManager.h +++ b/layout/base/public/nsIFrameManager.h @@ -76,11 +76,11 @@ typedef void /** * Frame manager interface. The frame manager serves two purposes: - *
  • provides a serice for mapping from content to frame and from out-of-flow - * frame to placeholder frame + *
  • provides a service for mapping from content to frame and from out-of-flow + * frame to placeholder frame. *
  • handles structural modifications to the frame model. If the frame model * lock can be acquired, then the changes are processed immediately; otherwise, - * they're queued and processed later + * they're queued and processed later. */ class nsIFrameManager : public nsISupports { public: @@ -99,7 +99,7 @@ public: // Gets and sets the root frame (typically the viewport). The lifetime of the // root frame is controlled by the frame manager. When the frame manager is - // destroyed it destroys the entire frame hierarchy + // destroyed it destroys the entire frame hierarchy. NS_IMETHOD GetRootFrame(nsIFrame** aRootFrame) const = 0; NS_IMETHOD SetRootFrame(nsIFrame* aRootFrame) = 0; diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index d2435f0924f6..43337070a632 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -3375,8 +3375,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresShell* aPresShell, #endif #ifdef MOZ_SVG if (NS_SUCCEEDED(aDocElement->GetNameSpaceID(nameSpaceID)) && - (nameSpaceID == nsSVGAtoms::nameSpaceID || - nameSpaceID == nsSVGAtoms::nameSpaceDeprecatedID)) { + (nameSpaceID == nsSVGAtoms::nameSpaceID)) { rv = NS_NewSVGOuterSVGFrame(aPresShell, aDocElement, &contentFrame); if (NS_FAILED(rv)) { return rv; @@ -6934,9 +6933,8 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsIPresShell* aPresShell, nsIStyleContext* aStyleContext, nsFrameItems& aFrameItems) { - // Make sure that we remain confined in the SVG world - if (aNameSpaceID != nsSVGAtoms::nameSpaceID) - return NS_OK; + NS_ASSERTION(NS_SUCCEEDED(aContent->GetNameSpaceID(aNameSpaceID)) && + (aNameSpaceID == nsSVGAtoms::nameSpaceID), "SVG frame constructed in wrong namespace"); nsresult rv = NS_OK; PRBool isAbsolutelyPositioned = PR_FALSE; @@ -6949,10 +6947,6 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsIPresShell* aPresShell, if (aTag == nsnull) return NS_OK; - // Make sure that we remain confined in the SVG world - if (aNameSpaceID != nsSVGAtoms::nameSpaceID) - return NS_OK; - // Initialize the new frame nsIFrame* newFrame = nsnull; //nsSVGTableCreator svgTableCreator(aPresShell); // Used to make table views. @@ -7297,8 +7291,7 @@ nsCSSFrameConstructor::ConstructFrameInternal( nsIPresShell* aPresShe if (NS_SUCCEEDED(rv) && ((nsnull == aFrameItems.childList) || (lastChild == aFrameItems.lastChild)) && - (aNameSpaceID == nsSVGAtoms::nameSpaceID || - aNameSpaceID == nsSVGAtoms::nameSpaceDeprecatedID)) { + (aNameSpaceID == nsSVGAtoms::nameSpaceID)) { rv = ConstructSVGFrame(aPresShell, aPresContext, aState, aContent, aParentFrame, aTag, aNameSpaceID, styleContext, aFrameItems); }