Bug 1415843: Remove an unneeded call to AdjustAppendParentForAfterContent. r=bz

I don't know why GetInsertionPrevSibling would get the parent wrong.

IsValidSibling handles the frameset case and a lot of the table caption cases.

The table caption cases IsValidSibling can't handle are due to elements which
create frames based on something other than display.

For those cases, while IsValidSibling will return incorrect results, we will end
up seeing that the parent frame is the wrong type after creating the frame
construction items for the new stuff and reframe under WipeContainingBlock.

MozReview-Commit-ID: 5b3L4CB6Oxl

--HG--
extra : rebase_source : c3559dae0b5f4de72fbf5031bdded48f79df6216
This commit is contained in:
Emilio Cobos Álvarez 2017-11-08 15:38:09 +01:00
Родитель b2e847755c
Коммит ca0edc11ac
1 изменённых файлов: 0 добавлений и 46 удалений

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

@ -8139,8 +8139,6 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
return;
}
nsIContent* container = insertion.mParentFrame->GetContent();
LayoutFrameType frameType = insertion.mParentFrame->Type();
LAYOUT_PHASE_TEMP_EXIT();
if (MaybeRecreateForFrameset(insertion.mParentFrame, aStartChild, aEndChild)) {
@ -8280,7 +8278,6 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
return;
}
container = insertion.mParentFrame->GetContent();
frameType = insertion.mParentFrame->Type();
}
}
@ -8355,49 +8352,6 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
}
}
// If the parent of our current prevSibling is different from the frame we'll
// actually use as the parent, then the calculated insertion point is now
// invalid and as it is unknown where to insert correctly we append instead
// (bug 341858).
// This can affect our prevSibling and isAppend, but should not have any
// effect on the WipeContainingBlock above, since this should only happen
// when neither parent is a ib-split frame and should not affect whitespace
// handling inside table-related frames (and in fact, can only happen when
// one of the parents is a table wrapper and one is an inner table or when the
// parent is a fieldset or fieldset content frame). So it won't affect the
// {ib} or XUL box cases in WipeContainingBlock(), and the table pseudo
// handling will only be affected by us maybe thinking we're not inserting
// at the beginning, whereas we really are. That would have made us reframe
// unnecessarily, but that's ok.
// XXXbz we should push our frame construction item code up higher, so we
// know what our items are by the time we start figuring out previous
// siblings
if (prevSibling && frameItems.NotEmpty() &&
frameItems.FirstChild()->GetParent() != prevSibling->GetParent()) {
#ifdef DEBUG
nsIFrame* frame1 = frameItems.FirstChild()->GetParent();
nsIFrame* frame2 = prevSibling->GetParent();
NS_ASSERTION(!IsFramePartOfIBSplit(frame1) &&
!IsFramePartOfIBSplit(frame2),
"Neither should be ib-split");
NS_ASSERTION((frame1->IsTableFrame() &&
frame2->IsTableWrapperFrame()) ||
(frame1->IsTableWrapperFrame() &&
frame2->IsTableFrame()) ||
frame1->IsFieldSetFrame() ||
(frame1->GetParent() &&
frame1->GetParent()->IsFieldSetFrame()),
"Unexpected frame types");
#endif
isAppend = true;
nsIFrame* appendAfterFrame;
insertion.mParentFrame =
::AdjustAppendParentForAfterContent(this, container,
frameItems.FirstChild()->GetParent(),
aStartChild, &appendAfterFrame);
prevSibling = ::FindAppendPrevSibling(insertion.mParentFrame, appendAfterFrame);
}
if (haveFirstLineStyle && insertion.mParentFrame == containingBlock && isAppend) {
// It's possible that the new frame goes into a first-line
// frame. Look at it and see...