Bug 1296516 - Cleanup a bit of code in layout/base

* Tidy RestyleManager::ContentStateChanged
* Convert UndisplayedMap to a typed hashtable
* Cleanup infallible or unchecked nsCSSFrameConstructor methods

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-04-17 05:04:10 -04:00 committed by Roy Tam
commit e1195a86e0
13 changed files with 358 additions and 459 deletions

View file

@ -4444,14 +4444,14 @@ PresShell::NotifyCounterStylesAreDirty()
mFrameConstructor->EndUpdate();
}
nsresult
PresShell::ReconstructFrames(void)
void
PresShell::ReconstructFrames()
{
NS_PRECONDITION(!mFrameConstructor->GetRootFrame() || mDidInitialize,
"Must not have root frame before initial reflow");
if (!mDidInitialize || mIsDestroying) {
// Nothing to do here
return NS_OK;
return;
}
nsCOMPtr<nsIPresShell> kungFuDeathGrip(this);
@ -4461,16 +4461,14 @@ PresShell::ReconstructFrames(void)
mDocument->FlushPendingNotifications(Flush_ContentAndNotify);
if (mIsDestroying) {
return NS_OK;
return;
}
nsAutoCauseReflowNotifier crNotifier(this);
mFrameConstructor->BeginUpdate();
nsresult rv = mFrameConstructor->ReconstructDocElementHierarchy();
mFrameConstructor->ReconstructDocElementHierarchy();
VERIFY_STYLE_TREE;
mFrameConstructor->EndUpdate();
return rv;
}
void