Bug 881832 - When flushing changes made by :hover style, make sure we also flush any pending changes on child documents. r=dbaron

This commit is contained in:
Matt Woodrow 2016-05-12 12:06:38 +12:00
Родитель 58b82b3f90
Коммит 0949e08117
1 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -3647,6 +3647,16 @@ PresShell::ScheduleViewManagerFlush(PaintType aType)
}
}
bool
FlushLayoutRecursive(nsIDocument* aDocument,
void* aData = nullptr)
{
MOZ_ASSERT(!aData);
aDocument->EnumerateSubDocuments(FlushLayoutRecursive, nullptr);
aDocument->FlushPendingNotifications(Flush_Layout);
return true;
}
void
PresShell::DispatchSynthMouseMove(WidgetGUIEvent* aEvent,
bool aFlushOnHoverChange)
@ -3671,7 +3681,10 @@ PresShell::DispatchSynthMouseMove(WidgetGUIEvent* aEvent,
hoverGenerationBefore != restyleManager->AsGecko()->GetHoverGeneration()) {
// Flush so that the resulting reflow happens now so that our caller
// can suppress any synthesized mouse moves caused by that reflow.
FlushPendingNotifications(Flush_Layout);
// This code only ever runs for the root document, but :hover changes
// can happen in descendant documents too, so make sure we flush
// all of them.
FlushLayoutRecursive(mDocument);
}
}