Bug 1137944 - Add plugin window handling for apz related notifications received by the content process. r=mstange

This commit is contained in:
Jim Mathies 2015-10-06 14:23:25 -05:00
Родитель ff9bcb2aec
Коммит 51bda23522
3 изменённых файлов: 13 добавлений и 6 удалений

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

@ -1854,7 +1854,7 @@ ScrollFrameHelper::ScrollFrameHelper(nsContainerFrame* aOuter,
, mTransformingByAPZ(false)
, mZoomableByAPZ(false)
, mVelocityQueue(aOuter->PresContext())
, mAsyncScrollEvent(END)
, mAsyncScrollEvent(END_DOM)
{
if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0) {
mScrollbarActivity = new ScrollbarActivity(do_QueryFrame(aOuter));
@ -1961,7 +1961,7 @@ ScrollFrameHelper::AsyncScrollCallback(ScrollFrameHelper* aInstance,
void
ScrollFrameHelper::CompleteAsyncScroll(const nsRect &aRange, nsIAtom* aOrigin)
{
NotifyPluginFrames(END);
NotifyPluginFrames(END_DOM);
// Apply desired destination range since this is the last step of scrolling.
mAsyncSmoothMSDScroll = nullptr;
@ -2001,10 +2001,15 @@ ScrollFrameHelper::NotifyPluginFrames(AsyncScrollEventType aEvent)
return;
}
if (XRE_IsContentProcess()) {
// Ignore 'inner' dom events triggered by apz transformations
if (mAsyncScrollEvent == BEGIN_APZ && aEvent != END_APZ) {
return;
}
if (aEvent != mAsyncScrollEvent) {
nsPresContext* presContext = mOuter->PresContext();
bool begin = (aEvent == BEGIN_APZ || aEvent == BEGIN_DOM);
presContext->Document()->EnumerateActivityObservers(NotifyPluginFramesCallback,
(void*)(aEvent == BEGIN));
(void*)begin);
mAsyncScrollEvent = aEvent;
}
}
@ -2165,7 +2170,7 @@ ScrollFrameHelper::ScrollToWithOrigin(nsPoint aScrollPosition,
mAsyncScroll->mIsSmoothScroll = isSmoothScroll;
if (isSmoothScroll) {
NotifyPluginFrames(BEGIN);
NotifyPluginFrames(BEGIN_DOM);
mAsyncScroll->InitSmoothScroll(now, mDestination, aOrigin, range, currentVelocity);
} else {
mAsyncScroll->Init(range);

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

@ -360,6 +360,8 @@ public:
// because we have special behaviour for it when APZ scrolling is active.
mOuter->SchedulePaint();
}
// Update windowed plugin visibility in response to apz scrolling events.
NotifyPluginFrames(aTransforming ? BEGIN_APZ : END_APZ);
}
bool IsTransformingByAPZ() const {
return mTransformingByAPZ;
@ -562,7 +564,7 @@ protected:
* Helper that notifies plugins about async smooth scroll operations managed
* by nsGfxScrollFrame.
*/
enum AsyncScrollEventType { BEGIN, END };
enum AsyncScrollEventType { BEGIN_DOM, BEGIN_APZ, END_DOM, END_APZ };
void NotifyPluginFrames(AsyncScrollEventType aEvent);
AsyncScrollEventType mAsyncScrollEvent;

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

@ -201,7 +201,7 @@ public:
void SetInstanceOwner(nsPluginInstanceOwner* aOwner);
/**
* Helper for hiding windowed plugins during non-apz scroll operations.
* Helper for hiding windowed plugins during async scroll operations.
*/
void SetScrollVisibility(bool aState);