зеркало из https://github.com/mozilla/gecko-dev.git
Bug 535721. Deal with MoveChildrenTo on non-siblings. r=roc
This commit is contained in:
Родитель
eb3295d399
Коммит
04f92c2b3b
|
@ -0,0 +1,17 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<script>
|
||||
function boom()
|
||||
{
|
||||
|
||||
document.getElementById("i").appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "div"));
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="boom();">
|
||||
|
||||
<div><span><span id="i"><div></div></span></span></div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -266,4 +266,5 @@ load 500467-1.html
|
|||
load 501878-1.html
|
||||
load 503936-1.html
|
||||
load 526378-1.xul
|
||||
load 535721-1.xhtml
|
||||
load 535911-1.xhtml
|
||||
|
|
|
@ -1396,10 +1396,9 @@ MoveChildrenTo(nsPresContext* aPresContext,
|
|||
nsIFrame* aNewParent,
|
||||
nsFrameList& aFrameList)
|
||||
{
|
||||
NS_PRECONDITION(aOldParent->GetParent() == aNewParent->GetParent(),
|
||||
"Unexpected old and new parents");
|
||||
PRBool sameGrandParent = aOldParent->GetParent() == aNewParent->GetParent();
|
||||
|
||||
if (aNewParent->HasView() || aOldParent->HasView()) {
|
||||
if (aNewParent->HasView() || aOldParent->HasView() || !sameGrandParent) {
|
||||
// Move the frames into the new view
|
||||
nsHTMLContainerFrame::ReparentFrameViewList(aPresContext, aFrameList,
|
||||
aOldParent, aNewParent);
|
||||
|
@ -1419,6 +1418,12 @@ MoveChildrenTo(nsPresContext* aPresContext,
|
|||
|
||||
if (setHasChildWithView) {
|
||||
aNewParent->AddStateBits(NS_FRAME_HAS_CHILD_WITH_VIEW);
|
||||
if (!sameGrandParent) {
|
||||
for (nsIFrame* ancestor = aNewParent->GetParent();
|
||||
ancestor; ancestor = ancestor->GetParent()) {
|
||||
ancestor->AddStateBits(NS_FRAME_HAS_CHILD_WITH_VIEW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (aNewParent->GetChildList(nsnull).IsEmpty() &&
|
||||
|
@ -5812,7 +5817,7 @@ nsCSSFrameConstructor::AppendFrames(nsFrameConstructorState& aState,
|
|||
// initial parent, because that could screw up float parenting; it's easier
|
||||
// to do this little fixup here instead.
|
||||
if (aFrameList.NotEmpty() && !IsInlineOutside(aFrameList.FirstChild())) {
|
||||
// See whether out trailing inline is empty
|
||||
// See whether our trailing inline is empty
|
||||
nsIFrame* firstContinuation = aParentFrame->GetFirstContinuation();
|
||||
if (firstContinuation->GetChildList(nsnull).IsEmpty()) {
|
||||
// Our trailing inline is empty. Collect our starting blocks from
|
||||
|
|
Загрузка…
Ссылка в новой задаче