Bug 1149035 - Make nsXULPopupManager::PopupResized take a LayoutDeviceIntSize param instead of a unit-less nsIntSize. r=roc
authorMats Palmgren <mats@mozilla.com>
Mon, 30 Mar 2015 11:36:01 -0400
changeset 267997 38834d4db03b146302d446a4186fe96e0059c19b
parent 267996 8d765f8afe2fbcf3b761c9e921c9c42a2c65c5c1
child 267998 0973f08337c46e69b8a822b23179873b905e0d60
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1149035
milestone39.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 1149035 - Make nsXULPopupManager::PopupResized take a LayoutDeviceIntSize param instead of a unit-less nsIntSize. r=roc
layout/xul/nsXULPopupManager.cpp
layout/xul/nsXULPopupManager.h
view/nsView.cpp
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -466,17 +466,17 @@ nsXULPopupManager::PopupMoved(nsIFrame* 
     nsPresContext* presContext = menuPopupFrame->PresContext();
     aPnt.x = presContext->DevPixelsToIntCSSPixels(aPnt.x);
     aPnt.y = presContext->DevPixelsToIntCSSPixels(aPnt.y);
     menuPopupFrame->MoveTo(aPnt.x, aPnt.y, false);
   }
 }
 
 void
-nsXULPopupManager::PopupResized(nsIFrame* aFrame, nsIntSize aSize)
+nsXULPopupManager::PopupResized(nsIFrame* aFrame, LayoutDeviceIntSize aSize)
 {
   nsMenuPopupFrame* menuPopupFrame = GetPopupToMoveOrResize(aFrame);
   if (!menuPopupFrame)
     return;
 
   nsView* view = menuPopupFrame->GetView();
   if (!view)
     return;
@@ -485,18 +485,18 @@ nsXULPopupManager::PopupResized(nsIFrame
   // If the size is what we think it is, we have nothing to do.
   if (curDevSize.width == aSize.width && curDevSize.height == aSize.height)
     return;
 
   // The size is different. Convert the actual size to css pixels and store it
   // as 'width' and 'height' attributes on the popup.
   nsPresContext* presContext = menuPopupFrame->PresContext();
 
-  nsIntSize newCSS(presContext->DevPixelsToIntCSSPixels(aSize.width),
-                   presContext->DevPixelsToIntCSSPixels(aSize.height));
+  CSSIntSize newCSS(presContext->DevPixelsToIntCSSPixels(aSize.width),
+                    presContext->DevPixelsToIntCSSPixels(aSize.height));
 
   nsIContent* popup = menuPopupFrame->GetContent();
   nsAutoString width, height;
   width.AppendInt(newCSS.width);
   height.AppendInt(newCSS.height);
   popup->SetAttr(kNameSpaceID_None, nsGkAtoms::width, width, false);
   popup->SetAttr(kNameSpaceID_None, nsGkAtoms::height, height, true);
 }
--- a/layout/xul/nsXULPopupManager.h
+++ b/layout/xul/nsXULPopupManager.h
@@ -19,16 +19,17 @@
 #include "nsTArray.h"
 #include "nsIObserver.h"
 #include "nsITimer.h"
 #include "nsIReflowCallback.h"
 #include "nsThreadUtils.h"
 #include "nsStyleConsts.h"
 #include "nsWidgetInitData.h"
 #include "mozilla/Attributes.h"
+#include "Units.h"
 
 // X.h defines KeyPress
 #ifdef KeyPress
 #undef KeyPress
 #endif
 
 /**
  * There are two types that are used:
@@ -526,19 +527,19 @@ public:
   /**
    * Indicate that the popup associated with aView has been moved to the
    * specified screen coordiates.
    */
   void PopupMoved(nsIFrame* aFrame, nsIntPoint aPoint);
 
   /**
    * Indicate that the popup associated with aView has been resized to the
-   * specified screen width and height.
+   * given device pixel size aSize.
    */
-  void PopupResized(nsIFrame* aFrame, nsIntSize ASize);
+  void PopupResized(nsIFrame* aFrame, mozilla::LayoutDeviceIntSize aSize);
 
   /**
    * Called when a popup frame is destroyed. In this case, just remove the
    * item and later popups from the list. No point going through HidePopup as
    * the frames have gone away.
    */
   void PopupDestroyed(nsMenuPopupFrame* aFrame);
 
--- a/view/nsView.cpp
+++ b/view/nsView.cpp
@@ -994,17 +994,17 @@ nsView::WindowResized(nsIWidget* aWidget
       }
     }
 
     return true;
   }
   else if (IsPopupWidget(aWidget)) {
     nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
     if (pm) {
-      pm->PopupResized(mFrame, nsIntSize(aWidth, aHeight));
+      pm->PopupResized(mFrame, LayoutDeviceIntSize(aWidth, aHeight));
       return true;
     }
   }
 
   return false;
 }
 
 bool