Bug 709083 - Call DoneCreatingElement before children have been appended to the element. r=bzbarsky.
This commit is contained in:
@@ -473,6 +473,23 @@ nsHtml5TreeBuilder::elementPushed(PRInt32 aNamespace, nsIAtom* aName, nsIContent
|
||||
treeOp->Init(eTreeOpStartLayout);
|
||||
return;
|
||||
}
|
||||
if (aName == nsHtml5Atoms::input ||
|
||||
aName == nsHtml5Atoms::button) {
|
||||
if (!formPointer) {
|
||||
// If form inputs don't belong to a form, their state preservation
|
||||
// won't work right without an append notification flush at this
|
||||
// point. See bug 497861.
|
||||
mOpQueue.AppendElement()->Init(eTreeOpFlushPendingAppendNotifications);
|
||||
}
|
||||
mOpQueue.AppendElement()->Init(eTreeOpDoneCreatingElement, aElement);
|
||||
return;
|
||||
}
|
||||
if (aName == nsHtml5Atoms::audio ||
|
||||
aName == nsHtml5Atoms::video ||
|
||||
aName == nsHtml5Atoms::menuitem) {
|
||||
mOpQueue.AppendElement()->Init(eTreeOpDoneCreatingElement, aElement);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -550,35 +567,12 @@ nsHtml5TreeBuilder::elementPopped(PRInt32 aNamespace, nsIAtom* aName, nsIContent
|
||||
treeOp->Init(eTreeOpDoneAddingChildren, aElement);
|
||||
return;
|
||||
}
|
||||
if (aName == nsHtml5Atoms::input ||
|
||||
aName == nsHtml5Atoms::button ||
|
||||
aName == nsHtml5Atoms::menuitem) {
|
||||
if (!formPointer) {
|
||||
// If form inputs don't belong to a form, their state preservation
|
||||
// won't work right without an append notification flush at this
|
||||
// point. See bug 497861.
|
||||
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
|
||||
NS_ASSERTION(treeOp, "Tree op allocation failed.");
|
||||
treeOp->Init(eTreeOpFlushPendingAppendNotifications);
|
||||
}
|
||||
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
|
||||
NS_ASSERTION(treeOp, "Tree op allocation failed.");
|
||||
treeOp->Init(eTreeOpDoneCreatingElement, aElement);
|
||||
return;
|
||||
}
|
||||
if (aName == nsHtml5Atoms::meta && !fragment) {
|
||||
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
|
||||
NS_ASSERTION(treeOp, "Tree op allocation failed.");
|
||||
treeOp->Init(eTreeOpProcessMeta, aElement);
|
||||
return;
|
||||
}
|
||||
if (aName == nsHtml5Atoms::audio || aName == nsHtml5Atoms::video) {
|
||||
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
|
||||
NS_ASSERTION(treeOp, "Tree op allocation failed.");
|
||||
treeOp->Init(eTreeOpDoneCreatingElement, aElement);
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user