mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 22:35:43 +00:00
#137382, cleanup handling of SVG namespace, and remove old bogus namespace.
r=afri (not part of default build)
This commit is contained in:
parent
977cc96ead
commit
34c91fa45e
@ -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___ */
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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___ */
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -76,11 +76,11 @@ typedef void
|
||||
|
||||
/**
|
||||
* Frame manager interface. The frame manager serves two purposes:
|
||||
* <li>provides a serice for mapping from content to frame and from out-of-flow
|
||||
* frame to placeholder frame
|
||||
* <li>provides a service for mapping from content to frame and from out-of-flow
|
||||
* frame to placeholder frame.
|
||||
* <li>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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user