Closed
Bug 236371
Opened 21 years ago
Closed 4 years ago
Bad tag enum passed to CNavDTD::IntTagToStringTag()!! eHTMLTag_whitespace
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: timeless, Assigned: timeless)
Details
(Keywords: assertion)
Yes I know, this summary has been used before...
xpcom.dll!nsDebug::Assertion(const char * aStr=0x017e3248, const char *
aExpr=0x017e3288, const char * aFile=0x017e307c, int aLine=0x00000a1a) Line 109 C++
gkparser.dll!CNavDTD::IntTagToStringTag(int aIntTag=0x00000071) Line 2586 +
0x1f C++
> gklayout.dll!HTMLContentSink::SinkTraceNode(unsigned int aBit=0x03411bb0,
const char * aMsg=0x016e75ec, nsHTMLTag aTag=eHTMLTag_whitespace, int
aStackPos=0x00000005, void * aThis=0x033dd738) Line 783 + 0x11 C++
gklayout.dll!SinkContext::AddLeaf(const nsIParserNode & aNode={...}) Line
1512 C++
gklayout.dll!HTMLContentSink::AddLeaf(const nsIParserNode & aNode={...})
Line 3215 C++
gkparser.dll!CNavDTD::AddLeaf(const nsIParserNode * aNode=0x0347db70) Line
3787 + 0xd C++
gkparser.dll!CNavDTD::HandleDefaultStartToken(CToken * aToken=0x034196b8,
nsHTMLTag aChildTag=eHTMLTag_a, nsCParserNode * aNode=0x0347db70) Line 1460 +
0x8 C++
gkparser.dll!CNavDTD::HandleStartToken(CToken * aToken=0x00000071) Line
1835 + 0xe C++
gkparser.dll!CNavDTD::HandleToken(CToken * aToken=0x034196b8, nsIParser *
aParser=0x033e4660) Line 1019 + 0xa C++
gkparser.dll!CNavDTD::BuildModel(nsIParser * aParser=0x033e4660, nsITokenizer
* aTokenizer=0x03405cb8, nsITokenObserver * anObserver=0x00000000,
nsIContentSink * aSink=0x033e5c88) Line 511 + 0xa C++
gkparser.dll!nsParser::BuildModel() Line 1896 C++
gkparser.dll!nsParser::ResumeParse(int allowIteration=0x00000001, int
aIsFinalChunk=0x00000001, int aCanInterrupt=0x00000001) Line 1761 + 0x6 C++
gkparser.dll!nsParser::ContinueParsing() Line 1359 + 0xc C++
gkparser.dll!nsParser::HandleParserContinueEvent() Line 1423 C++
gkparser.dll!nsParserContinueEvent::HandleEvent(PLEvent * aEvent=0x03074cb0)
Line 238 C++
aTag eHTMLTag_whitespace nsHTMLTag
The problem is here:
272 // static array of unicode tag names
273 #define HTML_TAG(_tag, _classname) sHTMLTagUnicodeName_##_tag,
274 #define HTML_OTHER(_tag, _classname)
275 static const PRUnichar* const kTagUnicodeTable[] = {
276 #include "nsHTMLTagList.h"
277 };
278 #undef HTML_TAG
279
280 // static array of tag atoms
281 static nsIAtom* kTagAtomTable[eHTMLTag_userdefined - 1];
282
283 // static array of tag StaticAtom structs
284 #define HTML_TAG(_tag, _classname) { #_tag, &kTagAtomTable[eHTMLTag_##_tag -
1] },
285 static const nsStaticAtom kTagAtoms_info[] = {
286 #include "nsHTMLTagList.h"
287 };
288 #undef HTML_TAG
289 #undef HTML_OTHER
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/htmlparser/public/nsHTMLTagList.h&rev=1.8&mark=180-181,188#178
Steps:
Click the throbber.
Comment 1•21 years ago
|
||
Hm, the problem is that when the proper logging env. variables are set, the sink
calls IntTagToStringTag() on every leaf that it receives from the DTD, but some
leaves are not really tags (such as whitespace, comments, etc.). The assertion
is harmless, really.
Comment 2•21 years ago
|
||
> The assertion is harmless, really.
then it should, by definition, not be an assertion. assertions are only there to
catch programming errors.
Comment 3•21 years ago
|
||
Well, the assertion probably should be there, as it can catch misuses of
IntTagToStringTag(). So the possible options to fix this are:
1) Give whitespace/comments/etc. string representations in nsHTMLTags.cpp
2) Fix the content sink's logger to not call that function on non-tags
2 is probably the better of the two, but begs the question of what the sink is
supposed to output when it *does* get one of these non-tags.
harmless is a matter of opinion, for a while this thing flooded my console.
these day's it's dwarfed by other things.
Component: DOM: HTML → DOM: Core & HTML
QA Contact: ian → general
Comment 5•4 years ago
|
||
Pretty sure this is no longer applicable.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•