Closed Bug 220027 Opened 21 years ago Closed 21 years ago

[FIX]Excessive assertions triggered by nsXMLElement::GetID()

Categories

(Core :: MathML, defect, P1)

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla1.6alpha

People

(Reporter: rbs, Assigned: bzbarsky)

References

()

Details

Attachments

(2 files)

nsresult nsGenericContainerElement::GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsIAtom** aPrefix, nsAString& aResult) const { NS_ASSERTION(nsnull != aName, "must have attribute name"); NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "must have a real namespace ID!"); [...] } This later assertion fires a lot at: http://www.mozilla.org/projects/mathml/demo/basics.xhtml I basically have to abort the browser to get out. Bonsai says that it was added by bz: "3.272 <bzbarsky@mit.edu> 23 Jun 2003 23:45 Add asserts on people attempting to fetch attributes in the kNamespaceID_Unknown namespace or call HasAttr on such. Bug 210314" The document freely mixes MathML+XHTML with its default attributes in the usual way. Is this now obsolete?
This GetID code is just completely bogus. It should be using kNameSpaceID_None for the namespace it passes to GetAttr. And the assert in GetAttr is not only correct, it caught a bug in this case. With the code as-is, the following MathML <maction xlink:id="bar" id="baz"> would return "bar" from GetID, if I read the code right. We should change nsXMLElement::GetID to do the right thing, and take out the remnants of kNameSpace_Unknown stuff in nsGenericContainerElement::GetAttr.
Attached patch PatchSplinter Review
Comment on attachment 132027 [details] [diff] [review] Patch jst? sicking? This is pretty straightforward...
Attachment #132027 - Flags: superreview?(jst)
Attachment #132027 - Flags: review?(bugmail)
Priority: -- → P1
Summary: Excessive assertions triggered by nsXMLElement::GetID() → [FIX]Excessive assertions triggered by nsXMLElement::GetID()
Target Milestone: --- → mozilla1.6alpha
Comment on attachment 132027 [details] [diff] [review] Patch sr=jst
Attachment #132027 - Flags: superreview?(jst) → superreview+
Attachment #132027 - Flags: review?(bugmail) → review+
Fixed. I don't think we need this on the 1.5 branch, do we?
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: