Skip to content

Commit

Permalink
[qtmozembed] Fix scroll event pipeline. Fixes JB#37171
Browse files Browse the repository at this point in the history
  • Loading branch information
rainemak committed Dec 11, 2018
1 parent 64c0a96 commit 23b7125
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/qmozview_p.cpp
Expand Up @@ -847,8 +847,13 @@ void QMozViewPrivate::OnTitleChanged(const char16_t *aTitle)
mViewIface->titleChanged();
}

bool QMozViewPrivate::SendAsyncScrollDOMEvent(const gfxRect &aContentRect, const gfxSize &aScrollableSize)
bool QMozViewPrivate::HandleScrollEvent(bool aIsRootScrollFrame, const gfxRect &aContentRect, const gfxSize &aScrollableSize)
{
// aIsRootScrollFrame makes it possible to handle chrome gesture also in case that we have
// an iframe that is of the size of the screen. We may need to add still a scrollable layer id or similar.
if (!aIsRootScrollFrame)
return false;

mContentResolution = contentWindowSize(mMozWindow).width() / aContentRect.width;

if (mContentRect.x() != aContentRect.x || mContentRect.y() != aContentRect.y ||
Expand Down
7 changes: 5 additions & 2 deletions src/qmozview_p.h
Expand Up @@ -17,9 +17,12 @@
#include <QMap>
#include <QSGSimpleTextureNode>
#include <QKeyEvent>

#include <mozilla/embedlite/EmbedLiteView.h>
#include <Units.h>

#include "qmozwindow.h"
#include "qmozscrolldecorator.h"
#include "mozilla/embedlite/EmbedLiteView.h"
#include "qmozview_templated_wrapper.h"
#include "qmozview_defined_wrapper.h"

Expand Down Expand Up @@ -64,7 +67,7 @@ class QMozViewPrivate : public QObject,
bool HandleLongTap(const nsIntPoint &aPoint) override;
bool HandleSingleTap(const nsIntPoint &aPoint) override;
bool HandleDoubleTap(const nsIntPoint &aPoint) override;
bool SendAsyncScrollDOMEvent(const gfxRect &aContentRect, const gfxSize &aScrollableSize) override;
bool HandleScrollEvent(bool aIsRootScrollFrame, const gfxRect &aContentRect, const gfxSize &aScrollableSize) override;

void SetMargins(const QMargins &margins, bool updateTopBottom);
QColor GetBackgroundColor() const;
Expand Down

0 comments on commit 23b7125

Please sign in to comment.