mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1039818 - Extract the implementation of nsIDOMWindowUtils::GetResolution into nsLayoutUtils. r=ehsan
This commit is contained in:
parent
61617910aa
commit
74e65ccce9
@ -541,12 +541,7 @@ nsDOMWindowUtils::GetResolution(float* aResolution)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable();
|
||||
if (sf) {
|
||||
*aResolution = sf->GetResolution();
|
||||
} else {
|
||||
*aResolution = presShell->GetResolution();
|
||||
}
|
||||
*aResolution = nsLayoutUtils::GetResolution(presShell);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -7989,6 +7989,16 @@ nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(nsIPresShell* aShell)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* static */ float
|
||||
nsLayoutUtils::GetResolution(nsIPresShell* aPresShell)
|
||||
{
|
||||
nsIScrollableFrame* sf = aPresShell->GetRootScrollFrameAsScrollable();
|
||||
if (sf) {
|
||||
return sf->GetResolution();
|
||||
}
|
||||
return aPresShell->GetResolution();
|
||||
}
|
||||
|
||||
/* static */ uint32_t
|
||||
nsLayoutUtils::GetTouchActionFromFrame(nsIFrame* aFrame)
|
||||
{
|
||||
|
@ -2577,6 +2577,12 @@ public:
|
||||
static bool HasApzAwareListeners(mozilla::EventListenerManager* aElm);
|
||||
static bool HasDocumentLevelListenersForApzAwareEvents(nsIPresShell* aShell);
|
||||
|
||||
/**
|
||||
* Get the resolution at which rescalable web content is drawn
|
||||
* (see nsIDOMWindowUtils.getResolution).
|
||||
*/
|
||||
static float GetResolution(nsIPresShell* aPresShell);
|
||||
|
||||
private:
|
||||
static uint32_t sFontSizeInflationEmPerLine;
|
||||
static uint32_t sFontSizeInflationMinTwips;
|
||||
|
Loading…
Reference in New Issue
Block a user