Bug 1508165, remove support for treecol[type=password]. r=MattN,webidl,smaug

Differential Revision: https://phabricator.services.mozilla.com/D48573

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexander J. Vincent 2019-10-08 23:46:23 +00:00
parent 87c3eb5a96
commit eb2ce4c505
5 changed files with 4 additions and 29 deletions

View File

@ -23,7 +23,6 @@ interface TreeColumn {
const short TYPE_TEXT = 1;
const short TYPE_CHECKBOX = 2;
const short TYPE_PASSWORD = 3;
readonly attribute short type;
TreeColumn? getNext();

View File

@ -352,8 +352,7 @@ void nsXULTooltipListener::CheckTreeBodyMove(MouseEvent* aMouseEvent) {
if (col) {
colType = col->Type();
}
if (row >= 0 && cellInfo.mChildElt.EqualsLiteral("text") &&
colType != TreeColumn_Binding::TYPE_PASSWORD) {
if (row >= 0 && cellInfo.mChildElt.EqualsLiteral("text")) {
mNeedTitletip = tree->IsCellCropped(row, col, rv);
}

View File

@ -3092,7 +3092,6 @@ ImgDrawResult nsTreeBodyFrame::PaintCell(
if (dirtyRect.IntersectRect(aDirtyRect, elementRect)) {
switch (aColumn->GetType()) {
case TreeColumn_Binding::TYPE_TEXT:
case TreeColumn_Binding::TYPE_PASSWORD:
result &= PaintText(aRowIndex, aColumn, elementRect, aPresContext,
aRenderingContext, aDirtyRect, currX);
break;
@ -3376,18 +3375,6 @@ ImgDrawResult nsTreeBodyFrame::PaintImage(
return result;
}
static void FillBufWithPWChars(nsAString* aOutString, int32_t aLength) {
MOZ_ASSERT(aOutString);
// change the output to the platform password character
char16_t passwordChar = LookAndFeel::GetPasswordCharacter();
aOutString->Truncate();
for (int32_t i = 0; i < aLength; i++) {
aOutString->Append(passwordChar);
}
}
ImgDrawResult nsTreeBodyFrame::PaintText(
int32_t aRowIndex, nsTreeColumn* aColumn, const nsRect& aTextRect,
nsPresContext* aPresContext, gfxContext& aRenderingContext,
@ -3400,10 +3387,6 @@ ImgDrawResult nsTreeBodyFrame::PaintText(
nsAutoString text;
mView->GetCellText(aRowIndex, aColumn, text);
if (aColumn->Type() == TreeColumn_Binding::TYPE_PASSWORD) {
FillBufWithPWChars(&text, text.Length());
}
// We're going to paint this text so we need to ensure bidi is enabled if
// necessary
CheckTextForBidi(text);

View File

@ -177,16 +177,13 @@ void nsTreeColumn::Invalidate(ErrorResult& aRv) {
// Figure out our column type. Default type is text.
mType = TreeColumn_Binding::TYPE_TEXT;
static Element::AttrValuesArray typestrings[] = {
nsGkAtoms::checkbox, nsGkAtoms::password, nullptr};
static Element::AttrValuesArray typestrings[] = {nsGkAtoms::checkbox,
nullptr};
switch (mContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
typestrings, eCaseMatters)) {
case 0:
mType = TreeColumn_Binding::TYPE_CHECKBOX;
break;
case 1:
mType = TreeColumn_Binding::TYPE_PASSWORD;
break;
}
// Fetch the crop style.

View File

@ -1288,10 +1288,7 @@
if (row < 0 || row >= this.view.rowCount || !column) {
return false;
}
if (
column.type != window.TreeColumn.TYPE_TEXT &&
column.type != window.TreeColumn.TYPE_PASSWORD
) {
if (column.type !== window.TreeColumn.TYPE_TEXT) {
return false;
}
if (column.cycler || !this.view.isEditable(row, column)) {