mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 952827 - Remove unused methods from nsIScrollable. r=roc
This commit is contained in:
parent
828272ad92
commit
edddcab186
@ -5796,11 +5796,7 @@ nsDocShell::SetTitle(const PRUnichar * aTitle)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
//*****************************************************************************
|
nsresult
|
||||||
// nsDocShell::nsIScrollable
|
|
||||||
//*****************************************************************************
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDocShell::GetCurScrollPos(int32_t scrollOrientation, int32_t * curPos)
|
nsDocShell::GetCurScrollPos(int32_t scrollOrientation, int32_t * curPos)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(curPos);
|
NS_ENSURE_ARG_POINTER(curPos);
|
||||||
@ -5824,32 +5820,7 @@ nsDocShell::GetCurScrollPos(int32_t scrollOrientation, int32_t * curPos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
nsresult
|
||||||
nsDocShell::SetCurScrollPos(int32_t scrollOrientation, int32_t curPos)
|
|
||||||
{
|
|
||||||
nsIScrollableFrame* sf = GetRootScrollFrame();
|
|
||||||
NS_ENSURE_TRUE(sf, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
nsPoint pt = sf->GetScrollPosition();
|
|
||||||
|
|
||||||
switch (scrollOrientation) {
|
|
||||||
case ScrollOrientation_X:
|
|
||||||
pt.x = curPos;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ScrollOrientation_Y:
|
|
||||||
pt.y = curPos;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
NS_ENSURE_TRUE(false, NS_ERROR_INVALID_ARG);
|
|
||||||
}
|
|
||||||
|
|
||||||
sf->ScrollTo(pt, nsIScrollableFrame::INSTANT);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDocShell::SetCurScrollPosEx(int32_t curHorizontalPos, int32_t curVerticalPos)
|
nsDocShell::SetCurScrollPosEx(int32_t curHorizontalPos, int32_t curVerticalPos)
|
||||||
{
|
{
|
||||||
nsIScrollableFrame* sf = GetRootScrollFrame();
|
nsIScrollableFrame* sf = GetRootScrollFrame();
|
||||||
@ -5860,69 +5831,10 @@ nsDocShell::SetCurScrollPosEx(int32_t curHorizontalPos, int32_t curVerticalPos)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX This is wrong
|
//*****************************************************************************
|
||||||
NS_IMETHODIMP
|
// nsDocShell::nsIScrollable
|
||||||
nsDocShell::GetScrollRange(int32_t scrollOrientation,
|
//*****************************************************************************
|
||||||
int32_t * minPos, int32_t * maxPos)
|
|
||||||
{
|
|
||||||
NS_ENSURE_ARG_POINTER(minPos && maxPos);
|
|
||||||
|
|
||||||
nsIScrollableFrame* sf = GetRootScrollFrame();
|
|
||||||
NS_ENSURE_TRUE(sf, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
nsSize portSize = sf->GetScrollPortRect().Size();
|
|
||||||
nsRect range = sf->GetScrollRange();
|
|
||||||
|
|
||||||
switch (scrollOrientation) {
|
|
||||||
case ScrollOrientation_X:
|
|
||||||
*minPos = range.x;
|
|
||||||
*maxPos = range.XMost() + portSize.width;
|
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
case ScrollOrientation_Y:
|
|
||||||
*minPos = range.y;
|
|
||||||
*maxPos = range.YMost() + portSize.height;
|
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
default:
|
|
||||||
NS_ENSURE_TRUE(false, NS_ERROR_INVALID_ARG);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDocShell::SetScrollRange(int32_t scrollOrientation,
|
|
||||||
int32_t minPos, int32_t maxPos)
|
|
||||||
{
|
|
||||||
//XXX First Check
|
|
||||||
/*
|
|
||||||
Retrieves or Sets the valid ranges for the thumb. When maxPos is set to
|
|
||||||
something less than the current thumb position, curPos is set = to maxPos.
|
|
||||||
|
|
||||||
@return NS_OK - Setting or Getting completed successfully.
|
|
||||||
NS_ERROR_INVALID_ARG - returned when curPos is not within the
|
|
||||||
minPos and maxPos.
|
|
||||||
*/
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDocShell::SetScrollRangeEx(int32_t minHorizontalPos,
|
|
||||||
int32_t maxHorizontalPos, int32_t minVerticalPos,
|
|
||||||
int32_t maxVerticalPos)
|
|
||||||
{
|
|
||||||
//XXX First Check
|
|
||||||
/*
|
|
||||||
Retrieves or Sets the valid ranges for the thumb. When maxPos is set to
|
|
||||||
something less than the current thumb position, curPos is set = to maxPos.
|
|
||||||
|
|
||||||
@return NS_OK - Setting or Getting completed successfully.
|
|
||||||
NS_ERROR_INVALID_ARG - returned when curPos is not within the
|
|
||||||
minPos and maxPos.
|
|
||||||
*/
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This returns setting for all documents in this docshell
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocShell::GetDefaultScrollbarPreferences(int32_t scrollOrientation,
|
nsDocShell::GetDefaultScrollbarPreferences(int32_t scrollOrientation,
|
||||||
int32_t * scrollbarPref)
|
int32_t * scrollbarPref)
|
||||||
@ -5943,15 +5855,6 @@ nsDocShell::GetDefaultScrollbarPreferences(int32_t scrollOrientation,
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set scrolling preference for all documents in this shell
|
|
||||||
//
|
|
||||||
// There are three possible values stored in the shell:
|
|
||||||
// 1) nsIScrollable::Scrollbar_Never = no scrollbar
|
|
||||||
// 2) nsIScrollable::Scrollbar_Auto = scrollbar appears if the document
|
|
||||||
// being displayed would normally have scrollbar
|
|
||||||
// 3) nsIScrollable::Scrollbar_Always = scrollbar always appears
|
|
||||||
//
|
|
||||||
// One important client is nsHTMLFrameInnerFrame::CreateWebShell()
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocShell::SetDefaultScrollbarPreferences(int32_t scrollOrientation,
|
nsDocShell::SetDefaultScrollbarPreferences(int32_t scrollOrientation,
|
||||||
int32_t scrollbarPref)
|
int32_t scrollbarPref)
|
||||||
|
@ -637,6 +637,9 @@ protected:
|
|||||||
// Convenience method for getting our parent docshell. Can return null
|
// Convenience method for getting our parent docshell. Can return null
|
||||||
already_AddRefed<nsDocShell> GetParentDocshell();
|
already_AddRefed<nsDocShell> GetParentDocshell();
|
||||||
protected:
|
protected:
|
||||||
|
nsresult GetCurScrollPos(int32_t scrollOrientation, int32_t * curPos);
|
||||||
|
nsresult SetCurScrollPosEx(int32_t curHorizontalPos, int32_t curVerticalPos);
|
||||||
|
|
||||||
// Override the parent setter from nsDocLoader
|
// Override the parent setter from nsDocLoader
|
||||||
virtual nsresult SetDocLoaderParent(nsDocLoader * aLoader);
|
virtual nsresult SetDocLoaderParent(nsDocLoader * aLoader);
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||||
|
* vim: set ts=2 sw=2 et tw=78:
|
||||||
*
|
*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
@ -9,92 +10,46 @@
|
|||||||
/**
|
/**
|
||||||
* The nsIScrollable is an interface that can be implemented by a control that
|
* The nsIScrollable is an interface that can be implemented by a control that
|
||||||
* supports scrolling. This is a generic interface without concern for the
|
* supports scrolling. This is a generic interface without concern for the
|
||||||
* type of content that may be inside. It simply deals blindly with scroll
|
* type of content that may be inside.
|
||||||
* position as a composite of the lowest possible scroll position, the highest
|
|
||||||
* possible position and the current position lying somewhere between the
|
|
||||||
* min and the max.
|
|
||||||
*
|
|
||||||
* XXXroc in our tree, only get/setDefaultScrollbarPreferences and
|
|
||||||
* getScrollbarVisibility are actually used externally. We should gut
|
|
||||||
* the rest. nsDocShell is using twips for all these coordinates
|
|
||||||
* which is going to confuse people anyway...
|
|
||||||
*/
|
*/
|
||||||
|
[scriptable, uuid(3507fc93-313e-4a4c-8ca8-4d0ea0f97315)]
|
||||||
[scriptable, uuid(919e792a-6490-40b8-bba5-f9e9ad5640c8)]
|
|
||||||
interface nsIScrollable : nsISupports
|
interface nsIScrollable : nsISupports
|
||||||
{
|
{
|
||||||
/*
|
/**
|
||||||
Constants declaring the two scroll orientations a scroll bar can be in.
|
* Constants declaring the two scroll orientations a scrollbar can be in.
|
||||||
ScrollOrientation_X - Horizontal scrolling. When passing this
|
* ScrollOrientation_X - Horizontal scrolling. When passing this
|
||||||
in to a scroll position method you are requesting or
|
* in to a method you are requesting or setting data for the
|
||||||
setting the positions for the horizontal scroll bar.
|
* horizontal scrollbar.
|
||||||
ScrollOrientation_Y - Vertical scrolling. When passing this
|
* ScrollOrientation_Y - Vertical scrolling. When passing this
|
||||||
in to a scroll position you are requesting or setting
|
* in to a method you are requesting or setting data for the
|
||||||
the positions for the vertical scroll bar.
|
* vertical scrollbar.
|
||||||
*/
|
*/
|
||||||
const long ScrollOrientation_X = 1;
|
const long ScrollOrientation_X = 1;
|
||||||
const long ScrollOrientation_Y = 2;
|
const long ScrollOrientation_Y = 2;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
Retrieves or Sets the current thumb position to the curPos passed in for the
|
* Constants declaring the states of the scrollbars.
|
||||||
scrolling orientation passed in. curPos should be between minPos and maxPos.
|
* ScrollPref_Auto - bars visible only when needed.
|
||||||
|
* ScrollPref_Never - bars never visible, even when scrolling still possible.
|
||||||
|
* ScrollPref_Always - bars always visible, even when scrolling is not possible
|
||||||
|
*/
|
||||||
|
const long Scrollbar_Auto = 1;
|
||||||
|
const long Scrollbar_Never = 2;
|
||||||
|
const long Scrollbar_Always = 3;
|
||||||
|
|
||||||
@return NS_OK - Setting or Getting completed successfully.
|
/**
|
||||||
NS_ERROR_INVALID_ARG - returned when curPos is not within the
|
* Get or set the default scrollbar state for all documents in
|
||||||
minPos and maxPos.
|
* this shell.
|
||||||
*/
|
*/
|
||||||
long getCurScrollPos(in long scrollOrientation);
|
long getDefaultScrollbarPreferences(in long scrollOrientation);
|
||||||
void setCurScrollPos(in long scrollOrientation, in long curPos);
|
void setDefaultScrollbarPreferences(in long scrollOrientation,
|
||||||
|
in long scrollbarPref);
|
||||||
|
|
||||||
/*
|
/**
|
||||||
This function atomizes the ability to scroll in two dimensions at the same
|
* Get information about whether the vertical and horizontal scrollbars are
|
||||||
time.
|
* currently visible. If you are only interested in one of the visibility
|
||||||
*/
|
* settings pass nullptr in for the one you aren't interested in.
|
||||||
void setCurScrollPosEx(in long curHorizontalPos, in long curVerticalPos);
|
*/
|
||||||
|
void getScrollbarVisibility(out boolean verticalVisible,
|
||||||
/*
|
out boolean horizontalVisible);
|
||||||
Retrieves or Sets the valid ranges for the thumb. When maxPos is set to
|
|
||||||
something less than the current thumb position, curPos is set = to maxPos.
|
|
||||||
|
|
||||||
@return NS_OK - Setting or Getting completed successfully.
|
|
||||||
NS_ERROR_INVALID_ARG - returned when curPos is not within the
|
|
||||||
minPos and maxPos.
|
|
||||||
*/
|
|
||||||
void getScrollRange(in long scrollOrientation, out long minPos, out long maxPos);
|
|
||||||
void setScrollRange(in long scrollOrientation, in long minPos, in long maxPos);
|
|
||||||
|
|
||||||
/*
|
|
||||||
This function atomizes the ability to set the ranges in two dimensions at
|
|
||||||
the same time.
|
|
||||||
*/
|
|
||||||
void setScrollRangeEx(in long minHorizontalPos, in long maxHorizontalPos,
|
|
||||||
in long minVerticalPos, in long maxVerticalPos);
|
|
||||||
|
|
||||||
/*
|
|
||||||
Constants declaring the states of the scroll bars.
|
|
||||||
ScrollPref_Auto - bars visible only when needed.
|
|
||||||
ScrollPref_Never - bars never visible, even when scrolling still possible.
|
|
||||||
ScrollPref_Always - bars always visible, even when scrolling is not possible
|
|
||||||
*/
|
|
||||||
const long Scrollbar_Auto = 1;
|
|
||||||
const long Scrollbar_Never = 2;
|
|
||||||
const long Scrollbar_Always = 3;
|
|
||||||
|
|
||||||
/*
|
|
||||||
Retrieves or Set the preferences for the scroll bar.
|
|
||||||
current is 'scrolling preference for this document'
|
|
||||||
default is 'scrolling preference for all documents in this shell'
|
|
||||||
resetScrollbarPreferences resets current to default
|
|
||||||
*/
|
|
||||||
long getDefaultScrollbarPreferences(in long scrollOrientation);
|
|
||||||
void setDefaultScrollbarPreferences(in long scrollOrientation, in long scrollbarPref);
|
|
||||||
|
|
||||||
/*
|
|
||||||
Get information about whether the vertical and horizontal scrollbars are
|
|
||||||
currently visible. nullptr is a valid argument. If you are only interested
|
|
||||||
in one of the visibility settings pass nullptr in for the one you aren't
|
|
||||||
interested in.
|
|
||||||
*/
|
|
||||||
void getScrollbarVisibility(out boolean verticalVisible,
|
|
||||||
out boolean horizontalVisible);
|
|
||||||
};
|
};
|
||||||
|
@ -1490,58 +1490,6 @@ NS_IMETHODIMP nsWebBrowser::SetTitle(const PRUnichar* aTitle)
|
|||||||
// nsWebBrowser::nsIScrollable
|
// nsWebBrowser::nsIScrollable
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::GetCurScrollPos(int32_t aScrollOrientation,
|
|
||||||
int32_t* aCurPos)
|
|
||||||
{
|
|
||||||
NS_ENSURE_STATE(mDocShell);
|
|
||||||
|
|
||||||
return mDocShellAsScrollable->GetCurScrollPos(aScrollOrientation, aCurPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::SetCurScrollPos(int32_t aScrollOrientation,
|
|
||||||
int32_t aCurPos)
|
|
||||||
{
|
|
||||||
NS_ENSURE_STATE(mDocShell);
|
|
||||||
|
|
||||||
return mDocShellAsScrollable->SetCurScrollPos(aScrollOrientation, aCurPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::SetCurScrollPosEx(int32_t aCurHorizontalPos,
|
|
||||||
int32_t aCurVerticalPos)
|
|
||||||
{
|
|
||||||
NS_ENSURE_STATE(mDocShell);
|
|
||||||
|
|
||||||
return mDocShellAsScrollable->SetCurScrollPosEx(aCurHorizontalPos,
|
|
||||||
aCurVerticalPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::GetScrollRange(int32_t aScrollOrientation,
|
|
||||||
int32_t* aMinPos, int32_t* aMaxPos)
|
|
||||||
{
|
|
||||||
NS_ENSURE_STATE(mDocShell);
|
|
||||||
|
|
||||||
return mDocShellAsScrollable->GetScrollRange(aScrollOrientation, aMinPos,
|
|
||||||
aMaxPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::SetScrollRange(int32_t aScrollOrientation,
|
|
||||||
int32_t aMinPos, int32_t aMaxPos)
|
|
||||||
{
|
|
||||||
NS_ENSURE_STATE(mDocShell);
|
|
||||||
|
|
||||||
return mDocShellAsScrollable->SetScrollRange(aScrollOrientation, aMinPos,
|
|
||||||
aMaxPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::SetScrollRangeEx(int32_t aMinHorizontalPos,
|
|
||||||
int32_t aMaxHorizontalPos, int32_t aMinVerticalPos, int32_t aMaxVerticalPos)
|
|
||||||
{
|
|
||||||
NS_ENSURE_STATE(mDocShell);
|
|
||||||
|
|
||||||
return mDocShellAsScrollable->SetScrollRangeEx(aMinHorizontalPos,
|
|
||||||
aMaxHorizontalPos, aMinVerticalPos, aMaxVerticalPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::GetDefaultScrollbarPreferences(int32_t aScrollOrientation,
|
NS_IMETHODIMP nsWebBrowser::GetDefaultScrollbarPreferences(int32_t aScrollOrientation,
|
||||||
int32_t* aScrollbarPref)
|
int32_t* aScrollbarPref)
|
||||||
{
|
{
|
||||||
|
@ -68,9 +68,9 @@ public:
|
|||||||
nsIID mID;
|
nsIID mID;
|
||||||
};
|
};
|
||||||
|
|
||||||
// {F1EAC761-87E9-11d3-AF80-00A024FFC08C} -
|
// {cda5863a-aa9c-411e-be49-ea0d525ab4b5} -
|
||||||
#define NS_WEBBROWSER_CID \
|
#define NS_WEBBROWSER_CID \
|
||||||
{0xf1eac761, 0x87e9, 0x11d3, { 0xaf, 0x80, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}
|
{0xcda5863a, 0xaa9c, 0x411e, { 0xbe, 0x49, 0xea, 0x0d, 0x52, 0x5a, 0xb4, 0xb5 }}
|
||||||
|
|
||||||
|
|
||||||
class nsWebBrowser : public nsIWebBrowser,
|
class nsWebBrowser : public nsIWebBrowser,
|
||||||
|
@ -2653,16 +2653,6 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement)
|
|||||||
// will act as the scrolling mechanism for the viewport.
|
// will act as the scrolling mechanism for the viewport.
|
||||||
// XXX Do we even need a viewport when printing to a printer?
|
// XXX Do we even need a viewport when printing to a printer?
|
||||||
|
|
||||||
// As long as the docshell doesn't prohibit it, and the device supports
|
|
||||||
// it, create a scroll frame that will act as the scolling mechanism for
|
|
||||||
// the viewport.
|
|
||||||
//
|
|
||||||
// Threre are three possible values stored in the docshell:
|
|
||||||
// 1) nsIScrollable::Scrollbar_Never = no scrollbars
|
|
||||||
// 2) nsIScrollable::Scrollbar_Auto = scrollbars appear if needed
|
|
||||||
// 3) nsIScrollable::Scrollbar_Always = scrollbars always
|
|
||||||
// Only need to create a scroll frame/view for cases 2 and 3.
|
|
||||||
|
|
||||||
bool isHTML = aDocElement->IsHTML();
|
bool isHTML = aDocElement->IsHTML();
|
||||||
bool isXUL = false;
|
bool isXUL = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user