Bug 1324619 part 2. Stop unnecessarily trying to reparent the style contexts of our kids in nsFirstLetterFrame::SetInitialChildList. r?emilio
The style contexts are already correct here; the frame constructor ensures that.
MozReview-Commit-ID: CWO225MB6Pe
--- a/layout/generic/nsFirstLetterFrame.cpp
+++ b/layout/generic/nsFirstLetterFrame.cpp
@@ -72,22 +72,22 @@ nsFirstLetterFrame::Init(nsIContent*
}
void
nsFirstLetterFrame::SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList)
{
MOZ_ASSERT(aListID == kPrincipalList, "Principal child list is the only "
"list that nsFirstLetterFrame should set via this function");
- RestyleManager* restyleManager = PresContext()->RestyleManager();
-
- for (nsFrameList::Enumerator e(aChildList); !e.AtEnd(); e.Next()) {
- NS_ASSERTION(e.get()->GetParent() == this, "Unexpected parent");
- restyleManager->ReparentStyleContext(e.get());
- nsLayoutUtils::MarkDescendantsDirty(e.get());
+ for (nsIFrame* f : aChildList) {
+ MOZ_ASSERT(f->GetParent() == this, "Unexpected parent");
+ MOZ_ASSERT(f->IsTextFrame(), "We should not have kids that are containers!");
+ MOZ_ASSERT_IF(f->StyleContext()->IsGecko(),
+ f->StyleContext()->AsGecko()->GetParent() == StyleContext());
+ nsLayoutUtils::MarkDescendantsDirty(f); // Drops cached textruns
}
mFrames.SetFrames(aChildList);
}
nsresult
nsFirstLetterFrame::GetChildFrameContainingOffset(int32_t inContentOffset,
bool inHint,