Bug 1635709: part 24.2) Rename `childContent` to `aChildContent`. r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D77254
This commit is contained in:
Mirko Brodesser 2020-06-02 09:08:44 +00:00
Родитель ed1b7493ab
Коммит 59fe54586f
2 изменённых файлов: 27 добавлений и 27 удалений

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

@ -2278,7 +2278,7 @@ nsresult nsFrameSelection::TableSelection::HandleSelection(
} }
nsresult nsFrameSelection::TableSelection::HandleDragSelecting( nsresult nsFrameSelection::TableSelection::HandleDragSelecting(
TableSelectionMode aTarget, nsIContent* childContent, TableSelectionMode aTarget, nsIContent* aChildContent,
const WidgetMouseEvent* aMouseEvent, Selection& aNormalSelection) { const WidgetMouseEvent* aMouseEvent, Selection& aNormalSelection) {
nsresult result = NS_OK; nsresult result = NS_OK;
@ -2286,16 +2286,16 @@ nsresult nsFrameSelection::TableSelection::HandleDragSelecting(
// We are drag-selecting // We are drag-selecting
if (aTarget != TableSelectionMode::Table) { if (aTarget != TableSelectionMode::Table) {
// If dragging in the same cell as last event, do nothing // If dragging in the same cell as last event, do nothing
if (mEndSelectedCell == childContent) { if (mEndSelectedCell == aChildContent) {
return NS_OK; return NS_OK;
} }
#ifdef DEBUG_TABLE_SELECTION #ifdef DEBUG_TABLE_SELECTION
printf( printf(
" mStartSelectedCell = %p, " " mStartSelectedCell = %p, "
"mEndSelectedCell = %p, childContent = %p " "mEndSelectedCell = %p, aChildContent = %p "
"\n", "\n",
mStartSelectedCell.get(), mEndSelectedCell.get(), childContent); mStartSelectedCell.get(), mEndSelectedCell.get(), aChildContent);
#endif #endif
// aTarget can be any "cell mode", // aTarget can be any "cell mode",
// so we can easily drag-select rows and columns // so we can easily drag-select rows and columns
@ -2312,7 +2312,7 @@ nsresult nsFrameSelection::TableSelection::HandleDragSelecting(
if (NS_FAILED(result)) { if (NS_FAILED(result)) {
return result; return result;
} }
result = GetCellIndexes(childContent, curRowIndex, curColIndex); result = GetCellIndexes(aChildContent, curRowIndex, curColIndex);
if (NS_FAILED(result)) { if (NS_FAILED(result)) {
return result; return result;
} }
@ -2335,7 +2335,7 @@ nsresult nsFrameSelection::TableSelection::HandleDragSelecting(
#endif #endif
// Continue dragging row or column selection // Continue dragging row or column selection
return SelectRowOrColumn(childContent, aNormalSelection); return SelectRowOrColumn(aChildContent, aNormalSelection);
} }
if (mMode == TableSelectionMode::Cell) { if (mMode == TableSelectionMode::Cell) {
#ifdef DEBUG_TABLE_SELECTION #ifdef DEBUG_TABLE_SELECTION
@ -2351,7 +2351,7 @@ nsresult nsFrameSelection::TableSelection::HandleDragSelecting(
if (NS_FAILED(result)) { if (NS_FAILED(result)) {
return result; return result;
} }
result = GetCellIndexes(childContent, curRowIndex, curColIndex); result = GetCellIndexes(aChildContent, curRowIndex, curColIndex);
if (NS_FAILED(result)) { if (NS_FAILED(result)) {
return result; return result;
} }
@ -2367,12 +2367,12 @@ nsresult nsFrameSelection::TableSelection::HandleDragSelecting(
mMode = TableSelectionMode::Column; mMode = TableSelectionMode::Column;
} }
return SelectRowOrColumn(childContent, aNormalSelection); return SelectRowOrColumn(aChildContent, aNormalSelection);
} }
} }
// Reselect block of cells to new end location // Reselect block of cells to new end location
return SelectBlockOfCells(mStartSelectedCell, childContent, return SelectBlockOfCells(mStartSelectedCell, aChildContent,
aNormalSelection); aNormalSelection);
} }
} }
@ -2381,7 +2381,7 @@ nsresult nsFrameSelection::TableSelection::HandleDragSelecting(
} }
nsresult nsFrameSelection::TableSelection::HandleMouseUpOrDown( nsresult nsFrameSelection::TableSelection::HandleMouseUpOrDown(
TableSelectionMode aTarget, bool aDragState, nsIContent* childContent, TableSelectionMode aTarget, bool aDragState, nsIContent* aChildContent,
nsINode* aParentContent, int32_t aContentOffset, nsINode* aParentContent, int32_t aContentOffset,
const WidgetMouseEvent* aMouseEvent, Selection& aNormalSelection) { const WidgetMouseEvent* aMouseEvent, Selection& aNormalSelection) {
nsresult result = NS_OK; nsresult result = NS_OK;
@ -2403,7 +2403,7 @@ nsresult nsFrameSelection::TableSelection::HandleMouseUpOrDown(
// We have at least 1 other selected cell // We have at least 1 other selected cell
// Check if new cell is already selected // Check if new cell is already selected
nsIFrame* cellFrame = childContent->GetPrimaryFrame(); nsIFrame* cellFrame = aChildContent->GetPrimaryFrame();
if (!cellFrame) { if (!cellFrame) {
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
} }
@ -2415,13 +2415,13 @@ nsresult nsFrameSelection::TableSelection::HandleMouseUpOrDown(
mDragSelectingCells = true; // Signal to start drag-cell-selection mDragSelectingCells = true; // Signal to start drag-cell-selection
mMode = aTarget; mMode = aTarget;
// Set start for new drag-selection block (not appended) // Set start for new drag-selection block (not appended)
mStartSelectedCell = childContent; mStartSelectedCell = aChildContent;
// The initial block end is same as the start // The initial block end is same as the start
mEndSelectedCell = childContent; mEndSelectedCell = aChildContent;
if (isSelected) { if (isSelected) {
// Remember this cell to (possibly) unselect it on mouseup // Remember this cell to (possibly) unselect it on mouseup
mUnselectCellOnMouseUp = childContent; mUnselectCellOnMouseUp = aChildContent;
#ifdef DEBUG_TABLE_SELECTION #ifdef DEBUG_TABLE_SELECTION
printf( printf(
"HandleTableSelection: Saving " "HandleTableSelection: Saving "
@ -2431,13 +2431,13 @@ nsresult nsFrameSelection::TableSelection::HandleMouseUpOrDown(
// Select an unselected cell // Select an unselected cell
// but first remove existing selection if not in same table // but first remove existing selection if not in same table
if (previousCellNode && if (previousCellNode &&
!IsInSameTable(previousCellNode, childContent)) { !IsInSameTable(previousCellNode, aChildContent)) {
aNormalSelection.RemoveAllRanges(IgnoreErrors()); aNormalSelection.RemoveAllRanges(IgnoreErrors());
// Reset selection mode that is cleared in RemoveAllRanges // Reset selection mode that is cleared in RemoveAllRanges
mMode = aTarget; mMode = aTarget;
} }
return ::SelectCellElement(childContent, aNormalSelection); return ::SelectCellElement(aChildContent, aNormalSelection);
} }
return NS_OK; return NS_OK;
@ -2472,7 +2472,7 @@ nsresult nsFrameSelection::TableSelection::HandleMouseUpOrDown(
// Always do this AFTER RemoveAllRanges // Always do this AFTER RemoveAllRanges
mMode = aTarget; mMode = aTarget;
return SelectRowOrColumn(childContent, aNormalSelection); return SelectRowOrColumn(aChildContent, aNormalSelection);
} }
} else { } else {
#ifdef DEBUG_TABLE_SELECTION #ifdef DEBUG_TABLE_SELECTION
@ -2487,11 +2487,11 @@ nsresult nsFrameSelection::TableSelection::HandleMouseUpOrDown(
if (rangeCount > 0 && aMouseEvent->IsShift() && if (rangeCount > 0 && aMouseEvent->IsShift() &&
mAppendStartSelectedCell && mAppendStartSelectedCell &&
mAppendStartSelectedCell != childContent) { mAppendStartSelectedCell != aChildContent) {
// Shift key is down: append a block selection // Shift key is down: append a block selection
mDragSelectingCells = false; mDragSelectingCells = false;
return SelectBlockOfCells(mAppendStartSelectedCell, childContent, return SelectBlockOfCells(mAppendStartSelectedCell, aChildContent,
aNormalSelection); aNormalSelection);
} }
@ -2522,7 +2522,7 @@ nsresult nsFrameSelection::TableSelection::HandleMouseUpOrDown(
} }
// Unselect a cell only if it wasn't // Unselect a cell only if it wasn't
// just selected on mousedown // just selected on mousedown
if (childContent == mUnselectCellOnMouseUp) { if (aChildContent == mUnselectCellOnMouseUp) {
// Scan ranges to find the cell to unselect (the selection range to // Scan ranges to find the cell to unselect (the selection range to
// remove) // remove)
// XXXbz it's really weird that this lives outside the loop, so once we // XXXbz it's really weird that this lives outside the loop, so once we
@ -2577,7 +2577,7 @@ nsresult nsFrameSelection::TableSelection::HandleMouseUpOrDown(
// Even better, should we collapse to just after the LAST deepest // Even better, should we collapse to just after the LAST deepest
// child // child
// (i.e., at the end of the cell's contents)? // (i.e., at the end of the cell's contents)?
return aNormalSelection.Collapse(childContent, 0); return aNormalSelection.Collapse(aChildContent, 0);
} }
#ifdef DEBUG_TABLE_SELECTION #ifdef DEBUG_TABLE_SELECTION
printf( printf(
@ -2586,7 +2586,7 @@ nsresult nsFrameSelection::TableSelection::HandleMouseUpOrDown(
#endif #endif
// Unselecting the start of previous block // Unselecting the start of previous block
// XXX What do we use now! // XXX What do we use now!
if (childContent == mAppendStartSelectedCell) { if (aChildContent == mAppendStartSelectedCell) {
mAppendStartSelectedCell = nullptr; mAppendStartSelectedCell = nullptr;
} }

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

@ -939,13 +939,13 @@ class nsFrameSelection final {
private: private:
[[nodiscard]] nsresult HandleDragSelecting( [[nodiscard]] nsresult HandleDragSelecting(
mozilla::TableSelectionMode aTarget, nsIContent* childContent, mozilla::TableSelectionMode aTarget, nsIContent* aChildContent,
const mozilla::WidgetMouseEvent* aMouseEvent, const mozilla::WidgetMouseEvent* aMouseEvent,
mozilla::dom::Selection& aNormalSelection); mozilla::dom::Selection& aNormalSelection);
[[nodiscard]] MOZ_CAN_RUN_SCRIPT nsresult HandleMouseUpOrDown( [[nodiscard]] MOZ_CAN_RUN_SCRIPT nsresult HandleMouseUpOrDown(
mozilla::TableSelectionMode aTarget, bool aDragState, mozilla::TableSelectionMode aTarget, bool aDragState,
nsIContent* childContent, nsINode* aParentContent, nsIContent* aChildContent, nsINode* aParentContent,
int32_t aContentOffset, const mozilla::WidgetMouseEvent* aMouseEvent, int32_t aContentOffset, const mozilla::WidgetMouseEvent* aMouseEvent,
mozilla::dom::Selection& aNormalSelection); mozilla::dom::Selection& aNormalSelection);
}; };