mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1686728 - Make nsCheckboxRadioFrame::GetUsableScreenRect a static function for its only consumer. r=layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D101777
This commit is contained in:
parent
7b6d28bc4a
commit
3168235844
@ -9,9 +9,7 @@
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
#include "mozilla/LookAndFeel.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "nsDeviceContext.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
||||
@ -151,18 +149,3 @@ nsresult nsCheckboxRadioFrame::SetFormProperty(nsAtom* aName,
|
||||
const nsAString& aValue) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// static
|
||||
nsRect nsCheckboxRadioFrame::GetUsableScreenRect(nsPresContext* aPresContext) {
|
||||
nsRect screen;
|
||||
|
||||
nsDeviceContext* context = aPresContext->DeviceContext();
|
||||
int32_t dropdownCanOverlapOSBar =
|
||||
LookAndFeel::GetInt(LookAndFeel::IntID::MenusCanOverlapOSBar, 0);
|
||||
if (dropdownCanOverlapOSBar)
|
||||
context->GetRect(screen);
|
||||
else
|
||||
context->GetClientRect(screen);
|
||||
|
||||
return screen;
|
||||
}
|
||||
|
@ -83,12 +83,6 @@ class nsCheckboxRadioFrame final : public nsAtomicContainerFrame,
|
||||
virtual nsresult SetFormProperty(nsAtom* aName,
|
||||
const nsAString& aValue) override;
|
||||
|
||||
/**
|
||||
* Returns the usable screen rect in app units, eg the rect where we can
|
||||
* draw dropdowns.
|
||||
*/
|
||||
static nsRect GetUsableScreenRect(nsPresContext* aPresContext);
|
||||
|
||||
protected:
|
||||
virtual ~nsCheckboxRadioFrame();
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/PathHelpers.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsDeviceContext.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsCheckboxRadioFrame.h"
|
||||
#include "nsGkAtoms.h"
|
||||
@ -534,6 +535,22 @@ class nsAsyncResize : public Runnable {
|
||||
WeakFrame mFrame;
|
||||
};
|
||||
|
||||
// Returns the usable screen rect in app units, the rect where we can
|
||||
// draw the dropdown.
|
||||
static nsRect GetUsableScreenRect(nsPresContext* aPresContext) {
|
||||
nsRect screen;
|
||||
|
||||
nsDeviceContext* context = aPresContext->DeviceContext();
|
||||
int32_t dropdownCanOverlapOSBar =
|
||||
LookAndFeel::GetInt(LookAndFeel::IntID::MenusCanOverlapOSBar, 0);
|
||||
if (dropdownCanOverlapOSBar) {
|
||||
context->GetRect(screen);
|
||||
} else {
|
||||
context->GetClientRect(screen);
|
||||
}
|
||||
return screen;
|
||||
}
|
||||
|
||||
void nsComboboxControlFrame::GetAvailableDropdownSpace(
|
||||
WritingMode aWM, nscoord* aBefore, nscoord* aAfter,
|
||||
LogicalPoint* aTranslation) {
|
||||
@ -558,7 +575,7 @@ void nsComboboxControlFrame::GetAvailableDropdownSpace(
|
||||
*aBefore = 0;
|
||||
*aAfter = 0;
|
||||
|
||||
nsRect screen = nsCheckboxRadioFrame::GetUsableScreenRect(PresContext());
|
||||
nsRect screen = ::GetUsableScreenRect(PresContext());
|
||||
nsSize containerSize = screen.Size();
|
||||
LogicalRect logicalScreen(aWM, screen, containerSize);
|
||||
if (mLastDropDownAfterScreenBCoord == nscoord_MIN) {
|
||||
|
Loading…
Reference in New Issue
Block a user