Bug 497861 - Wrong form state preservation on reparse in HTML5 parser. r=bnewman.

This commit is contained in:
Henri Sivonen
2009-11-06 15:06:48 +02:00
parent 572e8880a6
commit 8017ba2092
7 changed files with 129 additions and 115 deletions

View File

@@ -94,7 +94,8 @@ nsHtml5TreeOperation::~nsHtml5TreeOperation()
}
nsresult
nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder)
nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
nsIContent** aScriptElement)
{
nsresult rv = NS_OK;
switch(mOpCode) {
@@ -325,7 +326,7 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder)
if (snapshot) {
aBuilder->InitializeDocWriteParserState(snapshot, mInt);
}
aBuilder->SetScriptElement(node);
*aScriptElement = node;
return rv;
}
case eTreeOpDoneAddingChildren: {
@@ -338,6 +339,10 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder)
node->DoneCreatingElement();
return rv;
}
case eTreeOpFlushPendingAppendNotifications: {
aBuilder->FlushPendingAppendNotifications();
return rv;
}
case eTreeOpSetDocumentCharset: {
char* str = mOne.charPtr;
nsDependentCString dependentString(str);
@@ -380,11 +385,11 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder)
return rv;
}
case eTreeOpStreamEnded: {
aBuilder->StreamEnded();
aBuilder->DidBuildModel(PR_FALSE); // this causes a notifications flush anyway
return rv;
}
case eTreeOpStartLayout: {
aBuilder->StartLayout(); // this causes a flush anyway
aBuilder->StartLayout(); // this causes a notification flush anyway
return rv;
}
case eTreeOpDocumentMode: {