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
authorMasayuki Nakano <masayuki@d-toybox.com>
Sat, 17 Oct 2015 15:50:09 +0900
changeset 268142 380f6425759c35716dd0382859c8a15b74f186b8
parent 268141 e99568ffca32090c9a761240d85c9a7ae033e348
child 268143 108585f1f680f621e58db5fa0c1560867b9673f7
push id66719
push usermasayuki@d-toybox.com
push dateSat, 17 Oct 2015 06:50:19 +0000
treeherdermozilla-inbound@380f6425759c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1215434
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -67,16 +67,17 @@
 #include "FrameLayerBuilder.h"
 #include "mozilla/EventStateManager.h"
 #include "RestyleManager.h"
 #include "nsCaret.h"
 #include "nsISelection.h"
 #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().
 #ifdef GetCurrentTime
 #undef GetCurrentTime
 #endif
 
 using namespace mozilla;
@@ -3210,16 +3211,23 @@ nsDisplayLayerEventRegions::AddFrame(nsD
   if (borderBoxHasRoundedCorners ||
       (aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT)) {
     mMaybeHitRegion.Or(mMaybeHitRegion, borderBox);
   } else {
     mHitRegion.Or(mHitRegion, borderBox);
   }
   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
 
   uint32_t touchAction = nsLayoutUtils::GetTouchActionFromFrame(aFrame);
   if (touchAction & NS_STYLE_TOUCH_ACTION_NONE) {
     mNoActionRegion.Or(mNoActionRegion, borderBox);
   } else {