Bug 1466851 part 1. Remove some unused tree box object properties. r=mossop

These properties are not used from either JS or C++, and hence can be
removed from both nsITreeBoxObject and TreeBoxObject.webidl.  Properties in
this bucket: scrollToCell, scrollToColumn, scrollToHorizontalPosition,
invalidateColumnRange.
This commit is contained in:
Boris Zbarsky 2018-06-05 23:01:49 -04:00
Родитель e6d7462233
Коммит fcd02e0cc5
6 изменённых файлов: 0 добавлений и 174 удалений

Просмотреть файл

@ -105,23 +105,6 @@ interface TreeBoxObject : BoxObject {
*/
void scrollByPages(long numPages);
/**
* Scrolls such that a given cell is visible (if possible)
* at the top left corner of the visible view.
*/
void scrollToCell(long row, TreeColumn? col);
/**
* Scrolls horizontally so that the specified column is
* at the left of the view (if possible).
*/
void scrollToColumn(TreeColumn? col);
/**
* Scroll to a specific horizontal pixel position.
*/
void scrollToHorizontalPosition(long horizontalPosition);
/**
* Invalidation methods for fine-grained painting control.
*/
@ -130,7 +113,6 @@ interface TreeBoxObject : BoxObject {
void invalidateRow(long index);
void invalidateCell(long row, TreeColumn? col);
void invalidateRange(long startIndex, long endIndex);
void invalidateColumnRange(long startIndex, long endIndex, TreeColumn? col);
/**
* A hit test that can tell you what row the mouse is over.

Просмотреть файл

@ -388,33 +388,6 @@ TreeBoxObject::ScrollByPages(int32_t aNumPages)
return NS_OK;
}
NS_IMETHODIMP
TreeBoxObject::ScrollToCell(int32_t aRow, nsTreeColumn* aCol)
{
nsTreeBodyFrame* body = GetTreeBodyFrame();
if (body)
return body->ScrollToCell(aRow, aCol);
return NS_OK;
}
NS_IMETHODIMP
TreeBoxObject::ScrollToColumn(nsTreeColumn* aCol)
{
nsTreeBodyFrame* body = GetTreeBodyFrame();
if (body)
return body->ScrollToColumn(aCol);
return NS_OK;
}
NS_IMETHODIMP
TreeBoxObject::ScrollToHorizontalPosition(int32_t aHorizontalPosition)
{
nsTreeBodyFrame* body = GetTreeBodyFrame();
if (body)
return body->ScrollToHorizontalPosition(aHorizontalPosition);
return NS_OK;
}
NS_IMETHODIMP TreeBoxObject::Invalidate()
{
nsTreeBodyFrame* body = GetTreeBodyFrame();
@ -459,15 +432,6 @@ TreeBoxObject::InvalidateRange(int32_t aStart, int32_t aEnd)
return NS_OK;
}
NS_IMETHODIMP
TreeBoxObject::InvalidateColumnRange(int32_t aStart, int32_t aEnd, nsTreeColumn* aCol)
{
nsTreeBodyFrame* body = GetTreeBodyFrame();
if (body)
return body->InvalidateColumnRange(aStart, aEnd, aCol);
return NS_OK;
}
NS_IMETHODIMP
TreeBoxObject::GetRowAt(int32_t x, int32_t y, int32_t *aRow)
{

Просмотреть файл

@ -109,14 +109,10 @@ public:
// void ScrollToRow(int32_t index);
// void ScrollByLines(int32_t numLines);
// void ScrollByPages(int32_t numPages);
// void ScrollToCell(int32_t row, nsTreeColumn* col);
// void ScrollToColumn(nsTreeColumn* col);
// void ScrollToHorizontalPosition(int32_t horizontalPosition);
// void InvalidateColumn(nsTreeColumn* col);
// void InvalidateRow(int32_t index);
// void InvalidateCell(int32_t row, nsTreeColumn* col);
// void InvalidateRange(int32_t startIndex, int32_t endIndex);
// void InvalidateColumnRange(int32_t startIndex, int32_t endIndex, nsTreeColumn* col);
// void RowCountChanged(int32_t index, int32_t count);
protected:

Просмотреть файл

@ -106,23 +106,6 @@ interface nsITreeBoxObject : nsISupports
*/
void scrollByPages(in long numPages);
/**
* Scrolls such that a given cell is visible (if possible)
* at the top left corner of the visible view.
*/
void scrollToCell(in long row, in TreeColumn col);
/**
* Scrolls horizontally so that the specified column is
* at the left of the view (if possible).
*/
void scrollToColumn(in TreeColumn col);
/**
* Scroll to a specific horizontal pixel position.
*/
void scrollToHorizontalPosition(in long horizontalPosition);
/**
* Invalidation methods for fine-grained painting control.
*/
@ -131,8 +114,6 @@ interface nsITreeBoxObject : nsISupports
void invalidateRow(in long index);
void invalidateCell(in long row, in TreeColumn col);
void invalidateRange(in long startIndex, in long endIndex);
void invalidateColumnRange(in long startIndex, in long endIndex,
in TreeColumn col);
/**
* A hit test that can tell you what row the mouse is over.

Просмотреть файл

@ -742,48 +742,6 @@ nsTreeBodyFrame::InvalidateRange(int32_t aStart, int32_t aEnd)
return NS_OK;
}
nsresult
nsTreeBodyFrame::InvalidateColumnRange(int32_t aStart, int32_t aEnd, nsTreeColumn* aCol)
{
if (mUpdateBatchNest)
return NS_OK;
if (!aCol)
return NS_ERROR_INVALID_ARG;
if (aStart == aEnd)
return InvalidateCell(aStart, aCol);
int32_t last = LastVisibleRow();
if (aStart > aEnd || aEnd < mTopRowIndex || aStart > last)
return NS_OK;
if (aStart < mTopRowIndex)
aStart = mTopRowIndex;
if (aEnd > last)
aEnd = last;
#ifdef ACCESSIBILITY
if (nsIPresShell::IsAccessibilityActive()) {
int32_t end =
mRowCount > 0 ? ((mRowCount <= aEnd) ? mRowCount - 1 : aEnd) : 0;
FireInvalidateEvent(aStart, end, aCol, aCol);
}
#endif
nsRect rangeRect;
nsresult rv = aCol->GetRect(this,
mInnerBox.y+mRowHeight*(aStart-mTopRowIndex),
mRowHeight*(aEnd-aStart+1),
&rangeRect);
NS_ENSURE_SUCCESS(rv, rv);
InvalidateFrameWithRect(rangeRect);
return NS_OK;
}
static void
FindScrollParts(nsIFrame* aCurrFrame, nsTreeBodyFrame::ScrollParts* aResult)
{
@ -4100,55 +4058,6 @@ nsTreeBodyFrame::EnsureCellIsVisible(int32_t aRow, nsTreeColumn* aCol)
return rv;
}
nsresult
nsTreeBodyFrame::ScrollToCell(int32_t aRow, nsTreeColumn* aCol)
{
ScrollParts parts = GetScrollParts();
nsresult rv = ScrollToRowInternal(parts, aRow);
NS_ENSURE_SUCCESS(rv, rv);
rv = ScrollToColumnInternal(parts, aCol);
NS_ENSURE_SUCCESS(rv, rv);
UpdateScrollbars(parts);
return rv;
}
nsresult
nsTreeBodyFrame::ScrollToColumn(nsTreeColumn* aCol)
{
ScrollParts parts = GetScrollParts();
nsresult rv = ScrollToColumnInternal(parts, aCol);
NS_ENSURE_SUCCESS(rv, rv);
UpdateScrollbars(parts);
return rv;
}
nsresult nsTreeBodyFrame::ScrollToColumnInternal(const ScrollParts& aParts,
nsTreeColumn* aCol)
{
if (!aCol)
return NS_ERROR_INVALID_ARG;
nscoord x;
nsresult rv = aCol->GetXInTwips(this, &x);
if (NS_FAILED(rv))
return rv;
return ScrollHorzInternal(aParts, x);
}
nsresult
nsTreeBodyFrame::ScrollToHorizontalPosition(int32_t aHorizontalPosition)
{
ScrollParts parts = GetScrollParts();
int32_t position = nsPresContext::CSSPixelsToAppUnits(aHorizontalPosition);
nsresult rv = ScrollHorzInternal(parts, position);
NS_ENSURE_SUCCESS(rv, rv);
UpdateScrollbars(parts);
return rv;
}
nsresult
nsTreeBodyFrame::ScrollToRow(int32_t aRow)
{

Просмотреть файл

@ -95,16 +95,11 @@ public:
nsresult ScrollToRow(int32_t aRow);
nsresult ScrollByLines(int32_t aNumLines);
nsresult ScrollByPages(int32_t aNumPages);
nsresult ScrollToCell(int32_t aRow, nsTreeColumn *aCol);
nsresult ScrollToColumn(nsTreeColumn *aCol);
nsresult ScrollToHorizontalPosition(int32_t aValue);
nsresult Invalidate();
nsresult InvalidateColumn(nsTreeColumn *aCol);
nsresult InvalidateRow(int32_t aRow);
nsresult InvalidateCell(int32_t aRow, nsTreeColumn *aCol);
nsresult InvalidateRange(int32_t aStart, int32_t aEnd);
nsresult InvalidateColumnRange(int32_t aStart, int32_t aEnd,
nsTreeColumn *aCol);
nsresult GetRowAt(int32_t aX, int32_t aY, int32_t *aValue);
nsresult GetCellAt(int32_t aX, int32_t aY, int32_t *aRow,
nsTreeColumn **aCol, nsACString &aChildElt);
@ -385,7 +380,6 @@ protected:
// Our internal scroll method, used by all the public scroll methods.
nsresult ScrollInternal(const ScrollParts& aParts, int32_t aRow);
nsresult ScrollToRowInternal(const ScrollParts& aParts, int32_t aRow);
nsresult ScrollToColumnInternal(const ScrollParts& aParts, nsTreeColumn* aCol);
nsresult ScrollHorzInternal(const ScrollParts& aParts, int32_t aPosition);
nsresult EnsureRowIsVisibleInternal(const ScrollParts& aParts, int32_t aRow);