Bug 919355 - Part 2: Don't #include nsDeviceContext.h in Units.h; r=roc

This commit is contained in:
Ehsan Akhgari 2013-09-23 07:55:35 -04:00
parent 5dc78a019a
commit 39c223b372
13 changed files with 17 additions and 7 deletions

View File

@ -14,6 +14,7 @@
#include "nsFontMetrics.h"
#include "nsLayoutUtils.h"
#include "HyperTextAccessible.h"
#include "mozilla/AppUnits.h"
using namespace mozilla;
using namespace mozilla::a11y;
@ -504,7 +505,7 @@ TextAttrsMgr::FontSizeTextAttr::
//
// XXX todo: consider sharing this code with layout module? (bug 474621)
float px =
NSAppUnitsToFloatPixels(aValue, nsDeviceContext::AppUnitsPerCSSPixel());
NSAppUnitsToFloatPixels(aValue, mozilla::AppUnitsPerCSSPixel());
// Each pt is 4/3 of a CSS pixel.
int pts = NS_lround(px*3/4);

View File

@ -23,6 +23,7 @@
#include "nsDOMEventTargetHelper.h"
#include "nsPIWindowRoot.h"
#include "nsGlobalWindow.h"
#include "nsDeviceContext.h"
using namespace mozilla;
using namespace mozilla::dom;

View File

@ -12,7 +12,8 @@
#include "nsLayoutUtils.h"
#include "nsEvent.h"
#include "mozilla/dom/UIEventBinding.h"
#include "Units.h"
#include "nsPresContext.h"
#include "nsDeviceContext.h"
class nsDOMUIEvent : public nsDOMEvent,
public nsIDOMUIEvent

View File

@ -13,6 +13,7 @@
#include "nsDOMEvent.h"
#include "nsJSUtils.h"
#include "mozilla/dom/ScreenBinding.h"
#include "nsDeviceContext.h"
using namespace mozilla;
using namespace mozilla::dom;

View File

@ -9,7 +9,7 @@
#include <stdint.h>
namespace mozilla {
static int32_t AppUnitsPerCSSPixel() { return 60; }
static int32_t AppUnitsPerCSSInch() { return 96 * AppUnitsPerCSSPixel(); }
inline int32_t AppUnitsPerCSSPixel() { return 60; }
inline int32_t AppUnitsPerCSSInch() { return 96 * AppUnitsPerCSSPixel(); }
}
#endif /* _NS_APPUNITS_H_ */

View File

@ -12,6 +12,7 @@
#include "nsPrintfCString.h"
#include "mozilla/dom/Element.h"
#include "nsRegion.h"
#include "nsDeviceContext.h"
#include <algorithm>
namespace mozilla {

View File

@ -10,7 +10,6 @@
#include "mozilla/gfx/Point.h"
#include "mozilla/gfx/Rect.h"
#include "mozilla/gfx/ScaleFactor.h"
#include "nsDeviceContext.h"
#include "nsRect.h"
#include "nsMargin.h"
#include "mozilla/AppUnits.h"

View File

@ -9,6 +9,7 @@
#include "nsIDOMHTMLInputElement.h"
#include "nsEventStateManager.h"
#include "mozilla/LookAndFeel.h"
#include "nsDeviceContext.h"
using namespace mozilla;

View File

@ -24,6 +24,7 @@ class nsIScrollPositionListener;
class nsIFrame;
class nsPresContext;
class nsIContent;
class nsRenderingContext;
/**
* Interface for frames that are scrollable. This interface exposes

View File

@ -21,6 +21,7 @@
#include "gfxFontConstants.h"
#include "nsPresContext.h"
#include "imgRequestProxy.h"
#include "nsDeviceContext.h"
namespace css = mozilla::css;

View File

@ -43,6 +43,7 @@
#include "mozilla/dom/Element.h"
#include "prtime.h"
#include "nsWrapperCacheInlines.h"
#include "mozilla/AppUnits.h"
#include <algorithm>
using namespace mozilla;
@ -1094,7 +1095,7 @@ nsComputedDOMStyle::DoGetTransform()
mStyleContextHolder->PresContext(),
dummy,
bounds,
float(nsDeviceContext::AppUnitsPerCSSPixel()));
float(mozilla::AppUnitsPerCSSPixel()));
return MatrixToCSSValue(matrix);
}

View File

@ -15,6 +15,7 @@
#include "mozilla/LookAndFeel.h"
#endif
#include "nsCSSRuleProcessor.h"
#include "nsDeviceContext.h"
using namespace mozilla;

View File

@ -15,6 +15,7 @@
#include "nsMenuPopupFrame.h"
#include "nsClientRect.h"
#include "nsView.h"
#include "mozilla/AppUnits.h"
class nsPopupBoxObject : public nsBoxObject,
public nsIPopupBoxObject
@ -363,7 +364,7 @@ nsPopupBoxObject::GetAlignmentOffset(int32_t *aAlignmentOffset)
if (!menuPopupFrame)
return NS_OK;
int32_t pp = nsDeviceContext::AppUnitsPerCSSPixel();
int32_t pp = mozilla::AppUnitsPerCSSPixel();
// Note that the offset might be along either the X or Y axis, but for the
// sake of simplicity we use a point with only the X axis set so we can
// use ToNearestPixels().