Bug 1410226: Properly compute the insertion point for a display: contents child in an XBL binding. r=mats
MozReview-Commit-ID: DzuGDHZEc1A
This commit is contained in:
@@ -7111,29 +7111,25 @@ nsCSSFrameConstructor::GetInsertionPrevSibling(InsertionPoint* aInsertion,
|
||||
nsContainerFrame*
|
||||
nsCSSFrameConstructor::GetContentInsertionFrameFor(nsIContent* aContent)
|
||||
{
|
||||
// Get the primary frame associated with the content
|
||||
nsIFrame* frame = aContent->GetPrimaryFrame();
|
||||
nsIFrame* frame;
|
||||
while (!(frame = aContent->GetPrimaryFrame())) {
|
||||
if (!GetDisplayContentsStyleFor(aContent)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!frame) {
|
||||
if (GetDisplayContentsStyleFor(aContent)) {
|
||||
nsIContent* parent = aContent->GetParent();
|
||||
if (parent && parent == aContent->GetContainingShadow()) {
|
||||
parent = parent->GetBindingParent();
|
||||
}
|
||||
frame = parent ? GetContentInsertionFrameFor(parent) : nullptr;
|
||||
}
|
||||
if (!frame) {
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
// If the content of the frame is not the desired content then this is not
|
||||
// really a frame for the desired content.
|
||||
// XXX This check is needed due to bug 135040. Remove it once that's fixed.
|
||||
if (frame->GetContent() != aContent) {
|
||||
aContent = aContent->GetFlattenedTreeParent();
|
||||
if (!aContent) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// If the content of the frame is not the desired content then this is not
|
||||
// really a frame for the desired content.
|
||||
// XXX This check is needed due to bug 135040. Remove it once that's fixed.
|
||||
if (frame->GetContent() != aContent) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsContainerFrame* insertionFrame = frame->GetContentInsertionFrame();
|
||||
|
||||
NS_ASSERTION(!insertionFrame || insertionFrame == frame || !frame->IsLeaf(),
|
||||
|
||||
Reference in New Issue
Block a user