Bug 482921 part 0.5 - Restore support for using tree op queue to set document charset. r=bzbarsky.

This commit is contained in:
Henri Sivonen
2011-11-01 13:33:11 +02:00
parent 0f19b8fa68
commit 6d5bbec2af
3 changed files with 16 additions and 2 deletions

View File

@@ -127,6 +127,7 @@ nsHtml5TreeOperation::~nsHtml5TreeOperation()
case eTreeOpAppendCommentToDocument:
delete[] mTwo.unicharPtr;
break;
case eTreeOpSetDocumentCharset:
case eTreeOpNeedsCharsetSwitchTo:
delete[] mOne.charPtr;
break;
@@ -632,6 +633,13 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
aBuilder->FlushPendingAppendNotifications();
return rv;
}
case eTreeOpSetDocumentCharset: {
char* str = mOne.charPtr;
PRInt32 charsetSource = mInt;
nsDependentCString dependentString(str);
aBuilder->SetDocumentCharsetAndSource(dependentString, charsetSource);
return rv;
}
case eTreeOpNeedsCharsetSwitchTo: {
char* str = mOne.charPtr;
PRInt32 charsetSource = mInt;