From 1aeda3bb8d2ec0363e9f0961e7f37d9f1f2b1a12 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 30 Mar 2015 11:36:01 -0400 Subject: [PATCH] Bug 1149035 - Make nsXULPopupManager::PopupResized take a LayoutDeviceIntSize param instead of a unit-less nsIntSize. r=roc --- layout/xul/nsXULPopupManager.cpp | 6 +++--- layout/xul/nsXULPopupManager.h | 5 +++-- view/nsView.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/layout/xul/nsXULPopupManager.cpp b/layout/xul/nsXULPopupManager.cpp index 910e3bb1c2b2..b4e05a0804a2 100644 --- a/layout/xul/nsXULPopupManager.cpp +++ b/layout/xul/nsXULPopupManager.cpp @@ -471,7 +471,7 @@ nsXULPopupManager::PopupMoved(nsIFrame* aFrame, nsIntPoint aPnt) } void -nsXULPopupManager::PopupResized(nsIFrame* aFrame, nsIntSize aSize) +nsXULPopupManager::PopupResized(nsIFrame* aFrame, LayoutDeviceIntSize aSize) { nsMenuPopupFrame* menuPopupFrame = GetPopupToMoveOrResize(aFrame); if (!menuPopupFrame) @@ -490,8 +490,8 @@ nsXULPopupManager::PopupResized(nsIFrame* aFrame, nsIntSize aSize) // 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; diff --git a/layout/xul/nsXULPopupManager.h b/layout/xul/nsXULPopupManager.h index c01d0e020d5a..fb4a28954ff6 100644 --- a/layout/xul/nsXULPopupManager.h +++ b/layout/xul/nsXULPopupManager.h @@ -24,6 +24,7 @@ #include "nsStyleConsts.h" #include "nsWidgetInitData.h" #include "mozilla/Attributes.h" +#include "Units.h" // X.h defines KeyPress #ifdef KeyPress @@ -531,9 +532,9 @@ public: /** * 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 diff --git a/view/nsView.cpp b/view/nsView.cpp index 74bed3e126e7..db179b432c0d 100644 --- a/view/nsView.cpp +++ b/view/nsView.cpp @@ -999,7 +999,7 @@ nsView::WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight) else if (IsPopupWidget(aWidget)) { nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); if (pm) { - pm->PopupResized(mFrame, nsIntSize(aWidth, aHeight)); + pm->PopupResized(mFrame, LayoutDeviceIntSize(aWidth, aHeight)); return true; } }