fix for 159842: parser has no mechanism to allow parsing of incomplete html fragments. sr's from heikki, kin, bz

This commit is contained in:
jfrancis@netscape.com
2002-08-29 08:17:41 +00:00
parent dc8deef0c6
commit db48d7f810
14 changed files with 255 additions and 202 deletions

View File

@@ -469,6 +469,8 @@ void nsParser::SetCommand(const char* aCommand){
nsCAutoString theCommand(aCommand);
if(theCommand.Equals(kViewSourceCommand))
mCommand=eViewSource;
else if(theCommand.Equals(kViewFragmentCommand))
mCommand=eViewFragment;
else mCommand=eViewNormal;
mCommandStr.AssignWithConversion(aCommand);
}
@@ -1560,6 +1562,10 @@ nsresult nsParser::Parse(const nsAString& aSourceBuffer, void* aKey,
return result;
}
// hack to pass on to the dtd the caller's desire to
// parse a fragment without worrying about containment rules
if (aMode == eDTDMode_fragment)
mCommand = eViewFragment;
// Maintain a reference to ourselves so we don't go away
// till we're completely done.