Preserve tokenizer state between document.writes. b=99467, r=heikki@netscape.com, sr=jst@netscape.com

This commit is contained in:
harishd@netscape.com
2003-05-28 20:56:21 +00:00
parent 852d724fbd
commit 0a7d9c896a
12 changed files with 126 additions and 80 deletions

View File

@@ -1281,17 +1281,22 @@ void nsParser::PushContext(CParserContext& aContext) {
* @update gess7/22/98
* @return prev. context
*/
CParserContext* nsParser::PopContext() {
CParserContext* oldContext=mParserContext;
if(oldContext) {
mParserContext=oldContext->mPrevContext;
// If the old context was blocked, propagate the blocked state
// back to the new one. Also, propagate the stream listener state
// but don't override onStop state to guarantee the call to DidBuildModel().
CParserContext* nsParser::PopContext()
{
CParserContext* oldContext = mParserContext;
if (oldContext) {
mParserContext = oldContext->mPrevContext;
if (mParserContext) {
if(mParserContext->mStreamListenerState!=eOnStop) {
// If the old context was blocked, propagate the blocked state
// back to the new one. Also, propagate the stream listener state
// but don't override onStop state to guarantee the call to DidBuildModel().
if (mParserContext->mStreamListenerState != eOnStop) {
mParserContext->mStreamListenerState = oldContext->mStreamListenerState;
}
// Preserve tokenizer state so that information is not lost
// between document.write. This fixes bug 99467
if (mParserContext->mTokenizer)
mParserContext->mTokenizer->CopyState(oldContext->mTokenizer);
}
}
return oldContext;