[layout] Ensure we set the primary frame for native anon content where needed.

This commit is contained in:
Moonchild 2021-07-15 04:11:48 +00:00 committed by roytam1
commit a0ee1f3c0d

View file

@ -3463,8 +3463,10 @@ nsCSSFrameConstructor::ConstructTextFrame(const FrameConstructionData* aData,
// Add the newly constructed frame to the flow
aFrameItems.AddChild(newFrame);
if (!aState.mCreatingExtraFrames)
if (!aState.mCreatingExtraFrames ||
(aContent->IsInNativeAnonymousSubtree() && !aContent->GetPrimaryFrame())) {
aContent->SetPrimaryFrame(newFrame);
}
}
/* static */