gecko-dev/layout/base/tests/bug1518339-2.html
Emilio Cobos Álvarez 2caa18fcc1 Bug 1518339 - Make user-select: auto behave like user-select: text for editing roots. r=mats
This is the closest to the spec behavior, I think, and less likely to
cause interop issues, but if you prefer me to stop the 'inheritance' chain at
contenteditable elements or what not I can also do that.

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

--HG--
extra : moz-landing-system : lando
2019-01-08 20:21:12 +00:00

24 lines
710 B
HTML

<!doctype html>
<html class="reftest-wait">
<title>user-select can be overriden on a contenteditable element</title>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<style>
div {
-webkit-user-select: all;
-moz-user-select: all;
user-select: all;
}
</style>
<div contenteditable="true">
You should be able to select <b>all</b> of me.
</div>
<script>
SimpleTest.waitForFocus(function() {
const editable = document.querySelector('div[contenteditable="true"]');
editable.focus();
synthesizeMouseAtCenter(editable.querySelector("b"), {});
setTimeout(() => document.documentElement.removeAttribute("class"), 0);
});
</script>