Bug 1215434 part.2 Add plugin frame rect to dispatch-to-content region if it wants to handle wheel event as default action r=mstange

This commit is contained in:
Masayuki Nakano 2015-10-17 15:50:09 +09:00
parent 07adf60de2
commit f28a82b6bc

View File

@ -72,6 +72,7 @@
#include "nsDOMTokenList.h"
#include "mozilla/RuleNodeCacheConditions.h"
#include "nsCSSProps.h"
#include "nsPluginFrame.h"
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
// GetTickCount().
@ -3215,6 +3216,13 @@ nsDisplayLayerEventRegions::AddFrame(nsDisplayListBuilder* aBuilder,
}
if (aBuilder->GetAncestorHasApzAwareEventHandler()) {
mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, borderBox);
} else if (aFrame->GetType() == nsGkAtoms::objectFrame) {
// If the frame is a plugin frame and wants to handle wheel events as
// default action, we should add the frame to dispatch-to-content region.
nsPluginFrame* pluginFrame = do_QueryFrame(aFrame);
if (pluginFrame && pluginFrame->WantsToHandleWheelEventAsDefaultAction()) {
mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, borderBox);
}
}
// Touch action region