mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 914847. Use a mini-flush instead of a full style flush. r=dbaron
This commit is contained in:
parent
cdb5d5c27b
commit
c22d18150e
@ -6203,6 +6203,20 @@ nsIFrame* GetNearestFrameContainingPresShell(nsIPresShell* aPresShell)
|
||||
return frame;
|
||||
}
|
||||
|
||||
static bool
|
||||
FlushThrottledStyles(nsIDocument *aDocument, void *aData)
|
||||
{
|
||||
nsIPresShell* shell = aDocument->GetShell();
|
||||
if (shell && shell->IsVisible()) {
|
||||
nsPresContext* presContext = shell->GetPresContext();
|
||||
if (presContext) {
|
||||
presContext->TransitionManager()->UpdateAllThrottledStyles();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
WidgetGUIEvent* aEvent,
|
||||
@ -6299,14 +6313,21 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
|
||||
nsIFrame* frame = aFrame;
|
||||
|
||||
if (aEvent->eventStructType == NS_TOUCH_EVENT) {
|
||||
nsIDocument::UnlockPointer();
|
||||
FlushPendingNotifications(Flush_Layout);
|
||||
frame = GetNearestFrameContainingPresShell(this);
|
||||
}
|
||||
|
||||
bool dispatchUsingCoordinates = aEvent->IsUsingCoordinates();
|
||||
if (dispatchUsingCoordinates) {
|
||||
if (nsLayoutUtils::AreAsyncAnimationsEnabled() && mDocument) {
|
||||
if (aEvent->eventStructType == NS_TOUCH_EVENT) {
|
||||
nsIDocument::UnlockPointer();
|
||||
}
|
||||
|
||||
{ // scope for scriptBlocker.
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
GetRootPresShell()->GetDocument()->
|
||||
EnumerateSubDocuments(FlushThrottledStyles, nullptr);
|
||||
}
|
||||
frame = GetNearestFrameContainingPresShell(this);
|
||||
}
|
||||
|
||||
NS_WARN_IF_FALSE(frame, "Nothing to handle this event!");
|
||||
if (!frame)
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user