From 22db265958ab9f6b23930ed5173f4db4b7ac6759 Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Fri, 26 Feb 1999 03:02:19 +0000 Subject: [PATCH] Bug 3302. Fixed DOM calls to effect (more or less) the right change on the content model, modulo Bug 3275. This was causing asserts to fire whenever you called SetAttribute(). git-svn-id: svn://10.0.0.236/trunk@22040 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/xul/content/src/nsXULElement.cpp | 7 ++++--- mozilla/rdf/content/src/nsRDFElement.cpp | 7 ++++--- mozilla/rdf/content/src/nsRDFXULBuilder.cpp | 2 +- mozilla/rdf/content/src/nsXULElement.cpp | 7 ++++--- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/mozilla/content/xul/content/src/nsXULElement.cpp b/mozilla/content/xul/content/src/nsXULElement.cpp index b97bf74d2ba..47470c66b5e 100644 --- a/mozilla/content/xul/content/src/nsXULElement.cpp +++ b/mozilla/content/xul/content/src/nsXULElement.cpp @@ -1455,14 +1455,14 @@ static char kNameSpaceSeparator[] = ":"; // are built via the content model builders. // // Since mNameSpace will _always_ be null, specifying - // kNameSpaceID_Unknown allows us to at least match on the + // kNameSpaceID_None allows us to at least match on the // tag. You'll start seeing problems when the same name is used in // different namespaces. // // See http://bugzilla.mozilla.org/show_bug.cgi?id=3275 for more // info. - aNameSpaceID = kNameSpaceID_Unknown; // XXX should be kNameSpaceID_None + aNameSpaceID = kNameSpaceID_None; if (0 < prefix.Length()) { nsIAtom* nameSpaceAtom = NS_NewAtom(prefix); if (mNameSpace) { @@ -1722,7 +1722,8 @@ done: for (index = 0; index < count; index++) { const nsGenericAttribute* attr = (const nsGenericAttribute*)mAttributes->ElementAt(index); if (((attr->mNameSpaceID == aNameSpaceID) || - (aNameSpaceID == kNameSpaceID_Unknown)) && + (aNameSpaceID == kNameSpaceID_Unknown) || + (aNameSpaceID == kNameSpaceID_None)) && (attr->mName == aName)) { aResult = attr->mValue; if (0 < aResult.Length()) { diff --git a/mozilla/rdf/content/src/nsRDFElement.cpp b/mozilla/rdf/content/src/nsRDFElement.cpp index b97bf74d2ba..47470c66b5e 100644 --- a/mozilla/rdf/content/src/nsRDFElement.cpp +++ b/mozilla/rdf/content/src/nsRDFElement.cpp @@ -1455,14 +1455,14 @@ static char kNameSpaceSeparator[] = ":"; // are built via the content model builders. // // Since mNameSpace will _always_ be null, specifying - // kNameSpaceID_Unknown allows us to at least match on the + // kNameSpaceID_None allows us to at least match on the // tag. You'll start seeing problems when the same name is used in // different namespaces. // // See http://bugzilla.mozilla.org/show_bug.cgi?id=3275 for more // info. - aNameSpaceID = kNameSpaceID_Unknown; // XXX should be kNameSpaceID_None + aNameSpaceID = kNameSpaceID_None; if (0 < prefix.Length()) { nsIAtom* nameSpaceAtom = NS_NewAtom(prefix); if (mNameSpace) { @@ -1722,7 +1722,8 @@ done: for (index = 0; index < count; index++) { const nsGenericAttribute* attr = (const nsGenericAttribute*)mAttributes->ElementAt(index); if (((attr->mNameSpaceID == aNameSpaceID) || - (aNameSpaceID == kNameSpaceID_Unknown)) && + (aNameSpaceID == kNameSpaceID_Unknown) || + (aNameSpaceID == kNameSpaceID_None)) && (attr->mName == aName)) { aResult = attr->mValue; if (0 < aResult.Length()) { diff --git a/mozilla/rdf/content/src/nsRDFXULBuilder.cpp b/mozilla/rdf/content/src/nsRDFXULBuilder.cpp index e691355e920..e1a69436f7a 100644 --- a/mozilla/rdf/content/src/nsRDFXULBuilder.cpp +++ b/mozilla/rdf/content/src/nsRDFXULBuilder.cpp @@ -1787,7 +1787,7 @@ RDFXULBuilderImpl::GetResource(PRInt32 aNameSpaceID, // XXX check to see if we need to insert a '/' or a '#' nsAutoString tag(aNameAtom->GetUnicode()); - if (uri.Last() != '#' && uri.Last() != '/' && tag.First() != '#') + if (0 < uri.Length() && uri.Last() != '#' && uri.Last() != '/' && tag.First() != '#') uri.Append('#'); uri.Append(tag); diff --git a/mozilla/rdf/content/src/nsXULElement.cpp b/mozilla/rdf/content/src/nsXULElement.cpp index b97bf74d2ba..47470c66b5e 100644 --- a/mozilla/rdf/content/src/nsXULElement.cpp +++ b/mozilla/rdf/content/src/nsXULElement.cpp @@ -1455,14 +1455,14 @@ static char kNameSpaceSeparator[] = ":"; // are built via the content model builders. // // Since mNameSpace will _always_ be null, specifying - // kNameSpaceID_Unknown allows us to at least match on the + // kNameSpaceID_None allows us to at least match on the // tag. You'll start seeing problems when the same name is used in // different namespaces. // // See http://bugzilla.mozilla.org/show_bug.cgi?id=3275 for more // info. - aNameSpaceID = kNameSpaceID_Unknown; // XXX should be kNameSpaceID_None + aNameSpaceID = kNameSpaceID_None; if (0 < prefix.Length()) { nsIAtom* nameSpaceAtom = NS_NewAtom(prefix); if (mNameSpace) { @@ -1722,7 +1722,8 @@ done: for (index = 0; index < count; index++) { const nsGenericAttribute* attr = (const nsGenericAttribute*)mAttributes->ElementAt(index); if (((attr->mNameSpaceID == aNameSpaceID) || - (aNameSpaceID == kNameSpaceID_Unknown)) && + (aNameSpaceID == kNameSpaceID_Unknown) || + (aNameSpaceID == kNameSpaceID_None)) && (attr->mName == aName)) { aResult = attr->mValue; if (0 < aResult.Length()) {