Bug 1186972, use correct coordinates when comparing mouse position with menu anchor rectangle so that select element popups close properly, r=tn
authorNeil Deakin <neil@mozilla.com>
Mon, 10 Aug 2015 08:31:37 -0400
changeset 289666 fd0e8165c50f8b58e50d59b7abb629cdb62beb72
parent 289665 5dffd92d792de2ab1c2fef316b3eae2dccf253ef
child 289667 acf0df12b9e310ccd71f372c508a49bd7b55713b
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs1186972
milestone42.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 1186972, use correct coordinates when comparing mouse position with menu anchor rectangle so that select element popups close properly, r=tn
layout/xul/nsXULPopupManager.cpp
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -258,17 +258,20 @@ nsXULPopupManager::Rollup(uint32_t aCoun
           }
         }
       }
 
       // It's possible that some other element is above the anchor at the same
       // position, but the only thing that would happen is that the mouse
       // event will get consumed, so here only a quick coordinates check is
       // done rather than a slower complete check of what is at that location.
-      if (anchorRect.Contains(*pos)) {
+      nsPresContext* presContext = item->Frame()->PresContext();
+      nsIntPoint posCSSPixels(presContext->DevPixelsToIntCSSPixels(pos->x),
+                              presContext->DevPixelsToIntCSSPixels(pos->y));
+      if (anchorRect.Contains(posCSSPixels)) {
         if (consumeResult == ConsumeOutsideClicks_ParentOnly) {
           consume = true;
         }
 
         if (noRollupOnAnchor) {
           rollup = false;
         }
       }