From a0ee1f3c0d9f17479e0688f1706353293261e46b Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 15 Jul 2021 04:11:48 +0000 Subject: [PATCH] [layout] Ensure we set the primary frame for native anon content where needed. --- layout/base/nsCSSFrameConstructor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 25a5e58108..df793c67f8 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -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 */