Bug 1571418 - Don't allow editing login origin from about:logins. r=MattN

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tim Nguyen 2019-08-09 20:15:35 +00:00
Родитель bf4349ab10
Коммит 37dd6eac2d
2 изменённых файлов: 8 добавлений и 8 удалений

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

@ -24,9 +24,9 @@
display: none;
}
:host(:not([data-editing])) input[type="password"],
:host(:not([data-editing])) input[type="text"],
:host(:not([data-editing])) input[type="url"] {
input[type="password"][readOnly],
input[type="text"][readOnly],
input[type="url"][readOnly] {
all: unset;
font-size: 1.1em;
display: inline-block;
@ -78,17 +78,17 @@
padding-inline-start: 32px; /* 8px on each side, and 16px for icon width */
}
:host(:not([data-editing])) input[type="url"] {
input[type="url"][readOnly] {
color: var(--in-content-link-color) !important;
cursor: pointer;
}
:host(:not([data-editing])) input[type="url"]:hover {
input[type="url"][readOnly]:hover {
color: var(--in-content-link-color-hover) !important;
text-decoration: underline;
}
:host(:not([data-editing])) input[type="url"]:hover:active {
input[type="url"][readOnly]:hover:active {
color: var(--in-content-link-color-active) !important;
}

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

@ -275,7 +275,7 @@ export default class LoginItem extends HTMLElement {
}
if (
classList.contains("open-site-button") ||
(classList.contains("origin-input") && !this.dataset.editing)
(classList.contains("origin-input") && !this.readOnly)
) {
document.dispatchEvent(
new CustomEvent("AboutLoginsOpenSite", {
@ -532,7 +532,7 @@ export default class LoginItem extends HTMLElement {
this._deleteButton.disabled = this.dataset.isNewLogin;
this._editButton.disabled = shouldEdit;
let inputTabIndex = !shouldEdit ? -1 : 0;
this._originInput.readOnly = !shouldEdit;
this._originInput.readOnly = !this.dataset.isNewLogin;
this._originInput.tabIndex = inputTabIndex;
this._usernameInput.readOnly = !shouldEdit;
this._usernameInput.tabIndex = inputTabIndex;