mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 535721. Deal with MoveChildrenTo on non-siblings. r=roc
This commit is contained in:
parent
32cfd3d5a7
commit
976c983e86
17
layout/base/crashtests/535721-1.xhtml
Normal file
17
layout/base/crashtests/535721-1.xhtml
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user