mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-20 22:27:31 +09:00
Bug 1343879 - Be consistent about the parent style context the document-level anonymous content container should get: it should get no parent style context.
Tag #1375
This commit is contained in:
parent
484b481031
commit
87bc2cab4e
1 changed files with 15 additions and 9 deletions
|
|
@ -10751,16 +10751,22 @@ nsCSSFrameConstructor::AddFCItemsForAnonymousContent(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inheritFrame->GetType() == nsGkAtoms::canvasFrame) {
|
nsIFrame* styleParentFrame =
|
||||||
// CorrectStyleParentFrame returns nullptr if the prospective parent is
|
nsFrame::CorrectStyleParentFrame(inheritFrame, pseudo);
|
||||||
// the canvas frame, so avoid calling it in that situation.
|
// The only way we can not have a style parent now is if inheritFrame is the
|
||||||
} else {
|
// canvas frame and we're the NAC parent for all the things added via
|
||||||
inheritFrame = nsFrame::CorrectStyleParentFrame(inheritFrame, pseudo);
|
// nsIDocument::InsertAnonymousContent.
|
||||||
}
|
MOZ_ASSERT_IF(!styleParentFrame,
|
||||||
Element* originating = pseudo ? inheritFrame->GetContent()->AsElement() : nullptr;
|
inheritFrame->GetType() == nsGkAtoms::canvasFrame);
|
||||||
|
// And that anonymous div has no pseudo.
|
||||||
|
MOZ_ASSERT_IF(!styleParentFrame, !pseudo);
|
||||||
|
|
||||||
|
Element* originating =
|
||||||
|
pseudo ? styleParentFrame->GetContent()->AsElement() : nullptr;
|
||||||
|
nsStyleContext* parentStyle =
|
||||||
|
styleParentFrame ? styleParentFrame->StyleContext() : nullptr;
|
||||||
styleContext =
|
styleContext =
|
||||||
ResolveStyleContext(inheritFrame->StyleContext(), content, &aState, originating);
|
ResolveStyleContext(parentStyle, content, &aState, originating);
|
||||||
|
|
||||||
nsTArray<nsIAnonymousContentCreator::ContentInfo>* anonChildren = nullptr;
|
nsTArray<nsIAnonymousContentCreator::ContentInfo>* anonChildren = nullptr;
|
||||||
if (!aAnonymousItems[i].mChildren.IsEmpty()) {
|
if (!aAnonymousItems[i].mChildren.IsEmpty()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue