mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 758179. Part 1: Flush layout before calling nsFrame::HandlePress/HandleRelease. r=mats
This commit is contained in:
parent
cde3e8ec6a
commit
c35029e3ba
@ -462,6 +462,15 @@ public:
|
||||
virtual void HandleEvent(nsEventChainPostVisitor& aVisitor)
|
||||
{
|
||||
if (aVisitor.mPresContext && aVisitor.mEvent->eventStructType != NS_EVENT) {
|
||||
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN ||
|
||||
aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP) {
|
||||
// Mouse-up and mouse-down events call nsFrame::HandlePress/Release
|
||||
// which call GetContentOffsetsFromPoint which requires up-to-date layout.
|
||||
// Bring layout up-to-date now so that GetCurrentEventFrame() below
|
||||
// will return a real frame and we don't have to worry about
|
||||
// destroying it by flushing later.
|
||||
mPresShell->FlushPendingNotifications(Flush_Layout);
|
||||
}
|
||||
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
|
||||
if (frame) {
|
||||
frame->HandleEvent(aVisitor.mPresContext,
|
||||
|
Loading…
Reference in New Issue
Block a user