Bug 1116586 - Fix hit region for items with rounded corners. r=tn
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 21 Jan 2015 09:16:38 -0500
changeset 242418 c248261b202ef31ec0d0b135f690cc75946f9113
parent 242417 4ac07f1f29981038b4214ef790c1d14a8482c16f
child 242419 702470bd03ec1cb651c62106f212ba530fb27a5a
push id7677
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 18:11:24 +0000
treeherdermozilla-aurora@f531d838c055 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs1116586
milestone38.0a1
Bug 1116586 - Fix hit region for items with rounded corners. r=tn
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -2338,21 +2338,24 @@ ContainerState::PopPaintedLayerData()
       nsRegion* dest = isPrecise ? &containingPaintedLayerData->mHitRegion
                                  : &containingPaintedLayerData->mMaybeHitRegion;
       dest->Or(*dest, rect);
     }
   } else {
     EventRegions regions;
     regions.mHitRegion = ScaleRegionToOutsidePixels(data->mHitRegion);
     // Points whose hit-region status we're not sure about need to be dispatched
-    // to the content thread.
+    // to the content thread. If a point is in both maybeHitRegion and hitRegion
+    // then it's not a "maybe" any more, and doesn't go into the dispatch-to-
+    // content region.
     nsIntRegion maybeHitRegion = ScaleRegionToOutsidePixels(data->mMaybeHitRegion);
     regions.mDispatchToContentHitRegion.Sub(maybeHitRegion, regions.mHitRegion);
-    regions.mDispatchToContentHitRegion.Or(regions.mDispatchToContentHitRegion,
-                                           ScaleRegionToOutsidePixels(data->mDispatchToContentHitRegion));
+    regions.mDispatchToContentHitRegion.OrWith(
+        ScaleRegionToOutsidePixels(data->mDispatchToContentHitRegion));
+    regions.mHitRegion.OrWith(maybeHitRegion);
 
     nsIntPoint translation = -GetTranslationForPaintedLayer(data->mLayer);
     regions.mHitRegion.MoveBy(translation);
     regions.mDispatchToContentHitRegion.MoveBy(translation);
 
     layer->SetEventRegions(regions);
   }