Bug 1413619 - Fix insertion point computation when display: contents pseudos are involved.

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-04-17 07:20:06 -04:00 committed by Roy Tam
commit 5b1452e120
10 changed files with 192 additions and 243 deletions

View file

@ -1587,33 +1587,6 @@ nsLayoutUtils::GetFloatFromPlaceholder(nsIFrame* aFrame) {
return nullptr;
}
// static
bool
nsLayoutUtils::IsGeneratedContentFor(nsIContent* aContent,
nsIFrame* aFrame,
nsIAtom* aPseudoElement)
{
NS_PRECONDITION(aFrame, "Must have a frame");
NS_PRECONDITION(aPseudoElement, "Must have a pseudo name");
if (!aFrame->IsGeneratedContentFrame()) {
return false;
}
nsIFrame* parent = aFrame->GetParent();
NS_ASSERTION(parent, "Generated content can't be root frame");
if (parent->IsGeneratedContentFrame()) {
// Not the root of the generated content
return false;
}
if (aContent && parent->GetContent() != aContent) {
return false;
}
return (aFrame->GetContent()->NodeInfo()->NameAtom() == nsGkAtoms::mozgeneratedcontentbefore) ==
(aPseudoElement == nsCSSPseudoElements::before);
}
// static
nsIFrame*
nsLayoutUtils::GetCrossDocParentFrame(const nsIFrame* aFrame,