Bug 1582398 - Remove user-select: all for editable labels. r=masayuki

This seems to go back to our initial contenteditable implementation, and I don't
think there's a reason <label> should work differently from anything else.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-10-23 09:30:03 +00:00
Родитель ab49d009e4
Коммит 6d8c0d26b1
3 изменённых файлов: 19 добавлений и 4 удалений

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

@ -273,6 +273,7 @@ tags = clipboard
[test_inlineTableEditing.html]
[test_insertParagraph_in_inline_editing_host.html]
[test_keypress_untrusted_event.html]
[test_label_contenteditable.html]
[test_middle_click_paste.html]
tags = clipboard
skip-if = headless

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

@ -0,0 +1,18 @@
<!doctype html>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<script src="/tests/SimpleTest/EventUtils.js"></script>
<label style="display: block" contenteditable>
Foo
</label>
<script>
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(function() {
let label = document.querySelector("label");
synthesizeMouseAtCenter(label, {});
is(document.activeElement, label, "Label should get focus");
synthesizeKey("x", {});
is(label.innerText.trim(), "Foox", "Should not select the whole label");
SimpleTest.finish();
});
</script>

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

@ -76,10 +76,6 @@ input[contenteditable="true"][type="hidden"] {
visibility: visible !important;
}
label:-moz-read-write {
user-select: all;
}
*|*::-moz-display-comboboxcontrol-frame {
user-select: text;
}