mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 709083 - Call DoneCreatingElement before children have been appended to the element. r=bzbarsky.
This commit is contained in:
parent
62043cf721
commit
f57b6f1c40
@ -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;
|
||||
}
|
||||
|
||||
|
@ -95,6 +95,7 @@ _TEST_FILES = parser_datreader.js \
|
||||
test_bug655682.html \
|
||||
file_bug655682.sjs \
|
||||
test_viewsource.html \
|
||||
test_bug709083.html \
|
||||
test_bug715112.html \
|
||||
test_bug715739.html \
|
||||
$(NULL)
|
||||
|
30
parser/htmlparser/tests/mochitest/test_bug709083.html
Normal file
30
parser/htmlparser/tests/mochitest/test_bug709083.html
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=709083
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 709083</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=709083">Mozilla Bug 709083</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<video muted>
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 709083 **/
|
||||
|
||||
ok(document.getElementsByTagName("video")[0].muted, "Should be muted already.");
|
||||
|
||||
</script>
|
||||
</video>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user