Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-04-17 07:29:57 -04:00 committed by Roy Tam
commit ca09afd0b0
30 changed files with 206 additions and 44 deletions

View file

@ -3521,6 +3521,18 @@ Selection::GetParentObject() const
return nullptr;
}
DocGroup*
Selection::GetDocGroup() const
{
nsIPresShell* shell = GetPresShell();
if (!shell) {
return nullptr;
}
nsIDocument* doc = shell->GetDocument();
return doc ? doc->GetDocGroup() : nullptr;
}
NS_IMPL_CYCLE_COLLECTION_CLASS(Selection)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Selection)