Bug 482592. Use the right container in ContentInserted. r+sr=roc

This commit is contained in:
Boris Zbarsky 2009-03-12 10:17:14 -04:00
Родитель 553c2a6892
Коммит a64ef9fc93
5 изменённых файлов: 69 добавлений и 5 удалений

Просмотреть файл

@ -7820,7 +7820,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
aChild);
parentFrame =
::AdjustAppendParentForAfterContent(mPresShell->GetPresContext(),
aContainer, parentFrame,
container, parentFrame,
&appendAfterFrame);
}
}
@ -7910,7 +7910,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
nsIFrame* firstChild = parentFrame->GetFirstChild(nsnull);
if (firstChild &&
nsLayoutUtils::IsGeneratedContentFor(aContainer, firstChild,
nsLayoutUtils::IsGeneratedContentFor(container, firstChild,
nsCSSPseudoElements::before)) {
// Insert the new frames after the last continuation of the :before
prevSibling = firstChild->GetTailContinuation();
@ -7989,7 +7989,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
isAppend = PR_TRUE;
parentFrame =
::AdjustAppendParentForAfterContent(mPresShell->GetPresContext(),
aContainer,
container,
frameItems.childList->GetParent(),
&appendAfterFrame);
}
@ -8004,7 +8004,10 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
}
else {
// Use more complicated insert logic when inserting
InsertFirstLineFrames(state, aContainer, containingBlock, &parentFrame,
// XXXbz this method is a no-op, so it's easy for the args being passed
// here to make no sense without anyone noticing... If it ever stops
// being a no-op, vet them carefully!
InsertFirstLineFrames(state, container, containingBlock, &parentFrame,
prevSibling, frameItems);
}
}
@ -8014,7 +8017,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
NS_ASSERTION(!captionItems.childList, "leaking caption frames");
// Notify the parent frame
if (isAppend) {
AppendFrames(state, aContainer, parentFrame, frameItems,
AppendFrames(state, container, parentFrame, frameItems,
appendAfterFrame);
} else {
state.mFrameManager->InsertFrames(parentFrame,

Просмотреть файл

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
xy
</body>
</html>

Просмотреть файл

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="a">
<content>
<html:span xmlns:html="http://www.w3.org/1999/xhtml"
id="hasAfter"><children/></html:span>
</content>
</binding>
</bindings>
<style>
#hasAfter::after { content: "y"; }
#l { display: none; }
</style>
<script>
function doTest() {
var l = document.getElementById("l");
l.parentNode.insertBefore(document.createTextNode("x"), l);
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="doTest()">
<div style="-moz-binding: url(#a)"><span id="l"></span></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="a">
<content>
<html:span xmlns:html="http://www.w3.org/1999/xhtml"
id="hasBefore"><children/></html:span>
</content>
</binding>
</bindings>
<style>
#hasBefore::before { content: "x"; }
</style>
<script>
function doTest() {
var l = document.getElementById("l");
l.parentNode.insertBefore(document.createTextNode("y"), l);
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="doTest()">
<div style="-moz-binding: url(#a)"><span id="l"></span></div>
</body>
</html>

Просмотреть файл

@ -1097,3 +1097,5 @@ fails == 461512-1.html 461512-1-ref.html # Bug 461512
== 478956-1a.html 478956-1-ref.html
== 478956-1b.html 478956-1-ref.html
== 480017-1.html 480017-1-ref.html
== 482592-1a.xhtml 482592-1-ref.html
== 482592-1b.xhtml 482592-1-ref.html